:root {
  color-scheme: dark;
  --bg: #050805;
  --panel: #0d120f;
  --panel-strong: #131a16;
  --line: rgba(197, 255, 46, 0.25);
  --line-soft: rgba(255, 255, 255, 0.12);
  --text: #f5f7f0;
  --muted: #a8b0a3;
  --green: #a9ff15;
  --green-deep: #31e000;
  --cyan: #33d4ff;
  --pink: #ff3d7f;
  --money: #e8ff57;
  --danger: #ff4f64;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  letter-spacing: 0;
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(169, 255, 21, 0.08), transparent 38%),
    linear-gradient(225deg, rgba(51, 212, 255, 0.08), transparent 42%),
    #050805;
  overflow-x: hidden;
}

body.is-vault-mode {
  background:
    radial-gradient(circle at 50% 0%, rgba(169, 255, 21, 0.08), transparent 28%),
    #020403;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100svh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

body.is-hub-mode .topbar {
  display: none;
}

body.is-hub-mode .stats {
  display: none;
}

.hub-home[hidden],
.game-tabs[hidden],
.game-layout[hidden],
.side-panel[hidden],
body.is-hub-mode .game-tabs,
body.is-hub-mode .game-layout,
body.is-hub-mode .side-panel {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(169, 255, 21, 0.3);
}

.brand h1,
.brand p,
.panel-section h2,
.overlay h2,
.overlay p,
.status-line {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.brand p {
  margin-top: 5px;
  color: var(--green);
  font-size: 0.9rem;
}

.game-hub-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-left: 6px;
  padding: 0 12px;
  border: 1px solid rgba(169, 255, 21, 0.38);
  border-radius: 7px;
  background: rgba(9, 15, 10, 0.9);
  color: #dfffc0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: none;
  white-space: nowrap;
}

.game-hub-return:hover,
.game-hub-return:focus-visible {
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 0 14px rgba(169, 255, 21, 0.12);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 112px)) minmax(280px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.stat {
  min-height: 62px;
  padding: 9px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 18, 15, 0.88);
}

.stat span {
  color: var(--muted);
  font-size: 0.76rem;
}

.stat strong {
  font-size: 1.35rem;
  line-height: 1;
}

.phase-stat strong {
  font-size: 1rem;
  text-transform: uppercase;
}

.legend {
  min-height: 62px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 18, 15, 0.7);
}

.legend-item {
  min-height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.legend-item strong {
  color: var(--text);
  font-size: 0.76rem;
}

.legend-item.is-good {
  border-color: rgba(169, 255, 21, 0.28);
}

.legend-item.is-good strong {
  color: var(--green);
}

.legend-item.is-bad {
  border-color: rgba(255, 79, 100, 0.32);
}

.legend-item.is-bad strong {
  color: var(--danger);
}

.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;
}

.hub-home {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
}

.hub-home[hidden] {
  display: none;
}

body.is-mobile-game-clean .game-tabs,
body.is-mobile-game-clean .game-picker-panel,
body.is-mobile-game-clean .ranking-panel,
body.is-mobile-game-clean .player-panel {
  display: none !important;
}

body.is-mobile-game-clean .game-layout {
  grid-template-columns: 1fr !important;
}

body.is-mobile-game-clean .side-panel {
  display: block !important;
  margin-top: 0;
}

body.is-mobile-game-clean .skin-panel {
  display: block !important;
  padding: 10px;
  border-color: rgba(169, 255, 21, 0.28);
  background: rgba(4, 8, 4, 0.72);
}

body.is-mobile-game-clean .skin-panel .panel-head {
  margin-bottom: 8px;
}

body.is-mobile-game-clean .skin-panel .panel-head h2 {
  font-size: 0.82rem;
}

body.is-mobile-game-clean .skin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.is-mobile-game-clean .skin-option {
  min-height: 48px;
  padding: 7px 6px;
}

body.is-mobile-game-clean .skin-option strong {
  font-size: 0.72rem;
}

body.is-mobile-game-clean .skin-swatch {
  width: 34px;
  height: 16px;
}

.hub-hero {
  position: relative;
  min-height: min(720px, calc(100svh - 42px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  grid-template-areas:
    "carousel wallet";
  align-items: stretch;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(169, 255, 21, 0.32);
  border-radius: 8px;
  overflow: hidden;
  background: #040704;
  box-shadow:
    inset 0 0 70px rgba(169, 255, 21, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.34);
}

.hub-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 4, 0.78) 0%, rgba(4, 7, 4, 0.48) 48%, rgba(4, 7, 4, 0.74) 100%),
    linear-gradient(0deg, rgba(4, 7, 4, 0.88) 0%, transparent 60%);
  pointer-events: none;
}

.hub-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transform: scale(1.02);
}

.hub-wallet-card,
.hub-game-showcase {
  position: relative;
  z-index: 1;
}

