:root {
  --stage-top: #1E5476;
  --stage-mid: #0F2F45;
  --stage-bot: #071724;

  --cream: #FFFBF2;
  --cream-2: #F4ECDC;
  --paper: #FFFFFF;
  --ink: #0D2235;
  --text: #13293D;
  --muted: #586A7E;
  --line: #DCD2BE;

  --gold: #FFC226;
  --gold-d: #CA8500;
  --coral: #FF5538;
  --coral-d: #C22F17;
  --plum: #6936B5;
  --plum-d: #471F85;
  --navy: #14334C;
  --navy-d: #0A1D2E;
  --mint: #12B886;
  --jinx: #E62454;

  --t1-bg: #E2F8F0; --t1-fg: #097554;
  --t2-bg: #E6F0FF; --t2-fg: #1849C6;
  --t3-bg: #F1E8FF; --t3-fg: #6624C4;
  --t4-bg: #FFF3CF; --t4-fg: #9E6300;
  --t5-bg: linear-gradient(135deg, #F02D5E 0%, #FF7700 58%, #FFB700 100%);
  --t5-fg: #FFFFFF;

  --font-display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* ================= ARENA & CENTERED GAME CABINET ================= */
.arena {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px 52px;
  background: radial-gradient(ellipse at 50% 18%, var(--stage-top) 0%, var(--stage-mid) 54%, var(--stage-bot) 100%);
  overflow-x: clip;
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 110px,
    rgba(0, 0, 0, 0.16) 110px 113px
  );
  pointer-events: none;
}

.cabinet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 472px;
  background: var(--cream);
  border-radius: 30px;
  box-shadow:
    0 0 0 5px #091927,
    0 0 0 8px rgba(255, 226, 150, 0.2),
    0 28px 68px rgba(0, 0, 0, 0.58);
  overflow: visible;
  transition: max-width 0.25s ease;
}

.cabinet.is-wide {
  max-width: 556px;
}

/* ================= ILLUSTRATED CABINET HEADER & HUD ================= */
.cabinet-scene {
  position: relative;
  border-radius: 26px 26px 0 0;
  overflow: visible;
  padding: 12px 14px 28px;
  background: linear-gradient(180deg, #133956 0%, #26658E 62%, #EAB86E 100%);
  color: #FFFFFF;
}

.scene-decor {
  position: absolute;
  inset: 0;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.scene-orb {
  position: absolute;
  right: 32px;
  top: 48px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF9C4 0%, #FFD54F 58%, rgba(255, 213, 79, 0) 72%);
  opacity: 0.9;
}

.scene-cloud {
  position: absolute;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
}
.sc-1 { width: 92px; left: 22px; top: 68px; }
.sc-2 { width: 74px; right: 90px; top: 96px; }

.scene-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 140px;
}

.scene-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 38px;
}

/* HUD BAR */
.hud {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.acct-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: rgba(11, 30, 46, 0.72);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, background 0.12s ease;
}
.acct-pill:hover {
  background: rgba(11, 30, 46, 0.88);
  transform: translateY(-1px);
}
.acct-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.acct-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acct-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.acct-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1;
}
.acct-top b {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-lv {
  color: #FFE27A;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
}
.acct-lv i {
  font-style: normal;
}
.xp-bar {
  width: 68px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.xp-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #FFE27A, #42E695);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(11, 30, 46, 0.72);
  border: 2.5px solid var(--ink);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.sq-btn {
  appearance: none;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, #FFFFFF, #EAE2D0);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.sq-btn:hover {
  filter: brightness(1.04);
}
.sq-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.lang-dropdown {
  position: relative;
}
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 215px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--paper);
  color: var(--text);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 80;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}
.lang-item:hover {
  background: var(--cream-2);
}
.lang-item.is-active {
  background: var(--gold);
  color: var(--ink);
}

/* BRAND HERO LOCKUP */
.brand-hero {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 14px 8px 10px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.brand-emblem {
  display: inline-flex;
  filter: drop-shadow(0 3px 0 rgba(13, 34, 53, 0.55));
}
.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.55rem;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #FFFDF7;
  text-shadow: 0 3px 0 #0B1E2E, 0 6px 14px rgba(0, 0, 0, 0.35);
}
.brand-sub {
  margin: 6px auto 0;
  max-width: 38ch;
  font-size: 0.9rem;
  font-weight: 800;
  color: #FFF7DF;
  text-shadow: 0 1px 3px rgba(9, 25, 39, 0.65);
}

/* ================= STAGE & MODE SWITCHER ================= */
.stage {
  position: relative;
  z-index: 4;
  padding: 4px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: #E8DFCC;
  border: 2.5px solid var(--ink);
}

.mode-tab {
  appearance: none;
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  background: transparent;
  color: #4A5B6E;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.mode-tab.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(13, 34, 53, 0.18);
}
.live-badge-mini {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--mint);
  color: #FFFFFF;
}

