/* ==========================================================================
   Akaloka — Visual-First Design System & Player Portal (/dashboard)
   Zero-Framework Modern CSS | Elraf Studio
   ========================================================================== */

:root {
  --bg-void: #070b14;
  --bg-deep: #0c1322;
  --bg-surface: #111a2e;
  --bg-surface-2: #16223b;

  --border-subtle: rgba(148, 197, 255, 0.16);
  --border-strong: rgba(148, 197, 255, 0.34);

  --text-primary: #f3f7ff;
  --text-secondary: #b6c8e2;
  --text-muted: #849bb9;

  --realm-1: #4be1ec;
  --realm-1-bg: rgba(75, 225, 236, 0.12);
  --realm-1-border: rgba(75, 225, 236, 0.36);

  --realm-2: #10d89e;
  --realm-2-bg: rgba(16, 216, 158, 0.12);
  --realm-2-border: rgba(16, 216, 158, 0.36);

  --realm-3: #f6c453;
  --realm-3-bg: rgba(246, 196, 83, 0.13);
  --realm-3-border: rgba(246, 196, 83, 0.38);

  --realm-4: #a78bfa;
  --realm-4-bg: rgba(167, 139, 250, 0.13);
  --realm-4-border: rgba(167, 139, 250, 0.38);

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-card: 0 18px 44px rgba(2, 6, 16, 0.48);
  --shadow-glow-cyan: 0 10px 30px rgba(75, 225, 236, 0.24);
  --shadow-glow-gold: 0 10px 30px rgba(246, 196, 83, 0.22);

  --header-h: 78px;
  --container-max: 1200px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-void);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(75, 225, 236, 0.14), transparent 60%),
    radial-gradient(ellipse 70% 45% at 88% 4%, rgba(167, 139, 250, 0.12), transparent 58%),
    radial-gradient(ellipse 65% 40% at 50% 100%, rgba(16, 216, 158, 0.08), transparent 65%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--realm-1);
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
  color: #8cf0f7;
}

:focus-visible {
  outline: 2px solid var(--realm-1);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--realm-3);
  color: #070b14;
  font-weight: 700;
  font-size: 0.9rem;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Header & Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 50px;
  width: auto;
  aspect-ratio: 944 / 444;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.brand:hover .brand-logo {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 16px rgba(75, 225, 236, 0.28));
}

.footer-logo {
  height: 64px;
  width: auto;
  aspect-ratio: 944 / 444;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

@media (max-width: 480px) {
  .brand-logo {
    height: 44px;
  }

  .footer-logo {
    height: 52px;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 6px 2px;
  position: relative;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--realm-1), var(--realm-3));
}

.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.player-pill:hover {
  border-color: var(--realm-1);
  color: var(--text-primary);
}

.player-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #132542;
  border: 1px solid rgba(75, 225, 236, 0.45);
}

