/* ==========================================================================
   NL2 Arcade — shared styling for the mini-games suite
   Inherits NL2 Atlas brand (Racing Orange + Go Green) and adds a neon arcade feel.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Barlow:wght@400;500;600;700;800&family=Bebas+Neue&display=swap');

:root {
  --bg-primary: #0a0a0e;
  --bg-card: #131319;
  --bg-card-hover: #1a1a22;
  --border: #23232e;
  --text-primary: #f5f5f7;
  --text-secondary: #9898aa;
  --text-muted: #5e5e72;

  --accent: #FD8F0D;
  --accent-hover: #ffa133;
  --accent-dim: rgba(253,143,13,0.15);
  --accent-border: rgba(253,143,13,0.35);

  --green: #06C203;
  --green-bright: #00e676;
  --green-dim: rgba(6,194,3,0.14);
  --red: #ff1744;
  --red-dim: rgba(255,23,68,0.14);
  --yellow: #ffd740;
  --yellow-dim: rgba(255,215,64,0.14);
  --blue: #3b82f6;
  --purple: #a855f7;

  --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: 'Bebas Neue', 'Barlow Condensed', 'Impact', sans-serif;
  --font-hud: 'Orbitron', 'Bebas Neue', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Arcade top bar ── */
/* ── Top bar — gaming HUD aesthetic ── */
.arcade-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background:
    linear-gradient(180deg, rgba(10,10,14,0.98) 0%, rgba(14,14,20,0.95) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(253,143,13,0.2);
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  /* Subtle scanline texture for gaming vibe */
  background-image:
    linear-gradient(180deg, rgba(10,10,14,0.98) 0%, rgba(14,14,20,0.95) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 3px);
  position: sticky;
}
.arcade-bar::after {
  /* Accent underline glow */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(253,143,13,0.6) 30%, rgba(0,230,118,0.5) 70%, transparent);
  pointer-events: none;
}

/* Brand block — left cluster */
.arcade-bar .brand-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.arcade-bar h1 { margin: 0; }
.arcade-bar h1 a {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  text-decoration: none;
}
.arcade-bar h1 a::before {
  content: '◆';
  font-size: 0.85em;
  color: var(--green-bright);
  filter: drop-shadow(0 0 6px rgba(0,230,118,0.7));
}
.arcade-bar h1 a:hover { text-decoration: none; }
.arcade-bar h1 a:hover::before { animation: glitch-flicker 0.4s; }
@keyframes glitch-flicker {
  0%, 100% { opacity: 1; transform: translateX(0); }
  20% { opacity: 0.6; transform: translateX(-1px); }
  40% { opacity: 1; transform: translateX(1px); }
  60% { opacity: 0.8; transform: translateX(0); color: var(--accent); }
}
.arcade-bar h1 .arcade-tag {
  font-family: var(--font-hud);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--green-bright);
  background: rgba(0,230,118,0.12);
  border: 1px solid rgba(0,230,118,0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  text-shadow: 0 0 6px rgba(0,230,118,0.4);
  align-self: flex-start;
  margin-top: 2px;
}

/* Divider between zones */
.arcade-bar .zone-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.15), transparent);
  margin: 0 0.25rem;
  flex-shrink: 0;
}
/* ── Main nav (HOME / LEADERBOARDS) — primary pills ── */
.arcade-nav-main {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.arcade-nav-main a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-family: var(--font-hud);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.1s;
  text-decoration: none;
  /* Angled top-right + bottom-left corners (gaming aesthetic) */
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  overflow: hidden;
}
.arcade-nav-main a::before {
  /* Shimmer on hover */
  content: '';
  position: absolute;
  top: 0; left: -100%; bottom: 0;
  width: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.55s ease-out;
}
.arcade-nav-main a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
  border-color: rgba(255,255,255,0.15);
}
.arcade-nav-main a:hover::before { left: 100%; }
.arcade-nav-main a.active {
  color: var(--text-primary);
  background: rgba(253,143,13,0.15);
  border-color: rgba(253,143,13,0.45);
}
.arcade-nav-main .nav-hub.active {
  color: var(--accent);
  background: rgba(253,143,13,0.18);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(253,143,13,0.25), inset 0 0 8px rgba(253,143,13,0.1);
}
.arcade-nav-main .nav-invite {
  color: #9acd32;
  border-color: rgba(154,205,50,0.4);
  background: rgba(154,205,50,0.06);
}
.arcade-nav-main .nav-invite:hover {
  color: #a8e045;
  border-color: rgba(154,205,50,0.7);
  background: rgba(154,205,50,0.14);
}
.arcade-nav-main .nav-lb.active {
  color: var(--yellow);
  background: rgba(234,179,8,0.18);
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(234,179,8,0.25), inset 0 0 8px rgba(234,179,8,0.1);
}

