:root {
  --bg-deep: #070b18;
  --bg-panel: rgba(11, 18, 36, 0.84);
  --bg-panel-solid: #0d152a;
  --bg-card: rgba(15, 24, 46, 0.9);
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-bright: rgba(56, 189, 248, 0.45);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;
  --gold: #facc15;
  --gold-deep: #eab308;
  --gold-ink: #0f172a;
  --cyan: #38bdf8;
  --purple: #a855f7;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-display: "Arial Black", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--text-main);
  overflow-x: clip;
  line-height: 1.55;
}

/* Visually hidden utility (modern-web-guidance accessibility) */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  text-decoration: none;
}

:where(a:any-link, button, input, select, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* =========================================================
   FULL-BLEED 100vw x 100dvh BATTLE ISLAND LIVE ARENA
   ========================================================= */
.arena-viewport {
  position: relative;
  width: 100%;
  max-width: 100vw;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  isolation: isolate;
}

.arena-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

/* Floating 3-Group HUD Topbar */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 8px;
  width: 100%;
  max-width: 100%;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-main);
  font: 700 0.85rem/1 var(--font-body);
  cursor: pointer;
  backdrop-filter: blur(8px);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-btn:hover {
  border-color: var(--border-bright);
  background: rgba(20, 32, 62, 0.94);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(11, 18, 36, 0.84);
  color: var(--gold);
  font: 900 0.88rem/1 var(--font-display);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.score-pill strong {
  color: var(--gold);
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
}

/* 7-slot progress strip in center HUD */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.p-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.p-dot.active {
  background: var(--gold);
  border-color: #fff;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.7);
}

.p-dot.tier-mythic { background: #fde047; border-color: #fef08a; }
.p-dot.tier-legendary { background: #f59e0b; border-color: #fcd34d; }
.p-dot.tier-epic { background: #a855f7; border-color: #d8b4fe; }
.p-dot.tier-rare { background: #38bdf8; border-color: #bae6fd; }
.p-dot.tier-uncommon { background: #22c55e; border-color: #bbf7d0; }
.p-dot.tier-common { background: #94a3b8; border-color: #e2e8f0; }
.p-dot.tier-miss { background: #ef4444; border-color: #fecaca; }

/* Right-Edge Continuous Vertical Loot Rarity Meter (Desktop/Tablet) */
.vault-meter {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: 66px;
  height: min(420px, 56dvh);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.vault-meter-track {
  position: relative;
  width: 14px;
  flex: 1;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(
    to top,
    #64748b 0%,
    #22c55e 22%,
    #38bdf8 42%,
    #a855f7 62%,
    #f59e0b 82%,
    #fde047 100%
  );
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}

.vault-crown-line {
  position: absolute;
  left: -34px;
  right: -8px;
  bottom: 48.6%;
  border-top: 2px dashed var(--gold);
  display: flex;
  justify-content: flex-start;
}

.vault-crown-line span {
  transform: translateY(-100%);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(7, 11, 24, 0.85);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.vault-you-marker {
  position: absolute;
  right: 18px;
  bottom: 0%;
  transform: translateY(50%);
  padding: 2px 6px;
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
  font-size: 0.66rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transition: bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vault-meter-cap {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 4px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Main Centered Interactive Stage inside 100dvh */
.arena-center {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 16px 8px;
  min-height: 0;
  width: 100%;
}

.stage-panel {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stage-panel[hidden] {
  display: none !important;
}

/* IDLE / START VIEW */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(11, 18, 36, 0.72);
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.arena-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 6vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 3px 0 #1d4ed8,
    0 6px 26px rgba(56, 189, 248, 0.55);
}

.arena-subtitle {
  margin: 8px 0 14px;
  max-width: 540px;
  color: #e2e8f0;
  font-size: clamp(0.9rem, 2.2vw, 1.04rem);
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

/* Challenge Banner on Start Screen */
.challenge-banner {
  width: 100%;
  max-width: 560px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 8px 28px rgba(250, 204, 21, 0.22);
  text-align: left;
}

.challenge-banner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--gold);
  font-size: 0.92rem;
}

.challenge-banner-meta {
  margin: 4px 0 8px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.challenge-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mode Selector Pills */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 540px;
  margin-bottom: 10px;
}

.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.mode-tab span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mode-tab.active,
.mode-tab[aria-pressed="true"] {
  border-color: var(--cyan);
  background: rgba(14, 165, 233, 0.22);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.28);
}

.mode-tab.active span,
.mode-tab[aria-pressed="true"] span {
  color: #bae6fd;
}

.free-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-pill);
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #86efac;
  font-size: 0.74rem;
  font-weight: 800;
}

/* Unlimited / Category Filter Row on Idle */
.idle-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  max-width: 560px;
}

.filter-chip {
  min-height: 32px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(11, 18, 36, 0.8);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.active,
.filter-chip[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.18);
  color: #fef08a;
}

/* Primary Victory Gold CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  min-height: 54px;
  padding: 12px 24px;
  border: 2px solid #fef08a;
  border-radius: 14px;
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  color: var(--gold-ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 #a16207, 0 12px 30px rgba(234, 179, 8, 0.35);
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #a16207, 0 6px 16px rgba(234, 179, 8, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 24, 46, 0.9);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--border-bright);
  background: rgba(24, 38, 72, 0.95);
}

.idle-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.idle-streak-pill {
  color: var(--gold);
}

/* =========================================================
   ACTIVE PLAY VIEW
   ========================================================= */
.prompt-glass {
  width: 100%;
  padding: 20px 22px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(10, 16, 33, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.prompt-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cat-badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.dir-badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
}

.prompt-text {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.22rem, 3.2vw, 1.72rem);
  line-height: 1.24;
  color: #ffffff;
}

.hint-box {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
}

/* Input + Circular Timer Row */
.guess-form {
  width: 100%;
  margin-top: 12px;
}

.guess-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.timer-ring-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.timer-ring-svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: rgba(11, 18, 36, 0.85);
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 4;
}

.timer-ring-fg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke 0.2s ease;
}

.timer-ring-fg.warn { stroke: var(--amber); }
.timer-ring-fg.danger { stroke: var(--red); }

.timer-ring-label {
  position: absolute;
  font-size: 0.86rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.answer-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.38);
  background: rgba(7, 11, 24, 0.92);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.answer-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.answer-input:focus {
  border-color: var(--cyan);
}

.submit-btn {
  height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  border: 2px solid #fef08a;
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  color: var(--gold-ink);
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.timer-bar-track {
  width: 100%;
  height: 5px;
  margin-top: 8px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transform-origin: left center;
}

.play-sub-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.feedback-line {
  min-height: 22px;
  margin: 8px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fca5a5;
  text-align: left;
}

.suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.suggestion-chip {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.2);
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.suggestion-chip:hover {
  background: rgba(14, 165, 233, 0.38);
}

/* Shake feedback strictly opt-in under prefers-reduced-motion: no-preference */
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake-error {
  border-color: var(--red) !important;
}

@media (prefers-reduced-motion: no-preference) {
  .shake-error {
    animation: shakeX 0.28s ease-in-out;
  }
}

/* =========================================================
   REVEAL VIEW
   ========================================================= */
.reveal-card {
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-subtle);
  background: rgba(10, 16, 33, 0.92);
  backdrop-filter: blur(14px);
  text-align: left;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

.reveal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reveal-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reveal-points {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.reveal-answer-name {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 1.38rem;
  color: #ffffff;
}

.reveal-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.meta-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 700;
}

.reveal-fact {
  margin: 6px 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.spectrum-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 24, 46, 0.85);
  border: 1px solid var(--border-subtle);
}

.spectrum-box h3 {
  margin: 0 0 6px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.spectrum-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  padding: 2px 0;
  color: #f1f5f9;
}

.spectrum-item span:last-child {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* =========================================================
   SUMMARY VIEW (Scroll-safe inside 100dvh)
   ========================================================= */
.summary-card {
  width: 100%;
  max-width: 660px;
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(250, 204, 21, 0.4);
  background: rgba(10, 16, 33, 0.94);
  backdrop-filter: blur(14px);
  text-align: center;
}

.summary-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.summary-score {
  margin: 6px 0 2px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.05;
  color: #fff;
}

.summary-score small {
  font-size: 0.5em;
  color: var(--text-muted);
}

.integrity-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #86efac;
}

.integrity-pill.hinted {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.persona-box {
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.persona-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.persona-box strong {
  display: block;
  font-size: 0.96rem;
  color: #fff;
}

.persona-box p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* 1v1 VS Scorecard */
.duel-scorecard {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--gold);
  background: rgba(250, 204, 21, 0.1);
  text-align: center;
}

.duel-verdict {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.duel-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.duel-side {
  padding: 8px;
  border-radius: 8px;
  background: rgba(7, 11, 24, 0.72);
  font-size: 0.82rem;
}

.duel-side strong {
  display: block;
  font-size: 1.12rem;
  color: #fff;
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-actions .btn-primary {
  grid-column: 1 / -1;
  max-width: none;
  min-height: 46px;
  font-size: 0.96rem;
}

.summary-retention-hook {
  margin-bottom: 12px;
}

.summary-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 24, 46, 0.85);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
}

.breakdown-row:hover {
  border-color: var(--border-bright);
}

.breakdown-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-ans {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
}

.breakdown-pts {
  font-weight: 900;
  font-size: 0.86rem;
  color: var(--gold);
  white-space: nowrap;
}

/* Bottom Scroll Cue inside 100dvh */
.arena-footer-cue {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: center;
  padding: 4px 12px 10px;
}

.scroll-cue-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(11, 18, 36, 0.72);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
  text-align: center;
}

.scroll-cue-link:hover {
  color: var(--gold);
  border-color: rgba(250, 204, 21, 0.45);
}

/* =========================================================
   BELOW-THE-FOLD EDITORIAL, CATEGORY, EXPLORER & ARCHIVE
   ========================================================= */
.content-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.content-section {
  margin-bottom: 42px;
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin: 0 0 12px;
  color: #ffffff;
}

.content-section p {
  color: #cbd5e1;
  margin: 0 0 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-solid);
  text-decoration: none;
  color: inherit;
}

a.info-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.info-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.tier-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.tier-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-solid);
}

.tier-card strong {
  display: block;
  font-size: 0.94rem;
}

.tier-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* FAQ Accordion (no headings inside <summary> per accessibility guide) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-solid);
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 18px;
  font-weight: 800;
  font-size: 0.96rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::after {
  content: "+";
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

/* Subpage Header Bar (Explorer, Archive, Legal) */
.subpage-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 24, 0.92);
  backdrop-filter: blur(10px);
}