.hub-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-hero h2,
.hub-section-head h2 {
  margin: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

.hub-hero h2 {
  max-width: 540px;
  font-size: clamp(2.3rem, 7vw, 5rem);
  text-shadow:
    0 0 24px rgba(169, 255, 21, 0.34),
    0 10px 34px rgba(0, 0, 0, 0.55);
}

.hub-actions,
.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hub-primary,
.hub-secondary {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(169, 255, 21, 0.34);
  border-radius: 8px;
  color: var(--text);
  font-weight: 900;
  background: rgba(5, 8, 5, 0.82);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.hub-primary {
  color: #061006;
  border-color: #c8ff62;
  background: linear-gradient(135deg, #c2ff42 0%, var(--green) 46%, #72df00 100%);
  box-shadow:
    0 0 0 1px rgba(169, 255, 21, 0.2) inset,
    0 0 26px rgba(169, 255, 21, 0.34),
    0 10px 26px rgba(0, 0, 0, 0.28);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hub-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--green);
}

.hub-primary:hover {
  transform: translateY(-1px);
  border-color: #e1ff9d;
  box-shadow:
    0 0 0 1px rgba(218, 255, 148, 0.3) inset,
    0 0 34px rgba(169, 255, 21, 0.42),
    0 12px 30px rgba(0, 0, 0, 0.32);
}

.hub-primary:active {
  transform: translateY(1px) scale(0.99);
  background: linear-gradient(135deg, #a9ff15 0%, #83e900 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.36) inset,
    0 0 18px rgba(169, 255, 21, 0.28);
}

.hub-main-cta {
  width: min(390px, 72vw);
  min-height: 52px;
  justify-self: center;
  margin-top: 10px;
  font-size: 0.94rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.hub-wallet-card {
  grid-area: wallet;
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(169, 255, 21, 0.26);
  border-radius: 8px;
  background: rgba(5, 8, 5, 0.82);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 0 32px rgba(169, 255, 21, 0.06),
    0 16px 46px rgba(0, 0, 0, 0.34);
}

.hub-card-head {
  display: grid;
  gap: 2px;
}

.hub-card-head span,
.wallet-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.hub-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}

.hub-gaming-profile {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(169, 255, 21, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(169, 255, 21, 0.09), rgba(0, 0, 0, 0.28));
}

.hub-gaming-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(169, 255, 21, 0.5);
  border-radius: 50%;
  color: #d8ff97;
  background: #10160e;
  font-size: 0.72rem;
  font-weight: 900;
}

.hub-gaming-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hub-gaming-credit-copy { min-width: 0; display: grid; gap: 2px; }
.hub-gaming-credit-copy span,
.hub-gaming-source span { color: var(--muted); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hub-gaming-credit-copy strong { color: var(--green); font-size: 1.15rem; line-height: 1; }
.hub-gaming-credit-copy small { overflow: hidden; color: #9ca69c; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.hub-gaming-source { display: grid; gap: 3px; text-align: right; }
.hub-gaming-source > div { display: grid; gap: 1px; }
.hub-gaming-source strong { color: #e6ece3; font-size: 0.78rem; }
.hub-ngc-breakdown-toggle {
  justify-self: end;
  padding: 2px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font: 800 0.62rem/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.hub-ngc-breakdown-toggle:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }

.wallet-status.is-connected {
  color: var(--green);
}

.wallet-status.is-warning {
  color: #ffce45;
}

.wallet-status.is-error {
  color: #ff5870;
}

.wallet-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.52);
  outline: none;
}

.wallet-input:focus {
  border-color: var(--green);
}

.wallet-input.is-attention {
  border-color: #ffce45;
  box-shadow:
    0 0 0 1px rgba(255, 206, 69, 0.32) inset,
    0 0 24px rgba(255, 206, 69, 0.14);
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hub-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(169, 255, 21, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(169, 255, 21, 0.07), transparent 42%),
    rgba(9, 14, 10, 0.88);
}

.hub-game-showcase {
  grid-area: carousel;
  min-width: 0;
  align-self: stretch;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 12px;
  border: 1px solid rgba(169, 255, 21, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(169, 255, 21, 0.09), transparent 48%),
    rgba(3, 7, 4, 0.54);
  box-shadow:
    inset 0 0 70px rgba(169, 255, 21, 0.05),
    0 22px 62px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.hub-mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.hub-mode-actions[hidden] {
  display: none;
}

.hub-mode-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.hub-mode-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.hub-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.hub-section-head h2 {
  font-size: clamp(1.4rem, 4vw, 2.3rem);
}

.hub-game-grid {
  position: relative;
  min-height: 640px;
  height: 100%;
  display: block;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.hub-game-tile {
  position: relative;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(390px, 62vw);
  height: min(560px, 70svh);
  min-height: 420px;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 16px;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  background: #040704;
  box-shadow: inset 0 -80px 90px rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.6);
  transition:
    transform 360ms cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 260ms ease,
    filter 260ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.hub-game-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.22) 56%, transparent 100%),
    radial-gradient(circle at 50% 76%, rgba(169, 255, 21, 0.18), transparent 42%);
  pointer-events: none;
}

.hub-game-tile:hover {
  border-color: var(--green);
  box-shadow:
    inset 0 -80px 90px rgba(0, 0, 0, 0.62),
    0 0 24px rgba(169, 255, 21, 0.16);
  transform: translateY(-2px);
}

.hub-game-tile.is-active {
  z-index: 4;
  opacity: 1;
  pointer-events: auto;
  border-color: rgba(169, 255, 21, 0.84);
  box-shadow:
    inset 0 -92px 100px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 34px rgba(169, 255, 21, 0.22),
    0 32px 70px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%) scale(1) rotateY(0deg);
}

.hub-game-tile.is-prev {
  z-index: 3;
  opacity: 0.48;
  pointer-events: auto;
  filter: saturate(0.82) brightness(0.72);
  transform: translate(calc(-50% - min(250px, 35vw)), -50%) scale(0.76) rotateY(22deg);
}

.hub-game-tile.is-next {
  z-index: 3;
  opacity: 0.48;
  pointer-events: auto;
  filter: saturate(0.82) brightness(0.72);
  transform: translate(calc(-50% + min(250px, 35vw)), -50%) scale(0.76) rotateY(-22deg);
}

.hub-game-tile.is-far-prev {
  z-index: 1;
  opacity: 0.28;
  filter: blur(1px) saturate(0.7) brightness(0.54);
  transform: translate(calc(-50% - min(420px, 60vw)), -50%) scale(0.55) rotateY(32deg);
}

.hub-game-tile.is-far-next {
  z-index: 1;
  opacity: 0.28;
  filter: blur(1px) saturate(0.7) brightness(0.54);
  transform: translate(calc(-50% + min(420px, 60vw)), -50%) scale(0.55) rotateY(-32deg);
}

.hub-game-tile.is-active:hover {
  transform: translate(-50%, -52%) scale(1.02) rotateY(0deg);
}

.hub-game-tile.is-prev:hover {
  transform: translate(calc(-50% - min(250px, 35vw)), -52%) scale(0.78) rotateY(20deg);
}

.hub-game-tile.is-next:hover {
  transform: translate(calc(-50% + min(250px, 35vw)), -52%) scale(0.78) rotateY(-20deg);
}

.hub-game-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.hub-game-tile strong,
.hub-game-tile small,
.hub-game-meta {
  position: relative;
  z-index: 1;
}

.hub-game-tile strong {
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(169, 255, 21, 0.28);
}

.hub-game-tile small {
  color: #dfe8da;
  font-size: 0.9rem;
}

.hub-game-meta {
  justify-self: start;
  min-height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(169, 255, 21, 0.42);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.58);
}