/* ── Franchise pills — secondary chips with franchise colors ── */
.arcade-nav-franchise {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.arcade-nav-franchise a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: var(--text-muted);
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.1s;
  text-decoration: none;
}
.arcade-nav-franchise a:hover {
  transform: translateY(-1px);
  color: var(--text-primary);
}
.arcade-nav-franchise a.f-nl2:hover { color: #FD8F0D; border-color: rgba(253,143,13,0.35); }
.arcade-nav-franchise a.f-oo:hover  { color: #9acd32; border-color: rgba(154,205,50,0.35); }
.arcade-nav-franchise a.f-am:hover  { color: #fb923c; border-color: rgba(251,146,60,0.35); }
.arcade-nav-franchise a.f-nl2.active { color: #FD8F0D; background: rgba(253,143,13,0.14); border-color: var(--accent); box-shadow: 0 0 10px rgba(253,143,13,0.25); }
.arcade-nav-franchise a.f-oo.active  { color: #9acd32; background: rgba(154,205,50,0.14); border-color: #9acd32;    box-shadow: 0 0 10px rgba(154,205,50,0.25); }
.arcade-nav-franchise a.f-am.active  { color: #fb923c; background: rgba(251,146,60,0.14); border-color: #fb923c;    box-shadow: 0 0 10px rgba(251,146,60,0.25); }
.arcade-nav-franchise a .franchise-short {
  font-weight: 900;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}
.arcade-nav-franchise a .franchise-count {
  font-size: 0.56rem;
  opacity: 0.7;
  padding: 0.06rem 0.32rem;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-weight: 700;
}

/* ── Wallet HUD — credits + gold live display ── */
.arcade-wallet-hud {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}
.arcade-wallet-hud .hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.arcade-wallet-hud .hud-chip .icon {
  font-size: 0.9rem;
  filter: drop-shadow(0 0 4px currentColor);
}
.arcade-wallet-hud .hud-chip .value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  min-width: 1.5ch;
  text-align: right;
}
.arcade-wallet-hud .hud-chip.credits { color: var(--blue); }
.arcade-wallet-hud .hud-chip.gold    { color: var(--yellow); }
.arcade-wallet-hud .hud-chip.offline .value { color: var(--text-muted); }
.arcade-wallet-hud .hud-sep { color: rgba(255,255,255,0.1); }

/* Breadcrumb — moved to secondary row below the bar */
.nav-breadcrumb {
  position: absolute;
  left: 0; right: 0; top: 100%;
  padding: 0.35rem 1.5rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-hud);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.nav-breadcrumb a { font-weight: 900; text-decoration: none; }
.nav-breadcrumb a:hover { text-decoration: underline; }
.nav-breadcrumb .sep { opacity: 0.5; }
.nav-breadcrumb .game { color: var(--text-primary); font-weight: 700; }

/* ── Responsive breakpoints ── */
/* Tablet: hide franchise names, keep short codes */
@media (max-width: 980px) {
  .arcade-bar { padding: 0.6rem 1rem; gap: 0.75rem; }
  .arcade-nav-main a { padding: 0.45rem 0.75rem; font-size: 0.68rem; letter-spacing: 0.12em; }
  .arcade-nav-franchise a { padding: 0.4rem 0.55rem; }
  .arcade-nav-franchise a .franchise-name { display: none; }
}
/* Medium: drop brand tag, compact wallet */
@media (max-width: 780px) {
  .arcade-bar h1 a { font-size: 1.4rem; }
  .arcade-bar h1 .arcade-tag { display: none; }
  .arcade-nav-main a span.nav-label { display: none; }
  .arcade-nav-main a .nav-icon { font-size: 1rem; }
  .arcade-nav-main a { padding: 0.45rem 0.65rem; }
  .arcade-wallet-hud { font-size: 0.72rem; padding: 0.3rem 0.55rem; }
}
/* Small: icon-only main nav, franchise chips on second row */
@media (max-width: 560px) {
  .arcade-bar {
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .arcade-bar h1 a { font-size: 1.2rem; }
  .arcade-bar h1 a::before { display: none; }
  .arcade-nav-franchise {
    order: 10;
    width: 100%;
    justify-content: center;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  .zone-divider { display: none; }
  .arcade-wallet-hud { font-size: 0.7rem; gap: 0.35rem; padding: 0.25rem 0.5rem; }
  .arcade-wallet-hud .hud-chip .value { min-width: 1ch; }
}
/* Very small: compact further */
@media (max-width: 400px) {
  .arcade-bar h1 a span:not(.arcade-tag) { display: none; }
  .arcade-bar h1 a::before { display: inline; font-size: 1.4rem; }
  .arcade-nav-main a { padding: 0.4rem 0.55rem; }
}
.arcade-bar .player-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.12em;
  transition: border-color 0.18s, color 0.18s, transform 0.08s;
  flex-shrink: 0;
}
.arcade-bar .player-chip:hover { border-color: var(--accent); color: var(--text-primary); }
.arcade-bar .player-chip:active { transform: scale(0.97); }
/* Avatar circle */
.arcade-bar .player-chip .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hud);
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--bg-primary);
  letter-spacing: 0;
  flex-shrink: 0;
  position: relative;
}
.arcade-bar .player-chip .avatar::after {
  /* Online status dot */
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-bright);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 4px var(--green-bright);
}
.arcade-bar .player-chip.offline .avatar::after { background: var(--text-muted); box-shadow: none; }
@media (max-width: 560px) {
  .arcade-bar .player-chip .name { display: none; }
  .arcade-bar .player-chip { padding: 0.25rem; }
}

/* ── Hub ── */
.arcade-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(1rem, 3vw, 1.5rem);
  text-align: center;
  position: relative;
}
.arcade-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(253,143,13,0.12), transparent 70%);
  pointer-events: none;
}
.arcade-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--yellow), var(--green-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(253,143,13,0.3));
  margin-bottom: 0.5rem;
  position: relative;
}
.arcade-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.arcade-stats {
  max-width: 1240px;
  margin: 0 auto 2rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(0.5rem, 2vw, 1rem);
}
.arcade-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.arcade-stat .label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.arcade-stat .value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.arcade-stat.credits .value { color: var(--blue); }
.arcade-stat.gold .value { color: var(--yellow); }
.arcade-stat.rank .value { color: var(--accent); }
.arcade-stat.best .value { color: var(--green-bright); }

/* ── Game gallery ── */
.arcade-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
}

.game-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.25s;
}
.game-card:hover { transform: translateY(-2px); background: var(--bg-card-hover); text-decoration: none; color: var(--text-primary); }
.game-card:hover::before { background: linear-gradient(135deg, var(--accent), var(--green-bright)); }