.player-level-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--realm-3-bg);
  border: 1px solid var(--realm-3-border);
  color: var(--realm-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

.nav-mobile {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 95;
  background: rgba(7, 11, 20, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.5rem clamp(1rem, 5vw, 2rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.nav-mobile a,
.nav-mobile .mobile-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.nav-mobile .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 960px) {
  .nav-desktop {
    display: flex;
  }

  .menu-toggle,
  .nav-mobile {
    display: none !important;
  }
}

/* ---------- Buttons & Pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.84rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.54rem 1.05rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--realm-1) 0%, var(--realm-2) 100%);
  color: #04131c;
  box-shadow: var(--shadow-glow-cyan);
}

.btn-primary:hover:not(:disabled) {
  color: #04131c;
  box-shadow: 0 14px 34px rgba(75, 225, 236, 0.34);
}

.btn-secondary {
  background: rgba(22, 34, 59, 0.85);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border-color: var(--realm-1);
}

.btn-gold {
  background: linear-gradient(135deg, #ffd166 0%, #f59e0b 100%);
  color: #160f02;
  box-shadow: var(--shadow-glow-gold);
}

.btn-gold:hover:not(:disabled) {
  color: #160f02;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 26, 46, 0.88);
  color: var(--text-secondary);
}

.pill-live {
  background: var(--realm-2-bg);
  border-color: var(--realm-2-border);
  color: #6ef7c9;
}

.pill-demo {
  background: var(--realm-3-bg);
  border-color: var(--realm-3-border);
  color: var(--realm-3);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--realm-2);
  box-shadow: 0 0 10px var(--realm-2);
}

/* ---------- Visual-First Hero Stage 2.5D ---------- */

.hero {
  position: relative;
  padding-block: clamp(2.2rem, 5.5vw, 4.4rem) clamp(2.6rem, 5.5vw, 4.2rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4.5vw, 3rem);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 0.94fr 1.06fr;
  }
}

.hero-title {
  margin: 0.9rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  background: linear-gradient(118deg, #ffffff 8%, #7df9ff 42%, var(--realm-1) 66%, var(--realm-3) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 20px rgba(75, 225, 236, 0.22));
}

.hero-lead {
  margin: 0 0 1.6rem;
  color: var(--text-secondary);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0;
}

/* 2.5D Interactive Diorama Stage */

.hero-stage {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 10px;
  background: linear-gradient(145deg, rgba(75, 225, 236, 0.35), rgba(167, 139, 250, 0.25), rgba(246, 196, 83, 0.28));
  box-shadow: var(--shadow-card), 0 0 70px rgba(75, 225, 236, 0.16);
}

.hero-stage-viewport {
  position: relative;
  border-radius: calc(var(--radius-xl) - 6px);
  overflow: hidden;
  background: var(--bg-deep);
  aspect-ratio: 16 / 9;
}

.hero-layer-art {
  width: 100%;
  height: 100%;
  transform: scale(1.03);
  transition: transform 0.12s ease-out;
  will-change: transform;
}

.hero-layer-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-stage-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: transform 0.14s ease-out;
  will-change: transform;
}

.hero-pin {
  pointer-events: auto;
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--pin-color, var(--realm-1));
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  animation: floatPin 4.5s ease-in-out infinite;
  animation-delay: var(--pin-delay, 0s);
}

.hero-pin:hover {
  background: var(--bg-surface-2);
  transform: scale(1.06);
}

.hero-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pin-color, var(--realm-1));
  box-shadow: 0 0 10px var(--pin-color, var(--realm-1));
}

.pin-logic {
  top: 11%;
  left: 6%;
  --pin-color: var(--realm-1);
  --pin-delay: 0s;
}
.pin-civilization {
  bottom: 12%;
  left: 7%;
  --pin-color: var(--realm-2);
  --pin-delay: -1.2s;
}
.pin-expression {
  bottom: 14%;
  right: 6%;
  --pin-color: var(--realm-3);
  --pin-delay: -2.4s;
}
.pin-innovation {
  top: 11%;
  right: 6%;
  --pin-color: var(--realm-4);
  --pin-delay: -3.2s;
}

@keyframes floatPin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 480px) {
  .hero-pin {
    font-size: 0.64rem;
    padding: 0.24rem 0.5rem;
  }

  .pin-logic {
    top: 8%;
    left: 4%;
  }

  .pin-innovation {
    top: 8%;
    right: 4%;
  }

  .pin-civilization {
    bottom: 8%;
    left: 4%;
  }

  .pin-expression {
    bottom: 8%;
    right: 4%;
  }
}

/* ---------- Generic Sections ---------- */

.section {
  padding-block: clamp(2.8rem, 6vw, 4.5rem);
  border-top: 1px solid rgba(148, 197, 255, 0.08);
}

.section-header {
  max-width: 680px;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--realm-1);
  background: var(--realm-1-bg);
  border: 1px solid var(--realm-1-border);
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.section-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ---------- Interactive 4 Realms Switcher ---------- */

.realm-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

@media (min-width: 900px) {
  .realm-switcher-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.realm-switch-card {
  text-align: left;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.realm-switch-card:hover {
  transform: translateY(-2px);
}

.realm-switch-card[data-realm-switch="logic-space"] { --rc: var(--realm-1); --rc-bg: var(--realm-1-bg); }
.realm-switch-card[data-realm-switch="civilization"] { --rc: var(--realm-2); --rc-bg: var(--realm-2-bg); }
.realm-switch-card[data-realm-switch="expression"] { --rc: var(--realm-3); --rc-bg: var(--realm-3-bg); }
.realm-switch-card[data-realm-switch="innovation"] { --rc: var(--realm-4); --rc-bg: var(--realm-4-bg); }

.realm-switch-card.is-active {
  border-color: var(--rc);
  background: linear-gradient(180deg, var(--rc-bg), var(--bg-surface));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.realm-switch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.realm-switch-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--rc-bg);
  color: var(--rc);
  padding: 8px;
}

.realm-switch-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.realm-switch-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.realm-switch-island {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.realm-spotlight-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(1.15rem, 3.5vw, 1.85rem);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  transition: border-color 0.45s ease;
}

.realm-ambient-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow-orb {
  position: absolute;
  right: -10%;
  top: -24%;
  width: 72%;
  height: 148%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 55% 45%, var(--subj-primary, var(--realm-1)) 0%, transparent 64%),
    radial-gradient(circle at 22% 76%, var(--subj-secondary, var(--realm-3)) 0%, transparent 66%);
  opacity: 0.22;
  filter: blur(42px);
  transition: opacity 0.65s ease, transform 0.8s ease;
}

