/* BlakCade — shared arcade styles. Mobile-first, dark neon. */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #08080f;
  --bg2: #10101e;
  --panel: #161628;
  --ink: #eef0ff;
  --dim: #8b8fb0;
  --neon: #00f0ff;
  --neon2: #ff2d78;
  --gold: #ffc832;
  --green: #3dff8a;
  --purple: #a36bff;
  --radius: 18px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
}

body.game-body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- game top bar ---------- */
.gbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(180deg, rgba(8,8,15,.95), rgba(8,8,15,.7));
  z-index: 5;
}
.gbar a.back {
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid #262642;
}
.gbar .gtitle {
  flex: 1;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 15px;
}
.gbar .coins {
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  background: var(--panel);
  border: 1px solid #262642;
  border-radius: 12px;
  padding: 7px 12px;
}

canvas#game {
  flex: 1;
  width: 100%;
  display: block;
  touch-action: none;
}

/* ---------- overlays ---------- */
.bc-overlay {
  position: fixed; inset: 0;
  background: rgba(5,5,12,.82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  animation: bcFade .25s ease;
}
@keyframes bcFade { from { opacity: 0; } to { opacity: 1; } }
.bc-panel {
  background: var(--panel);
  border: 1px solid #2a2a4a;
  border-radius: 24px;
  padding: 30px 26px;
  width: min(86vw, 340px);
  text-align: center;
  box-shadow: 0 0 60px rgba(0,240,255,.08);
  animation: bcPop .3s cubic-bezier(.2,1.6,.4,1);
}
@keyframes bcPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bc-panel h2 { font-size: 22px; letter-spacing: 3px; margin-bottom: 14px; }
.bc-best-glow { color: var(--gold); text-shadow: 0 0 18px rgba(255,200,50,.6); }
.bc-score-label { color: var(--dim); font-size: 12px; letter-spacing: 2px; }
.bc-score { font-size: 52px; font-weight: 900; line-height: 1.1; color: var(--neon); text-shadow: 0 0 24px rgba(0,240,255,.4); }
.bc-sub { color: var(--dim); font-size: 14px; margin: 8px 0 4px; }
.bc-coin-dot { color: var(--gold); }
.bc-extra { color: var(--ink); font-size: 14px; margin-top: 8px; opacity: .85; }
.bc-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 15px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
}
.bc-btn-primary { background: linear-gradient(135deg, var(--neon), #0090ff); color: #001018; }
.bc-btn-primary:active { transform: scale(.97); }
.bc-btn-ghost { background: transparent; border: 1px solid #33335a; color: var(--dim); }

.bc-toast {
  position: fixed;
  left: 50%; top: 18%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid #2e2e52;
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  z-index: 60;
  animation: bcPop .25s cubic-bezier(.2,1.6,.4,1);
  pointer-events: none;
  white-space: nowrap;
}
.bc-toast-out { opacity: 0; transition: opacity .4s; }

/* ---------- hub ---------- */
body.hub-body { min-height: 100%; overflow-y: auto; }
.hub-wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.hub-head {
  padding: max(26px, env(safe-area-inset-top)) 0 6px;
  text-align: center;
}
.hub-logo {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(90deg, var(--neon), var(--purple), var(--neon2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hub-tag { color: var(--dim); font-size: 12px; letter-spacing: 3px; margin-top: 4px; }
.hub-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 22px;
}
.hub-stat {
  background: var(--panel);
  border: 1px solid #24243f;
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.hub-stat .v { color: var(--gold); }
.hub-stat .flame { color: var(--neon2); }

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
@media (min-width: 480px) { .game-grid { grid-template-columns: 1fr 1fr 1fr; } }

.gcard {
  position: relative;
  border-radius: var(--radius);
  padding: 18px 14px 14px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease;
}
.gcard:active { transform: scale(.96); }
.gcard .gi { font-size: 34px; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.gcard .gn { font-weight: 900; font-size: 15px; letter-spacing: 1px; }
.gcard .gt { font-size: 11px; opacity: .75; margin-top: 3px; line-height: 1.35; }
.gcard .gb { margin-top: auto; padding-top: 8px; font-size: 11px; font-weight: 700; opacity: .9; }
.gcard .gb .bv { color: #fff; }

.hub-foot { text-align: center; color: #3c3c5e; font-size: 11px; letter-spacing: 2px; margin-top: 34px; }