.game-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.game-card .franchise-badge {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.franchise-badge.f-nl2 { color: #FD8F0D; border-color: rgba(253,143,13,0.4); background: rgba(253,143,13,0.1); }
.franchise-badge.f-oo  { color: #9acd32; border-color: rgba(154,205,50,0.4); background: rgba(154,205,50,0.1); }
.franchise-badge.f-am  { color: #fb923c; border-color: rgba(251,146,60,0.4); background: rgba(251,146,60,0.1); }

.game-card .game-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.game-card.shift .game-icon { background: rgba(0,230,118,0.12); border-color: rgba(0,230,118,0.35); color: var(--green-bright); }
.game-card.launch .game-icon { background: rgba(255,215,64,0.12); border-color: rgba(255,215,64,0.35); color: var(--yellow); }
.game-card.burnout .game-icon { background: rgba(255,23,68,0.12); border-color: rgba(255,23,68,0.35); color: var(--red); }
.game-card.dyno .game-icon { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); color: var(--blue); }
.game-card.nitrous .game-icon { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.35); color: var(--purple); }
.game-card.mudbog .game-icon    { background: rgba(154,205,50,0.12); border-color: rgba(154,205,50,0.35); color: #9acd32; }
.game-card.winch .game-icon     { background: rgba(132,169,89,0.12); border-color: rgba(132,169,89,0.4); color: #b4d27a; }
.game-card.hillclimb .game-icon { background: rgba(184,216,117,0.12); border-color: rgba(184,216,117,0.4); color: #b8d875; }
.game-card.traildash .game-icon { background: rgba(122,168,88,0.12); border-color: rgba(122,168,88,0.4); color: #7aa858; }
.game-card.bullseye .game-icon  { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.4); color: #f97316; }
.game-card.steady .game-icon    { background: rgba(251,146,60,0.12); border-color: rgba(251,146,60,0.4); color: #fb923c; }
.game-card.duckhunt .game-icon  { background: rgba(253,186,116,0.12); border-color: rgba(253,186,116,0.4); color: #fdba74; }
.game-card.trapshoot .game-icon { background: rgba(252,211,77,0.12); border-color: rgba(252,211,77,0.4); color: #fcd34d; }

/* ── Franchise filter tabs ── */
.franchise-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
@media (max-width: 560px) {
  .franchise-filter { gap: 0.35rem; }
  .franchise-tab { padding: 0.4rem 0.65rem; font-size: 0.66rem; letter-spacing: 0.1em; }
  .franchise-tab .count { padding: 0.08rem 0.25rem; font-size: 0.58rem; }
}
.franchise-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.franchise-tab:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.franchise-tab.active { color: var(--text-primary); border-color: currentColor; }
.franchise-tab[data-franchise="all"].active { color: var(--accent); }
.franchise-tab[data-franchise="nl2"].active { color: #FD8F0D; background: rgba(253,143,13,0.1); }
.franchise-tab[data-franchise="oo"].active  { color: #9acd32; background: rgba(154,205,50,0.1); }
.franchise-tab[data-franchise="am"].active  { color: #fb923c; background: rgba(251,146,60,0.1); }
.franchise-tab .count {
  font-size: 0.62rem;
  opacity: 0.7;
  padding: 0.1rem 0.35rem;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-primary);
}
.game-card .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}
.game-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.game-card .meta .best {
  font-family: var(--font-hud);
  font-weight: 700;
  color: var(--green-bright);
  letter-spacing: 0.08em;
}
.game-card .meta .best.none { color: var(--text-muted); }
.game-card .play-cta {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.2em;
}

/* ── Leaderboard panels ── */
.leaderboard-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
}
.leaderboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.leaderboard h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.leaderboard h3 .game-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.leaderboard .caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.leaderboard table { width: 100%; border-collapse: collapse; }
.leaderboard th {
  font-size: 0.68rem;
  text-align: left;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.leaderboard th.num, .leaderboard td.num { text-align: right; }
.leaderboard td {
  padding: 0.5rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(35,35,46,0.5);
}
.leaderboard tr:last-child td { border-bottom: none; }
.leaderboard td.rank {
  width: 1.5rem;
  font-family: var(--font-hud);
  color: var(--text-muted);
  font-weight: 700;
}
.leaderboard tr.top-1 td.rank { color: var(--yellow); text-shadow: 0 0 8px rgba(255,215,64,0.4); }
.leaderboard tr.top-2 td.rank { color: #c0c0c0; }
.leaderboard tr.top-3 td.rank { color: #cd7f32; }
.leaderboard tr.me { background: rgba(253,143,13,0.08); }
.leaderboard tr.me td.name { color: var(--accent); font-weight: 700; }
.leaderboard td.name { font-weight: 600; }
.leaderboard td.score { font-family: var(--font-hud); font-weight: 700; color: var(--green-bright); }
.leaderboard td.grade {
  font-family: var(--font-hud);
  font-weight: 900;
  text-align: center;
  width: 2rem;
}
.leaderboard .empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.leaderboard .footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.leaderboard .footer a { font-family: var(--font-hud); font-weight: 700; letter-spacing: 0.1em; font-size: 0.7rem; }

/* ── Section headers for hub ── */
.arcade-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.arcade-section-title .count {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* ── Game screen frame ── */
.game-frame {
  width: 100%;
  min-height: calc(100vh - 60px);
  background: radial-gradient(ellipse at 50% 120%, #1a1a2e 0%, var(--bg-primary) 70%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-hud-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 60;
}
.game-hud-back:hover { color: var(--accent); border-color: var(--accent-border); text-decoration: none; }

/* Shared scanline overlay */
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
  pointer-events: none;
  z-index: 50;
}

/* ── Common game UI ── */
.game-screen { display: none; width: 100%; height: 100%; position: absolute; inset: 0; }
.game-screen.active { display: flex; }

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

.game-title-big {
  font-family: var(--font-hud);
  font-size: clamp(22px, 5.5vw, 48px);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--red), var(--accent), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,23,68,0.3));
  text-transform: uppercase;
  padding: 0 16px;
  text-align: center;
}
.game-subtitle {
  font-size: clamp(11px, 2.5vw, 16px);
  color: var(--text-muted);
  letter-spacing: 3px;
  max-width: 500px;
  padding: 0 16px;
  text-align: center;
  font-style: italic;
}
.game-instructions {
  max-width: 440px;
  font-size: clamp(11px, 2.5vw, 14px);
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  padding: 0 16px;
}
.game-instructions .hl { color: var(--green-bright); font-weight: 700; }
.game-instructions .hl-y { color: var(--yellow); font-weight: 700; }
.game-instructions .hl-r { color: var(--red); font-weight: 700; }

.btn-primary {
  margin-top: 16px;
  padding: 14px 48px;
  font-family: var(--font-hud);
  font-size: 18px;
  font-weight: 700;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--green-bright), #69f0ae);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 0 30px rgba(0,230,118,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 0 50px rgba(0,230,118,0.5); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  padding: 12px 40px;
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--blue), #82b1ff);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 3px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(59,130,246,0.3);
}
.btn-secondary:active { transform: scale(0.96); }

.btn-ghost {
  padding: 10px 28px;
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent-border); }

.result-grade {
  font-family: var(--font-hud);
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 900;
  line-height: 1;
}
.result-time {
  font-family: var(--font-hud);
  font-size: clamp(14px, 3vw, 22px);
  color: var(--text-muted);
  letter-spacing: 2px;
}
.result-score {
  font-family: var(--font-hud);
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 900;
  color: var(--green-bright);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0,230,118,0.3);
}
.result-new-best {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  color: var(--yellow);
  letter-spacing: 0.3em;
  text-shadow: 0 0 12px rgba(255,215,64,0.4);
  animation: pulse-best 1.2s ease-in-out infinite;
}
@keyframes pulse-best { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.rewards-box { display: flex; gap: 24px; margin: 8px 0; }
.reward-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.reward-icon { font-size: 28px; }
.reward-amount {
  font-family: var(--font-hud);
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
}
.reward-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.credits-color { color: var(--blue); }
.gold-color { color: var(--yellow); }

/* ── Connection loading / error states ── */
.connection-veil {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, var(--bg-primary) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 1;
  transition: opacity 0.35s;
}
.connection-veil.hidden { opacity: 0; pointer-events: none; }
.connection-veil .veil-inner {
  text-align: center;
  padding: 1.5rem;
  max-width: 420px;
}
.connection-veil h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.connection-veil p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.connection-veil .spinner {
  width: 52px; height: 52px;
  margin: 1.25rem auto 0;
  border: 3px solid rgba(253,143,13,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: veil-spin 0.9s linear infinite;
}
@keyframes veil-spin { to { transform: rotate(360deg); } }
.connection-veil.error .spinner { display: none; }
.connection-veil.error h3 { color: var(--red); }
.connection-veil.error .retry-btn {
  margin-top: 1rem;
  padding: 12px 32px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ── Bonus spin modal ── */
.spin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
  padding: 1rem;
}
.spin-modal.active { opacity: 1; }
.spin-inner {
  background: var(--bg-card);
  border: 2px solid var(--accent-border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem 1.25rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 80px rgba(253,143,13,0.25);
}
.spin-title {
  font-family: var(--font-hud);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 900;
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, var(--yellow), var(--accent), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.3rem;
}
.spin-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.spin-wheel-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 1rem;
}
.spin-canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: block;
  filter: drop-shadow(0 0 20px rgba(0,0,0,0.4));
}
.spin-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--yellow);
  filter: drop-shadow(0 0 8px rgba(255,215,64,0.8));
  z-index: 2;
  pointer-events: none;
}
.spin-btn {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  background: radial-gradient(circle at 35% 35%, #fbbf24 0%, #b45309 90%);
  color: #1a1a0e;
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(255,215,64,0.4), inset 0 2px 6px rgba(255,255,255,0.3);
  z-index: 3;
  transition: transform 0.1s;
}
.spin-btn:hover { transform: translate(-50%, -50%) scale(1.05); }
.spin-btn:active { transform: translate(-50%, -50%) scale(0.95); }

.spin-result { min-height: 3.5rem; margin-bottom: 0.75rem; }
.spin-outcome {
  padding: 0.8rem 1rem;
  background: rgba(0,230,118,0.1);
  border: 1px solid rgba(0,230,118,0.35);
  border-radius: 8px;
  animation: result-pop 0.4s ease-out;
}
.spin-outcome .label {
  font-family: var(--font-hud);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--green-bright);
  margin-bottom: 0.15rem;
}
.spin-outcome .desc { font-size: 0.88rem; color: var(--text-secondary); }
.spin-outcome.bust {
  background: rgba(107,114,128,0.1);
  border-color: rgba(107,114,128,0.35);
}
.spin-outcome.bust .label { color: var(--text-muted); }
.spin-outcome.jackpot {
  background: linear-gradient(135deg, rgba(255,23,68,0.15), rgba(255,215,64,0.18));
  border-color: var(--yellow);
  animation: result-pop 0.4s ease-out, jackpot-pulse 1.5s ease-in-out infinite 0.4s;
}
.spin-outcome.jackpot .label {
  background: linear-gradient(135deg, var(--red), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes result-pop {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes jackpot-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,215,64,0.4); }
  50%      { box-shadow: 0 0 40px rgba(255,23,68,0.5); }
}
.spin-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* "Spin for bonus" button that appears on result screens */
.btn-spin {
  margin-top: 4px;
  padding: 14px 40px;
  font-family: var(--font-hud);
  font-size: 16px;
  font-weight: 900;
  color: #1a1a0e;
  background: linear-gradient(135deg, var(--yellow), var(--accent), var(--red));
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  box-shadow: 0 0 30px rgba(255,215,64,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  animation: spin-button-glow 2s ease-in-out infinite;
}
.btn-spin:hover { transform: scale(1.04); }
.btn-spin:active { transform: scale(0.96); }
.btn-spin:disabled { opacity: 0.3; cursor: not-allowed; animation: none; }
@keyframes spin-button-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,215,64,0.3), inset 0 1px 0 rgba(255,255,255,0.3); }
  50%      { box-shadow: 0 0 40px rgba(255,23,68,0.4), inset 0 1px 0 rgba(255,255,255,0.3); }
}

/* ── Name prompt modal ── */
.name-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.25s ease;
}
.name-modal.active { display: flex; }
.name-modal .modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 0 60px rgba(253,143,13,0.2);
}
.name-modal h4 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--accent);
}
.name-modal p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.name-modal input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-hud);
  font-size: 1.1rem;
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  outline: none;
  margin-bottom: 1rem;
}
.name-modal input:focus { border-color: var(--accent); }
.name-modal .modal-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ============================================================================
   UX extras — profile modal, hub rails, favorites, in-game help, mobile fixes
   Appended 2026-04-19 by arcade-ux.js
   ============================================================================ */