.ambient-art-layer {
  position: absolute;
  inset: -4%;
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-mask-image: radial-gradient(ellipse 95% 92% at 66% 48%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.2) 100%);
  mask-image: radial-gradient(ellipse 95% 92% at 66% 48%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.2) 100%);
  will-change: opacity, transform;
}

.ambient-art-layer.is-visible {
  opacity: 0.27;
  animation: ambientSlowDrift 16s ease-in-out infinite alternate;
}

.ambient-art-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes ambientSlowDrift {
  0% { transform: scale(1.01) translate3d(0%, 0%, 0); }
  100% { transform: scale(1.08) translate3d(-1.5%, -1.2%, 0); }
}

.ambient-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.realm-ambient-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(96deg, rgba(11, 17, 32, 0.68) 0%, rgba(11, 17, 32, 0.34) 48%, rgba(11, 17, 32, 0.14) 100%),
    linear-gradient(180deg, rgba(11, 17, 32, 0.26) 0%, rgba(11, 17, 32, 0.04) 48%, rgba(7, 11, 20, 0.58) 100%);
}

.realm-panel-head,
.subject-tiles-grid,
.subject-spotlight {
  position: relative;
  z-index: 2;
}

.realm-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.realm-panel-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.realm-panel-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.subject-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .subject-tiles-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.subject-icon-tile {
  padding: 0.95rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
  animation: tileFadeIn 0.28s ease both;
  animation-delay: var(--tile-delay, 0ms);
}

@keyframes tileFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.subject-icon-tile:hover,
.subject-icon-tile.is-selected {
  border-color: var(--realm-accent, var(--realm-1));
  background: rgba(18, 29, 52, 0.88);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--realm-accent, var(--realm-1));
  display: grid;
  place-items: center;
  padding: 8px;
}

.tile-meta {
  display: grid;
  gap: 0.1rem;
}

.tile-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.28;
}

.subject-spotlight {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--subj-primary, var(--realm-1));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  transition: border-color 0.4s ease;
}

.subject-spotlight.is-updating {
  animation: spotlightTextIn 0.28s ease;
}

