/* BangBang Legacy homepage.
   Sections: tokens · base · layout · buttons · header · hero · facts · sections · features · trailer ·
   chips · roster · maps · news · start/account · forms · dialogs · footer · responsive · motion. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-elevated: #0b111e;
  --surface: #101828;
  --surface-2: #152036;
  --surface-3: #1c2a44;
  --field: #0a101c;
  --line: rgba(156, 178, 214, 0.14);
  --line-strong: rgba(156, 178, 214, 0.3);
  --text: #eef3fb;
  --text-muted: #aab6c9;
  --text-dim: #8592a8;
  --gold: #ffc53d;
  --gold-hover: #ffd466;
  --gold-ink: #241500;
  --teal: #4fd6f0;
  --focus: #7fe3ff;
  --danger: #ff6170;
  --success: #4ad98f;

  --role-marksman: #ff9a2e;
  --role-fighter: #ffd23f;
  --role-defender: #3ddc84;
  --role-support: #33d6ff;
  --role-mage: #b57bff;
  --role-assassin: #ff5c7a;
  --mode-deathmatch: #ff7a5c;
  --mode-destroy-base: #ffb347;
  --mode-domination: #4fd6f0;
  --mode-escort: #7bd88f;
  --mode-survival: #c38bff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 18px 48px -24px rgba(0, 0, 0, 0.75);
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-height: 64px;
  --section-space: clamp(64px, 9vw, 120px);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255, 197, 61, 0.35); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; border-radius: var(--radius-sm);
  transform: translateY(-160%); transition: transform 0.15s ease;
}
.skip-link:focus { transform: none; }
.noscript-note { margin-top: 24px; color: var(--text-muted); }

/* ---------------------------------------------------------------- layout */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-space); }
.section + .section { border-top: 1px solid var(--line); }
.eyebrow {
  margin-bottom: 12px; color: var(--gold); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.85rem); }