/* ── Mobile-safe top bar ──────────────────────────────────────────────────
   The bar stays sticky at top: 0; boost z-index so nothing overlays it, and
   wrap its pills so the HOME / TROPHIES / PROFILE row always fits. */
.arcade-bar {
  z-index: 999;
  flex-wrap: wrap;
  row-gap: 0.4rem;
}
@media (max-width: 640px) {
  .arcade-bar {
    padding: 0.55rem 0.75rem;
    min-height: 52px;
  }
  .arcade-bar .arcade-nav-main,
  .arcade-bar .arcade-nav-franchise {
    gap: 0.35rem;
  }
}

/* Profile nav pill mirrors HUB/TROPHIES but with a purple-ish accent */
.arcade-nav-main .nav-profile {
  color: #c084fc;
  border-color: rgba(192,132,252,0.35);
  background: rgba(192,132,252,0.06);
}
.arcade-nav-main .nav-profile:hover {
  color: #d8b4fe;
  border-color: rgba(192,132,252,0.6);
  background: rgba(192,132,252,0.14);
}

/* ── Hub rails ─────────────────────────────────────────────────────────── */
.hub-rails {
  max-width: 1240px;
  margin: 0 auto clamp(1rem, 3vw, 1.75rem);
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2.5vw, 1.5rem);
}
.hub-greeting {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  padding: 0.25rem 0;
}
.hub-rail {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(0.75rem, 2vw, 1.1rem) clamp(0.9rem, 2.5vw, 1.25rem);
}
.hub-rail-head {
  display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.6rem; flex-wrap: wrap;
}
.hub-rail-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--text-primary);
}
.hub-rail-sub {
  font-family: var(--font-hud);
  font-size: 0.7rem; letter-spacing: 0.15em;
  color: var(--text-muted);
}
.hub-rail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
}
.hub-empty {
  padding: 0.8rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Continue — big feature card */
.hub-continue-card {
  display: flex; gap: clamp(0.75rem, 2vw, 1.1rem);
  padding: clamp(0.8rem, 2vw, 1.1rem);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(253,143,13,0.08), rgba(253,143,13,0.02));
  border: 1px solid rgba(253,143,13,0.25);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.hub-continue-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.hub-continue-card .icon {
  width: clamp(44px, 9vw, 64px); height: clamp(44px, 9vw, 64px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: clamp(22px, 5vw, 32px);
  flex-shrink: 0;
}
.hub-continue-card .body { flex: 1; min-width: 0; }
.hub-continue-card .name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.hub-continue-card .sub {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hub-continue-card .meta {
  margin-top: 0.5rem; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-hud); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--text-muted);
}
.hub-continue-card .cta { color: var(--accent); font-weight: 700; }

/* Mini cards for Favorites / New rails */
.hub-mini {
  position: relative;
  display: flex; flex-direction: column;
  gap: 0.4rem;
  padding: clamp(0.6rem, 1.6vw, 0.85rem);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.hub-mini:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(253,143,13,0.04);
}
.hub-mini-ico {
  font-size: clamp(22px, 4.5vw, 28px);
  color: var(--accent);
  line-height: 1;
}
.hub-mini-nm {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.hub-mini-meta {
  font-family: var(--font-hud); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.2rem;
}
.hub-mini-meta .cta { color: var(--accent); font-weight: 700; }
.hub-mini-fav {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 28px; height: 28px;
  color: var(--text-muted);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
  padding: 0;
}
.hub-mini-fav:hover { color: var(--yellow); border-color: var(--yellow); }
.hub-mini-fav.on { color: var(--yellow); border-color: var(--yellow); background: rgba(234,179,8,0.1); }

/* Favorite star on the full gallery cards */
.game-card { position: relative; }
.game-card-fav {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 30px; height: 30px;
  color: var(--text-muted);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  transition: color .12s ease, border-color .12s ease, background .12s ease, transform .12s ease;
}
.game-card-fav:hover { color: var(--yellow); border-color: var(--yellow); transform: scale(1.08); }
.game-card-fav.on { color: var(--yellow); border-color: var(--yellow); background: rgba(234,179,8,0.12); }

/* ── Profile modal ─────────────────────────────────────────────────────── */
.profile-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem);
}
.profile-modal.active { display: flex; animation: fadeIn 0.18s ease; }
.profile-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  font-family: var(--font-body, system-ui, sans-serif);
}
.profile-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: clamp(0.9rem, 2.5vw, 1.25rem);
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(253,143,13,0.2), rgba(253,143,13,0.08));
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hud); font-weight: 900;
  font-size: 1.1rem; letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
}
.profile-titles { flex: 1; min-width: 0; }
.profile-eyebrow {
  font-family: var(--font-hud); font-size: 0.65rem; letter-spacing: 0.22em;
  color: var(--text-muted); margin-bottom: 0.15rem;
}
.profile-name {
  font-family: var(--font-display); font-size: clamp(1.1rem, 3vw, 1.4rem);
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis;
}
.profile-uid {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem; color: var(--text-muted); opacity: 0.7;
  margin-top: 0.15rem;
}
.profile-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 26px; cursor: pointer;
  padding: 0 6px; line-height: 1;
  align-self: flex-start;
}
.profile-close:hover { color: var(--text-primary); }

