/* Seven Steps — centered copy over full-monitor montage */

/* Hide side rails / stars on home so the new bg owns the screen */
body:has(#homeScreen.active) .ambient-stars,
body:has(#homeScreen.active) .history-rail {
  display: none !important;
}

body:has(#homeScreen.active) .app-shell {
  background: #02060d !important;
  overflow: hidden !important;
  height: 100dvh;
  max-height: 100dvh;
}

body:has(#homeScreen.active) {
  overflow: hidden;
  height: 100dvh;
}

body:has(#homeScreen.active) .global-header {
  background: linear-gradient(180deg, rgba(2, 6, 13, 0.72), rgba(2, 6, 13, 0));
}

#homeScreen.active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - var(--header-h));
  min-height: 0;
  max-height: calc(100dvh - var(--header-h));
  overflow: hidden;
}

/* ——— Full-monitor background, text unchanged/centered ——— */
#homeScreen .home-hero {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: clamp(24px, 4vh, 48px) 24px clamp(28px, 5vh, 56px);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  background-color: #02060d;
}

/* Kill game-v4 inherited plates — desktop keeps full-bleed cover */
#homeScreen .home-hero:before {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("images/landing-hero-bg.jpg");
  /* Preserve montage aspect — cover crops edges instead of stretching */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: none;
  transform: none;
}

/* Mobile plate layers (enabled below 900px) */
#homeScreen .hero-bg {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#homeScreen .hero-bg-fill,
#homeScreen .hero-bg-plate {
  position: absolute;
  inset: 0;
}

#homeScreen .hero-bg-fill {
  inset: -12%;
  background-image: url("images/landing-hero-bg.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(22px) saturate(1.05) brightness(0.52);
  transform: scale(1.1);
}

#homeScreen .hero-bg-plate {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

#homeScreen .home-hero:after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Soft center wash so existing centered text stays readable */
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(2, 6, 14, 0.55) 0%, rgba(2, 6, 14, 0.28) 42%, rgba(2, 6, 14, 0.45) 100%),
    linear-gradient(180deg, rgba(2, 6, 14, 0.35) 0%, transparent 18%, transparent 78%, rgba(2, 6, 14, 0.55) 100%);
  pointer-events: none;
}

#homeScreen .hero-pyramid-img {
  display: none !important;
}

#homeScreen .hero-copy {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  animation: heroRise 0.65s ease both;
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

#homeScreen .hero-brand-logo {
  display: block;
  width: min(300px, 58vw);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto 4px;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.7));
  animation: logoIn 0.8s ease both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

#homeScreen .eyebrow {
  margin: 0 auto 8px;
  justify-content: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

#homeScreen .hero-copy h1 {
  margin: 4px auto 12px;
  font-size: clamp(32px, 4.8vw, 56px);
  max-width: 14ch;
  text-align: center;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
}

#homeScreen .hero-lead {
  margin: 0 auto;
  max-width: 34ch;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.4;
  color: #e8f0f8;
  text-align: center;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.85);
}

#homeScreen .hero-actions {
  margin: 22px auto 0;
  gap: 14px;
  justify-content: center;
}

#homeScreen .hero-actions .btn-primary {
  animation: ctaPulse 2.8s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 8px 0 #5a3403, 0 14px 28px rgba(0, 0, 0, 0.42), inset 0 2px rgba(255, 255, 255, 0.55); }
  50% { box-shadow: 0 8px 0 #5a3403, 0 14px 34px rgba(231, 171, 37, 0.28), inset 0 2px rgba(255, 255, 255, 0.55); }
}

/* Scores + career: viewport swap (no page scroll) */
.landing-scores-section {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 12px 18px 16px;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(41, 91, 147, 0.16), transparent 70%),
    #02060d;
}

body.home-scores-open #homeScreen .home-hero {
  display: none !important;
}

body.home-scores-open #homeScreen .landing-scores-section {
  display: flex;
}