@keyframes spotlightTextIn {
  from { opacity: 0.45; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.subject-spotlight strong {
  display: block;
  font-size: 0.96rem;
  color: var(--text-primary);
}

.subject-spotlight p {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.spotlight-badge {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--realm-3-bg);
  border: 1px solid var(--realm-3-border);
  color: var(--realm-3);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ---------- 3-Step Visual Timeline ---------- */

.steps-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 820px) {
  .steps-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.step-card {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.step-num-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #070b14;
  background: linear-gradient(135deg, var(--realm-1), var(--realm-2));
}

.step-card:nth-child(2) .step-num-badge {
  background: linear-gradient(135deg, var(--realm-2), var(--realm-3));
}

.step-card:nth-child(3) .step-num-badge {
  background: linear-gradient(135deg, var(--realm-3), var(--realm-4));
}

.step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.step-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* ---------- Quick CTA & Android Access Band ---------- */

.cta-band {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(75, 225, 236, 0.16), transparent 52%),
    radial-gradient(circle at 100% 100%, rgba(246, 196, 83, 0.14), transparent 52%),
    var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.65rem;
  align-items: center;
}

@media (min-width: 900px) {
  .cta-band {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.quick-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.quick-input-row input {
  flex: 1 1 220px;
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 11, 20, 0.85);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.quick-input-row input:focus {
  border-color: var(--realm-1);
  outline: none;
}

.quick-msg {
  margin: 0;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
}

.quick-msg.is-ok {
  background: rgba(16, 216, 158, 0.14);
  border: 1px solid var(--realm-2-border);
  color: #6ef7c9;
}

.quick-msg.is-error {
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

/* ---------- Auth Modal & Checkout Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(4, 7, 15, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
  padding: 1.55rem;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.google-signin-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.88rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.google-signin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f8fafc;
}

.auth-modal-alt {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.text-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--realm-1);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.05rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 4px;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.78);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.auth-mode-tab {
  border: none;
  border-radius: 999px;
  padding: 0.56rem 0.75rem;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.auth-mode-tab.is-active {
  background: var(--bg-surface-2);
  color: var(--realm-1);
  box-shadow: inset 0 0 0 1px var(--realm-1-border);
}

.auth-form {
  display: grid;
  gap: 0.78rem;
}

.auth-input-group {
  display: grid;
  gap: 0.32rem;
}

.auth-input-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.auth-input-group input {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(7, 11, 20, 0.88);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.94rem;
}

.auth-input-group input:focus {
  border-color: var(--realm-1);
  outline: none;
}

.pw-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-field-wrap input {
  padding-right: 4.1rem;
}

.pw-toggle-btn {
  position: absolute;
  right: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.pw-toggle-btn:hover {
  border-color: var(--realm-1);
  color: var(--text-primary);
}

.auth-hint {
  margin: 0;
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pill-method.is-playerid {
  background: var(--realm-1-bg);
  border-color: var(--realm-1-border);
  color: var(--realm-1);
  font-family: var(--font-mono);
}

.pill-method.is-google {
  background: var(--realm-4-bg);
  border-color: var(--realm-4-border);
  color: #ddd6fe;
}

/* ---------- Player Portal (/dashboard) ---------- */

.portal-main {
  padding-block: clamp(1.8rem, 4vw, 3rem) 4rem;
  min-height: calc(100vh - var(--header-h) - 220px);
}

.portal-gate-card {
  max-width: 580px;
  margin-inline: auto;
  margin-block: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  text-align: center;
  display: grid;
  gap: 1rem;
}

.portal-header-card {
  padding: 1.35rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.portal-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.portal-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--realm-1);
  background: #132542;
  flex-shrink: 0;
}

.portal-player-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
}

.portal-player-email {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  word-break: break-word;
}

.portal-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.portal-empty-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(75, 225, 236, 0.09);
  border: 1px solid var(--realm-1-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.portal-tab-btn {
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.portal-tab-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.portal-tab-btn.is-active {
  background: linear-gradient(135deg, var(--realm-1), var(--realm-2));
  color: #04131c;
  border-color: transparent;
}

/* KPI Grid & Progress Bars */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 820px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi-card {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.kpi-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text-primary);
}

.portal-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 860px) {
  .portal-two-col {
    grid-template-columns: 1fr 1.25fr;
  }
}

.panel-card {
  padding: 1.35rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.panel-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.75);
  border: 1px solid rgba(148, 197, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.realm-bar-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.realm-bar-row:last-child {
  margin-bottom: 0;
}

.realm-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.subjects-progress-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .subjects-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .subjects-progress-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.subject-stat-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid var(--border-subtle);
  display: grid;
  gap: 0.65rem;
}

.subject-stat-card.has-mastery {
  border-color: var(--realm-3-border);
  background: linear-gradient(180deg, rgba(246, 196, 83, 0.08), rgba(7, 11, 20, 0.65));
}

.subject-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.subject-stat-id {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mini-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--subj-accent, var(--realm-1));
  padding: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.subject-stat-name {
  font-weight: 700;
  font-size: 0.94rem;
}

.subject-stat-realm {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.subject-stat-pct {
  font-size: 0.9rem;
  font-weight: 700;
}

.subject-stat-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-unlocked-text {
  color: var(--realm-3);
  font-weight: 700;
}

.badge-locked-text {
  color: var(--text-muted);
}

/* Achievements Tab */

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tab {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-tab[aria-selected="true"] {
  background: var(--text-primary);
  color: var(--bg-void);
  border-color: var(--text-primary);
}

.ach-grid,
.titles-medal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .ach-grid,
  .titles-medal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .titles-medal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ach-card,
.title-medal-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.ach-card.is-locked,
.title-medal-card.is-locked {
  opacity: 0.58;
  filter: grayscale(0.45);
}

.ach-card.is-unlocked,
.title-medal-card.is-unlocked {
  border-color: var(--ach-color, var(--realm-3));
  background: linear-gradient(135deg, rgba(246, 196, 83, 0.1), rgba(17, 26, 46, 0.9));
}

.ach-card.is-unlocked::after,
.title-medal-card.is-unlocked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.12) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: badgeShimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badgeShimmer {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(120%); }
}

.ach-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ach-color, var(--realm-3));
  flex-shrink: 0;
}

.ach-body {
  min-width: 0;
}

.ach-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.ach-cat {
  color: var(--ach-color, var(--realm-1));
}

.ach-state {
  color: var(--text-muted);
}

.ach-title,
.title-medal-name {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}

.ach-desc,
.title-medal-req {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.title-medal-subj {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Top-Up Tab */

.balance-banner {
  padding: 1.25rem 1.45rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(75, 225, 236, 0.14), rgba(246, 196, 83, 0.14));
  border: 1px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.balance-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--realm-1);
}

.topup-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 920px) {
  .topup-layout {
    grid-template-columns: 1.35fr 0.95fr;
    align-items: start;
  }
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .packages-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pkg-card {
  text-align: left;
  padding: 1.05rem;
  border-radius: var(--radius-lg);
  background: rgba(7, 11, 20, 0.62);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.pkg-card:hover {
  transform: translateY(-2px);
}

.pkg-card.is-selected {
  border-color: var(--pkg-accent, var(--realm-1));
  background: rgba(22, 34, 59, 0.95);
  box-shadow: 0 0 0 2px rgba(75, 225, 236, 0.22);
}

.pkg-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pkg-accent, var(--realm-1));
}