.hub-carousel {
  position: relative;
  min-height: 100%;
}

.hub-carousel-nav {
  position: absolute;
  z-index: 6;
  top: 50%;
  width: 46px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(169, 255, 21, 0.5);
  border-radius: 8px;
  color: var(--green);
  font-size: 1.25rem;
  font-weight: 900;
  background: rgba(2, 5, 3, 0.76);
  box-shadow: 0 0 22px rgba(169, 255, 21, 0.18);
  transform: translateY(-50%);
}

.hub-carousel-nav:hover {
  border-color: var(--green);
  background: rgba(17, 32, 12, 0.88);
}

.hub-carousel-nav.is-prev {
  left: 4px;
}

.hub-carousel-nav.is-next {
  right: 4px;
}

.hub-leaderboards {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(169, 255, 21, 0.055), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 36%),
    rgba(3, 6, 4, 0.88);
}

.hub-board-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 27, 23, 0.94), rgba(4, 7, 5, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 6px 18px rgba(0, 0, 0, 0.22);
  scrollbar-width: none;
}
.hub-board-tabs::-webkit-scrollbar { display: none; }

.hub-board-tab {
  position: relative;
  min-height: 42px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8e9990;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.hub-board-tab.is-active,
.hub-board-tab:hover {
  color: #efffdf;
  border-color: rgba(169, 255, 21, 0.46);
  background: linear-gradient(180deg, rgba(169, 255, 21, 0.13), rgba(25, 38, 20, 0.36));
  box-shadow: inset 0 1px rgba(220, 255, 176, 0.12), 0 0 15px rgba(169, 255, 21, 0.06);
}
.hub-board-tab.is-active::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 2px; border-radius: 2px; background: var(--green); box-shadow: 0 0 8px rgba(169, 255, 21, 0.38); }

.hub-board-levels {
  width: fit-content;
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(51, 167, 255, 0.22);
  border-radius: 10px;
  background: rgba(5, 12, 18, 0.82);
}