.profile-tabs {
  display: flex; gap: 2px;
  background: rgba(255,255,255,0.02);
  padding: 0.3rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.profile-tab {
  flex: 1; min-width: fit-content;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-hud); font-size: 0.72rem;
  letter-spacing: 0.15em; font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  transition: color .12s ease, background .12s ease;
}
.profile-tab:hover { color: var(--text-secondary); }
.profile-tab.active {
  color: var(--accent);
  background: rgba(253,143,13,0.08);
}
.profile-panels { padding: clamp(0.9rem, 2.5vw, 1.25rem); }
.profile-panel { display: none; }
.profile-panel.active { display: block; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.profile-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.profile-stat .label {
  display: block;
  font-family: var(--font-hud); font-size: 0.6rem; letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.profile-stat .value {
  font-family: var(--font-display); font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.profile-stat.credits .value { color: var(--blue); }
.profile-stat.gold .value { color: var(--yellow); }
.profile-stat.best .value { color: var(--green-bright); }
.profile-stat.rank .value { color: var(--accent); }

.profile-block-title {
  font-family: var(--font-hud); font-size: 0.72rem; letter-spacing: 0.18em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.profile-mini-card {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: rgba(253,143,13,0.06);
  border: 1px solid rgba(253,143,13,0.25);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}
.profile-mini-card:hover { border-color: var(--accent); background: rgba(253,143,13,0.1); }
.profile-mini-card .ico { font-size: 1.25rem; }
.profile-mini-card .nm {
  flex: 1;
  font-family: var(--font-display); letter-spacing: 0.02em;
  color: var(--text-primary);
}
.profile-mini-card .cta {
  font-family: var(--font-hud); font-size: 0.7rem; letter-spacing: 0.15em;
  color: var(--accent); font-weight: 700;
}
.profile-block { margin-bottom: 1rem; }

.profile-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem;
}
.profile-actions button {
  flex: 1 1 auto;
  min-width: fit-content;
}

.profile-stats-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.profile-stats-table th {
  text-align: left;
  font-family: var(--font-hud); font-size: 0.62rem; letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.profile-stats-table th.num, .profile-stats-table td.num { text-align: right; }
.profile-stats-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(35,35,46,0.4);
}
.profile-stats-table td a { text-decoration: none; }
.profile-stats-table tr:last-child td { border-bottom: none; }

.profile-fav-list {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.profile-fav-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.profile-fav-row .nm { flex: 1; text-decoration: none; }
.profile-fav-row .unpin { padding: 0.3rem 0.7rem; font-size: 0.7rem; }
.profile-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
}
.profile-pin-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s ease, background .12s ease;
}
.profile-pin-btn:hover { border-color: var(--yellow); background: rgba(234,179,8,0.06); }
.profile-pin-btn .ico { font-size: 1.1rem; }
.profile-pin-btn .nm { font-family: var(--font-display); font-size: 0.88rem; }
.profile-pin-btn .cta {
  font-family: var(--font-hud); font-size: 0.62rem; letter-spacing: 0.15em;
  color: var(--yellow); font-weight: 700;
}
.profile-hint {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5;
}
.profile-edit-current {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0.75rem 0;
}
.profile-edit-current .label {
  font-family: var(--font-hud); font-size: 0.62rem; letter-spacing: 0.2em;
  color: var(--text-muted);
}
.profile-edit-current .value {
  font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.04em;
  color: var(--accent);
}
.profile-edit-form .label {
  display: block;
  font-family: var(--font-hud); font-size: 0.65rem; letter-spacing: 0.2em;
  color: var(--text-muted); margin-bottom: 0.35rem;
}
.profile-edit-form input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-hud); font-size: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  outline: none;
}
.profile-edit-form input:focus { border-color: var(--accent); }
.profile-edit-status {
  min-height: 18px;
  font-family: var(--font-hud); font-size: 0.74rem; letter-spacing: 0.08em;
  margin-top: 0.35rem;
}
.profile-edit-status.ok  { color: var(--green-bright); }
.profile-edit-status.err { color: var(--red); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── In-game help + back buttons ──────────────────────────────────────── */
.ingame-help-btn, .ingame-back-btn {
  position: fixed;
  z-index: 998;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  background: rgba(10,10,14,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-hud); font-size: 0.72rem; letter-spacing: 0.14em; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.ingame-help-btn { bottom: 16px; right: 16px; }
.ingame-back-btn { bottom: 16px; left: 16px; display: none; }
.ingame-help-btn:hover, .ingame-back-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(253,143,13,0.12);
}
.ingame-help-btn .label, .ingame-back-btn .label {
  line-height: 1;
}
@media (max-width: 640px) {
  .ingame-back-btn { display: inline-flex; }
  .ingame-help-btn { padding: 0.4rem 0.65rem; }
  .ingame-help-btn .label,
  .ingame-back-btn .label { display: none; }
  .ingame-help-btn span[aria-hidden], .ingame-back-btn span[aria-hidden] { font-size: 18px; }
}

.ingame-help-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem);
}
.ingame-help-modal.active { display: flex; animation: fadeIn 0.18s ease; }
.ingame-help-modal .help-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  padding: clamp(0.9rem, 2.5vw, 1.25rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ingame-help-modal .help-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.75rem;
}
.ingame-help-modal .help-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}
.ingame-help-modal .help-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 24px; cursor: pointer;
  padding: 0 4px; line-height: 1;
}
.ingame-help-modal .help-body {
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.92rem;
}
.ingame-help-modal .help-body .game-instructions {
  padding: 0; background: none; border: none;
}
.ingame-help-modal .help-actions {
  margin-top: 1rem;
  display: flex; justify-content: flex-end;
}