.pkg-amount {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.pkg-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.pkg-bonus {
  font-size: 0.76rem;
  color: var(--realm-2);
  font-weight: 700;
}

.pkg-price {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--realm-3);
}

.payment-grid {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.pay-card {
  text-align: left;
  padding: 0.82rem 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.pay-card.is-selected {
  border-color: var(--realm-1);
  background: rgba(22, 34, 59, 0.92);
}

.pay-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.pay-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--realm-1-bg);
  color: var(--realm-1);
}

.pay-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checkout-summary-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.74);
  border: 1px solid var(--border-subtle);
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--realm-3-bg);
  color: var(--realm-3);
}

.pay-code-box {
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.82);
  border: 1px dashed var(--realm-1);
  text-align: center;
  margin: 0.85rem 0;
}

/* ---------- Legal Pages (/privacy & /terms) ---------- */

.legal-hero {
  padding-block: clamp(2.2rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.legal-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.legal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: 2.25rem 4rem;
}

@media (min-width: 960px) {
  .legal-layout {
    grid-template-columns: 270px 1fr;
    align-items: start;
  }
}

.legal-toc {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 960px) {
  .legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 18px);
  }
}

.legal-toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 800;
}

.legal-toc ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.legal-toc a {
  color: var(--text-secondary);
}

.legal-toc a:hover {
  color: var(--realm-1);
}

.legal-article {
  min-width: 0;
  display: grid;
  gap: 1.5rem;
}

.legal-card {
  padding: clamp(1.2rem, 3vw, 1.85rem);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.legal-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legal-card h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 1.02rem;
  color: var(--realm-1);
}

.legal-card p {
  margin: 0 0 0.8rem;
  color: var(--text-secondary);
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-card ul,
.legal-card ol {
  margin: 0.4rem 0 0.85rem;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.4rem;
}

.legal-card strong {
  color: var(--text-primary);
}

.callout {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--realm-2-bg);
  border: 1px solid var(--realm-2-border);
  color: var(--text-primary);
  font-size: 0.93rem;
  margin-top: 0.75rem;
}

.callout-warn {
  background: var(--realm-3-bg);
  border-color: var(--realm-3-border);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-top: 0.9rem;
}

.data-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.82rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.data-table thead th {
  background: rgba(7, 11, 20, 0.85);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td {
  color: var(--text-secondary);
}

/* ---------- 404 Page ---------- */

.error-page {
  min-height: calc(100vh - var(--header-h) - 220px);
  display: grid;
  place-items: center;
  padding-block: 4rem;
  text-align: center;
}

.error-card {
  max-width: 560px;
  padding: 2.2rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--realm-1);
  margin: 0 0 0.6rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 18, 0.92);
  padding-block: 2.8rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-desc {
  margin: 0.75rem 0 0;
  max-width: 40ch;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-heading {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text-secondary);
}

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

.footer-bottom {
  padding-top: 1.4rem;
  border-top: 1px solid rgba(148, 197, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-legal-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

/* ---------- Scroll Reveal & Motion Safety ---------- */

.js-ready .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ambient-art-layer,
  .ambient-glow-orb,
  .subject-spotlight.is-updating {
    animation: none !important;
    transition: none !important;
  }

  .btn,
  .hero-pin,
  .hero-layer-art,
  .hero-stage-pins,
  .subject-icon-tile,
  .ach-card.is-unlocked::after,
  .title-medal-card.is-unlocked::after,
  .js-ready .reveal {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