.section-lede { margin-top: 16px; color: var(--text-muted); font-size: 1.05rem; max-width: 62ch; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .section-lede { margin-inline: auto; }
.section-head--split { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; max-width: none; }

/* ---------------------------------------------------------------- buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0 1.15rem; border: 1px solid transparent; border-radius: 10px;
  font-size: 0.95rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.button--primary { background: var(--gold); color: var(--gold-ink); }
.button--primary:hover:not(:disabled) { background: var(--gold-hover); }
.button--secondary { background: rgba(255, 255, 255, 0.06); border-color: var(--line-strong); color: var(--text); }
.button--secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.button--ghost { background: transparent; border-color: var(--line); color: var(--text-muted); }
.button--ghost:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.button--danger { background: var(--danger); color: #1d0307; }
.button--lg { min-height: 52px; padding: 0 1.5rem; border-radius: 12px; font-size: 1rem; }
.text-button {
  margin-top: 6px; padding: 0; border: 0; background: none; color: var(--teal);
  font-size: 0.85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.85), rgba(7, 11, 20, 0));
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(7, 11, 20, 0.94); border-bottom-color: var(--line); backdrop-filter: blur(10px); }
.header-bar { display: flex; align-items: center; gap: 28px; height: var(--header-height); }
.brand { flex: none; }
.brand-logo { width: auto; height: 46px; }
.primary-nav { display: flex; gap: 26px; margin-right: auto; }
.primary-nav a {
  position: relative; padding: 8px 0; color: var(--text-muted); font-size: 0.95rem; font-weight: 600;
  transition: color 0.15s ease;
}
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--text); }
.primary-nav a[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--gold);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle {
  display: none; position: relative; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255, 255, 255, 0.04);
}
.menu-toggle-bar {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform 0.2s ease, top 0.2s ease;
}
.menu-toggle-bar:first-child { top: 16px; }
.menu-toggle-bar:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:first-child { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:last-child { top: 21px; transform: rotate(-45deg); }
.mobile-drawer {
  position: absolute; top: var(--header-height); left: 0; right: 0; padding-block: 8px 20px;
  background: rgba(7, 11, 20, 0.98); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.mobile-nav { display: grid; }
.mobile-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 1.05rem; font-weight: 600; }
.mobile-actions { display: grid; margin-top: 16px; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(600px, 92svh, 900px); overflow: hidden; isolation: isolate;
}
.hero-media, .hero-shade { position: absolute; inset: 0; z-index: -1; }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity 0.8s ease; }
.hero.is-video-playing .hero-video { opacity: 1; }
.hero-shade {
  background:
    linear-gradient(90deg, rgba(7, 11, 20, 0.95) 0%, rgba(7, 11, 20, 0.82) 30%, rgba(7, 11, 20, 0.3) 62%, rgba(7, 11, 20, 0.12) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.78) 0%, rgba(7, 11, 20, 0) 26%, rgba(7, 11, 20, 0) 60%, var(--bg) 100%);
}
.hero-content { padding-top: calc(var(--header-height) + 72px); }
.graphics-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; max-width: 760px;
  margin-bottom: 28px; padding: 16px 18px;
  border: 1px solid var(--gold); border-radius: var(--radius); background: var(--surface);
}
.graphics-notice-text { flex: 1 1 320px; }
.graphics-notice-title { font-size: 1.05rem; color: var(--gold); }
.graphics-notice p { margin-top: 6px; color: var(--text); font-size: 0.95rem; }
.graphics-notice code { padding: 1px 6px; border-radius: 6px; background: var(--field); font-size: 0.9em; overflow-wrap: anywhere; user-select: all; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 6px 12px;
  border: 1px solid rgba(255, 197, 61, 0.4); border-radius: 999px; background: rgba(7, 11, 20, 0.55);
  color: var(--gold); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
}
.hero-title { max-width: 15ch; font-size: clamp(2.35rem, 1.3rem + 4vw, 4.4rem); line-height: 1.06; letter-spacing: -0.025em; }
.hero-lede { max-width: 52ch; margin-top: 22px; color: #c9d3e2; font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: clamp(40px, 7vw, 72px); padding-bottom: 24px;
}
.media-credit { color: var(--text-dim); font-size: 0.8rem; }
.ambient-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(7, 11, 20, 0.6); color: var(--text);
}
.ambient-toggle:hover { background: rgba(7, 11, 20, 0.85); }
.ambient-toggle .icon { width: 18px; height: 18px; }
.ambient-toggle[data-state="playing"] .icon--play,
.ambient-toggle:not([data-state="playing"]) .icon--pause { display: none; }

/* ---------------------------------------------------------------- facts */
.fact-strip { border-block: 1px solid var(--line); background: var(--bg-elevated); }
.fact-list { display: grid; grid-template-columns: repeat(5, 1fr); }
.fact-list li { display: grid; gap: 2px; padding: 22px 0 22px 20px; border-left: 1px solid var(--line); }
.fact-list li:first-child { border-left: 0; padding-left: 0; }
.fact-list strong { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); font-weight: 800; line-height: 1.1; }
.fact-list span { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------------------------------------------------------------- features */
.feature-list { display: grid; gap: clamp(48px, 7vw, 96px); }
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: clamp(24px, 5vw, 64px); }
.feature:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.feature-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature-media figcaption {
  position: absolute; left: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(7, 11, 20, 0.72); color: var(--text-muted); font-size: 0.75rem;
}
.feature-index { display: block; margin-bottom: 14px; color: var(--gold); font-weight: 800; letter-spacing: 0.12em; }
.feature-copy h3 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.1rem); }
.feature-copy p { margin-top: 14px; color: var(--text-muted); font-size: 1.05rem; }

/* ---------------------------------------------------------------- trailer */
.section--trailer { background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 197, 61, 0.08), transparent 70%), var(--bg); }
.trailer-card {
  position: relative; display: block; overflow: hidden; max-width: 1120px; margin-inline: auto;
  border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow); background: #000;
}
.trailer-poster { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.4s ease, opacity 0.3s ease; }
.trailer-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(7, 11, 20, 0.85)); pointer-events: none; }
.trailer-card:hover .trailer-poster { transform: scale(1.02); }
.trailer-cta {
  position: absolute; left: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 28px); z-index: 1;
  display: flex; align-items: center; gap: 14px;
}
.trailer-play {
  display: grid; place-items: center; width: clamp(52px, 6vw, 72px); aspect-ratio: 1; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7); transition: transform 0.2s ease;
}
.trailer-play .icon { width: 42%; height: 42%; margin-left: 6%; }
.trailer-card:hover .trailer-play { transform: scale(1.08); }
.trailer-label { display: grid; font-weight: 800; font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem); line-height: 1.2; }
.trailer-duration { color: var(--text-muted); font-size: 0.8em; font-weight: 600; }

