:root {
  color-scheme: dark;
  --ink: #f0f0ea;
  --muted: #999e97;
  --night: #111411;
  --navy: #151815;
  --surface: #1a1e1a;
  --surface-raised: #222722;
  --panel: #1a1e1a;
  --panel-solid: #1a1e1a;
  --line: rgba(240, 240, 234, 0.05);
  --line-strong: rgba(240, 240, 234, 0.1);
  --blue: #829785;
  --blue-soft: #b5c2b5;
  --gold: #c77a5c;
  --mint: #829785;
  --violet: #8e7f90;
  --danger: #c86d6d;
  --shadow: none;
  --shadow-soft: none;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 280px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--night);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--night); }
body::-webkit-scrollbar-thumb { border: 2px solid var(--night); border-radius: 99px; background: #353a35; }

::selection { background: var(--gold); color: #17110e; }

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }
a { color: inherit; }

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

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: calc(0.75rem + env(safe-area-inset-left));
  padding: 0.75rem 1rem;
  border-radius: 11px;
  background: var(--gold);
  color: #111827;
  font-weight: 850;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.ui-icon {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Application shell */
.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.app-sidebar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  height: 100dvh;
  min-width: 0;
  flex-direction: column;
  padding: calc(1.25rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar-brand,
.mobile-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  padding: 5px;
  border: 1px solid rgba(243, 199, 95, 0.35);
  border-radius: 14px;
  background: linear-gradient(145deg, #182d49, #0c1a2c);
  box-shadow: 0 8px 24px rgba(0, 7, 20, 0.32);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-copy strong,
.mobile-brand strong {
  display: block;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.sidebar-brand-copy small,
.mobile-brand small {
  display: block;
  margin-top: 0.15rem;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 2.3rem;
}

.sidebar-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sidebar-link .ui-icon { width: 20px; height: 20px; }

.sidebar-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.sidebar-link.is-active {
  border-color: rgba(111, 148, 255, 0.24);
  background: rgba(111, 148, 255, 0.12);
  color: var(--blue-soft);
}

.sidebar-install-card {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
  padding: 1rem;
  border: 1px solid rgba(243, 199, 95, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(243, 199, 95, 0.1), transparent 55%),
    var(--surface);
}

.install-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--gold);
  color: #152036;
}

.install-card-icon .ui-icon { width: 19px; height: 19px; }
.sidebar-install-copy strong { display: block; font-size: 0.82rem; }
.sidebar-install-copy p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.69rem; line-height: 1.45; }

.sidebar-install-button {
  min-height: 38px;
  border: 1px solid rgba(243, 199, 95, 0.35);
  border-radius: 11px;
  background: transparent;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 820;
  cursor: pointer;
}

.sidebar-install-button:hover { background: rgba(243, 199, 95, 0.1); }

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.sidebar-status > span:first-child {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(93, 215, 179, 0.1);
}

.sidebar-status.is-offline > span:first-child { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 122, 138, 0.1); }

.app-workspace { min-width: 0; }

.app-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: calc(72px + env(safe-area-inset-top));
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: env(safe-area-inset-top) clamp(1rem, 2.7vw, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.84);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.mobile-brand { display: none; }

.topbar-title { min-width: 0; }
.topbar-title span { display: block; color: var(--gold); font-size: 0.64rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
.topbar-title strong { display: block; margin-top: 0.1rem; overflow: hidden; font-size: 0.94rem; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 0.55rem; }

.topbar-install,
.topbar-leaderboard,
.topbar-academy,
.student-profile-trigger,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.topbar-install { border-color: rgba(243, 199, 95, 0.25); color: var(--gold); }
.topbar-install:hover { background: rgba(243, 199, 95, 0.08); }
.topbar-leaderboard:hover,
.topbar-academy:hover,
.student-profile-trigger:hover,
.icon-button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.055); }

.icon-button { width: 42px; padding: 0; }
.icon-button .ui-icon { width: 19px; height: 19px; }
.icon-button .icon-sound-off,
.icon-button.is-muted .icon-sound-on { display: none; }
.icon-button.is-muted .icon-sound-off { display: block; }

.student-profile-trigger {
  max-width: 210px;
  padding: 0.28rem 0.68rem 0.28rem 0.3rem;
  text-align: left;
}

.student-profile-avatar,
.student-profile-dialog-avatar {
  display: grid;
  overflow: hidden;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(243, 199, 95, 0.3);
  border-radius: 50%;
  background: #172943;
  color: var(--gold);
  font-weight: 850;
}

.student-profile-avatar { width: 34px; height: 34px; font-size: 0.62rem; }
.student-profile-avatar img,
.student-profile-dialog-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-profile-copy { min-width: 0; }
.student-profile-copy small,
.student-profile-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-profile-copy small { color: var(--muted); font-size: 0.52rem; font-weight: 720; }
.student-profile-copy strong { max-width: 112px; margin-top: 0.05rem; font-size: 0.68rem; }

.offline-banner {
  position: fixed;
  z-index: 300;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  max-width: calc(100% - 1.5rem);
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 122, 138, 0.35);
  border-radius: 99px;
  background: #1d1a28;
  box-shadow: var(--shadow-soft);
  color: #ffd9de;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.offline-banner > span { color: var(--danger); }

.hub-main {
  width: min(100%, 1340px);
  margin: 0 auto;
  padding: clamp(1rem, 2.7vw, 2.5rem);
}

/* Hero */
.hub-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: 460px;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(125deg, rgba(111, 148, 255, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(243, 199, 95, 0.07), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 90px;
}

.hub-hero::after {
  position: absolute;
  right: -14%;
  bottom: -55%;
  width: 640px;
  height: 640px;
  border: 1px solid rgba(111, 148, 255, 0.1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 2; min-width: 0; max-width: 740px; }

.eyebrow,
.section-kicker {
  color: var(--blue-soft);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; }
.eyebrow > span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(243, 199, 95, 0.1); }

.hub-hero h1 {
  max-width: 720px;
  margin: 1rem 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.2vw, 4.7rem);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hub-hero h1 span { color: var(--gold); }

.hero-copy > p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.7rem; }

.hero-game-finder {
  display: grid;
  max-width: 660px;
  min-height: 58px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.45rem;
  padding: 0.35rem 0.4rem 0.35rem 1rem;
  border: 1px solid rgba(111, 148, 255, 0.38);
  border-radius: 17px;
  background: rgba(4, 12, 23, 0.58);
  box-shadow: 0 14px 34px rgba(0, 7, 20, 0.22);
}

.hero-game-finder:focus-within { border-color: var(--blue-soft); box-shadow: 0 0 0 4px rgba(111, 148, 255, 0.1), 0 14px 34px rgba(0, 7, 20, 0.22); }
.hero-game-finder .ui-icon { width: 20px; color: var(--blue-soft); }
.hero-game-finder input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; font-size: 0.9rem; }
.hero-game-finder input::placeholder { color: #71839a; }
.hero-game-finder button { min-height: 46px; padding: 0 1rem; border: 0; border-radius: 12px; color: #101b2d; background: var(--gold); font: inherit; font-size: 0.72rem; font-weight: 850; cursor: pointer; }

.finder-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.65rem; color: var(--muted); font-size: 0.64rem; }
.finder-suggestions button { padding: 0.25rem 0.5rem; border: 0; color: var(--blue-soft); background: transparent; font: inherit; font-size: inherit; font-weight: 780; cursor: pointer; }
.finder-suggestions button:hover { text-decoration: underline; }
.hero-library-note { margin-top: 1.05rem !important; color: var(--muted) !important; font-size: 0.67rem !important; line-height: 1.4 !important; }
.hero-library-note strong { color: var(--ink); }

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.1rem;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #132036; }
.primary-button:hover { background: #ffda7d; border-color: #ffda7d; transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.025); color: var(--ink); }
.secondary-button:hover { border-color: rgba(111, 148, 255, 0.5); background: rgba(111, 148, 255, 0.08); }

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 650px;
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 12, 23, 0.34);
}

.hero-metrics > div { min-width: 0; padding: 0.9rem 1rem; border-right: 1px solid var(--line); }
.hero-metrics > div:last-child { border-right: 0; }
.hero-metrics strong { display: block; color: var(--ink); font-size: 1.35rem; font-weight: 850; letter-spacing: -0.03em; line-height: 1; }
.hero-metrics span { display: block; margin-top: 0.32rem; overflow: hidden; color: var(--muted); font-size: 0.64rem; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }

.hero-visual {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 360px;
  place-items: center;
}

.hero-glow {
  position: absolute;
  width: min(92%, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 148, 255, 0.25), rgba(111, 148, 255, 0.04) 55%, transparent 70%);
  filter: blur(4px);
}