.hub-board-levels[hidden] { display: none; }

.hub-board-level {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #91a1ae;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hub-board-level.is-active,
.hub-board-level:hover {
  color: #eef8ff;
  border-color: rgba(51, 167, 255, 0.5);
  background: rgba(51, 167, 255, 0.14);
}

.hub-board-list {
  min-height: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.hub-board-list.nfc-board { padding-top: 1px; }

.event-rules-view {
  width: min(100%, 760px);
  margin: auto;
  padding: clamp(10px, 3vw, 24px) 0;
}

.event-rules-card {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 5vw, 38px);
  border: 1px solid rgba(169, 255, 21, 0.34);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(13, 20, 15, 0.94), rgba(2, 5, 3, 0.96));
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 20px 60px rgba(0,0,0,.48), 0 0 32px rgba(169,255,21,.08);
}

.event-rules-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% 0, rgba(169,255,21,.12), transparent 38%);
}

.event-rules-card h2 { position: relative; margin: 4px 0 6px; font-size: clamp(1.8rem, 7vw, 3.2rem); text-transform: uppercase; }
.event-rules-schedule { position: relative; margin: 0 0 22px; color: var(--green); font-weight: 800; }
.event-rules-block { position: relative; margin-top: 14px; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(0,0,0,.26); }
.event-rules-block h3 { margin: 0 0 10px; color: var(--green); font-size: .82rem; letter-spacing: .15em; }
.event-rules-block ol { margin: 0; padding-left: 22px; }
.event-rules-block li, .event-rules-block p { margin: 7px 0; color: var(--text); line-height: 1.45; }
.event-rules-podium { display: grid; gap: 8px; }
.event-rules-podium > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.035); }
.event-rules-podium span { color: var(--muted); text-align: right; }
.event-rules-motto { position: relative; display: block; margin: 22px 0 14px; text-align: center; color: var(--green); letter-spacing: .18em; }
.event-rules-back { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; text-decoration: none; }

@media (max-width: 460px) {
  body.is-event-rules .app-shell { padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  body.is-event-rules .stats, body.is-event-rules .game-hub-return { display: none; }
  .event-rules-podium > div { grid-template-columns: 1fr; gap: 3px; }
  .event-rules-podium span { text-align: left; }
}

.hub-board-list li {
  min-height: 54px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(3, 6, 4, 0.64);
}

.hub-board-list .rank {
  width: 32px;
  height: 32px;
}

.level-guide {
  flex: 1 0 100%;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.level-chip {
  min-height: 25px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.73rem;
  white-space: nowrap;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.level-chip strong {
  color: var(--text);
}

.level-chip.is-current {
  color: var(--text);
  border-color: rgba(51, 212, 255, 0.5);
  box-shadow: inset 0 0 14px rgba(51, 212, 255, 0.1);
}

.level-chip.is-current strong {
  color: var(--cyan);
}

.game-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.game-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 18, 15, 0.86);
}

.game-tab.is-active,
.game-tab:hover {
  color: var(--text);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(169, 255, 21, 0.14);
}

.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
}

.arena-section,
.side-panel {
  min-width: 0;
}

.arena-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.arena-tools {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.arena-frame {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(169, 255, 21, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 255, 21, 0.04) 1px, transparent 1px),
    #071008;
  background-size: 36px 36px;
  box-shadow: inset 0 0 60px rgba(49, 224, 0, 0.08);
  overflow: hidden;
  transition:
    border-color 420ms ease,
    box-shadow 420ms ease;
}