/* ============================================================================
   v1.0.1 bugfixes — playing-mode nav hide, scrollable result, mobile space
   ============================================================================ */

/* Hide the arcade-bar + breadcrumb while a game is actively running.
   The game-frame expands to the full viewport so small phones can see the
   whole play area. HELP and ARCADE floating buttons stay visible so the
   player still has one-tap escape + help access. */
body.arcade-playing .arcade-bar,
body.arcade-playing .nav-breadcrumb {
  display: none !important;
}
body.arcade-playing .game-frame {
  min-height: 100vh;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height — handles iOS address bar */
}

/* Result screen MUST be scrollable on mobile — multiple games overflow
   the viewport with grade + score + breakdown + 4 action buttons + bonus
   spin. Before this fix, SHARE RUN / ARCADE got clipped below the fold on
   small phones. Top-align + internal overflow keeps everything reachable. */
#result-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#result-screen.active {
  justify-content: flex-start !important;
  padding: clamp(1rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1.5rem) clamp(2rem, 6vw, 3rem) !important;
}
/* Give the result-screen's button rows a bit of breathing room on phones
   so the 4 CTAs (RETRY / SPIN / ARCADE / SHARE) don't bunch up against
   each other or get clipped by the bottom edge of the viewport */
#result-screen .btn-primary,
#result-screen .btn-secondary,
#result-screen .btn-ghost,
#result-screen .btn-spin,
#result-screen .btn-share {
  min-width: 120px;
}

/* Start screen also scrollable — on very small phones (iPhone SE class) the
   hero tagline + subtitle + instructions + RACE button can exceed viewport. */
#start-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#start-screen.active {
  justify-content: flex-start !important;
  padding: clamp(1rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1.5rem) clamp(2rem, 6vw, 3rem) !important;
}

/* When the top nav is hidden during gameplay, the ← ARCADE button must
   show on all viewports (not just mobile) so desktop players still have
   an escape hatch. Same for HELP — keep it visible. */
body.arcade-playing .ingame-back-btn {
  display: inline-flex;
}

/* ============ Shop page ============ */
/* Dedicated styling for /store.html. Card states: can-afford, too-expensive,
   locked (Prestige/Mythic only), owned. Cards live inside responsive grids
   that collapse from 3–4 columns → 2 → 1 as the viewport narrows. */

.shop-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1rem, 4vw, 2rem) 1rem;
  text-align: center;
}
.shop-hero .shop-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(135deg, #FD8F0D 0%, #FFD700 60%, #00e676 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(253,143,13,0.35));
  margin-bottom: 0.5rem;
}
.shop-hero .shop-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto 1.15rem;
  line-height: 1.5;
}