/* ---------------------------------------------------------------- chips (shared filters) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  --tone: var(--gold);
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 18%, var(--surface)); color: var(--text); }
.chip-count { min-width: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 0.75rem; text-align: center; }
[data-tone="marksman"], [data-role="marksman"] { --tone: var(--role-marksman); }
[data-tone="fighter"], [data-role="fighter"] { --tone: var(--role-fighter); }
[data-tone="defender"], [data-role="defender"] { --tone: var(--role-defender); }
[data-tone="support"], [data-role="support"] { --tone: var(--role-support); }
[data-tone="mage"], [data-role="mage"] { --tone: var(--role-mage); }
[data-tone="assassin"], [data-role="assassin"] { --tone: var(--role-assassin); }
[data-tone="deathmatch"], [data-mode="deathmatch"] { --tone: var(--mode-deathmatch); }
[data-tone="destroy-base"], [data-mode="destroy-base"] { --tone: var(--mode-destroy-base); }
[data-tone="domination"], [data-mode="domination"] { --tone: var(--mode-domination); }
[data-tone="escort"], [data-mode="escort"] { --tone: var(--mode-escort); }
[data-tone="survival"], [data-mode="survival"] { --tone: var(--mode-survival); }

/* ---------------------------------------------------------------- roster */
.roster-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; gap: 28px; }
.spotlight {
  --tone: var(--gold);
  position: sticky; top: calc(var(--header-height) + 20px); overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--tone) 24%, transparent), transparent 60%), var(--surface);
}
.spotlight-art { display: grid; place-items: center; padding: 28px 28px 0; }
.spotlight-art img { width: min(100%, 300px); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55)); }
.spotlight-body { padding: 8px 28px 28px; }
.spotlight-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.role-tag {
  padding: 2px 10px; border: 1px solid color-mix(in srgb, var(--tone) 60%, transparent); border-radius: 999px;
  color: var(--tone); font-size: 0.78rem; font-weight: 700;
}
.role-tag--primary { background: var(--tone); border-color: var(--tone); color: #120d02; }
.spotlight-name { margin-top: 12px; font-size: clamp(1.8rem, 1.4rem + 1vw, 2.3rem); }
.difficulty { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.pips { display: inline-flex; gap: 4px; }
.pip { width: 18px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
.pip.is-filled { background: var(--gold); }
.spotlight-description { margin-top: 14px; color: var(--text-muted); }
.spotlight-subhead { margin-top: 22px; color: var(--text-dim); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.skill-list { margin-top: 8px; border-top: 1px solid var(--line); }
.skill { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.skill-kind { flex: none; padding: 1px 8px; border-radius: 999px; background: rgba(79, 214, 240, 0.14); color: var(--teal); font-size: 0.72rem; font-weight: 700; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tank-card {
  --tone: var(--gold);
  display: grid; justify-items: center; gap: 2px; padding: 10px 8px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.tank-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tank-card[aria-pressed="true"] { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, var(--surface)); }
.tank-card-art { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 4px; }
.tank-card-name { font-size: 0.9rem; font-weight: 700; line-height: 1.25; }
.tank-card-role { color: var(--tone); font-size: 0.75rem; font-weight: 600; }
.roster-count { margin-top: 14px; color: var(--text-dim); font-size: 0.85rem; }

/* ---------------------------------------------------------------- maps */
.mode-summary {
  --tone: var(--gold);
  min-height: 3.2em; margin: -8px 0 24px; padding-left: 14px; border-left: 3px solid var(--tone);
  color: var(--text-muted); max-width: 70ch;
}
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.map-card figure { overflow: hidden; height: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.map-card-art { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.4s ease; }
.map-card:hover .map-card-art { transform: scale(1.04); }
.map-card figcaption { display: grid; gap: 2px; padding: 12px 16px 16px; }
.map-card-mode { color: var(--tone); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.map-card-name { font-size: 1.05rem; }

/* ---------------------------------------------------------------- news */
.tab-list { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tab { min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-3); color: var(--text); }
.tab-panel:focus-visible { outline-offset: 6px; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.news-item {
  display: grid; align-content: start; gap: 10px; width: 100%; height: 100%; padding: 22px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.news-item:hover { border-color: rgba(255, 197, 61, 0.45); background: var(--surface-2); }
.news-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-dim); font-size: 0.82rem; }
.news-tag { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.news-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; }
.news-summary { color: var(--text-muted); font-size: 0.95rem; }
.news-empty { color: var(--text-muted); }

/* ---------------------------------------------------------------- start & account panel */
.section--start { background: linear-gradient(180deg, var(--bg), var(--bg-elevated)); }
.start-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: clamp(32px, 6vw, 80px); align-items: start; }
.steps { display: grid; gap: 22px; margin-bottom: 36px; counter-reset: step; }
.steps li { position: relative; padding-left: 64px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 44px; height: 44px; border: 1px solid rgba(255, 197, 61, 0.5); border-radius: 12px;
  color: var(--gold); font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
}
.steps h3 { font-size: 1.2rem; }
.steps p { margin-top: 6px; color: var(--text-muted); }
.account-panel { padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.account-panel.is-busy { cursor: progress; }
.account-panel-head h3 { font-size: 1.4rem; }
.account-panel-status { margin-top: 8px; color: var(--text-muted); font-size: 0.92rem; }
.account-panel-form, .account-form { display: grid; gap: 16px; margin-top: 20px; }
.account-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.account-panel-actions .button { flex: 1 1 140px; }
.account-panel-session { margin-top: 20px; }
.session-label { color: var(--text-muted); font-size: 0.9rem; }
.session-username { display: block; margin: 4px 0 16px; font-size: 1.3rem; overflow-wrap: anywhere; }
.account-panel-note { margin-top: 18px; color: var(--text-dim); font-size: 0.82rem; }
.account-play { width: 100%; margin-bottom: 12px; }
[data-account-security] .account-play { margin: 16px 0 0; }
.account-forgot { justify-self: start; margin-top: 0; }

/* ---------------------------------------------------------------- forms */
.form-field { display: grid; gap: 6px; }
.form-field label { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; }
.form-field input {
  width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--field); color: var(--text); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input::placeholder { color: #66748a; }
.form-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(79, 214, 240, 0.2); }
.form-field input[aria-invalid="true"] { border-color: var(--danger); }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; min-height: 34px; padding: 0 10px; transform: translateY(-50%);
  border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
}
.password-toggle:hover { color: var(--text); }
.field-hint { color: var(--text-dim); font-size: 0.82rem; }
[data-state="error"] { color: var(--danger); }
[data-state="success"] { color: var(--success); }

/* ---------------------------------------------------------------- dialogs */
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: rgba(3, 6, 12, 0.78); backdrop-filter: blur(4px); }
.dialog-card, .account-card {
  position: relative; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: clamp(22px, 4vw, 32px); border: 1px solid var(--line-strong); border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow);
}
.dialog-close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text);
}
.dialog-close:hover { background: var(--surface-3); }
.news-dialog-title { padding-right: 44px; font-size: 1.5rem; }
.news-dialog-date { margin-top: 6px; color: var(--text-dim); font-size: 0.88rem; }
.news-dialog-body { margin-top: 16px; color: var(--text-muted); white-space: pre-line; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.video-dialog { width: min(1200px, calc(100vw - 32px)); }
.video-dialog-frame { position: relative; overflow: hidden; border-radius: 16px; background: #000; box-shadow: var(--shadow); }
.video-stage { aspect-ratio: 16 / 9; }
.video-player { width: 100%; height: 100%; background: #000; }
.dialog-close--floating { z-index: 1; background: rgba(7, 11, 20, 0.7); border-color: var(--line-strong); }

.account-heading { padding-right: 44px; }
.account-heading h2 { font-size: 1.6rem; }
.account-heading p:last-child { margin-top: 6px; color: var(--text-muted); font-size: 0.95rem; }
.account-mode-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 20px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.account-mode { flex: 1 1 auto; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font-weight: 600; }
.account-mode.is-active { background: var(--surface-3); color: var(--text); }
.account-status { min-height: 1.5em; margin-top: 14px; font-size: 0.92rem; }
.account-status:empty { min-height: 0; margin-top: 0; }
.account-submit { width: 100%; margin-top: 4px; }
.account-dialog.is-busy { cursor: progress; }
.account-security-summary { margin-top: 20px; }
.account-security-summary p { margin-top: 4px; color: var(--text-muted); font-size: 0.92rem; }
.account-security-details { display: grid; gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.account-security-details div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 12px 14px; background: var(--surface); }
.account-security-details dt { color: var(--text-dim); font-size: 0.85rem; }
.account-security-details dd { overflow-wrap: anywhere; font-size: 0.92rem; }
.account-id { display: block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.82rem; }
/* Flex rather than grid: when the secondary-password button is hidden its partner fills the row. */
.account-security-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.account-security-actions .button { flex: 1 1 calc(50% - 5px); }
.account-security-actions .account-security-action--full { flex-basis: 100%; }
.account-danger-confirm { margin-top: 14px; padding: 16px; border: 1px solid rgba(255, 97, 112, 0.45); border-radius: 12px; background: rgba(255, 97, 112, 0.08); }
.account-danger-confirm p { margin-top: 4px; color: var(--text-muted); font-size: 0.9rem; }
.account-danger-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.account-logout { width: 100%; margin-top: 12px; }
.account-security-advice { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.account-security-advice ul { margin-top: 8px; padding-left: 18px; list-style: disc; color: var(--text-muted); }
.account-session-chip { padding: 10px 14px; border-radius: 10px; background: var(--field); color: var(--text-muted); font-size: 0.9rem; }
.account-footnote { margin-top: 20px; color: var(--text-dim); font-size: 0.8rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-elevated); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 32px; padding-block: 48px 32px; }
.footer-brand { display: flex; align-items: center; gap: 18px; }
.footer-logo { width: 120px; flex: none; }
.footer-brand p { max-width: 34ch; color: var(--text-muted); font-size: 0.92rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-nav a { color: var(--text-muted); font-weight: 600; font-size: 0.92rem; }
.footer-nav a:hover { color: var(--text); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 18px 28px; color: var(--text-dim); font-size: 0.82rem; }
.footer-legal::before { content: ""; flex: 1 0 100%; height: 1px; margin-bottom: 10px; background: var(--line); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .primary-nav { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr auto; }
  .footer-nav { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 959px) {
  .primary-nav, .nav-account-btn { display: none; }
  .menu-toggle { display: inline-block; }
  .header-actions { margin-left: auto; }
  .header-play { min-height: 40px; padding: 0 14px; }
  .brand-logo { height: 40px; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(7, 11, 20, 0.8) 0%, rgba(7, 11, 20, 0.72) 40%, rgba(7, 11, 20, 0.88) 75%, var(--bg) 100%);
  }
  .fact-list { grid-template-columns: repeat(3, 1fr); }
  .fact-list li { padding: 18px 0 18px 16px; }
  .fact-list li:nth-child(4) { border-left: 0; padding-left: 0; }
  .fact-list li:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .feature { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .roster-layout { grid-template-columns: 1fr; }
  .spotlight { position: static; display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); align-items: center; }
  .spotlight-art { padding: 20px; }
  .spotlight-body { padding: 20px 20px 20px 0; }
  .start-layout { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .hero { min-height: 560px; }
  .hero-content { padding-top: calc(var(--header-height) + 48px); }
  .hero-actions .button { flex: 1 1 100%; }
  .hero-footer { padding-top: 32px; }
  .fact-list { grid-template-columns: repeat(2, 1fr); }
  .fact-list li, .fact-list li:nth-child(4) { padding: 16px 0 16px 14px; border-left: 1px solid var(--line); }
  .fact-list li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fact-list li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .spotlight { grid-template-columns: 1fr; }
  .spotlight-art { padding: 20px 20px 0; }
  .spotlight-art img { width: min(70%, 220px); }
  .spotlight-body { padding: 8px 20px 20px; }
  .roster-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .tank-card { padding: 8px 6px 10px; }
  .tank-card-name { font-size: 0.82rem; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .map-card figcaption { padding: 10px 12px 12px; }
  .map-card-mode { font-size: 0.66rem; letter-spacing: 0.05em; }
  .map-card-name { font-size: 0.92rem; line-height: 1.3; }
  .section-head--split { align-items: start; }
  .account-security-details div { grid-template-columns: 1fr; gap: 2px; }
  .account-security-actions .button { flex-basis: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav { grid-row: auto; }
  .footer-brand { flex-direction: column; align-items: flex-start; }
  .video-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
}

@media (max-width: 380px) {
  .header-bar { gap: 12px; }
  .brand-logo { height: 34px; }
  .header-play { padding: 0 12px; font-size: 0.88rem; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