.pane-card {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 4px 0 rgba(13, 34, 53, 0.12);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

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

.kicker-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
}
.tag-coral { background: #FFE8E3; color: #B82912; }
.tag-teal { background: #E1F5FE; color: #0B4F71; }

.edition-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
}

.pane-title {
  margin: -2px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--ink);
}

.pane-desc {
  margin: -4px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.45;
}

/* 5-Tier Jewel Scale */
.rarity-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  background: var(--cream);
  border: 2px solid var(--line);
}
.rs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  border-radius: 9px;
  text-align: center;
  border: 1.5px solid rgba(13, 34, 53, 0.15);
}
.rs-item span {
  font-size: 0.62rem;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.rs-item b {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
}
.rs-item.t1, .tp-chip.t1, .tier-pill.t1 { background: var(--t1-bg); color: var(--t1-fg); }
.rs-item.t2, .tp-chip.t2, .tier-pill.t2 { background: var(--t2-bg); color: var(--t2-fg); }
.rs-item.t3, .tp-chip.t3, .tier-pill.t3 { background: var(--t3-bg); color: var(--t3-fg); }
.rs-item.t4, .tp-chip.t4, .tier-pill.t4 { background: var(--t4-bg); color: var(--t4-fg); }
.rs-item.t5, .tp-chip.t5, .tier-pill.t5 { background: var(--t5-bg); color: var(--t5-fg); }

/* ================= GLOSSY 3D GAME BUTTONS ================= */
.gbtn, .act-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.12s ease;
}
.gbtn::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 4px;
  height: 28%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.gbtn:hover:not(:disabled), .act-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.gbtn:active:not(:disabled), .act-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink) !important;
}
.gbtn:disabled, .act-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gbtn-xl, .act-xl {
  min-height: 58px;
  font-size: 1.08rem;
  border-radius: 16px;
}

.gbtn-gold, .act-gold, .act-primary {
  background: linear-gradient(180deg, #FFE270 0%, var(--gold) 58%, #E59B00 100%);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.gbtn-coral {
  background: linear-gradient(180deg, #FF745C 0%, var(--coral) 58%, var(--coral-d) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--ink);
}
.gbtn-plum, .act-violet {
  background: linear-gradient(180deg, #8652D6 0%, var(--plum) 60%, var(--plum-d) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--ink);
}
.gbtn-cream, .act-ghost, .act-secondary {
  background: linear-gradient(180deg, #FFFFFF 0%, #EFE8D8 100%);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.gbtn-navy, .act-ink {
  background: linear-gradient(180deg, #1E496B 0%, var(--navy) 60%, var(--navy-d) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--ink);
}

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}
.text-link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 2px 4px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.text-link-btn:hover {
  color: var(--ink);
  text-decoration: underline;
}
.dot-sep {
  color: var(--line);
}

/* Inputs & Pairs */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lbl {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.text-inp {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 800;
  outline: none;
}
.text-inp:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(255, 194, 38, 0.35);
}

.btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.code-join-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.code-inp {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
}

.live-dot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
}
.live-dot-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.22);
  display: inline-block;
}

.scroll-cue {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: #DCEEFF;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0.9;
}
.scroll-cue:hover {
  opacity: 1;
  color: #FFE27A;
}
.scroll-arrow {
  display: inline-block;
  animation: bobCue 1.6s ease-in-out infinite;
}
@keyframes bobCue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ================= ACTIVE GAMEPLAY PANELS ================= */
.challenge-banner {
  background: linear-gradient(90deg, #FFF3CC, #FFE4DC);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.game-panel {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.round-progress-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 24px;
  height: 8px;
  border-radius: 99px;
  background: var(--cream-2);
  border: 1.5px solid var(--ink);
}
.step-dot.is-done { background: var(--mint); }
.step-dot.is-current { background: var(--coral); width: 36px; }

.clock-ring {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.98rem;
}
.clock-ring.is-urgent {
  background: var(--jinx);
  color: #FFFFFF;
  animation: pulseUrgent 0.5s infinite alternate;
}
@keyframes pulseUrgent {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.prompt-stage-box {
  background: linear-gradient(180deg, #163C59, #0F2B42);
  color: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
}
.prompt-pack-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFE27A;
  margin-bottom: 4px;
}
.prompt-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  line-height: 1.2;
}

.answer-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.answer-input {
  background: #FFFFFF;
  font-size: 1.02rem;
}

/* Curses */
.curse-alert {
  background: #2D1247;
  color: #FFE27A;
  border: 2px solid var(--jinx);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}
.curse-tiny .answer-input { font-size: 0.62rem !important; }
.curse-notimer .clock-ring span { filter: blur(7px); }
.curse-foggy .answer-input { filter: blur(3.8px); }
.curse-flip .answer-bar { transform: rotate(180deg); }
.curse-scramble .answer-bar { animation: jitterShake 0.24s infinite; }
@keyframes jitterShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  75% { transform: translate(2px, -1px); }
}

.feedback-line {
  min-height: 22px;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}
.fb-ok { color: #0B8A64; }
.fb-warn { color: var(--coral-d); }

.locked-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
}
.locked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}
.locked-chip b {
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* Lobby & Players */
.lobby-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lobby-box {
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-code-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
}
.room-code-digits {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.player-roster, .live-player-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--paper);
  border: 1.8px solid var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}