body.is-snake-mode .arena-frame {
  border-color: rgba(169, 255, 21, 0.34);
  background:
    linear-gradient(rgba(169, 255, 21, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 255, 21, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, rgba(169, 255, 21, 0.09), transparent 46%),
    #030604;
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
  box-shadow:
    inset 0 0 82px rgba(49, 224, 0, 0.12),
    inset 0 0 140px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(169, 255, 21, 0.08);
}

body.is-snake-mode .arena-frame::before,
body.is-snake-mode .arena-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.is-snake-mode .arena-frame::before {
  z-index: 0;
  background:
    linear-gradient(115deg, transparent 0 31%, rgba(169, 255, 21, 0.09) 31.5%, transparent 33% 65%, rgba(93, 252, 255, 0.045) 65.5%, transparent 67%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
  opacity: 0.42;
}

body.is-snake-mode .arena-frame::after {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(169, 255, 21, 0.035) 8px 10px);
  mix-blend-mode: screen;
  opacity: 0.34;
}

.arena-frame.is-level-two {
  border-color: rgba(184, 255, 42, 0.52);
  background: #071008;
  background-size: 36px 36px;
  box-shadow:
    inset 0 0 74px rgba(169, 255, 21, 0.1),
    0 0 28px rgba(169, 255, 21, 0.08);
}

.arena-frame.is-level-three {
  border-color: rgba(51, 212, 255, 0.52);
  box-shadow:
    inset 0 0 74px rgba(51, 212, 255, 0.1),
    0 0 28px rgba(51, 212, 255, 0.08);
}

.arena-frame.is-level-four {
  border-color: rgba(166, 85, 255, 0.58);
  box-shadow:
    inset 0 0 80px rgba(166, 85, 255, 0.12),
    0 0 30px rgba(166, 85, 255, 0.1);
}

.arena-frame.is-level-five {
  border-color: rgba(255, 206, 69, 0.62);
  box-shadow:
    inset 0 0 84px rgba(255, 206, 69, 0.12),
    0 0 34px rgba(255, 206, 69, 0.12);
}

body.is-snake-mode .arena-frame.is-level-two {
  border-color: rgba(184, 255, 42, 0.52);
  box-shadow:
    inset 0 0 78px rgba(169, 255, 21, 0.12),
    inset 0 0 140px rgba(0, 0, 0, 0.48),
    0 0 30px rgba(169, 255, 21, 0.1);
}

body.is-snake-mode .arena-frame.is-level-three {
  border-color: rgba(51, 212, 255, 0.52);
  box-shadow:
    inset 0 0 78px rgba(51, 212, 255, 0.12),
    inset 0 0 140px rgba(0, 0, 0, 0.48),
    0 0 30px rgba(51, 212, 255, 0.1);
}

body.is-snake-mode .arena-frame.is-level-four {
  border-color: rgba(166, 85, 255, 0.58);
  box-shadow:
    inset 0 0 84px rgba(166, 85, 255, 0.14),
    inset 0 0 140px rgba(0, 0, 0, 0.48),
    0 0 32px rgba(166, 85, 255, 0.12);
}

body.is-snake-mode .arena-frame.is-level-five {
  border-color: rgba(255, 206, 69, 0.66);
  box-shadow:
    inset 0 0 90px rgba(255, 206, 69, 0.15),
    inset 0 0 140px rgba(0, 0, 0, 0.5),
    0 0 36px rgba(255, 206, 69, 0.13);
}

.arena-frame.is-vault {
  border-color: rgba(169, 255, 21, 0.22);
  background:
    linear-gradient(rgba(169, 255, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #070908;
  box-shadow:
    inset 0 0 70px rgba(169, 255, 21, 0.06),
    inset 0 0 120px rgba(0, 0, 0, 0.44);
}

.arena-frame.is-alarm {
  border-color: rgba(255, 79, 100, 0.5);
  box-shadow:
    inset 0 0 78px rgba(255, 79, 100, 0.12),
    0 0 28px rgba(255, 79, 100, 0.1);
}

#gameCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 82svh, 760px);
  max-height: calc(100svh - 156px);
  aspect-ratio: 1 / 1;
  touch-action: none;
}

body.is-vault-mode .app-shell {
  width: min(100vw, 760px);
  padding: 0 0 max(12px, env(safe-area-inset-bottom));
  gap: 0;
}

body.is-vault-mode .topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 48px;
  padding: max(6px, env(safe-area-inset-top)) 8px 6px;
  border-bottom: 1px solid rgba(169, 255, 21, 0.14);
  background: rgba(2, 4, 3, 0.88);
  backdrop-filter: blur(12px);
}

body.is-vault-mode .brand-logo {
  width: 36px;
  height: 36px;
}

body.is-vault-mode .brand {
  gap: 8px;
}

body.is-vault-mode .brand h1 {
  font-size: 0.9rem;
}

body.is-vault-mode .brand p {
  margin-top: 2px;
  font-size: 0.72rem;
}

body.is-vault-mode .stats,
body.is-vault-mode .game-tabs {
  display: none;
}

body.is-vault-mode .game-layout {
  display: block;
}

body.is-vault-mode .arena-section {
  position: relative;
  display: block;
}

body.is-vault-mode .arena-tools {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  right: 8px;
  min-height: 38px;
  pointer-events: none;
}

body.is-vault-mode .arena-tools .sound-toggle {
  justify-self: end;
  pointer-events: auto;
}

body.is-vault-mode .arena-tools .help-toggle {
  pointer-events: auto;
}

body.is-vault-mode .level-badge {
  display: none;
}

body.is-vault-mode .run-toast {
  align-self: start;
  justify-self: center;
  background: rgba(2, 4, 3, 0.74);
}

body.is-vault-mode .arena-frame {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #020403;
  box-shadow: none;
}

body.is-vault-mode #gameCanvas {
  width: 100%;
  max-height: none;
  aspect-ratio: auto;
}

