/* Accueil mobile-first — un écran utile, sans marketing redondant */

.home-landing {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vh, 20px);
  width: min(640px, 100%);
  margin: 0 auto;
  padding: clamp(4px, 1vh, 12px) 0 clamp(12px, 2vh, 20px);
  min-height: 0;
}

.home-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.home-account-chip {
  display: grid;
  gap: 1px;
  justify-items: end;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.home-account-chip.is-connected {
  border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
}

.home-account-badge {
  max-width: 7.5rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-build-stamp {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  opacity: 0.75;
}

.home-top-logo {
  width: clamp(52px, 14vw, 72px);
  height: clamp(52px, 14vw, 72px);
  border-radius: 14px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 16%, transparent);
}

.home-top-title {
  margin: 0;
  font-size: clamp(1.45rem, 5.5vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.home-top-tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  font-weight: 700;
  line-height: 1.35;
}

.home-primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.home-primary-cta-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.home-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-module-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.home-module-tile:hover,
.home-module-tile:focus-visible {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  transform: translateY(-1px);
}

.home-module-tile#homeQuickD20 {
  grid-column: 1 / -1;
}

.home-module-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--gold);
}

.home-module-label {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.home-module-desc {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-top: auto;
  padding-top: 4px;
}

.home-footer-label {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.home-footer-link {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.home-footer-link--discord {
  border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line));
  color: var(--accent-2);
}

/* Accueil actif = jamais le header global (toutes largeurs, portrait ou paysage) */
body.home-mode .app-header,
body:has(#homeView:not(.is-hidden)) .app-header {
  display: none !important;
}

body.home-mode,
body:has(#homeView:not(.is-hidden)) {
  min-height: 100dvh;
  overflow-x: hidden;
}

body.home-mode .app-shell,
body:has(#homeView:not(.is-hidden)) .app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.home-mode .home-view,
body:has(#homeView:not(.is-hidden)) .home-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

body.home-mode .home-landing,
body:has(#homeView:not(.is-hidden)) .home-landing {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
}

/* Vue accueil : détails mobile */
@media (max-width: 860px) {
  body.home-mode .home-landing {
    padding-top: 4px;
  }
}

@media (max-width: 620px) {
  body.home-mode .brand-lockup {
    display: none;
  }

  body.home-mode .nav-actions {
    display: none;
  }
}

/* Desktop / tablette : descriptions courtes visibles */
@media (min-width: 621px) {
  .home-landing {
    width: min(920px, 100%);
    gap: 20px;
    padding: 20px 0 32px;
  }

  .home-modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-module-tile#homeQuickD20 {
    grid-column: auto;
  }

  .home-module-tile {
    min-height: 108px;
  }

  .home-module-desc {
    display: block;
  }
}