.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}
.mini-tag {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
}

/* Reveal & Scorecard */
.reveal-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.reveal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--cream);
  border: 1.8px solid var(--line);
  font-size: 0.88rem;
}
.reveal-row.is-jinxed {
  border-color: var(--jinx);
  background: #FFF0F4;
}
.jinx-stamp {
  background: var(--jinx);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
}
.crown-stamp {
  background: var(--gold);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 6px;
}
.score-hero-box {
  text-align: center;
  padding: 18px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #163C59, #0E293E);
  color: #FFFFFF;
  border: 2.5px solid var(--ink);
}
.score-big-num {
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1.05;
  color: #FFE27A;
}
.rank-badge-lg {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}
.gem-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gem-pill {
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--t5-bg);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ================= BELOW-THE-FOLD EDITORIAL GUIDE ================= */
.reading {
  background: var(--cream);
  border-top: 4px solid #0B1F30;
  padding: 52px 20px 68px;
}
.reading-in {
  max-width: 700px;
  margin: 0 auto;
}
.kicker {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  background: #143650;
  color: #FFE27A;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.reading h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  color: var(--ink);
  margin: 34px 0 12px;
  line-height: 1.22;
}
.reading-head + h2 {
  margin-top: 12px;
}
.reading p {
  margin: 0 0 15px;
  font-size: 1rem;
  font-weight: 600;
  color: #263B4F;
}

.showcase-card {
  margin: 22px 0;
  background: var(--paper);
  border: 2px solid #C9BFA9;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(13, 34, 53, 0.06);
}
.sc-prompt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #13354F;
  color: #FFFFFF;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.sc-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #FFE27A;
}
.sc-timer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--gold);
  color: var(--ink);
  padding: 2px 9px;
  border-radius: 99px;
}
.sc-examples {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
}
.sc-row.is-jinx {
  background: #FFF2F5;
  border-color: #F5B5C5;
}
.sc-tier-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #FFFFFF;
}
.sc-tier-dot.t1 { background: var(--mint); }
.sc-tier-dot.t5 { background: #F02D5E; }
.sc-tier-dot.jinx { background: var(--jinx); width: 16px; height: 16px; }
.sc-word { flex: 1; font-weight: 800; }
.sc-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--t1-bg);
  color: var(--t1-fg);
}
.sc-badge.t5-badge { background: var(--t5-bg); color: #FFFFFF; }
.sc-badge.jinx-badge { background: var(--jinx); color: #FFFFFF; }
.sc-pts { font-family: var(--font-mono); font-size: 0.86rem; }
.showcase-card figcaption {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}

.guide-steps, .guide-tips {
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
  color: #263B4F;
}
.guide-steps strong, .guide-tips strong {
  color: var(--ink);
}

.callout-note {
  background: var(--paper);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1.8px solid #CFC5AF;
  border-radius: 14px;
  background: var(--paper);
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.guide-table th, .guide-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid #EAE3D2;
}
.guide-table th {
  background: #F4EFE3;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.guide-table tr:last-child td { border-bottom: none; }
.tier-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
}
.mono-pts {
  font-family: var(--font-mono);
  font-weight: 700;
}

.curse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.curse-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: var(--paper);
  border: 1.5px solid #D6CCB8;
}
.curse-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #F2ECFE;
  color: var(--plum);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.curse-card p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.lang-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}
.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--paper);
  border: 1.5px solid #CFC5AF;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
}
.lang-chip.is-current {
  background: var(--gold);
  border-color: var(--ink);
}

.faq {
  margin-top: 36px;
}
.faq details {
  background: var(--paper);
  border: 1.6px solid #D5CBB7;
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 9px;
}
.faq summary {
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--coral);
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 10px 0 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.guide-footer {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.footer-support {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid #CFC5AF;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
}
.footer-mail {
  color: var(--coral-d);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
}
.footer-mail:hover {
  text-decoration: underline;
}
.reading .footer-disclaimer {
  margin: 2px auto 0;
  max-width: 62ch;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}
.footer-disclaimer a {
  color: var(--ink);
  text-decoration: underline;
}
.reading .footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ================= AUTH & ARCHIVE MODALS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 21, 34, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 120;
}
.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.96rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.google-btn:hover {
  background: #F8FAFC;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: var(--line);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--paper);
  border: 2px solid var(--line);
}

.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-msg {
  background: var(--ink);
  color: #FFFFFF;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .arena {
    padding: 10px 8px 46px;
  }
  .cabinet {
    border-radius: 24px;
  }
  .brand-title {
    font-size: 2.15rem;
  }
  .btn-pair {
    grid-template-columns: 1fr;
  }
}