body.is-vault-mode .mobile-controls {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

body.is-vault-mode .mobile-controls button {
  width: 58px;
  height: 52px;
  pointer-events: auto;
  background: rgba(2, 4, 3, 0.64);
  backdrop-filter: blur(12px);
}

body.is-vault-mode .side-panel {
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto auto;
}

.run-toast {
  justify-self: center;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(169, 255, 21, 0.45);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(5, 8, 5, 0.88);
  box-shadow: 0 0 24px rgba(169, 255, 21, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.run-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.run-toast.is-record {
  border-color: rgba(51, 212, 255, 0.6);
  color: var(--cyan);
  box-shadow: 0 0 26px rgba(51, 212, 255, 0.24);
}

.run-toast.is-level {
  border-color: rgba(51, 212, 255, 0.66);
  color: var(--cyan);
  box-shadow: 0 0 28px rgba(51, 212, 255, 0.28);
}

.run-toast.is-shield {
  border-color: rgba(93, 252, 255, 0.66);
  color: #5dfcff;
  box-shadow: 0 0 28px rgba(93, 252, 255, 0.28);
}

.run-toast.is-alarm {
  border-color: rgba(255, 38, 56, 0.72);
  color: #fff0f1;
  background: rgba(32, 2, 7, 0.92);
  box-shadow: 0 0 30px rgba(255, 38, 56, 0.3);
}

.level-badge {
  padding: 7px 10px;
  border: 1px solid rgba(169, 255, 21, 0.32);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(5, 8, 5, 0.76);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 240ms ease,
    color 240ms ease;
  pointer-events: none;
}

.level-badge.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.level-badge.is-level-two,
.level-badge.is-level-three,
.level-badge.is-level-four,
.level-badge.is-level-five {
  color: var(--cyan);
  border-color: rgba(51, 212, 255, 0.55);
}

body.is-snake-mode .level-badge {
  background:
    linear-gradient(135deg, rgba(169, 255, 21, 0.12), rgba(5, 8, 5, 0.88)),
    rgba(5, 8, 5, 0.82);
  box-shadow: 0 0 18px rgba(169, 255, 21, 0.14);
}

body.is-snake-mode .level-badge.is-level-five {
  color: #ffce45;
  border-color: rgba(255, 206, 69, 0.62);
  box-shadow: 0 0 20px rgba(255, 206, 69, 0.18);
}

.sound-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 5, 0.84);
  color: var(--green);
}

.sound-toggle:hover {
  border-color: var(--green);
}

.help-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 5, 0.84);
  color: var(--green);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
}

.help-toggle:hover {
  border-color: var(--green);
}

.speaker-icon {
  position: relative;
  width: 21px;
  height: 18px;
  display: block;
}

.speaker-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 1px;
  width: 6px;
  height: 8px;
  border-radius: 2px 0 0 2px;
  background: currentColor;
  box-shadow: 5px 0 currentColor;
  clip-path: polygon(0 18%, 45% 18%, 100% 0, 100% 100%, 45% 82%, 0 82%);
}

.speaker-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 1px;
  width: 9px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
}

.sound-toggle.is-muted {
  color: var(--muted);
}

.sound-toggle.is-muted .speaker-icon::after {
  top: 1px;
  right: 4px;
  width: 2px;
  height: 18px;
  border: 0;
  border-radius: 2px;
  background: var(--danger);
  transform: rotate(-40deg);
}

.howto-modal[hidden] {
  display: none;
}

.howto-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(10px);
}

.howto-card {
  position: relative;
  width: min(420px, 100%);
  max-height: min(760px, calc(100svh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(169, 255, 21, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(169, 255, 21, 0.1), transparent 42%),
    rgba(5, 8, 5, 0.94);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 70px rgba(0, 0, 0, 0.65),
    0 0 34px rgba(169, 255, 21, 0.18);
}

.howto-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.54);
  font-weight: 900;
}

