:root {
  color-scheme: dark;
  --ink: #f7f9fc;
  --muted: #91a0b5;
  --night: #07111f;
  --navy: #0a1627;
  --surface: #0d1b2d;
  --surface-raised: #112238;
  --panel: rgba(17, 34, 56, 0.76);
  --panel-solid: #0d1b2d;
  --line: rgba(177, 199, 230, 0.14);
  --line-strong: rgba(177, 199, 230, 0.28);
  --blue: #6f94ff;
  --blue-soft: #a9bdff;
  --gold: #f3c75f;
  --mint: #5dd7b3;
  --violet: #a98af7;
  --danger: #ff7a8a;
  --shadow: 0 24px 70px rgba(0, 7, 20, 0.42);
  --shadow-soft: 0 12px 32px rgba(0, 7, 20, 0.25);
  --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:
    radial-gradient(circle at 82% -10%, rgba(111, 148, 255, 0.14), transparent 30rem),
    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: #29415d; }

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

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-academy,
.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-academy: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; }

.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: 520px;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.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(3rem, 6vw, 5.4rem);
  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; }

.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(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.quick-start-grid:has(.continue-card:not([hidden])) { grid-template-columns: repeat(4, 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); }

.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) auto;
  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 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 0.9rem;
}

.game-card-link,
.game-card-button {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.game-card {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 330px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 7, 20, 0.14);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-card-link:hover .game-card,
.game-card-button:hover .game-card { border-color: color-mix(in srgb, var(--card-accent, var(--blue)) 45%, var(--line)); box-shadow: 0 18px 40px rgba(0, 7, 20, 0.28); transform: translateY(-4px); }

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

.game-art {
  position: relative;
  display: grid;
  min-height: 132px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--card-accent, var(--blue)) 24%, transparent), transparent 56%),
    #0a1728;
}

.game-art::after {
  position: absolute;
  inset: auto -10% -75% auto;
  width: 150px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--blue)) 18%, transparent);
  border-radius: 50%;
  content: "";
}

.game-number,
.status-pill {
  position: absolute;
  z-index: 2;
  top: 0.7rem;
  font-size: 0.57rem;
  font-weight: 820;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game-number { left: 0.75rem; color: #6d7e93; }
.status-pill { right: 0.7rem; padding: 0.23rem 0.48rem; border: 1px solid var(--line); border-radius: 99px; background: rgba(7, 17, 31, 0.62); color: var(--muted); }
.game-card.is-playable .status-pill { border-color: color-mix(in srgb, var(--card-accent, var(--mint)) 45%, var(--line)); color: #d8fff3; }

.game-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--blue)) 34%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-accent, var(--blue)) 12%, #0d1b2d);
  box-shadow: 0 12px 30px rgba(0, 7, 20, 0.25);
  font-size: 2rem;
}

.game-card-body { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 1rem; }
.category-label { color: color-mix(in srgb, var(--card-accent, var(--blue)) 70%, white); font-size: 0.58rem; font-weight: 820; letter-spacing: 0.09em; text-transform: uppercase; }
.game-card h3 { margin: 0.28rem 0 0.4rem; overflow: hidden; font-size: 1.03rem; font-weight: 820; letter-spacing: -0.02em; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.game-card-body > p { display: -webkit-box; min-height: 2.65rem; margin: 0; overflow: hidden; color: var(--muted); font-size: 0.72rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.game-card-meta { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.9rem; }
.skill-tag,
.duration-tag { overflow: hidden; padding: 0.23rem 0.42rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 0.56rem; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.skill-tag { min-width: 0; }
.duration-tag { flex: 0 0 auto; }

.game-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.9rem; }
.play-label { color: var(--ink); font-size: 0.68rem; font-weight: 800; }
.game-card-footer .ui-icon { width: 17px; color: var(--muted); transition: transform 160ms ease; }
.game-card-link:hover .game-card-footer .ui-icon,
.game-card-button:hover .game-card-footer .ui-icon { transform: translateX(3px); }

.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 {
  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 { 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; }

.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; }
}

@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,
  .topbar-install span { display: none; }
  .topbar-actions { gap: 0.4rem; }
  .topbar-install,
  .icon-button { width: 40px; min-height: 40px; padding: 0; }

  .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-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 { min-height: 245px; }
  .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; }
  .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: 1fr; gap: 0.65rem; }
  .game-card { display: grid; min-height: 142px; grid-template-columns: 104px minmax(0, 1fr); }
  .game-art { min-height: 100%; border-right: 1px solid var(--line); border-bottom: 0; }
  .game-art::after { right: -80%; bottom: -34%; }
  .game-number { display: none; }
  .status-pill { top: 0.5rem; right: 0.45rem; font-size: 0.49rem; }
  .game-icon { width: 54px; height: 54px; border-radius: 16px; font-size: 1.55rem; }
  .game-card-body { padding: 0.75rem 0.8rem; }
  .game-card h3 { font-size: 0.94rem; }
  .game-card-body > p { min-height: 2.3rem; font-size: 0.65rem; }
  .game-card-meta { margin-top: 0.55rem; }
  .game-card-footer { padding-top: 0.55rem; }

  .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; }

  .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 { grid-template-columns: 92px minmax(0, 1fr); }
  .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; }
}