body.home-scores-open #homeScreen .scores-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 200px);
  /* Stacked on phones this is taller than the cap, and every ancestor
     clips, so it needs to scroll itself or the local panel is lost. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.scores-actions {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

body.home-scores-open #homeScreen .hs-list {
  max-height: min(42vh, 360px);
  overflow: auto;
}

.landing-history-section,
.landing-history-heading {
  display: none;
}

#homeScreen .home-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 64px);
  max-width: none;
  width: min(560px, 92vw);
  margin: 0 auto 28px;
  padding: 18px 8px 0;
  border: 0;
  border-top: 1px solid rgba(236, 184, 61, 0.18);
  background: transparent;
  box-shadow: none;
}

.scores-grid {
  width: min(1100px, 96vw);
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.score-panel {
  border: 1px solid rgba(60, 92, 128, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 30, 50, 0.92), rgba(4, 11, 20, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 16px;
  min-width: 0;
}

.score-kicker,
.score-panel-head h2 {
  margin: 0;
  font: 800 10px var(--orbitron);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8ca4ba;
}

.score-panel-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #7e9bb5;
}

.score-panel-head {
  margin-bottom: 12px;
}

.live-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3dde8a;
  box-shadow: 0 0 0 0 rgba(61, 222, 138, 0.55);
  animation: livePulse 1.8s ease-out infinite;
  margin-right: 6px;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 222, 138, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(61, 222, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 222, 138, 0); }
}

.live-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.live-count strong {
  font: 900 clamp(34px, 4vw, 46px) var(--cinzel);
  color: #f0ca62;
  line-height: 1;
}

.live-count span,
#playersNote {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7e9bb5;
}

#playersNote {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
}

.hs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.hs-tab {
  border: 1px solid #2f4e6d;
  background: rgba(9, 23, 40, 0.9);
  color: #9db4cb;
  border-radius: 999px;
  padding: 6px 10px;
  font: 700 10px var(--orbitron);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.hs-tab.selected,
.hs-tab[aria-selected="true"] {
  border-color: #e7af2b;
  color: #ffd978;
  background: rgba(90, 52, 3, 0.35);
}

.hs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 7.5rem;
}

.hs-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(2, 8, 16, 0.45);
  border: 1px solid rgba(47, 78, 109, 0.45);
}

.hs-row b {
  font: 800 12px var(--orbitron);
  color: #f0ca62;
}

.hs-row strong {
  display: block;
  font: 700 15px var(--raj);
  color: #eef5fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-row small {
  display: block;
  font-size: 11px;
  color: #7e9bb5;
}

.hs-row em {
  font: 800 12px var(--orbitron);
  color: #ffd978;
  font-style: normal;
  letter-spacing: 0.06em;
}

.hs-empty {
  margin: 0;
  color: #7e9bb5;
  font-size: 14px;
  line-height: 1.4;
}

#homeScreen .home-stats > div {
  flex: 0 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  text-align: center;
}

#homeScreen .home-stats strong {
  display: block;
  font: 800 clamp(20px, 2.4vw, 28px) var(--orbitron);
  color: #fff;
}

#homeScreen .home-stats span {
  font: 700 10px var(--orbitron);
  color: #718da7;
  letter-spacing: 0.12em;
}

@media (max-width: 980px) {
  .scores-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #homeScreen.active {
    height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
  }
  #homeScreen .home-hero {
    min-height: 0;
    height: 100%;
    padding: 20px 20px 28px;
  }
  /*
    Mobile pyramid: full-bleed cover (never stretch).
    Anchor lower so the staircase base/star reads as a pyramid,
    not a floating mid-step strip or letterboxed contain plate.
  */
  #homeScreen .home-hero:before {
    display: block !important;
    background-size: cover;
    background-position: center 68%;
    background-repeat: no-repeat;
  }
  #homeScreen .hero-bg {
    display: none !important;
  }
  #homeScreen .hero-brand-logo {
    width: min(260px, 58vw);
  }
}

@media (max-width: 620px) {
  #homeScreen.active {
    height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
  }
  #homeScreen .home-hero {
    min-height: 0;
    height: 100%;
    padding: 16px 16px 24px;
  }
  #homeScreen .home-hero:before {
    background-position: center 70%;
  }
  #homeScreen .hero-brand-logo {
    width: min(220px, 56vw);
    margin-bottom: 2px;
  }
  #homeScreen .hero-copy h1 { font-size: 32px; }
  #homeScreen .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #homeScreen .hero-actions .btn { width: 100%; }
  #homeScreen .home-stats {
    gap: 18px;
    width: 100%;
    padding-top: 16px;
  }
  .landing-scores-section {
    padding: 22px 12px 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #homeScreen .hero-copy,
  #homeScreen .hero-brand-logo,
  #homeScreen .hero-actions .btn-primary,
  .live-dot {
    animation: none !important;
  }
}