.hero-mascot {
  position: relative;
  display: grid;
  width: min(100%, 350px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(111, 148, 255, 0.2);
  border-radius: 50%;
  background: rgba(7, 17, 31, 0.42);
}

.hero-mascot-player { position: relative; z-index: 2; display: block; width: 112%; height: 112%; }
.mascot-fallback { position: absolute; z-index: 1; display: grid; place-items: center; font-size: 8rem; }
lottie-player:defined + .mascot-fallback { display: none; }

.mascot-label {
  position: absolute;
  z-index: 4;
  right: 50%;
  bottom: 0.65rem;
  display: flex;
  width: max-content;
  max-width: 90%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(7, 17, 31, 0.9);
  box-shadow: var(--shadow-soft);
  transform: translateX(50%);
  backdrop-filter: blur(12px);
}

.mascot-status { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(93, 215, 179, 0.1); }
.mascot-label strong { display: block; font-size: 0.75rem; }
.mascot-label small { display: block; color: var(--muted); font-size: 0.61rem; }

.hero-orbit-chip {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-size: 0.7rem;
  font-weight: 850;
}

.chip-one { top: 16%; left: 0; color: var(--blue-soft); transform: rotate(-8deg); }
.chip-two { right: 1%; bottom: 25%; color: var(--gold); transform: rotate(7deg); }

/* Sections and quick start */
.quick-start,
.game-browser,
.academy-bridge { scroll-margin-top: 92px; }

.quick-start { padding: clamp(3rem, 6vw, 5rem) 0 1rem; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 840;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.section-heading > p { max-width: 360px; margin: 0; color: var(--muted); font-size: 0.78rem; text-align: right; }

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem;
}

.quick-start-grid:has(.continue-card:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.quick-card {
  display: grid;
  min-width: 0;
  min-height: 116px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.quick-card:hover { border-color: var(--line-strong); background: var(--surface-raised); transform: translateY(-2px); }
.quick-card-featured { border-color: rgba(243, 199, 95, 0.3); background: linear-gradient(135deg, rgba(243, 199, 95, 0.11), transparent 52%), var(--surface); }
.quick-card > span:nth-child(2) { min-width: 0; }
.quick-card small,
.quick-card strong,
.quick-card em { display: block; }
.quick-card small { color: var(--muted); font-size: 0.58rem; font-style: normal; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.quick-card strong { margin-top: 0.18rem; overflow: hidden; font-size: 0.9rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.quick-card em { margin-top: 0.22rem; overflow: hidden; color: var(--muted); font-size: 0.65rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.quick-card > .ui-icon { width: 18px; color: var(--muted); }

.quick-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: rgba(243, 199, 95, 0.15);
  color: var(--gold);
  font-size: 0.83rem;
  font-weight: 850;
}

.quick-blue { background: rgba(111, 148, 255, 0.14); color: var(--blue-soft); }
.quick-violet { background: rgba(169, 138, 247, 0.14); color: #cab9ff; }

/* Game library */
.game-browser { padding: clamp(3.5rem, 6vw, 5rem) 0; }
.browser-heading > p strong { color: var(--ink); }

.discovery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.discovery-toolbar > p { margin: 0; color: var(--muted); font-size: 0.68rem; }
.discovery-tabs { display: inline-flex; gap: 0.3rem; padding: 0.3rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(4, 12, 23, 0.34); }
.discovery-tabs button { min-height: 38px; padding: 0.45rem 0.8rem; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font: inherit; font-size: 0.7rem; font-weight: 820; cursor: pointer; }
.discovery-tabs button.is-active { color: var(--ink); background: var(--surface-raised); box-shadow: 0 6px 16px rgba(0, 7, 20, 0.22); }

.library-controls { margin-bottom: 1rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(10, 22, 39, 0.55); }
.library-controls[hidden] { display: none; }
.library-controls .difficulty-paths { margin-bottom: 0.65rem; }
.library-controls .browser-tools { position: static; margin-bottom: 0; box-shadow: none; }
.library-more-wrap { display: flex; justify-content: center; margin-top: 1.25rem; }
.library-more-wrap .secondary-button[hidden] { display: none; }

.difficulty-paths {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.difficulty-path {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.difficulty-path:hover { border-color: var(--line-strong); background: var(--surface-raised); transform: translateY(-1px); }
.difficulty-path.is-active { border-color: rgba(111, 148, 255, 0.48); background: linear-gradient(145deg, rgba(111, 148, 255, 0.13), transparent 58%), var(--surface); }
.difficulty-path[data-difficulty="medium"].is-active { border-color: rgba(111, 148, 255, 0.52); }
.difficulty-path[data-difficulty="hard"].is-active { border-color: rgba(243, 199, 95, 0.5); background: linear-gradient(145deg, rgba(243, 199, 95, 0.11), transparent 58%), var(--surface); }
.difficulty-path[data-difficulty="impossible"].is-active { border-color: rgba(209, 140, 255, 0.48); background: linear-gradient(145deg, rgba(209, 140, 255, 0.11), transparent 58%), var(--surface); }
.difficulty-path-index { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 0.57rem; font-weight: 850; }
.difficulty-path strong,
.difficulty-path small { display: block; }
.difficulty-path strong { font-size: 0.86rem; }
.difficulty-path small { margin-top: 0.18rem; color: var(--muted); font-size: 0.6rem; line-height: 1.35; }
.difficulty-path em { grid-column: 2; color: var(--muted); font-size: 0.57rem; font-style: normal; font-weight: 760; letter-spacing: 0.05em; text-transform: uppercase; }

.browser-tools {
  position: sticky;
  z-index: 35;
  top: calc(72px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(10, 22, 39, 0.92);
  box-shadow: 0 12px 28px rgba(0, 7, 20, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.search-box {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.search-box:focus-within { border-color: rgba(111, 148, 255, 0.6); box-shadow: 0 0 0 3px rgba(111, 148, 255, 0.08); }
.search-box .ui-icon { width: 18px; height: 18px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 0.8rem; }
.search-box input::placeholder { color: #68798e; }
.search-box kbd { padding: 0.08rem 0.38rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 0.65rem; }

.category-filters { display: flex; min-width: 0; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.category-filters::-webkit-scrollbar { display: none; }

.filter-chip,
.availability-toggle {
  flex: 1 0 auto;
  min-height: 48px;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 790;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.filter-chip span { margin-left: 0.2rem; opacity: 0.65; font-size: 0.61rem; }
.filter-chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.045); }
.filter-chip.active { border-color: rgba(111, 148, 255, 0.28); background: rgba(111, 148, 255, 0.13); color: var(--blue-soft); }

.availability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-color: var(--line);
  white-space: nowrap;
}

.availability-toggle > span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.availability-toggle[aria-pressed="true"] { border-color: rgba(93, 215, 179, 0.32); background: rgba(93, 215, 179, 0.1); color: #a4f2da; }
.availability-toggle[aria-pressed="true"] > span { background: var(--mint); }

/* ---------------------------------------------------------------
 * Game grid — Arcade cabinet cards.
 * Each card is a compact stand-up cabinet: marquee header, brushed
 * charcoal face, CRT screen with phosphor art & scanlines, marquee
 * title in Bungee, VT323 pixel HUD, per-category cabinet stripe.
 * ------------------------------------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.35rem 1.1rem;
}

.game-card-link,
.game-card-button {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1);
}

.game-card-link:hover,
.game-card-button:hover { transform: translateY(-6px); }

.game-card-link:focus-visible,
.game-card-button:focus-visible {
  outline: 3px solid var(--cab-accent, var(--gold));
  outline-offset: 4px;
  border-radius: 4px;
}

/* Cabinet body */
.game-card {
  --cab-face: #16181c;
  --cab-face-2: #0d0f13;
  --cab-edge: #05060a;
  --cab-ink: #f4f6ff;
  --cab-muted: #7f8698;
  --cab-line: rgba(255, 255, 255, 0.08);
  --cab-accent: #ff2e63;
  --cab-phosphor: #38ff9a;
  --cab-screen-bg: #061014;

  position: relative;
  display: grid;
  height: 100%;
  min-height: 420px;
  grid-template-rows: auto auto auto auto auto 1fr auto;
  overflow: hidden;
  padding: 0.9rem 0.95rem 1rem;
  border-radius: 14px 14px 22px 22px / 14px 14px 30px 30px;
  border: 1px solid var(--cab-edge);
  color: var(--cab-ink);
  background:
    linear-gradient(180deg, var(--cab-face) 0%, var(--cab-face) 62%, var(--cab-face-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -8px 20px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 3px 0 var(--cab-edge),
    0 10px 22px rgba(0, 0, 0, 0.55),
    0 24px 44px rgba(0, 0, 0, 0.45);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), box-shadow 220ms ease;
}

.game-card-link:hover .game-card,
.game-card-button:hover .game-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -8px 20px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 5px 0 var(--cab-edge),
    0 18px 34px rgba(0, 0, 0, 0.6),
    0 34px 60px rgba(0, 0, 0, 0.45),
    0 0 32px color-mix(in srgb, var(--cab-accent) 32%, transparent);
}

/* Rivets on the corners for tactile physicality */
.game-card::before,
.game-card::after {
  position: absolute;
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4a4f5c, #05060a 68%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.game-card::before { top: 8px; left: 8px; }
.game-card::after  { top: 8px; right: 8px; }

/* Per-category cabinet accent (marquee neon) */
.game-card[data-category="educational"] { --cab-accent: #37c8ff; --cab-phosphor: #7cfbff; }
.game-card[data-category="action"]      { --cab-accent: #ff2e63; --cab-phosphor: #ffdc4f; }
.game-card[data-category="puzzle"]      { --cab-accent: #a26bff; --cab-phosphor: #c6a4ff; }
.game-card[data-category="casual"]      { --cab-accent: #2affb4; --cab-phosphor: #7cffcd; }

/* Marquee header */
.cab-marquee {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.6rem;
  color: rgba(255, 255, 255, 0.55);
  font-family: "VT323", ui-monospace, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
}

.cab-brand {
  color: var(--cab-accent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--cab-accent) 55%, transparent);
}

.cab-cabinet b {
  color: var(--cab-ink);
  font-weight: normal;
}

.cab-stripe {
  position: relative;
  z-index: 2;
  height: 4px;
  margin: 0.4rem 0 0.65rem;
  border-radius: 2px;
  background:
    linear-gradient(90deg,
      transparent 0,
      var(--cab-accent) 12%,
      var(--cab-accent) 88%,
      transparent 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--cab-accent) 65%, transparent);
}

/* CRT screen */
.cab-screen {
  position: relative;
  z-index: 2;
  padding: 6px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #2b2e35, #131418 60%, #0a0b0f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(0, 0, 0, 0.65);
}

.cab-bezel {
  position: relative;
  overflow: hidden;
  height: 148px;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 40%,
      color-mix(in srgb, var(--cab-phosphor) 8%, var(--cab-screen-bg)) 0%,
      var(--cab-screen-bg) 78%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.85),
    inset 0 0 22px rgba(0, 0, 0, 0.55),
    inset 0 0 40px color-mix(in srgb, var(--cab-phosphor) 12%, transparent);
}

.cab-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cab-phosphor);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cab-phosphor) 60%, transparent));
}

.cab-scene svg {
  display: block;
  width: min(72%, 175px);
  height: auto;
}

.cab-scene img,
.cab-grid-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.game-card:hover .cab-scene img,
.game-card:hover .cab-grid-img {
  transform: scale(1.04);
  filter: brightness(1.1);
}

/* CRT scanlines + subtle screen curve highlight */
.cab-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.28) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 3px 100%;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

.cab-scanlines::after {
  position: absolute;
  content: "";
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.14), transparent 45%);
  pointer-events: none;
}

/* HUD text overlaid on the screen */
.cab-hud {
  position: absolute;
  z-index: 3;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 0.44rem;
  letter-spacing: 0.1em;
  color: var(--cab-phosphor);
  text-shadow: 0 0 6px color-mix(in srgb, var(--cab-phosphor) 70%, transparent);
}

.cab-hud-top { top: 6px; left: 8px; }
.cab-hud-bottom { bottom: 6px; right: 8px; }
.cab-hud b { font-weight: normal; }

/* Control-panel area below the screen */
.cab-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.25rem 0.15rem 0.35rem;
  border-bottom: 1px dashed var(--cab-line);
  font-family: "VT323", ui-monospace, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cab-meta .cab-category { color: var(--cab-ink); }
.cab-meta .cab-vol { color: var(--cab-muted); }

/* Marquee title */
.cab-title {
  position: relative;
  z-index: 2;
  margin: 0.55rem 0 0.4rem;
  padding: 0 0.15rem;
  font-family: "Bungee", "Impact", sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cab-ink);
  text-shadow:
    0 0 1px var(--cab-accent),
    0 1px 0 var(--cab-edge),
    0 0 14px color-mix(in srgb, var(--cab-accent) 40%, transparent);
}

.cab-dek {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 0.15rem;
  color: var(--cab-muted);
  font-family: "Inter", ui-sans-serif, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Coin slot + CTA row */
.cab-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.15rem 0;
  border-top: 1px dashed var(--cab-line);
}

.cab-skill {
  max-width: 45%;
  color: var(--cab-muted);
  font-family: "VT323", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.cab-cta .status-pill {
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--cab-accent);
  border-radius: 2px;
  color: var(--cab-accent);
  background: transparent;
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card.is-playable .cab-cta .status-pill {
  color: var(--cab-edge);
  background: var(--cab-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cab-accent) 50%, transparent);
}

.cab-slot {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: #05060a;
  box-shadow:
    inset 0 1px 1px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.06);
}

.cab-slot-inner {
  position: absolute;
  inset: 1px 4px;
  border-radius: 1px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--cab-accent) 45%, transparent),
    transparent);
  animation: coinShimmer 2.6s linear infinite;
}

.cab-cta-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  color: var(--cab-ink);
  text-transform: uppercase;
}

.cab-cta .ui-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: var(--cab-accent);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.game-card-link:hover .cab-cta .ui-icon,
.game-card-button:hover .cab-cta .ui-icon { transform: translateX(4px); }

@keyframes coinShimmer {
  0% { transform: translateX(-100%); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cab-slot-inner { animation: none; }
}

.empty-state {
  padding: 4rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon { display: grid; width: 64px; height: 64px; margin: 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.empty-state .empty-icon .ui-icon { width: 28px; height: 28px; }
.empty-state h3 { margin: 0.8rem 0 0.25rem; color: var(--ink); font-size: 1.35rem; }
.empty-state p { margin: 0 0 1.1rem; font-size: 0.82rem; }

/* Main-site bridge */
.academy-bridge {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(243, 199, 95, 0.2);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 95% 10%, rgba(243, 199, 95, 0.12), transparent 24rem),
    var(--surface);
}

.academy-bridge::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--gold), var(--blue)); content: ""; }
.academy-bridge-copy { position: relative; z-index: 1; }
.academy-bridge h2 { max-width: 720px; margin: 0.55rem 0 0.8rem; font-size: clamp(2rem, 4vw, 3.3rem); font-weight: 840; letter-spacing: -0.055em; line-height: 1.02; }
.academy-bridge-copy > p { max-width: 700px; margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.academy-bridge-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.academy-proof { position: relative; z-index: 1; display: grid; gap: 0.65rem; }
.academy-proof > div { display: grid; grid-template-columns: 86px 1fr; gap: 0.75rem; align-items: center; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(7, 17, 31, 0.35); }
.academy-proof strong { color: var(--gold); font-size: 1.3rem; font-weight: 850; letter-spacing: -0.03em; }
.academy-proof span { color: var(--muted); font-size: 0.65rem; font-weight: 760; letter-spacing: 0.06em; text-transform: uppercase; }

/* Footer */
.hub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  width: min(calc(100% - clamp(2rem, 5.4vw, 5rem)), 1290px);
  margin: 1.2rem auto 0;
  padding: 1.5rem 0 calc(1.8rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.footer-brand { display: flex; min-width: 0; align-items: center; gap: 0.7rem; }
.footer-logo { display: block; width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; }
.footer-brand p { margin: 0; }
.footer-brand strong,
.footer-brand span { display: block; }
.footer-brand strong { font-size: 0.78rem; }
.footer-brand span { margin-top: 0.12rem; color: var(--muted); font-size: 0.63rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem 1rem; }
.footer-links a { color: var(--muted); font-size: 0.68rem; font-weight: 720; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* Dialogs and status UI */
.roadmap-dialog,
.install-dialog,
.student-profile-dialog {
  width: min(calc(100% - 1.5rem), 440px);
  padding: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(0, 7, 20, 0.72);
  color: var(--ink);
  text-align: center;
}

.roadmap-dialog::backdrop,
.install-dialog::backdrop,
.student-profile-dialog::backdrop { background: rgba(2, 8, 18, 0.82); backdrop-filter: blur(8px); }

.dialog-close { position: absolute; top: 0.75rem; right: 0.75rem; display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); font-size: 1.35rem; cursor: pointer; }
.dialog-icon { display: block; margin-bottom: 0.7rem; font-size: 3.2rem; }
.roadmap-dialog h2,
.install-dialog h2 { margin: 0.28rem 0 0.6rem; font-size: 1.6rem; line-height: 1.1; }
.roadmap-dialog > p:not(.section-kicker),
.install-dialog > p:not(.section-kicker) { margin: 0 0 1.35rem; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.install-dialog-icon { display: grid; width: 68px; height: 68px; margin: 0 auto 1rem; place-items: center; padding: 8px; border: 1px solid rgba(243, 199, 95, 0.3); border-radius: 19px; background: #102039; }
.install-dialog-icon img { width: 100%; height: 100%; object-fit: contain; }

.student-profile-dialog {
  width: min(calc(100% - 1.5rem), 520px);
  text-align: left;
}

.student-profile-dialog-head { display: flex; align-items: center; gap: 1rem; padding-right: 2.2rem; }
.student-profile-dialog-avatar { width: 74px; height: 74px; font-size: 1rem; }
.student-profile-dialog h2 { margin: 0.2rem 0 0; font-size: 1.55rem; letter-spacing: -0.035em; }
.student-profile-dialog-head > div > p:last-child { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.8rem; }
.student-profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.55rem; margin: 1.35rem 0; }
.student-profile-facts > div { min-width: 0; padding: 0.8rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.student-profile-facts span,
.student-profile-facts strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-profile-facts span { color: var(--muted); font-size: 0.54rem; font-weight: 780; letter-spacing: 0.07em; text-transform: uppercase; }
.student-profile-facts strong { margin-top: 0.3rem; font-size: 0.78rem; }
.student-profile-note { margin: 0 0 1.2rem; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }

.app-toast {
  position: fixed;
  z-index: 350;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.72rem;
}

.app-toast button { min-height: 34px; padding: 0 0.7rem; border: 0; border-radius: 9px; background: var(--gold); color: #132036; font-size: 0.68rem; font-weight: 800; cursor: pointer; }

.mobile-tabbar { display: none; }

/* Shared game-page system */
.game-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: calc(clamp(0.7rem, 2vw, 1.4rem) + env(safe-area-inset-top)) calc(clamp(0.7rem, 2vw, 1.4rem) + env(safe-area-inset-right)) calc(clamp(0.7rem, 2vw, 1.4rem) + env(safe-area-inset-bottom)) calc(clamp(0.7rem, 2vw, 1.4rem) + env(safe-area-inset-left));
}

.game-shell { display: flex; width: min(100%, 1080px); min-height: calc(100dvh - clamp(1.4rem, 4vw, 2.8rem)); flex: 1; flex-direction: column; gap: 0.85rem; margin: 0 auto; }

.game-topbar,
.game-panel { border: 1px solid var(--line); background: rgba(13, 27, 45, 0.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.game-topbar { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.65rem; border-radius: 17px; }

.back-button,
.game-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 0.42rem; padding: 0.58rem 0.82rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.025); color: var(--ink); font-size: 0.75rem; font-weight: 780; text-decoration: none; cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
.back-button:hover,
.game-button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.game-button.primary { border-color: var(--gold); background: var(--gold); color: #132036; }
.game-button.primary:hover { background: #ffda7d; border-color: #ffda7d; }

.game-title-block { min-width: 0; text-align: center; }
.game-title-block h1 { margin: 0; overflow: hidden; font-size: clamp(1.08rem, 3vw, 1.45rem); font-weight: 830; letter-spacing: -0.025em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.game-title-block p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.59rem; font-weight: 760; letter-spacing: 0.09em; text-transform: uppercase; }
.game-top-actions { display: flex; flex: 0 0 auto; gap: 0.45rem; }

.game-dashboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.stat-card { min-width: 0; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 27, 45, 0.76); text-align: center; }
.stat-card span { display: block; overflow: hidden; color: var(--muted); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.stat-card strong { display: block; margin-top: 0.08rem; font-size: 1.2rem; font-weight: 840; line-height: 1; }

.game-panel { position: relative; display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: clamp(0.65rem, 2vw, 1.2rem); border-radius: 22px; }
.canvas-wrap { position: relative; display: grid; width: min(100%, 700px); min-width: 0; min-height: 0; aspect-ratio: 1; place-items: center; }
.game-canvas,
canvas.game-canvas { display: block; width: 100%; height: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: 18px; background: #081321; touch-action: none; }
.game-status { min-height: 1.5em; margin: 0.4rem 0 0; color: var(--muted); font-size: 0.78rem; font-weight: 720; text-align: center; }

.game-overlay { position: absolute; z-index: 10; inset: 0; display: grid; place-items: center; padding: 1rem; border-radius: inherit; background: rgba(4, 12, 23, 0.82); backdrop-filter: blur(8px); }
.game-overlay-card { width: min(100%, 390px); padding: 1.5rem; border: 1px solid var(--line-strong); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.game-overlay-card > span { display: block; font-size: 3.2rem; }
.game-overlay-card h2 { margin: 0.4rem 0; font-size: 1.65rem; font-weight: 840; letter-spacing: -0.03em; line-height: 1.05; }
.game-overlay-card p { margin: 0 0 1rem; color: var(--muted); font-size: 0.82rem; }
.game-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.touch-controls { display: none; width: 100%; margin-top: 0.7rem; user-select: none; }
.touch-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px); gap: 0.32rem; justify-content: center; }
.touch-button { display: grid; min-width: 48px; min-height: 48px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.055); color: var(--ink); font-size: 1.1rem; font-weight: 850; touch-action: manipulation; }
.touch-button:active { background: rgba(111, 148, 255, 0.18); transform: scale(0.95); }
.touch-up { grid-column: 2; grid-row: 1; }
.touch-left { grid-column: 1; grid-row: 2; }
.touch-down { grid-column: 2; grid-row: 2; }
.touch-right { grid-column: 3; grid-row: 2; }

[data-reveal] { animation: revealIn 520ms cubic-bezier(.2,.8,.2,1) both; }
[data-reveal].is-pending,
[data-reveal].is-visible { opacity: 1; transform: none; }

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

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .app-sidebar { align-items: center; padding-inline: 0.75rem; }
  .sidebar-brand-copy,
  .sidebar-link span,
  .sidebar-install-copy,
  .sidebar-install-button,
  .sidebar-status [data-connection-label] { display: none; }
  .sidebar-nav { width: 100%; }
  .sidebar-link { justify-content: center; padding-inline: 0; }
  .sidebar-install-card { width: 52px; padding: 0.4rem; place-items: center; }
  .sidebar-status { justify-content: center; }
  .quick-start-grid,
  .quick-start-grid:has(.continue-card:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hub-hero { grid-template-columns: minmax(0, 1fr) minmax(250px, 0.65fr); padding: 2.2rem; }
  .hub-hero h1 { font-size: clamp(2.7rem, 7vw, 4.4rem); }
  .hero-visual { min-height: 300px; }
  .browser-tools { grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.2fr); }
  .availability-toggle { grid-column: 1 / -1; justify-self: start; min-height: 38px; }
  .academy-bridge { grid-template-columns: 1fr; }
  .academy-proof { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .academy-proof > div { grid-template-columns: 1fr; gap: 0.25rem; }
  .difficulty-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.arcade-hub-page { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .app-sidebar { display: none; }
  .app-topbar { min-height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) calc(0.7rem + env(safe-area-inset-right)) 0 calc(0.7rem + env(safe-area-inset-left)); }
  .mobile-brand { display: inline-flex; gap: 0.55rem; }
  .mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .mobile-brand strong { font-size: 0.82rem; }
  .mobile-brand small { font-size: 0.54rem; }
  .topbar-title,
  .topbar-academy,
  .student-profile-copy,
  .topbar-install span { display: none; }
  .topbar-actions { gap: 0.4rem; }
  .topbar-install,
  .student-profile-trigger,
  .icon-button { width: 40px; min-height: 40px; padding: 0; }
  .student-profile-trigger { border-radius: 50%; }
  .student-profile-avatar { width: 34px; height: 34px; }

  .hub-main { padding: 0.75rem 0.7rem 1.5rem; }
  .hub-hero { grid-template-columns: 1fr; gap: 1.4rem; min-height: auto; padding: 1.5rem 1.15rem; border-radius: 22px; text-align: left; }
  .hub-hero::after { right: -75%; bottom: -18%; width: 460px; height: 460px; }
  .hub-hero h1 { margin-top: 0.8rem; font-size: clamp(2.35rem, 12vw, 3.35rem); letter-spacing: -0.058em; }
  .hero-copy > p { font-size: 0.87rem; line-height: 1.62; }
  .hero-game-finder { min-height: 54px; grid-template-columns: auto minmax(0, 1fr); padding: 0.35rem 0.75rem; }
  .hero-game-finder button { grid-column: 1 / -1; width: 100%; min-height: 42px; }
  .finder-suggestions { gap: 0.15rem; }
  .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; margin-top: 1.25rem; }
  .hero-actions .primary-button,
  .hero-actions .secondary-button { min-width: 0; padding-inline: 0.6rem; text-align: center; }
  .hero-metrics { margin-top: 1.25rem; }
  .hero-metrics > div { padding: 0.75rem 0.45rem; text-align: center; }
  .hero-metrics strong { font-size: 1.08rem; }
  .hero-metrics span { font-size: 0.53rem; }
  .hero-visual { display: none; }
  .hero-mascot { width: min(72vw, 250px); }
  .mascot-fallback { font-size: 6rem; }
  .mascot-label { bottom: -0.25rem; }
  .hero-orbit-chip { width: 38px; height: 38px; border-radius: 11px; font-size: 0.61rem; }
  .chip-one { left: 5%; }
  .chip-two { right: 6%; }

  .quick-start { padding-top: 2.8rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0.25rem; margin-bottom: 0.9rem; }
  .section-heading h2 { font-size: 1.75rem; }
  .section-heading > p { text-align: left; }
  .quick-start-grid,
  .quick-start-grid:has(.continue-card:not([hidden])) { grid-template-columns: 1fr; gap: 0.6rem; }
  .quick-card { min-height: 86px; padding: 0.78rem; }

  .game-browser { padding: 3rem 0; }
  .discovery-toolbar { align-items: flex-start; flex-direction: column; gap: 0.6rem; }
  .discovery-tabs { width: 100%; }
  .discovery-tabs button { flex: 1; }
  .library-controls { padding: 0.55rem; border-radius: 16px; }
  .difficulty-paths { display: flex; margin-inline: -0.2rem; overflow-x: auto; padding: 0 0.2rem 0.35rem; scroll-snap-type: x proximity; scrollbar-width: none; }
  .difficulty-paths::-webkit-scrollbar { display: none; }
  .difficulty-path { min-width: min(78vw, 260px); min-height: 92px; scroll-snap-align: start; }
  .browser-tools { top: calc(62px + env(safe-area-inset-top)); grid-template-columns: 1fr; margin-inline: -0.2rem; padding: 0.5rem; border-radius: 15px; }
  .search-box { min-height: 44px; }
  .search-box kbd { display: none; }
  .category-filters { margin-inline: -0.1rem; padding-bottom: 0.05rem; }
  .filter-chip { min-height: 40px; padding: 0.45rem 0.75rem; }
  .availability-toggle { grid-column: auto; min-height: 38px; justify-self: start; }

  .game-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1.1rem 0.9rem; }
  .game-card { min-height: 365px; padding: 0.85rem 0.9rem; }
  .cab-bezel { height: 126px; }
  .cab-title { font-size: 1.18rem; }
  .cab-dek { font-size: 0.7rem; }
  .cab-cta-label { display: none; }

  .academy-bridge { gap: 1.5rem; padding: 1.5rem 1.2rem; border-radius: 22px; }
  .academy-bridge h2 { font-size: 2rem; }
  .academy-bridge-actions { display: grid; }
  .academy-proof { grid-template-columns: 1fr; }
  .academy-proof > div { grid-template-columns: 72px 1fr; }

  .hub-footer { width: calc(100% - 1.4rem); align-items: flex-start; flex-direction: column; }
  .footer-links { justify-content: flex-start; }

  .mobile-tabbar {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 0.38rem max(0.35rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0.35rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(7, 17, 31, 0.94);
    box-shadow: 0 -12px 30px rgba(0, 7, 20, 0.26);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  .mobile-tabbar a,
  .mobile-tabbar button { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 0.2rem; padding: 0.2rem; border: 0; background: transparent; color: var(--muted); font-size: 0.53rem; font-weight: 750; text-decoration: none; cursor: pointer; }
  .mobile-tabbar .ui-icon { width: 19px; height: 19px; }
  .mobile-tabbar .is-active { color: var(--blue-soft); }
  .mobile-play-icon { display: grid; width: 34px; height: 34px; margin-top: -13px; place-items: center; border-radius: 12px; background: var(--gold); box-shadow: 0 6px 18px rgba(243, 199, 95, 0.22); color: #132036; font-size: 0.68rem; }

  .app-toast { right: 0.7rem; bottom: calc(74px + env(safe-area-inset-bottom)); left: 0.7rem; justify-content: space-between; }
  .student-profile-dialog { padding: 1.25rem; }
  .student-profile-dialog-avatar { width: 62px; height: 62px; }
  .student-profile-facts { grid-template-columns: 1fr; }

  .game-page { padding: calc(0.45rem + env(safe-area-inset-top)) calc(0.45rem + env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) calc(0.45rem + env(safe-area-inset-left)); }
  .game-shell { min-height: calc(100dvh - 0.9rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); gap: 0.5rem; }
  .game-topbar { padding: 0.45rem; border-radius: 14px; }
  .back-button span,
  .game-top-actions .button-text { display: none; }
  .back-button,
  .game-top-actions .game-button { width: 42px; min-height: 42px; padding: 0; }
  .game-title-block p { display: none; }
  .game-dashboard { gap: 0.35rem; }
  .stat-card { padding: 0.48rem 0.3rem; border-radius: 11px; }
  .stat-card strong { font-size: 1rem; }
  .game-panel { padding: 0.45rem; border-radius: 18px; }
  .touch-controls { display: block; }
}

@media (max-width: 370px) {
  .hub-hero { padding-inline: 0.9rem; }
  .hero-actions { grid-template-columns: 1fr; }
  .hero-metrics span { font-size: 0.48rem; }
  .game-card { padding: 0.85rem 0.9rem; min-height: 340px; }
  .cab-meta .duration-tag { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls { display: block; }
}

@media (display-mode: standalone) {
  .topbar-install,
  .sidebar-install-card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal].is-pending { opacity: 1; transform: none; }
}

/* Simplified discovery experience -------------------------------------------------
   The first screen has one job: help a student start a game. The complete
   catalogue and its filters remain available, but only after an explicit choice. */
.simplified-hub-page { background: #081321; }
.simplified-hub-page .app-shell { display: block; }
.simplified-hub-page .app-workspace { width: 100%; }
.simplified-hub-page .app-topbar { min-height: 68px; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.simplified-hub-page .mobile-brand { display: inline-flex; gap: 0.55rem; text-decoration: none; }
.simplified-hub-page .mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.simplified-hub-page .hub-main { width: min(100%, 1180px); padding-top: clamp(1rem, 3vw, 2rem); }

.simplified-hub-page .simple-hero {
  min-height: 350px;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 24px;
  background: linear-gradient(130deg, rgba(111, 148, 255, 0.09), transparent 48%), #0d1b2d;
  box-shadow: none;
}
.simplified-hub-page .simple-hero::after { display: none; }
.simplified-hub-page .simple-hero h1 { max-width: 640px; margin: 0.7rem 0 0.65rem; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.02; }
.simplified-hub-page .simple-hero .hero-copy > p { font-size: 1rem; line-height: 1.6; }
.simplified-hub-page .hero-game-finder { max-width: 610px; margin-top: 1.35rem; }
.simplified-hub-page .finder-suggestions,
.simplified-hub-page .hero-actions { display: none; }

.hero-start-actions { display: flex; max-width: 610px; align-items: stretch; gap: 0.65rem; margin-top: 0.7rem; }
.continue-game-button,
.simple-random-button { min-height: 58px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.continue-game-button { display: grid; min-width: 0; flex: 1 1 auto; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; padding: 0.55rem 0.75rem; background: rgba(111, 148, 255, 0.08); }
.continue-game-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: rgba(111, 148, 255, 0.15); color: var(--blue-soft); }
.continue-game-button small,
.continue-game-button strong,
.continue-game-button em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-game-button small { color: var(--blue-soft); font-size: 0.58rem; font-weight: 750; text-transform: uppercase; }
.continue-game-button strong { font-size: 0.82rem; }
.continue-game-button em { color: var(--muted); font-size: 0.64rem; font-style: normal; }
.continue-game-button > .ui-icon { width: 18px; }
.simple-random-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.65rem 1rem; background: transparent; color: var(--ink); font-size: 0.76rem; font-weight: 750; cursor: pointer; }
.simple-random-button > span { color: var(--gold); }
.continue-game-button:hover,
.simple-random-button:hover { border-color: var(--line-strong); background-color: rgba(255, 255, 255, 0.045); }
.simplified-hub-page .hero-library-note { margin-top: 0.8rem; font-size: 0.7rem; }
.simplified-hub-page .hero-visual { min-height: 230px; }
.simplified-hub-page .hero-mascot { width: min(100%, 200px); }
.simplified-hub-page .hero-orbit-chip { display: none; }
.simplified-hub-page .mascot-label { bottom: 0; }

.simplified-hub-page .game-browser { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.simplified-hub-page .browser-heading { margin-bottom: 1rem; }
.simplified-hub-page .browser-heading h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); }
.quiet-result-count { color: var(--muted); font-size: 0.7rem; }
.simplified-hub-page .library-controls { margin-bottom: 1rem; padding: 0; border: 0; border-radius: 0; background: transparent; }
.library-control-topline { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 0.65rem; }
.library-control-topline .search-box { min-height: 48px; }
.back-to-picks { padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 13px; background: transparent; color: var(--muted); font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.back-to-picks:hover { border-color: var(--line-strong); color: var(--ink); }
.simple-filter-row { margin-top: 0.65rem; }
.simplified-hub-page .difficulty-paths,
.simplified-hub-page .category-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.simplified-hub-page .difficulty-paths { margin-bottom: 0.45rem; }
.simplified-hub-page .difficulty-path,
.simplified-hub-page .filter-chip { width: auto; min-width: 0; min-height: 34px; flex: 0 0 auto; padding: 0.4rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 0.67rem; font-style: normal; font-weight: 700; }
.simplified-hub-page .difficulty-path::before { display: none; }
.simplified-hub-page .difficulty-path:hover,
.simplified-hub-page .filter-chip:hover { border-color: var(--line-strong); color: var(--ink); transform: none; }
.simplified-hub-page .difficulty-path.is-active,
.simplified-hub-page .filter-chip.active { border-color: rgba(111, 148, 255, 0.45); background: rgba(111, 148, 255, 0.12); color: #dce5ff; }

.simplified-hub-page .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.55rem 1rem; }
.simplified-hub-page .game-card-link,
.simplified-hub-page .game-card-button { display: block; height: 100%; border-radius: 8px; transition: none; }
.simplified-hub-page .game-card-link:hover,
.simplified-hub-page .game-card-button:hover { transform: none; }
.simplified-hub-page .game-card-link:focus-visible,
.simplified-hub-page .game-card-button:focus-visible { outline: 0; }
.simplified-hub-page .game-card-button:disabled { cursor: not-allowed; opacity: 1; }
.simplified-hub-page .game-card.is-completed .game-cover { outline-color: rgba(133, 177, 142, 0.34); }
.simplified-hub-page .game-card.is-completed .cab-scene img { filter: saturate(0.45) brightness(0.62); }
.simplified-hub-page .game-card.is-completed .status-pill { background: #d7e4d8; color: #17251b; }
.simplified-hub-page .game-card.is-completed .cab-title,
.simplified-hub-page .game-card.is-completed .skill-tag { color: #858e87; }
.simplified-hub-page .game-card { display: flex; min-height: 0; height: 100%; flex-direction: column; overflow: visible; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); font-family: var(--font-body); }
.simplified-hub-page .game-card::before,
.simplified-hub-page .game-card::after { display: none; }
.simplified-hub-page .game-card-link:hover .game-card,
.simplified-hub-page .game-card-button:hover .game-card { border: 0; background: transparent; box-shadow: none; }
.game-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 8px; background: #101f33; outline: 1px solid rgba(255, 255, 255, 0.08); outline-offset: -1px; }
.game-cover .cab-scene { position: absolute; inset: 0; display: block; filter: none; }
.game-cover .cab-scene img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; transition: transform 180ms ease, filter 180ms ease; }
.simplified-hub-page .game-card-link:hover .cab-scene img,
.simplified-hub-page .game-card-button:hover .cab-scene img { transform: scale(1.012); filter: none; }
.simplified-hub-page .game-card-link:hover .game-cover,
.simplified-hub-page .game-card-button:hover .game-cover { outline-color: rgba(255, 255, 255, 0.2); }
.simplified-hub-page .game-card-link:focus-visible .game-cover,
.simplified-hub-page .game-card-button:focus-visible .game-cover { outline: 2px solid #d28a6d; outline-offset: 3px; }
.game-cover .status-pill { position: absolute; top: 0.55rem; left: 0.55rem; padding: 0.24rem 0.42rem; border: 0; border-radius: 3px; background: rgba(17, 20, 17, 0.88); color: #f4f3ed; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.07em; line-height: 1; text-transform: uppercase; backdrop-filter: none; }
.game-card-copy { min-width: 0; padding: 0.68rem 0 0; }
.game-card-meta { display: flex; min-width: 0; align-items: center; justify-content: flex-start; gap: 0; margin-top: 0.34rem; color: var(--muted); font-size: 0.58rem; font-weight: 650; line-height: 1.3; }
.game-card-meta .category-label { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.game-card-meta .duration-tag::before { margin: 0 0.38rem; content: "\00b7"; }
.simplified-hub-page .cab-title { overflow: hidden; margin: 0; padding: 0; color: var(--ink); font-family: var(--font-body); font-size: 0.92rem; font-weight: 720; letter-spacing: -0.015em; line-height: 1.3; text-overflow: ellipsis; text-shadow: none; text-transform: none; white-space: nowrap; }
.simplified-hub-page .game-card-copy > .skill-tag { overflow: hidden; margin: 0.3rem 0 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-family: var(--font-body); font-size: 0.59rem; font-weight: 500; letter-spacing: 0; line-height: 1.3; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.simplified-hub-page .library-more-wrap { margin-top: 1rem; }
.simplified-hub-page .library-more-wrap .secondary-button { min-height: 44px; padding-inline: 1rem; }
.simplified-hub-page .simple-academy-bridge { display: flex; min-height: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-radius: 18px; }
.simplified-hub-page .simple-academy-bridge::before { width: 2px; }
.simplified-hub-page .simple-academy-bridge h2 { margin: 0.25rem 0; font-size: 1.25rem; letter-spacing: -0.025em; }
.simplified-hub-page .simple-academy-bridge-copy > p { font-size: 0.75rem; }
.simplified-hub-page .simple-academy-bridge .primary-button { flex: 0 0 auto; }

@media (max-width: 1180px) {
  .simplified-hub-page .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .simplified-hub-page .app-topbar { min-height: 62px; padding-inline: 0.75rem; }
  .simplified-hub-page .topbar-academy,
  .simplified-hub-page .student-profile-copy { display: none; }
  .simplified-hub-page .student-profile-trigger { width: 42px; padding: 0.2rem; }
  .simplified-hub-page .hub-main { padding: 0.7rem 0.75rem calc(6rem + env(safe-area-inset-bottom)); }
  .simplified-hub-page .simple-hero { display: block; padding: 1.35rem 1rem; border-radius: 18px; text-align: left; }
  .simplified-hub-page .simple-hero h1 { max-width: 100%; margin-top: 0.55rem; font-size: clamp(2rem, 9vw, 2.5rem); letter-spacing: -0.05em; }
  .simplified-hub-page .simple-hero .hero-copy > p { font-size: 0.86rem; }
  .simplified-hub-page .hero-game-finder { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 50px; padding: 0.3rem 0.35rem 0.3rem 0.65rem; }
  .simplified-hub-page .hero-game-finder button { grid-column: auto; width: auto; min-height: 40px; padding-inline: 0.75rem; }
  .simplified-hub-page .hero-visual { display: none; }
  .hero-start-actions { display: grid; grid-template-columns: 1fr; }
  .simple-random-button { min-height: 48px; }
  .simplified-hub-page .hero-library-note { margin-top: 0.65rem; }
  .simplified-hub-page .game-browser { padding: 2.3rem 0; }
  .library-control-topline { grid-template-columns: 1fr; }
  .back-to-picks { min-height: 40px; }
  .simplified-hub-page .difficulty-paths,
  .simplified-hub-page .category-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: none; }
  .simplified-hub-page .difficulty-paths::-webkit-scrollbar,
  .simplified-hub-page .category-filters::-webkit-scrollbar { display: none; }
  .simplified-hub-page .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 0.7rem; }
  .simplified-hub-page .game-card { display: flex; border-radius: 0; }
  .simplified-hub-page .game-cover { height: auto; min-height: 0; aspect-ratio: 16 / 10; }
  .simplified-hub-page .game-card-copy { padding: 0.58rem 0 0; }
  .simplified-hub-page .cab-title { font-size: 0.84rem; }
  .game-card-meta { margin-top: 0.27rem; font-size: 0.54rem; }
  .simplified-hub-page .game-card-copy > .skill-tag { margin-top: 0.25rem; font-size: 0.55rem; }
  .simplified-hub-page .simple-academy-bridge { align-items: flex-start; flex-direction: column; }
  .simplified-hub-page .simple-academy-bridge .primary-button { width: 100%; }
  .simplified-hub-page .mobile-tabbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Flat dark theme ---------------------------------------------------------------
   Solid, quiet surfaces replace neon gradients, glows and ornamental lines. */
.flat-dark-theme,
.flat-dark-theme body { background: #111411; }
.flat-dark-theme * { box-shadow: none !important; text-shadow: none !important; }
.flat-dark-theme .app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.student-profile-rail { position: sticky; top: 0; display: flex; height: 100dvh; align-self: start; flex-direction: column; padding: 1.2rem; background: #151815; }
.rail-brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; }
.rail-brand .brand-mark { width: 42px; height: 42px; }
.rail-brand strong,
.rail-brand small { display: block; }
.rail-brand strong { font-size: 0.9rem; }
.rail-brand small { color: #d28a6d; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.student-rail-profile { display: grid; width: 100%; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; margin-top: 3rem; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.student-rail-avatar { display: grid; width: 54px; height: 54px; overflow: hidden; place-items: center; border-radius: 16px; background: #292d29; color: #d9a188; font-size: 0.75rem; font-weight: 800; }
.student-rail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-rail-copy { min-width: 0; }
.student-rail-copy small,
.student-rail-copy strong,
.student-rail-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-rail-copy small { color: var(--muted); font-size: 0.56rem; }
.student-rail-copy strong { margin-top: 0.1rem; font-size: 0.8rem; }
.student-rail-copy em { margin-top: 0.12rem; color: #b5c2b5; font-size: 0.62rem; font-style: normal; }
.student-rail-profile > .ui-icon { width: 16px; color: var(--muted); }
.rail-dashboard-link { display: inline-flex; align-items: center; gap: 0.55rem; margin-top: auto; padding: 0.75rem; border-radius: 12px; background: #1d211d; color: #c7cbc5; font-size: 0.66rem; font-weight: 700; text-decoration: none; }
.rail-dashboard-link:hover { background: #292e29; color: var(--ink); }
.rail-dashboard-link .ui-icon { width: 17px; }
.flat-dark-theme .mobile-brand { display: none; }
.flat-dark-theme .app-topbar { justify-content: flex-end; }
.flat-dark-theme .student-profile-trigger { display: none; }
.flat-dark-theme .app-topbar { border: 0; background: #111411; backdrop-filter: none; -webkit-backdrop-filter: none; }
.flat-dark-theme .brand-mark,
.flat-dark-theme .student-profile-avatar,
.flat-dark-theme .student-profile-dialog-avatar { border: 0; background: #292d29; color: #d9a188; }
.flat-dark-theme .topbar-academy,
.flat-dark-theme .topbar-leaderboard,
.flat-dark-theme .student-profile-trigger,
.flat-dark-theme .icon-button { border: 0; background: #1c201c; }
.flat-dark-theme .topbar-academy:hover,
.flat-dark-theme .topbar-leaderboard:hover,
.flat-dark-theme .student-profile-trigger:hover,
.flat-dark-theme .icon-button:hover { background: #282d28; }

.flat-dark-theme .simple-hero { min-height: 390px; grid-template-columns: minmax(0, 1fr) 310px; border: 0; background: #1a1e1a; }
.flat-dark-theme .eyebrow,
.flat-dark-theme .section-kicker { color: #aeb5ac; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.035em; text-transform: none; }
.flat-dark-theme .simple-hero h1 span { color: #d28a6d; }
.flat-dark-theme .hero-game-finder { border: 0; background: #101310; }
.flat-dark-theme .hero-game-finder:focus-within { border: 0; outline: 2px solid #829785; outline-offset: 2px; }
.flat-dark-theme .hero-game-finder .ui-icon { color: #9fa79d; }
.flat-dark-theme .hero-game-finder button { border: 0; background: #c77a5c; color: #1b120f; }
.flat-dark-theme .continue-game-button,
.flat-dark-theme .simple-random-button { border: 0; background: #232823; }
.flat-dark-theme .continue-game-button:hover,
.flat-dark-theme .simple-random-button:hover { background: #2c322c; }
.flat-dark-theme .continue-game-icon { background: #303730; color: #d5ddd3; }
.flat-dark-theme .simple-random-button > span { color: #d28a6d; }
.flat-dark-theme .hero-visual { min-height: 310px; }
.flat-dark-theme .hero-mascot { width: min(100%, 300px); border: 0; background: transparent; }
.flat-dark-theme .hero-mascot-player { width: 125%; height: 125%; }
.flat-dark-theme .mascot-label { border: 0; background: #232823; backdrop-filter: none; }
.flat-dark-theme .mascot-status { background: #829785; }

.flat-dark-theme .library-controls,
.flat-dark-theme .search-box { border: 0; background: #1a1e1a; }
.flat-dark-theme .back-to-picks,
.flat-dark-theme .difficulty-path,
.flat-dark-theme .filter-chip { border: 0; background: #1d211d; }
.category-back-button { display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 0.7rem; padding: 0.65rem 0.8rem; border: 0; border-radius: 12px; background: #232823; color: #e5e8e2; font-size: 0.7rem; font-weight: 750; cursor: pointer; }
.category-back-button:hover { background: #2c322c; }
.category-back-button .ui-icon { width: 16px; }
.category-back-button-bottom { margin: 1.15rem 0 0; }
.flat-dark-theme .back-to-picks:hover,
.flat-dark-theme .difficulty-path:hover,
.flat-dark-theme .filter-chip:hover { background: #292e29; }
.flat-dark-theme .difficulty-path.is-active,
.flat-dark-theme .filter-chip.active { border: 0; background: #364036; color: #edf1eb; }

.flat-dark-theme .game-card { border: 0; background: transparent; }
.flat-dark-theme .game-card-link:hover .game-card,
.flat-dark-theme .game-card-button:hover .game-card { border: 0; background: transparent; }
.flat-dark-theme .game-cover { background: #293329; }
.flat-dark-theme .game-card[data-category="educational"] .game-cover { background: #293329; }
.flat-dark-theme .game-card[data-category="action"] .game-cover { background: #3a2923; }
.flat-dark-theme .game-card[data-category="puzzle"] .game-cover { background: #302b32; }
.flat-dark-theme .game-card[data-category="casual"] .game-cover { background: #283235; }
.flat-dark-theme .game-cover .cab-scene { display: grid; place-items: center; color: inherit; filter: none; font-size: clamp(3rem, 6vw, 4.5rem); }
.flat-dark-theme .game-cover .cab-scene img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) brightness(0.9) contrast(0.98); transform: none; }
.flat-dark-theme .game-card-link:hover .cab-scene img,
.flat-dark-theme .game-card-button:hover .cab-scene img { filter: saturate(0.95) brightness(0.94) contrast(1); transform: scale(1.012); }
.flat-dark-theme .game-cover .cab-scene.is-fallback { font-size: clamp(3rem, 6vw, 4.5rem); }
.flat-dark-theme .game-cover .status-pill { border: 0; background: rgba(17, 20, 17, 0.88); color: #f0f0ea; backdrop-filter: none; }
.flat-dark-theme .game-card-meta .category-label { color: #9ea59e; }
.game-category-gateways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 4.5rem; }
.game-category-gateways[hidden] { display: none; }
.game-category-gateway { display: grid; min-width: 0; min-height: 290px; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; padding: 0; border: 0; border-radius: 22px; color: var(--ink); text-align: left; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.game-category-gateway.gateway-fun { background: #332720; }
.game-category-gateway.gateway-educational { background: #253027; }
.game-category-gateway:hover { transform: translateY(-2px); }
.game-category-gateway.gateway-fun:hover { background: #3c2d25; }
.game-category-gateway.gateway-educational:hover { background: #2c392e; }
.gateway-copy { display: flex; min-width: 0; justify-content: center; flex-direction: column; padding: clamp(1.5rem, 4vw, 2.4rem); }
.gateway-copy small { color: #b8bcb5; font-size: 0.64rem; font-weight: 700; }
.gateway-copy strong { display: block; margin-top: 0.35rem; font-size: clamp(2.4rem, 4vw, 3.6rem); letter-spacing: -0.055em; line-height: 1; }
.gateway-copy em { display: block; max-width: 260px; margin-top: 0.65rem; color: #a7aba4; font-size: 0.72rem; font-style: normal; line-height: 1.5; }
.gateway-copy > span { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1.15rem; color: #f0f0ea; font-size: 0.68rem; font-weight: 750; }
.gateway-copy .ui-icon { width: 15px; color: #d38a6e; }
.gateway-symbol { display: grid; width: clamp(150px, 14vw, 220px); place-items: center; color: rgba(240, 240, 234, 0.12); font-size: clamp(2.7rem, 5vw, 4.8rem); font-weight: 800; letter-spacing: -0.07em; writing-mode: vertical-rl; transform: rotate(180deg); }
.flat-dark-theme .secondary-button { border: 0; background: #232823; }
.flat-dark-theme .secondary-button:hover { border: 0; background: #2c322c; }
.flat-dark-theme .primary-button { border: 0; background: #c77a5c; color: #1b120f; }
.flat-dark-theme .primary-button:hover { border: 0; background: #d48b6f; }

.flat-dark-theme .academy-bridge { border: 0; background: #1a1e1a; }
.flat-dark-theme .academy-bridge::before { display: none; }
.flat-dark-theme .hub-footer { border: 0; }
.flat-dark-theme .empty-state { border: 0; background: #1a1e1a; }
.flat-dark-theme .empty-state .empty-icon { border: 0; background: #232823; }

@media (max-width: 1050px) {
  .flat-dark-theme .app-shell { display: block; }
  .student-profile-rail { display: none; }
  .flat-dark-theme .mobile-brand { display: inline-flex; }
  .flat-dark-theme .app-topbar { justify-content: space-between; }
  .flat-dark-theme .student-profile-trigger { display: inline-flex; }
}

@media (max-width: 700px) {
  .flat-dark-theme .simple-hero { min-height: 0; }
  .flat-dark-theme .mobile-tabbar { border: 0; background: #151815; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .flat-dark-theme .mobile-play-icon { background: #c77a5c; color: #1b120f; }
  .game-category-gateways { grid-template-columns: 1fr; gap: 0.8rem; margin-top: 3.25rem; }
  .game-category-gateway { min-height: 220px; grid-template-columns: minmax(0, 1fr) 100px; border-radius: 18px; }
  .gateway-copy { padding: 1.3rem; }
  .gateway-copy strong { font-size: 2.25rem; }
  .gateway-copy em { font-size: 0.66rem; }
  .gateway-copy > span { margin-top: 0.8rem; }
  .gateway-symbol { width: 100px; font-size: 2.5rem; }
}

@media (max-width: 420px) {
  .game-category-gateway { grid-template-columns: minmax(0, 1fr) 82px; }
  .gateway-symbol { width: 82px; font-size: 2rem; }
}

/* Arcade Arena leaderboard ---------------------------------------------------- */
.arena-leaderboard {
  position: relative;
  overflow: hidden;
  margin-top: clamp(3rem, 7vw, 6rem);
  border-radius: 22px;
  background: #161a16;
  color: var(--ink);
  isolation: isolate;
  scroll-margin-top: 88px;
}

.leaderboard-celebration {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: clamp(280px, 46vw, 560px);
  overflow: hidden;
  pointer-events: none;
}

.leaderboard-celebration-player { display: block; width: 100%; height: 100%; opacity: 0.62; }

.leaderboard-banner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding: clamp(1.35rem, 3vw, 2.2rem);
  background: #1d211d;
}

.leaderboard-crown {
  position: relative;
  z-index: 3;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 18px;
  background: #2b2820;
  color: #d2a45c;
}

.leaderboard-winner-badge { display: block; width: 62px; height: 62px; }
.leaderboard-kicker { display: block; color: #aeb5ac; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.035em; }
.leaderboard-banner h2 { margin: 0.3rem 0 0; font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.055em; line-height: 1; }
.leaderboard-banner h2 em { color: #d28a6d; font-style: normal; }
.leaderboard-banner p { max-width: 620px; margin: 0.55rem 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.leaderboard-mark-note { min-width: 185px; padding: 0.9rem 1rem; border-left: 3px solid #d2a45c; border-radius: 0 12px 12px 0; background: #232823; }
.leaderboard-mark-note span,
.leaderboard-mark-note strong,
.leaderboard-mark-note small { display: block; }
.leaderboard-mark-note span { color: #aeb5ac; font-size: 0.6rem; font-weight: 700; }
.leaderboard-mark-note strong { margin-top: 0.18rem; color: #d2a45c; font-size: 1.15rem; }
.leaderboard-mark-note small { margin-top: 0.25rem; color: var(--muted); font-size: 0.56rem; }

.leaderboard-body { position: relative; z-index: 1; padding: clamp(1rem, 3vw, 2rem); }
.leaderboard-you { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; margin-bottom: 1.4rem; padding: 0.85rem 1rem; border-left: 3px solid #829785; border-radius: 0 12px 12px 0; background: #232a26; }
.leaderboard-you span { color: #b5c2b5; font-size: 0.66rem; font-weight: 700; }
.leaderboard-you strong { font-size: 1rem; }
.leaderboard-you em { color: #d2a45c; font-size: 0.9rem; font-style: normal; font-weight: 800; }
.leaderboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.leaderboard-section-heading span { color: #9aa19a; font-size: 0.64rem; font-weight: 700; }
.leaderboard-section-heading h3 { margin: 0.16rem 0 0; font-size: 1.35rem; letter-spacing: -0.035em; }
.leaderboard-section-heading p { margin: 0; color: var(--muted); font-size: 0.65rem; }
.leaderboard-section-heading p strong { color: var(--ink); }

/* Podium — 2nd | 1st (elevated) | 3rd */
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; align-items: end; }
.leaderboard-champion {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 0.55rem;
  overflow: hidden;
  padding: 1.6rem 1rem 1.2rem;
  border-radius: 18px;
  background: #1d211d;
  text-align: center;
}
.leaderboard-champion.rank-1 { order: 2; padding-top: 2.3rem; padding-bottom: 1.7rem; background: #2b2820; }
.leaderboard-champion.rank-2 { order: 1; background: #232723; }
.leaderboard-champion.rank-3 { order: 3; background: #2a221c; }
.leaderboard-champion.is-current-student { outline: 2px solid #829785; outline-offset: -2px; }

/* Ghost rank numeral, echoing the category gateway symbols */
.leaderboard-champion::before {
  position: absolute;
  top: -1.4rem;
  right: -0.3rem;
  color: rgba(240, 240, 234, 0.07);
  font-size: 7.5rem;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 1;
  pointer-events: none;
}
.leaderboard-champion.rank-1::before { content: "1"; color: rgba(210, 164, 92, 0.13); }
.leaderboard-champion.rank-2::before { content: "2"; }
.leaderboard-champion.rank-3::before { content: "3"; color: rgba(199, 122, 92, 0.11); }

/* Medal chip */
.leaderboard-champion-rank {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.26rem 0.5rem;
  border-radius: 99px;
  background: #353a35;
  color: #e5e8e2;
  font-size: 0.6rem;
  font-weight: 800;
}
.leaderboard-champion.rank-1 .leaderboard-champion-rank { background: #d2a45c; color: #1b150c; }
.leaderboard-champion.rank-2 .leaderboard-champion-rank { background: #b9bfc2; color: #14171a; }
.leaderboard-champion.rank-3 .leaderboard-champion-rank { background: #c77a5c; color: #1b120f; }

.leaderboard-champion-avatar { position: relative; z-index: 1; display: grid; width: 64px; height: 64px; overflow: hidden; place-items: center; border-radius: 18px; background: #303730; color: #d9a188; font-size: 0.75rem; font-weight: 800; }
.leaderboard-champion.rank-1 .leaderboard-champion-avatar { width: 76px; height: 76px; }
.leaderboard-champion-avatar img,
.leaderboard-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.leaderboard-avatar-fallback { grid-area: 1 / 1; }
.leaderboard-champion-avatar img { grid-area: 1 / 1; }
.leaderboard-champion-copy { position: relative; z-index: 1; min-width: 0; max-width: 100%; }
.leaderboard-champion-copy strong,
.leaderboard-champion-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-champion-copy strong { font-size: 0.86rem; }
.leaderboard-champion-copy span { margin-top: 0.22rem; color: var(--muted); font-size: 0.6rem; }
.leaderboard-champion-mark { position: relative; z-index: 1; width: min(100%, 150px); margin-top: 0.3rem; }
.leaderboard-champion-mark strong,
.leaderboard-champion-mark span { display: block; }
.leaderboard-champion-mark strong { color: #d2a45c; font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1; }
.leaderboard-champion.rank-1 .leaderboard-champion-mark strong { font-size: 1.9rem; }
.leaderboard-champion-mark span { margin-top: 0.3rem; color: var(--muted); font-size: 0.56rem; }

/* Stat meter (arena mark as a power bar) */
.leaderboard-mark-meter {
  display: block;
  height: 4px;
  margin-top: 0.45rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(240, 240, 234, 0.08);
}
.leaderboard-mark-meter::after {
  display: block;
  width: var(--mark, 0%);
  height: 100%;
  border-radius: inherit;
  background: #c77a5c;
  content: "";
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.leaderboard-champion.rank-1 .leaderboard-mark-meter::after { background: #d2a45c; }

.leaderboard-list-panel { margin-top: 1.7rem; }
.leaderboard-list-title { margin-top: 1.3rem; }
.leaderboard-columns,
.leaderboard-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 120px 100px; align-items: center; gap: 0.75rem; }
.leaderboard-columns { padding: 0.55rem 0.9rem; color: #9aa19a; font-size: 0.58rem; font-weight: 700; }
.leaderboard-columns span:last-child { text-align: right; }
.leaderboard-list { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.leaderboard-row { min-height: 66px; padding: 0.55rem 0.9rem; border-radius: 14px; background: #1d211d; transition: background 160ms ease; }
.leaderboard-row:hover { background: #242924; }
.leaderboard-row.is-current-student { border-left: 3px solid #829785; background: #232a26; }
.leaderboard-row-rank { color: #a7aba4; font-size: 0.78rem; font-weight: 800; }
.leaderboard-row:nth-child(-n+7) .leaderboard-row-rank { color: #d28a6d; }
.leaderboard-row-student { display: flex; min-width: 0; align-items: center; gap: 0.7rem; }
.leaderboard-row-avatar { display: grid; width: 44px; height: 44px; overflow: hidden; flex: 0 0 auto; place-items: center; border-radius: 13px; background: #292d29; color: #d9a188; font-size: 0.6rem; font-weight: 800; }
.leaderboard-row-avatar img { grid-area: 1 / 1; }
.leaderboard-row-copy { min-width: 0; }
.leaderboard-row-copy strong,
.leaderboard-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-row-copy strong { font-size: 0.76rem; }
.leaderboard-row-copy small { margin-top: 0.15rem; color: var(--muted); font-size: 0.58rem; }
.leaderboard-row-grade { color: #b5bcb5; font-size: 0.66rem; }
.leaderboard-row-mark { text-align: right; }
.leaderboard-row-mark strong { color: #d2a45c; font-size: 0.88rem; }
.leaderboard-row-mark .leaderboard-mark-meter { width: 64px; margin-left: auto; margin-top: 0.35rem; }
.leaderboard-status { margin: 1rem 0 0; color: var(--muted); font-size: 0.64rem; text-align: center; }
.leaderboard-load-more,
.leaderboard-retry { display: block; min-height: 44px; margin: 0.9rem auto 0; padding: 0.7rem 1.15rem; border: 0; border-radius: 12px; background: #232823; color: #e5e8e2; font: inherit; font-size: 0.68rem; font-weight: 750; cursor: pointer; transition: background 160ms ease; }
.leaderboard-load-more:hover,
.leaderboard-retry:hover { background: #2c322c; }
.leaderboard-load-more:disabled { opacity: 0.55; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
  .leaderboard-mark-meter::after { transition: none; }
}

@media (max-width: 900px) {
  .leaderboard-banner { grid-template-columns: auto minmax(0, 1fr); }
  .leaderboard-mark-note { grid-column: 1 / -1; border-radius: 0 12px 12px 0; }
  .leaderboard-podium { grid-template-columns: 1fr; align-items: stretch; }
  .leaderboard-champion,
  .leaderboard-champion.rank-1 {
    order: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
    padding: 0.9rem 3rem 0.9rem 1rem;
    text-align: left;
  }
  .leaderboard-champion.rank-1 .leaderboard-champion-avatar { width: 64px; height: 64px; }
  .leaderboard-champion::before { top: auto; bottom: -2.1rem; right: -0.2rem; font-size: 6rem; }
  .leaderboard-champion-rank { top: 50%; right: 0.8rem; left: auto; transform: translateY(-50%); }
  .leaderboard-champion-copy { text-align: left; }
  .leaderboard-champion-mark { width: auto; min-width: 90px; margin-top: 0; justify-self: end; text-align: right; }
  .leaderboard-champion.rank-1 .leaderboard-champion-mark strong { font-size: 1.55rem; }
  .leaderboard-champion-mark .leaderboard-mark-meter { width: 72px; margin-left: auto; }
}

@media (max-width: 700px) {
  .simplified-hub-page .mobile-tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .topbar-leaderboard span { display: none; }
  .topbar-leaderboard { width: 42px; padding: 0; }
  .topbar-leaderboard .ui-icon { width: 19px; }
  .arena-leaderboard { margin-top: 3.5rem; border-radius: 17px; }
  .leaderboard-banner { grid-template-columns: 46px minmax(0, 1fr); gap: 0.8rem; padding: 1.1rem; }
  .leaderboard-crown { width: 46px; height: 46px; border-radius: 12px; }
  .leaderboard-winner-badge { width: 44px; height: 44px; }
  .leaderboard-banner h2 { font-size: 1.8rem; }
  .leaderboard-banner p { font-size: 0.68rem; }
  .leaderboard-mark-note { min-width: 0; padding: 0.7rem 0.8rem; }
  .leaderboard-body { padding: 0.75rem; }
  .leaderboard-you { grid-template-columns: 1fr auto; gap: 0.35rem 0.8rem; }
  .leaderboard-you em { grid-column: 2; }
  .leaderboard-section-heading { align-items: start; }
  .leaderboard-champion,
  .leaderboard-champion.rank-1 { padding: 0.8rem 2.6rem 0.8rem 0.8rem; }
  .leaderboard-champion-avatar,
  .leaderboard-champion.rank-1 .leaderboard-champion-avatar { width: 50px; height: 50px; border-radius: 14px; }
  .leaderboard-champion-mark strong,
  .leaderboard-champion.rank-1 .leaderboard-champion-mark strong { font-size: 1.1rem; }
  .leaderboard-champion-mark { min-width: 72px; }
  .leaderboard-champion-mark .leaderboard-mark-meter { width: 56px; }
  .leaderboard-columns,
  .leaderboard-row { grid-template-columns: 36px minmax(0, 1fr) 72px; gap: 0.45rem; }
  .leaderboard-columns { padding-inline: 0.65rem; }
  .leaderboard-columns span:nth-child(3) { display: none; }
  .leaderboard-columns span:last-child { grid-column: 3; }
  .leaderboard-row { min-height: 60px; padding: 0.5rem 0.65rem; }
  .leaderboard-row-avatar { width: 40px; height: 40px; }
  .leaderboard-row-grade { display: none; }
  .leaderboard-row-mark strong { font-size: 0.78rem; }
  .leaderboard-row-mark .leaderboard-mark-meter { width: 52px; }
}

@media (max-width: 390px) {
  .leaderboard-champion,
  .leaderboard-champion.rank-1 { grid-template-columns: 50px minmax(0, 1fr); }
  .leaderboard-champion-mark { grid-column: 1 / -1; justify-self: start; margin-top: 0.3rem; text-align: left; }
  .leaderboard-champion-mark .leaderboard-mark-meter { margin-left: 0; }
}