.subpage-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subpage-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subpage-nav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.subpage-nav a:hover,
.subpage-nav a[aria-current="page"] {
  background: rgba(56, 189, 248, 0.16);
  color: #fff;
}

.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb-nav a {
  color: var(--cyan);
  text-decoration: none;
}

/* Explorer & 390px Select Overflow Hard Guard */
.stage-shell {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.explorer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}

.explorer-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.explorer-field label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select.answer-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.entity-card {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-solid);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.entity-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff;
}

.entity-pts {
  font-weight: 900;
  font-size: 0.84rem;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.entity-fact {
  margin: 0;
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #050811;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--gold);
}

/* Native Modal Dialogs (light-dismiss-a-dialog + accessibility) */
dialog.app-dialog {
  width: min(92vw, 500px);
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  background: #0d152a;
  color: var(--text-main);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  overflow: auto;
}

dialog.app-dialog::backdrop {
  background: rgba(3, 6, 15, 0.75);
  backdrop-filter: blur(4px);
}

.dialog-body {
  padding: 20px 22px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
}

.dialog-close {
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 24, 46, 0.9);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Navigation Drawer Dialog (left-docked) */
dialog.drawer-dialog {
  margin: 0 auto 0 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(86vw, 320px);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #f1f5f9;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.drawer-links a:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

.drawer-section-label {
  margin: 12px 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.share-preview-img {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-tile {
  padding: 12px;
  border-radius: 10px;
  background: rgba(7, 11, 24, 0.75);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.stat-tile strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
}

.stat-tile span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* =========================================================
   RESPONSIVE & SHORT-VIEWPORT CASCADE (Strictly descending!)
   ========================================================= */
@media (max-width: 780px) {
  .vault-meter {
    display: none;
  }
  .explorer-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 8px 8px 4px;
    gap: 4px;
  }
  .hud-group {
    gap: 4px;
  }
  .brand-pill {
    padding: 0 7px;
    min-height: 34px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }
  .score-pill {
    padding: 0 7px;
    min-height: 34px;
    font-size: 0.72rem;
  }
  .score-pill strong {
    font-size: 0.82rem;
  }
  .hud-btn {
    min-width: 32px;
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.78rem;
  }
  body:not(.in-round) .progress-dots {
    display: none;
  }
  .progress-dots {
    padding: 5px 6px;
    gap: 3px;
  }
  .p-dot {
    width: 7px;
    height: 7px;
  }
  body.in-round .brand-pill {
    display: none;
  }
  .arena-center {
    padding: 4px 12px 6px;
  }
  .hero-eyebrow {
    font-size: 0.66rem;
    padding: 3px 10px;
  }
  .free-badge {
    font-size: 0.68rem;
    padding: 3px 10px;
  }
  .idle-meta-row {
    gap: 6px;
    font-size: 0.7rem;
  }
  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .mode-tab {
    min-height: 44px;
    font-size: 0.78rem;
  }
  .prompt-glass {
    padding: 14px 12px 12px;
  }
  .guess-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 6px;
  }
  .timer-ring-wrap,
  .timer-ring-svg {
    width: 44px;
    height: 44px;
  }
  .answer-input,
  .submit-btn {
    height: 46px;
    font-size: 0.92rem;
  }
  .submit-btn {
    padding: 0 10px;
    font-size: 0.84rem;
  }
  .spectrum-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .summary-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Short-screen mobile guards (strictly descending: 740px -> 670px -> 620px) */
@media (max-height: 740px) {
  .arena-title {
    font-size: clamp(1.9rem, 5vw, 3.1rem);
  }
  .arena-subtitle {
    margin: 4px 0 10px;
    font-size: 0.88rem;
  }
  .btn-primary {
    min-height: 48px;
  }
}

@media (max-height: 670px) {
  .hero-eyebrow {
    margin-bottom: 4px;
    padding: 3px 10px;
    font-size: 0.68rem;
  }
  .arena-title {
    font-size: clamp(1.7rem, 5vw, 2.5rem);
  }
  .arena-subtitle {
    margin: 4px 0 8px;
    font-size: 0.82rem;
  }
  .mode-tabs {
    margin-bottom: 6px;
  }
  .mode-tab {
    min-height: 40px;
    padding: 4px 6px;
  }
  .free-badge {
    margin-bottom: 8px;
    padding: 3px 10px;
    font-size: 0.72rem;
  }
  .idle-controls {
    margin-bottom: 8px;
  }
  .btn-primary {
    min-height: 44px;
    font-size: 0.98rem;
  }
  .idle-meta-row {
    margin-top: 6px;
    font-size: 0.74rem;
  }
  .arena-footer-cue {
    padding: 2px 8px 6px;
  }
}

@media (max-height: 620px) {
  .topbar {
    padding: 6px 10px 2px;
  }
  .hero-eyebrow {
    display: none;
  }
  .arena-title {
    font-size: 1.65rem;
  }
  .arena-subtitle {
    margin: 3px 0 6px;
    font-size: 0.78rem;
  }
  .free-badge {
    display: none;
  }
  .mode-tab {
    min-height: 36px;
  }
  .mode-tab span {
    display: none;
  }
  .btn-primary {
    min-height: 42px;
    padding: 8px 18px;
    box-shadow: 0 4px 0 #a16207;
  }
  .arena-footer-cue {
    padding: 2px 8px 4px;
  }
}

@media (pointer: coarse) {
  .filter-chip,
  .suggestion-chip {
    min-height: 40px;
  }
}