.howto-kicker {
  margin: 0 48px 6px 0;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.howto-card h2 {
  margin: 0 48px 12px 0;
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.howto-body {
  display: grid;
  gap: 10px;
}

.howto-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.howto-body ol,
.howto-body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.howto-body li {
  margin: 0 0 8px;
  line-height: 1.36;
}

.howto-body strong {
  color: var(--green);
}

.overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(5, 8, 5, 0.78);
  backdrop-filter: blur(10px);
}

.overlay.is-visible {
  display: grid;
}

.overlay-logo {
  width: min(180px, 38vw);
  height: min(180px, 38vw);
  object-fit: cover;
  border-radius: 8px;
  filter: drop-shadow(0 0 24px rgba(169, 255, 21, 0.45));
}

.overlay-cover {
  width: min(320px, 74vw);
  height: min(320px, 42svh);
  border: 1px solid rgba(169, 255, 21, 0.4);
  box-shadow:
    0 0 28px rgba(169, 255, 21, 0.24),
    0 20px 56px rgba(0, 0, 0, 0.42);
}

.overlay.is-vault-overlay {
  background:
    linear-gradient(rgba(5, 8, 5, 0.84), rgba(5, 8, 5, 0.9)),
    repeating-linear-gradient(90deg, rgba(169, 255, 21, 0.08) 0 1px, transparent 1px 68px);
  backdrop-filter: blur(8px) saturate(1.15);
}

.overlay.is-vault-overlay .overlay-logo {
  display: none;
}

.overlay.is-vault-overlay h2 {
  font-size: clamp(1.55rem, 6vw, 3.1rem);
  letter-spacing: 0.08em;
  color: var(--green);
  text-shadow: 0 0 22px rgba(169, 255, 21, 0.38);
}

.overlay.is-vault-overlay p {
  max-width: 360px;
  color: #d4dccf;
}

.overlay h2 {
  font-size: clamp(1.8rem, 8vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.overlay p {
  max-width: 420px;
  color: var(--muted);
}

.cash-snake-ngc-result {
  display: grid;
  gap: 3px;
  min-width: min(250px, 82%);
  padding: 9px 13px;
  border: 1px solid rgba(169, 255, 21, .28);
  border-radius: 10px;
  background: rgba(4, 10, 7, .82);
  color: #eef5e8;
  font-size: 11px;
  letter-spacing: .08em;
  text-align: center;
}

.cash-snake-ngc-result[hidden] { display: none; }
.cash-snake-ngc-result strong { color: #a9ff15; font-size: 10px; }
.cash-snake-ngc-result b { color: #fff; }

.primary-action,
.secondary-action,
.icon-button,
.mobile-controls button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 0 20px rgba(169, 255, 21, 0.1);
}

.primary-action {
  min-width: 164px;
  padding: 0 22px;
  color: #071008;
  font-weight: 800;
  background: linear-gradient(90deg, var(--green), var(--money));
}

.secondary-action {
  width: 100%;
  padding: 0 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.primary-action:hover,
.secondary-action:hover,
.icon-button:hover,
.mobile-controls button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.mobile-controls {
  display: none;
  width: min(100%, 286px);
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(58px, 74px));
  grid-template-rows: repeat(2, 52px);
  justify-content: center;
  gap: 8px;
}

.mobile-controls button {
  width: 100%;
  height: 52px;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.control-up {
  grid-column: 2;
  grid-row: 1;
}

.control-left {
  grid-column: 1;
  grid-row: 2;
}

.control-down {
  grid-column: 2;
  grid-row: 2;
}

.control-right {
  grid-column: 3;
  grid-row: 2;
}

.side-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.panel-section {
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 18, 15, 0.88);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-section h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
}

.game-card-grid {
  display: grid;
  gap: 8px;
}

.game-card {
  width: 100%;
  min-height: 58px;
  padding: 10px;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: rgba(8, 13, 9, 0.9);
}

.game-card strong {
  font-size: 0.95rem;
}

.game-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.game-card.is-active,
.game-card:hover {
  border-color: var(--green);
  box-shadow: inset 0 0 18px rgba(169, 255, 21, 0.08);
}

.skin-panel[hidden] {
  display: none;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.skin-option {
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  display: grid;
  gap: 6px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 13, 9, 0.9);
}

.skin-option strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skin-option.is-active,
.skin-option:hover {
  color: var(--text);
  border-color: var(--green);
  box-shadow: inset 0 0 18px rgba(169, 255, 21, 0.1);
}

.skin-swatch {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(169, 255, 21, 0.24);
}

.skin-swatch.is-classic {
  background: linear-gradient(90deg, #d8ff4c, #31e000);
}

.skin-swatch.is-cyber {
  background: linear-gradient(90deg, #dffcff, #33d4ff, #0c66ff);
  box-shadow: 0 0 16px rgba(51, 212, 255, 0.32);
}

.skin-swatch.is-gold {
  background: linear-gradient(90deg, #fff3a8, #ffce45, #a9ff15);
  box-shadow: 0 0 16px rgba(255, 206, 69, 0.32);
}

.weekly-winner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
}

.weekly-winner > strong {
  grid-column: 1 / -1;
  color: var(--text);
}

.weekly-winner > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.winner-rank {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #061006;
  font-weight: 900;
  background: linear-gradient(135deg, var(--money), var(--green));
  box-shadow: 0 0 18px rgba(169, 255, 21, 0.22);
}

.winner-player {
  min-width: 0;
}

.winner-player strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-player span {
  color: var(--muted);
  font-size: 0.82rem;
}

.leaderboard {
  height: 100%;
  max-height: calc(100svh - 352px);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line-soft);
}

.leaderboard li:last-child {
  border-bottom: 0;
}

.rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #061006;
  font-weight: 800;
  background: var(--green);
}

.player {
  min-width: 0;
}

.player strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player span,
.score-meta,
.name-label,
.status-line {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-meta {
  text-align: right;
}

.name-label {
  display: block;
  margin-bottom: 6px;
}

.name-input {
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #080d09;
  outline: none;
}

.name-input:focus {
  border-color: var(--green);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.status-line {
  min-height: 20px;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100vw - 18px, 720px);
  }

  body:not(.is-hub-mode) .app-shell {
    gap: 8px;
  }

  body:not(.is-hub-mode) .topbar {
    gap: 8px;
    min-height: 0;
    padding-bottom: 6px;
  }

  body:not(.is-hub-mode) .brand-logo {
    width: 52px;
    height: 52px;
  }

  body:not(.is-hub-mode) .brand h1 {
    font-size: 1.2rem;
  }

  body:not(.is-hub-mode) .brand p {
    margin-top: 3px;
    font-size: 0.78rem;
  }

  body:not(.is-hub-mode) .game-hub-return {
    min-height: 32px;
    margin-left: auto;
    padding: 0 9px;
    font-size: 0.58rem;
  }

  .hub-hero {
    min-height: calc(100svh - 28px);
    grid-template-columns: 1fr;
    grid-template-areas:
      "carousel"
      "wallet";
    align-items: stretch;
    padding: 16px;
  }

  .hub-hero::after {
    background:
      linear-gradient(0deg, rgba(4, 7, 4, 0.96) 0%, rgba(4, 7, 4, 0.7) 52%, rgba(4, 7, 4, 0.16) 100%);
  }

  .hub-game-grid {
    min-height: min(590px, 70svh);
  }

  .hub-game-tile {
    width: min(360px, 76vw);
    height: min(510px, 64svh);
    min-height: 390px;
  }

  .hub-game-tile.is-prev {
    transform: translate(calc(-50% - min(210px, 34vw)), -50%) scale(0.72) rotateY(20deg);
  }

  .hub-game-tile.is-next {
    transform: translate(calc(-50% + min(210px, 34vw)), -50%) scale(0.72) rotateY(-20deg);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding-bottom: 12px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  body:not(.is-hub-mode) .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  body:not(.is-hub-mode) .stat {
    min-height: 48px;
    padding: 7px;
  }

  body:not(.is-hub-mode) .stat strong {
    font-size: 1.05rem;
  }

  body:not(.is-hub-mode) .stat span {
    font-size: 0.68rem;
  }

  .legend {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body:not(.is-hub-mode) .legend {
    display: none;
  }

  .level-guide {
    justify-content: flex-start;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  body.is-hub-mode .game-tabs {
    overflow-x: auto;
  }

  body:not(.is-hub-mode) .game-tabs,
  body:not(.is-hub-mode) .game-picker-panel,
  body:not(.is-hub-mode) .ranking-panel,
  body:not(.is-hub-mode) .player-panel {
    display: none;
  }

  body:not(.is-hub-mode) .side-panel {
    display: block;
  }

  body:not(.is-hub-mode) .game-layout {
    grid-template-columns: 1fr;
  }

  #gameCanvas {
    max-height: min(68svh, calc(100vw - 20px));
  }

  .mobile-controls {
    display: grid;
  }
}

@media (max-width: 460px) {
  .hub-home {
    gap: 12px;
  }

  .hub-hero {
    min-height: calc(100svh - 22px);
    padding: 10px;
    gap: 10px;
  }

  .hub-actions,
  .wallet-actions {
    grid-template-columns: 1fr;
  }

  .hub-actions {
    display: grid;
  }

  .hub-game-grid {
    min-height: min(540px, 67svh);
  }

  .hub-game-tile {
    width: min(330px, 82vw);
    height: min(470px, 60svh);
    min-height: 360px;
  }

  .hub-game-tile.is-prev {
    opacity: 0.28;
    transform: translate(calc(-50% - 46vw), -50%) scale(0.56) rotateY(18deg);
  }

  .hub-game-tile.is-next {
    opacity: 0.28;
    transform: translate(calc(-50% + 46vw), -50%) scale(0.56) rotateY(-18deg);
  }

  .hub-carousel-nav {
    width: 42px;
    height: 52px;
  }

  .hub-section {
    padding: 12px;
  }

  .hub-wallet-card {
    padding: 12px;
  }

  .hub-mode-actions {
    grid-template-columns: 1fr;
  }

  .hub-board-list {
    min-height: 210px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .stat {
    min-height: 54px;
    padding: 8px;
  }

  .stat strong {
    font-size: 1.2rem;
  }

  .phase-stat strong {
    font-size: 0.86rem;
  }

  .arena-frame {
    min-height: auto;
  }

  .arena-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .run-toast {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 34px;
  }

  .overlay {
    padding: 16px;
  }

  .overlay-logo {
    width: 132px;
    height: 132px;
  }

  .run-toast {
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  .level-badge {
    padding: 6px 8px;
    font-size: 0.66rem;
  }

  .sound-toggle {
    width: 38px;
    height: 38px;
  }

  .leaderboard li {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
  }
}