.shop-hero .wallet-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(19,19,25,0.7);
  font-family: var(--font-hud);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}
.shop-hero .wallet-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
.shop-hero .wallet-chip .icon { font-size: 1rem; }
.shop-hero .wallet-chip strong {
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.06em;
}
.shop-hero .wallet-credits strong { color: var(--yellow); }
.shop-hero .wallet-gold strong    { color: var(--accent); }
.shop-hero .wallet-sep { color: var(--text-muted); }

/* ── Content + rails ── */
.shop-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}
.shop-rail {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.shop-rail[hidden] { display: none; }

.shop-rail-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.shop-rail-title .rail-label {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.shop-rail-title .rail-caption {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.shop-rail.featured-rail .shop-rail-title .rail-label {
  background: linear-gradient(90deg, #ff00d9, #c084fc, #ff00d9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(255,0,217,0.25));
}
.shop-rail.legacy-rail .shop-rail-title .rail-label {
  background: linear-gradient(90deg, #FD8F0D, #FFD700, #ff00cc, #00d9ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.shop-rail-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(19,19,25,0.5);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ── Grids ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(0.6rem, 1.6vw, 1rem);
}
.shop-grid-featured,
.shop-grid-legacy {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
@media (max-width: 600px) {
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .shop-grid-featured,
  .shop-grid-legacy { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ── Skin groups — per-game subsections ── */
.shop-skin-group { margin-bottom: 1.25rem; }
.shop-skin-group:last-child { margin-bottom: 0; }
.shop-skin-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-hud);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.55rem;
  padding-left: 0.1rem;
}
.shop-skin-group-title .dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex-shrink: 0;
}

/* ── Card base ── */
.shop-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.shop-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  transition: background 0.2s ease;
}
.shop-card.can-afford:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(253,143,13,0.35);
}

/* Card top row: rarity badge + optional game tag */
.shop-card .shop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  min-height: 1.1rem;
}

/* Rarity badge */
.shop-card .rarity-badge {
  font-family: var(--font-hud);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Per-rarity color tokens on both the top bar and badge */
.shop-card.rarity-common::before       { background: #b0b0b0; }
.shop-card.rarity-rare::before         { background: #4a9eff; }
.shop-card.rarity-epic::before         { background: #c084fc; }
.shop-card.rarity-legendary::before    { background: #fbbf24; }
.shop-card.rarity-mythic_drops::before { background: #ff00d9; }
.shop-card.rarity-prestige::before     { background: linear-gradient(135deg,#FD8F0D,#FFD700); }
.shop-card.rarity-mythic::before       { background: linear-gradient(90deg,#ff00cc,#00d9ff,#ffd700,#ff00cc); }

.rarity-badge.rarity-common       { color: #d0d0d0; border-color: rgba(176,176,176,0.35); background: rgba(176,176,176,0.08); }
.rarity-badge.rarity-rare         { color: #87c4ff; border-color: rgba(74,158,255,0.4);  background: rgba(74,158,255,0.12); }
.rarity-badge.rarity-epic         { color: #e0bbfc; border-color: rgba(192,132,252,0.4); background: rgba(192,132,252,0.12); }
.rarity-badge.rarity-legendary    { color: #fcd34d; border-color: rgba(251,191,36,0.4);  background: rgba(251,191,36,0.12); }
.rarity-badge.rarity-mythic_drops {
  color: #fff;
  border-color: rgba(255,0,217,0.5);
  background: linear-gradient(135deg, rgba(255,0,217,0.25), rgba(192,132,252,0.2));
  text-shadow: 0 0 6px rgba(255,0,217,0.6);
}
.rarity-badge.rarity-prestige {
  color: #1a0f00;
  border-color: rgba(253,143,13,0.7);
  background: linear-gradient(135deg,#FD8F0D,#FFD700);
  font-weight: 900;
  text-shadow: none;
}
.rarity-badge.rarity-mythic {
  color: #0b0014;
  border-color: transparent;
  background: linear-gradient(90deg,#ff00cc,#00d9ff,#ffd700,#ff00cc);
  background-size: 200% 100%;
  font-weight: 900;
  animation: shop-mythic-shimmer 4s linear infinite;
}
@keyframes shop-mythic-shimmer {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Game tag chip on skin cards */
.shop-card .shop-game-tag {
  font-family: var(--font-hud);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--tag-color, var(--accent));
  border: 1px solid currentColor;
  background: rgba(255,255,255,0.02);
  opacity: 0.85;
  white-space: nowrap;
}

/* Icon / preview block */
.shop-card .shop-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 6vw, 2.8rem);
  width: clamp(54px, 14vw, 72px);
  height: clamp(54px, 14vw, 72px);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  line-height: 1;
}
.shop-card.shop-card-big .shop-card-icon {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  width: clamp(68px, 16vw, 88px);
  height: clamp(68px, 16vw, 88px);
}

/* Name-color HANDLE preview swatch */
.shop-card .name-swatch {
  font-family: var(--font-hud);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.3rem;
}

/* Card name / price */
.shop-card .shop-card-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}
.shop-card.shop-card-big .shop-card-name { font-size: 1.2rem; }

.shop-card .shop-card-price {
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.shop-card .price-credits { color: var(--yellow); }
.shop-card .price-gold    { color: var(--accent); }
.shop-card .price-sep     { color: var(--text-muted); padding: 0 0.1rem; }
.shop-card .price-free    { color: var(--green-bright); }

/* Actions / bottom row */
.shop-card .shop-card-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 0.25rem;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.shop-card .shop-btn {
  appearance: none;
  border: none;
  font-family: var(--font-hud);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-transform: uppercase;
  transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
  text-align: center;
}
.shop-card .shop-btn:disabled { opacity: 0.6; cursor: wait; }
.shop-card .shop-btn-buy {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #1a0f00;
}
.shop-card .shop-btn-buy:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent-hover), #ffb24d);
}
.shop-card .shop-btn-equip {
  background: rgba(0,230,118,0.12);
  color: var(--green-bright);
  border: 1px solid rgba(0,230,118,0.35);
}
.shop-card .shop-btn-equip:hover:not(:disabled) {
  background: rgba(0,230,118,0.22);
}
.shop-card .equipped-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: var(--font-hud);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  background: rgba(0,230,118,0.18);
  color: var(--green-bright);
  border: 1px solid rgba(0,230,118,0.45);
}

/* Shortfall inline label (too-expensive state) */
.shop-card .shop-shortfall {
  font-family: var(--font-hud);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  padding: 0.5rem 0.4rem;
  border-radius: 6px;
  background: rgba(255,23,68,0.08);
  border: 1px solid rgba(255,23,68,0.25);
  width: 100%;
  text-align: center;
}

/* Progress bar for locked Prestige / Mythic cards */
.shop-card .shop-progress { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
.shop-card .shop-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.shop-card .shop-progress-bar .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,#FD8F0D,#FFD700);
  transition: width 0.4s ease;
}
.shop-card.rarity-mythic .shop-progress-bar .fill {
  background: linear-gradient(90deg,#ff00cc,#00d9ff,#ffd700);
}
.shop-card .shop-progress-label {
  font-family: var(--font-hud);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-align: center;
}

/* Owned corner checkmark */
.shop-card .owned-check {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,230,118,0.15);
  border: 1px solid rgba(0,230,118,0.45);
  color: var(--green-bright);
  font-size: 0.75rem;
  font-weight: 900;
}
.shop-card .owned-check.equipped {
  background: var(--green-bright);
  color: #071a0f;
  border-color: var(--green-bright);
  box-shadow: 0 0 10px rgba(0,230,118,0.55);
}

/* Card state variants */
.shop-card.can-afford {
  border-color: rgba(253,143,13,0.3);
}
.shop-card.too-expensive {
  opacity: 0.65;
  filter: saturate(0.7);
}
.shop-card.too-expensive:hover {
  opacity: 0.85;
}
.shop-card.locked {
  opacity: 0.78;
  background: linear-gradient(180deg, var(--bg-card) 70%, rgba(253,143,13,0.06) 100%);
  border-color: rgba(253,143,13,0.2);
}
.shop-card.locked.rarity-mythic {
  background: linear-gradient(180deg, var(--bg-card) 70%, rgba(255,0,217,0.08) 100%);
  border-color: rgba(255,0,217,0.25);
}
.shop-card.owned {
  border-color: rgba(0,230,118,0.35);
  background: linear-gradient(180deg, var(--bg-card) 80%, rgba(0,230,118,0.06) 100%);
}

/* Big cards (featured + legacy) lean a bit taller and give the icon more air */
.shop-card.shop-card-big {
  padding: 1.1rem 1rem 1rem;
  gap: 0.7rem;
}
.shop-card.shop-card-big .rarity-badge { font-size: 0.62rem; }

/* ── Toast ── */
.shop-toast {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 4vw, 2rem);
  transform: translateX(-50%) translateY(120%);
  min-width: 220px;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-hud);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.shop-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.shop-toast.success { border-color: rgba(0,230,118,0.45); color: var(--green-bright); }
.shop-toast.error   { border-color: rgba(255,23,68,0.45);  color: var(--red); }

/* ── Small-screen tweaks ── */
@media (max-width: 480px) {
  .shop-hero .wallet-summary { font-size: 0.76rem; padding: 0.5rem 0.85rem; }
  .shop-rail-title { padding-bottom: 0.35rem; }
  .shop-rail-title .rail-label { font-size: 1.3rem; }
  .shop-card { padding: 0.85rem 0.75rem 0.8rem; gap: 0.45rem; }
  .shop-card .shop-card-name { font-size: 0.95rem; }
  .shop-card .shop-btn,
  .shop-card .equipped-label { padding: 0.5rem 0.7rem; font-size: 0.7rem; letter-spacing: 0.15em; }
}

/* ============================================================================
   Profile CUSTOMIZE tab — equip switcher for owned avatars, colors, skins
   ============================================================================ */

.customize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.customize-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.7rem 0.6rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.customize-item:hover {
  border-color: var(--accent);
  background: rgba(253,143,13,0.06);
  transform: translateY(-1px);
}
.customize-item.equipped {
  border-color: var(--green-bright);
  background: rgba(0,230,118,0.06);
}
.customize-item .ci-ico {
  font-size: 1.5rem;
  line-height: 1;
}
.customize-item .ci-nm {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.customize-item .ci-status {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.customize-item.equipped .ci-status {
  color: var(--green-bright);
}

/* ============================================================================
   SHOP nav pill — sits in .arcade-nav-main with HOME / TROPHIES
   ============================================================================ */
.arcade-nav-main .nav-shop {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.06);
}
.arcade-nav-main .nav-shop:hover {
  color: #fcd34d;
  border-color: rgba(251,191,36,0.7);
  background: rgba(251,191,36,0.14);
}
.arcade-nav-main .nav-shop.active {
  color: #fbbf24;
  background: rgba(251,191,36,0.16);
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251,191,36,0.25), inset 0 0 8px rgba(251,191,36,0.1);
}

/* ============================================================================
   Prestige / Mythic unlock banner (hub)
   Appears above the hub rails for 24h (Prestige) / 7 days (Mythic) after
   someone hits the milestone. Reads from /events/prestige.
   ============================================================================ */
.prestige-banner {
  max-width: 1240px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 10px;
  font-family: var(--font-hud, system-ui, sans-serif);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  animation: prestigeIn 0.5s ease;
}
.prestige-banner.prestige {
  background: linear-gradient(90deg, rgba(253,143,13,0.12), rgba(255,215,0,0.05));
  border: 1px solid rgba(253,143,13,0.5);
  color: var(--text-primary);
}
.prestige-banner.mythic {
  background: linear-gradient(90deg, rgba(255,0,204,0.1), rgba(0,217,255,0.1), rgba(255,215,0,0.1));
  border: 1px solid rgba(255,0,204,0.5);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}
.prestige-banner.mythic::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: mythicShimmer 3s linear infinite;
  pointer-events: none;
}
@keyframes prestigeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mythicShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.prestige-banner .pb-ico {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.6));
}
.prestige-banner .pb-text { flex: 1; }
.prestige-banner .pb-text strong {
  color: var(--text-primary);
  font-weight: 900;
  letter-spacing: 0.1em;
}
.prestige-banner .pb-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Gradient name rendering — handle text uses background-clip */
.bcg-grad-name {
  font-weight: inherit;
  display: inline;
}
