/* ═══════════════════════════════════════════════════════════════
   Friends Arcade Hub v3 — styles.css
   Design direction: Clean · Confident · Arcade-Modern
   Palette: Deep navy bg · Indigo/Cyan primary · Warm white text
   Fonts: Syne (headings) · DM Sans (body)
   Aesthetic: Notion × Arcade — minimal chrome, bold type, neon glow
═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Core palette */
  --bg:         #0d0f1a;
  --bg-raised:  #141828;
  --bg-card:    #1a1f30;
  --bg-input:   #1e2436;
  --border:     rgba(255,255,255,0.08);
  --border-md:  rgba(255,255,255,0.13);

  /* Brand: indigo → cyan */
  --indigo:     #6366f1;
  --indigo-lt:  #818cf8;
  --cyan:       #06b6d4;
  --cyan-lt:    #22d3ee;

  /* Accent chips */
  --green:      #10b981;
  --green-glow: rgba(16,185,129,0.25);
  --orange:     #f59e0b;
  --pink:       #ec4899;
  --red:        #ef4444;

  /* Text */
  --text:       #f1f5f9;
  --text-2:     #94a3b8;
  --text-3:     #475569;

  /* Gradient */
  --grad:       linear-gradient(135deg, var(--indigo), var(--cyan));
  --grad-warm:  linear-gradient(135deg, #f59e0b, #ec4899);

  /* Fonts */
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
  --glow-indigo: 0 0 24px rgba(99,102,241,.35);
  --glow-cyan:   0 0 24px rgba(6,182,212,.35);
  --glow-green:  0 0 20px rgba(16,185,129,.3);

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t: .2s;
  --t-lg: .3s;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font-family: var(--font-body); }
.hidden { display: none !important; }

/* ── Noise texture overlay ─────────────────────────────────── */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .5;
}

/* ── Screen system ─────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: calc(100dvh - 58px);
  padding: 16px 16px 32px;
  position: relative;
  z-index: 1;
  animation: screenIn var(--t-lg) var(--ease) both;
}
.screen.active { display: flex; }
.screen--game  { padding: 0; }

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

/* ═══════════════════════════════════════════════════════════════
   ACCESS SCREEN
═══════════════════════════════════════════════════════════════ */
#access-screen {
  min-height: 100dvh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: fixed; inset: 0;
  z-index: 999;
  overflow: hidden;
  padding: 24px;
  background: var(--bg); /* solid bg so menu never bleeds through */
}
/* When access screen is hidden, collapse it fully */
#access-screen.hidden {
  display: none !important;
}

/* Ambient orbs */
.access-bg { position: absolute; inset: 0; pointer-events: none; }
.access-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbPulse 6s ease-in-out infinite;
}
.access-orb--1 { width: 320px; height: 320px; top: -100px; right: -80px; background: rgba(99,102,241,.25); animation-delay: 0s; }
.access-orb--2 { width: 240px; height: 240px; bottom: -60px; left: -60px; background: rgba(6,182,212,.2); animation-delay: -2s; }
.access-orb--3 { width: 180px; height: 180px; top: 40%; left: 30%; background: rgba(236,72,153,.12); animation-delay: -4s; }

@keyframes orbPulse {
  0%,100% { transform: scale(1) translate(0,0); opacity: .6; }
  50%      { transform: scale(1.15) translate(8px,-8px); opacity: 1; }
}

.access-card {
  position: relative; z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 36px 28px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-lg), var(--glow-indigo);
  backdrop-filter: blur(20px);
}

.access-badge {
  font-family: var(--font-head);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--indigo-lt);
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--r-full);
  padding: 4px 12px;
}

.access-logo-mark { display: flex; justify-content: center; }
.access-logo-mark svg { border-radius: 14px; box-shadow: var(--glow-indigo); }

.access-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 7vw, 2rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.access-sub {
  color: var(--text-2);
  font-size: .88rem;
  text-align: center;
}

.access-form { width: 100%; display: flex; flex-direction: column; gap: 8px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.access-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  letter-spacing: 6px;
  padding: 14px 52px 14px 18px;
  outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.access-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.access-input::placeholder { letter-spacing: 2px; color: var(--text-3); font-size: .9rem; }

.access-btn {
  position: absolute; right: 8px;
  background: var(--grad);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--t), transform var(--t);
  flex-shrink: 0;
}
.access-btn:hover  { opacity: .85; }
.access-btn:active { transform: scale(.93); }

.access-error {
  color: var(--red);
  font-size: .8rem;
  min-height: 18px;
  text-align: center;
  font-weight: 600;
}

.access-hint { color: var(--text-3); font-size: .78rem; text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(13,15,26,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand { display: flex; align-items: center; gap: 8px; }
.topbar-icon  { font-size: 1.2rem; }
.topbar-name  {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-2);
}

.topbar-scores { display: flex; gap: 8px; }

.score-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 5px 12px;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  color: var(--cyan);
  transition: transform .15s var(--ease-spring);
}
.score-chip--ticket { color: var(--orange); }
.score-chip.bump    { animation: chipBump .3s var(--ease-spring); }
.score-chip-icon    { font-size: .95rem; }

@keyframes chipBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.topbar-exit {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.topbar-exit:hover { color: var(--red); border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.06); }

/* ═══════════════════════════════════════════════════════════════
   MAIN MENU
═══════════════════════════════════════════════════════════════ */
.menu-hero { padding: 8px 0 4px; }
.menu-eyebrow {
  font-size: .75rem;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.menu-heading {
  font-family: var(--font-head);
  font-size: clamp(2rem, 10vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 10px;
}
.menu-streak {
  display: flex; gap: 4px; flex-wrap: wrap;
  min-height: 14px;
  margin-bottom: 6px;
}
.streak-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad);
  animation: streakPop .3s var(--ease-spring) both;
}
@keyframes streakPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Big play button */
.cta-play {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--grad);
  border: none;
  border-radius: var(--r-lg);
  padding: 18px 22px;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: var(--glow-indigo);
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
  touch-action: manipulation;
}
.cta-play:hover  { opacity: .9; box-shadow: var(--glow-indigo), 0 0 40px rgba(6,182,212,.2); }
.cta-play:active { transform: scale(.97); }

.cta-play-icon  { font-size: 1.8rem; }
.cta-play-label {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  flex: 1;
  text-align: center;
}
.cta-play-arrow { font-size: 1.4rem; color: rgba(255,255,255,.7); }

/* 2×2 action grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  touch-action: manipulation;
  text-align: left;
}
.action-tile:hover  { background: var(--bg-raised); border-color: var(--border-md); }
.action-tile:active { transform: scale(.96); }

.action-tile-icon  { font-size: 1.6rem; }
.action-tile-label {
  font-family: var(--font-head);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-2);
}

/* Coloured left border accent per tile */
.action-tile--missions { border-left: 3px solid var(--indigo); }
.action-tile--daily    { border-left: 3px solid var(--green); }
.action-tile--shop     { border-left: 3px solid var(--orange); }
.action-tile--coins    { border-left: 3px solid var(--pink); }

/* Tip strip */
.tip-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: .8rem;
  color: var(--text-2);
}
.tip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  animation: tipPulse 2s ease-in-out infinite;
}
@keyframes tipPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* ═══════════════════════════════════════════════════════════════
   SHARED SCREEN ELEMENTS
═══════════════════════════════════════════════════════════════ */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.screen-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  text-align: center;
  padding-right: 52px; /* balance nav-back */
}

.nav-back {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  padding: 7px 12px;
  white-space: nowrap;
  transition: color var(--t), border-color var(--t), background var(--t);
  touch-action: manipulation;
  flex-shrink: 0;
}
.nav-back:hover  { color: var(--text); border-color: var(--border-md); background: var(--bg-raised); }
.nav-back:active { transform: scale(.95); }

.section-lead {
  color: var(--text-2);
  font-size: .88rem;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   GAME SELECT — list style
═══════════════════════════════════════════════════════════════ */
.game-list { display: flex; flex-direction: column; gap: 8px; }

.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  touch-action: manipulation;
  gap: 10px;
}
.game-row:hover  { background: var(--bg-raised); border-color: var(--border-md); }
.game-row:active { transform: scale(.98); }

.game-row-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.game-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.game-row-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.game-row-icon--green   { background: rgba(16,185,129,.12);  border: 1px solid rgba(16,185,129,.2); }
.game-row-icon--cyan    { background: rgba(6,182,212,.12);   border: 1px solid rgba(6,182,212,.2); }
.game-row-icon--purple  { background: rgba(139,92,246,.12);  border: 1px solid rgba(139,92,246,.2); }
.game-row-icon--indigo  { background: rgba(99,102,241,.12);  border: 1px solid rgba(99,102,241,.2); }
.game-row-icon--orange  { background: rgba(245,158,11,.12);  border: 1px solid rgba(245,158,11,.2); }
.game-row-icon--pink    { background: rgba(236,72,153,.12);  border: 1px solid rgba(236,72,153,.2); }

.game-row-name {
  font-family: var(--font-head);
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.game-row-meta { font-size: .75rem; color: var(--text-2); margin-top: 2px; }

.game-row-earn  { font-size: .75rem; color: var(--cyan); font-weight: 600; }
.game-row-arrow { color: var(--text-3); flex-shrink: 0; }

.new-chip {
  font-size: .5rem;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: var(--grad);
  border-radius: var(--r-full);
  padding: 2px 7px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   MEMORY DIFFICULTY
═══════════════════════════════════════════════════════════════ */
.diff-list { display: flex; flex-direction: column; gap: 8px; }

.diff-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  touch-action: manipulation;
}
.diff-row:hover  { background: var(--bg-raised); border-color: var(--border-md); }
.diff-row:active { transform: scale(.98); }

.diff-left { display: flex; align-items: center; gap: 14px; }
.diff-right { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.diff-earn  { font-size: .78rem; color: var(--cyan); font-weight: 600; }

.diff-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.diff-dot--easy   { background: var(--green);  color: var(--green); }
.diff-dot--medium { background: var(--orange); color: var(--orange); }
.diff-dot--hard   { background: var(--red);    color: var(--red); }

.diff-name { font-family: var(--font-head); font-size: .92rem; font-weight: 700; color: var(--text); }
.diff-meta { font-size: .75rem; color: var(--text-2); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════════
   GAME TOPBAR
═══════════════════════════════════════════════════════════════ */
.game-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.game-topbar-title {
  font-family: var(--font-head);
  font-size: .78rem; font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-2);
  flex: 1; text-align: center;
}
.game-topbar-score {
  font-family: var(--font-head);
  font-size: .72rem; font-weight: 700;
  color: var(--cyan);
  min-width: 60px; text-align: right;
}

#game-area {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: 12px; flex: 1; overflow-y: auto;
  gap: 10px;
}

#game-canvas {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  display: block; max-width: 100%;
  touch-action: none;
}

/* ═══════════════════════════════════════════════════════════════
   MINI UIs (shared container)
═══════════════════════════════════════════════════════════════ */
.mini-ui { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; }

/* ── RPS ── */
.rps-board {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; width: 100%; margin-bottom: 12px;
}
.rps-side {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1;
}
.rps-label { font-size: .65rem; font-weight: 700; color: var(--text-2); letter-spacing: 2px; }
.rps-score {
  font-family: var(--font-head);
  font-size: 2rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rps-vs { font-family: var(--font-head); font-size: .75rem; color: var(--text-3); }

.rps-result-text {
  font-family: var(--font-head); font-size: .72rem; font-weight: 700;
  color: var(--text-2); text-align: center;
  min-height: 22px; margin-bottom: 10px;
  transition: color .2s;
}
.rps-result-text.win  { color: var(--green); }
.rps-result-text.lose { color: var(--red); }

.rps-showdown {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 18px;
}
.rps-emoji { font-size: 2.8rem; transition: transform .2s var(--ease-spring); }
.rps-flash  { font-size: 1.2rem; color: var(--text-3); }

.rps-moves { display: flex; gap: 10px; width: 100%; }
.move-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 14px 6px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  touch-action: manipulation;
}
.move-btn:hover  { border-color: var(--indigo); background: rgba(99,102,241,.06); }
.move-btn:active { transform: scale(.93); }
.move-emoji { font-size: 1.8rem; }
.move-name  { font-size: .65rem; font-weight: 700; color: var(--text-2); letter-spacing: 1px; }

.rps-caption { font-size: .72rem; color: var(--text-3); margin-top: 12px; text-align: center; }

/* ── Cards ── */
.cards-stats {
  display: flex; gap: 10px; margin-bottom: 12px; width: 100%;
}
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 5px 14px;
  font-size: .78rem; color: var(--text-2);
}
.stat-pill strong { color: var(--cyan); font-family: var(--font-head); }

.cards-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 7px; width: 100%; max-width: 310px;
}

.card-item {
  aspect-ratio: 3/4;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  transition: transform .15s, border-color .15s;
  user-select: none; touch-action: manipulation;
}
.card-item:not(.flipped):not(.matched) { background: var(--bg-raised); }
.card-item:not(.flipped):not(.matched)::after {
  content: '?'; font-family: var(--font-head); font-size: .8rem; color: var(--text-3);
}
.card-item.flipped {
  border-color: var(--indigo); background: var(--bg-card);
  animation: cardReveal .2s var(--ease) both;
}
.card-item.matched { border-color: var(--green); background: var(--green-glow); cursor: default; }
.card-item:hover:not(.matched):not(.flipped) { transform: scale(1.06); border-color: var(--border-md); }

@keyframes cardReveal {
  from { transform: rotateY(90deg) scale(.9); opacity: 0; }
  to   { transform: rotateY(0)     scale(1);  opacity: 1; }
}

/* ── Memory HUD ── */
.mem-stats-bar {
  display: flex; justify-content: space-between; align-items: stretch;
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 10px 16px; margin-bottom: 12px; gap: 8px;
}
.mem-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mem-stat-label { font-size: .6rem; font-weight: 700; color: var(--text-3); letter-spacing: 1.5px; text-transform: uppercase; }
.mem-stat-body  { display: flex; align-items: baseline; gap: 2px; }
.mem-val  { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--cyan); }
.mem-cap  { font-size: .65rem; color: var(--text-3); }

.mem-stat--timer .mem-val { transition: color .3s; }
.mem-stat--timer.warning .mem-val {
  color: var(--red);
  animation: timerUrgent .7s ease-in-out infinite;
}
@keyframes timerUrgent {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}

.memory-grid { display: grid; gap: 6px; width: 100%; }

.mem-card {
  aspect-ratio: 3/4; border-radius: var(--r-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  transition: transform .15s, border-color .15s;
  user-select: none; touch-action: manipulation;
  position: relative; overflow: hidden;
}
.mem-card::before {
  content: '?'; font-family: var(--font-head); font-size: .7rem; color: var(--text-3);
}
.mem-card.flipped {
  border-color: var(--indigo); background: var(--bg-card);
  animation: cardReveal .18s var(--ease) both;
}
.mem-card.flipped::before,
.mem-card.matched::before { display: none; }
.mem-card.matched { border-color: var(--green); background: var(--green-glow); cursor: default; }
.mem-card:hover:not(.flipped):not(.matched) { transform: scale(1.05); border-color: var(--border-md); }
.mem-card .card-emoji { display: none; }
.mem-card.flipped .card-emoji, .mem-card.matched .card-emoji { display: block; }

/* ── Reaction ── */
.reaction-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 18px; width: 100%;
}
.reaction-label {
  font-family: var(--font-head); font-size: .7rem; font-weight: 800;
  letter-spacing: 3px; color: var(--text-2); text-align: center;
  min-height: 20px;
}

.reaction-pad {
  width: 190px; height: 190px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer;
  border: 2.5px solid var(--border);
  background: var(--bg-card);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .1s;
  touch-action: manipulation; user-select: none;
}
.reaction-pad:active { transform: scale(.92); }

.reaction-pad.state-wait   { border-color: var(--border); background: var(--bg-card); }
.reaction-pad.state-ready  { border-color: var(--red); background: rgba(239,68,68,.08); box-shadow: 0 0 24px rgba(239,68,68,.2); }
.reaction-pad.state-go     { border-color: var(--green); background: rgba(16,185,129,.12); box-shadow: var(--glow-green); animation: padGo .1s var(--ease-spring); }
.reaction-pad.state-early  { border-color: var(--red); background: rgba(239,68,68,.18); }

@keyframes padGo {
  from { transform: scale(.92); }
  to   { transform: scale(1); }
}

.reaction-pad-icon { font-size: 3rem; }
.reaction-pad-text {
  font-family: var(--font-head); font-size: .45rem; font-weight: 800;
  color: var(--text-2); text-align: center; letter-spacing: 1.5px; line-height: 1.6;
}

.reaction-stats {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 10px;
}
.reaction-stat-row { display: flex; justify-content: space-between; align-items: center; }
.reaction-stat-key { font-size: .72rem; font-weight: 600; color: var(--text-2); letter-spacing: 1px; }
.reaction-stat-val { font-family: var(--font-head); font-size: .82rem; font-weight: 700; color: var(--cyan); }

/* ═══════════════════════════════════════════════════════════════
   MISSIONS
═══════════════════════════════════════════════════════════════ */
.missions-list { display: flex; flex-direction: column; gap: 8px; }

.mission-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--t);
}
.mission-item.completed  { opacity: .55; }
.mission-item.ready      { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(6,182,212,.15); }

.mission-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mission-name { font-weight: 700; font-size: .9rem; color: var(--text); flex: 1; }
.mission-reward {
  font-family: var(--font-head); font-size: .55rem; font-weight: 700;
  color: var(--cyan); background: rgba(6,182,212,.1);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: var(--r-full); padding: 3px 9px; flex-shrink: 0;
}
.mission-bar  { height: 6px; background: var(--bg-raised); border-radius: var(--r-full); overflow: hidden; }
.mission-fill {
  height: 100%; border-radius: var(--r-full);
  background: var(--grad); transition: width .5s var(--ease);
}
.mission-bottom { display: flex; justify-content: space-between; align-items: center; }
.mission-status { font-size: .78rem; color: var(--text-2); }

.claim-btn {
  background: var(--green); border: none; border-radius: var(--r-full);
  color: #fff; cursor: pointer;
  font-family: var(--font-head); font-size: .55rem; font-weight: 800;
  padding: 7px 14px; letter-spacing: .5px;
  transition: filter var(--t), transform var(--t);
  touch-action: manipulation;
}
.claim-btn:hover  { filter: brightness(1.1); }
.claim-btn:active { transform: scale(.94); }

/* ═══════════════════════════════════════════════════════════════
   SHOP
═══════════════════════════════════════════════════════════════ */
.shop-list { display: flex; flex-direction: column; gap: 8px; }

.shop-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  gap: 12px; transition: border-color var(--t);
}
.shop-row--featured { border-color: rgba(99,102,241,.35); background: rgba(99,102,241,.05); }
.shop-row-left { display: flex; align-items: center; gap: 14px; flex: 1; }

.shop-icon-wrap { font-size: 1.6rem; min-width: 40px; }
.shop-row-name  { font-weight: 700; font-size: .9rem; color: var(--text); display: flex; align-items: center; gap: 7px; }
.shop-row-price { font-size: .78rem; color: var(--text-2); margin-top: 2px; }

.best-value {
  font-family: var(--font-head); font-size: .48rem; font-weight: 800;
  color: #fff; background: var(--grad);
  border-radius: var(--r-full); padding: 2px 7px; vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.primary-btn {
  width: 100%;
  background: var(--grad);
  border: none; border-radius: var(--r-md);
  color: #fff; cursor: pointer;
  font-family: var(--font-head); font-size: .82rem; font-weight: 800;
  padding: 15px 20px; letter-spacing: .5px;
  box-shadow: var(--glow-indigo);
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
  touch-action: manipulation;
}
.primary-btn:hover  { opacity: .88; }
.primary-btn:active { transform: scale(.96); }
.primary-btn:disabled { opacity: .4; cursor: not-allowed; }

.ghost-btn {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text-2);
  cursor: pointer; font-family: var(--font-body);
  font-size: .85rem; font-weight: 600;
  padding: 12px 20px; width: 100%;
  transition: background var(--t), border-color var(--t), color var(--t);
  touch-action: manipulation;
}
.ghost-btn:hover  { background: var(--bg-raised); color: var(--text); border-color: var(--border-md); }
.ghost-btn:active { transform: scale(.96); }

.buy-btn {
  background: var(--bg-raised); border: 1.5px solid var(--border-md);
  border-radius: var(--r-full); color: var(--text);
  cursor: pointer; font-family: var(--font-head);
  font-size: .65rem; font-weight: 800; padding: 8px 16px;
  transition: background var(--t), border-color var(--t), transform var(--t);
  touch-action: manipulation; flex-shrink: 0;
}
.buy-btn:hover  { background: var(--indigo); border-color: var(--indigo); }
.buy-btn:active { transform: scale(.94); }
.buy-btn--featured { background: var(--indigo); border-color: var(--indigo); }

/* ═══════════════════════════════════════════════════════════════
   MODALS — bottom sheet style
═══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl) var(--r-xl) var(--r-lg) var(--r-lg);
  padding: 8px 24px 32px;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 18px;
  animation: sheetUp var(--t-lg) var(--ease-spring) both;
  box-shadow: var(--shadow-lg);
}

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

.modal-pill {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border-md); margin: 0 auto 6px;
}
.modal-title {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 800;
  color: var(--text); text-align: center;
}
.modal-body   { text-align: center; color: var(--text-2); font-size: .9rem; line-height: 1.7; }
.modal-body strong { color: var(--cyan); font-family: var(--font-head); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }

/* Daily reward content */
.daily-reward-icon { font-size: 3.5rem; text-align: center; margin: 4px 0;
  animation: floatIcon 2.5s ease-in-out infinite; display: block; }
@keyframes floatIcon {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.daily-amount { font-family: var(--font-head); font-size: 2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text; text-align: center; }
.daily-type { color: var(--text-2); font-size: .88rem; text-align: center; }
.daily-countdown { font-size: .85rem; color: var(--text-2); text-align: center; line-height: 1.7; }
.daily-countdown strong { color: var(--orange); font-family: var(--font-head); font-size: .78rem; }

/* Game over */
.gameover-icon { font-size: 3.5rem; text-align: center; }
.gameover-body { text-align: center; color: var(--text-2); font-size: .88rem; line-height: 1.8; }
.gameover-body strong { color: var(--cyan); font-family: var(--font-head); }

/* ═══════════════════════════════════════════════════════════════
   AD OVERLAY
═══════════════════════════════════════════════════════════════ */
.ad-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.96);
  z-index: 600; display: flex; align-items: center; justify-content: center;
}
.ad-overlay.hidden { display: none; }

.ad-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 28px 20px; width: 100%; max-width: 360px;
}

.ad-eyebrow {
  font-family: var(--font-head); font-size: .55rem; font-weight: 800;
  letter-spacing: 3px; color: var(--text-3);
}

.ad-video-mock {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; position: relative; overflow: hidden;
}
.ad-video-mock::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,
    rgba(255,255,255,0.012), rgba(255,255,255,0.012) 1px, transparent 1px, transparent 10px);
}
.ad-play      { font-size: 2.5rem; color: rgba(255,255,255,.4); }
.ad-brand-name { font-size: .88rem; color: var(--text-2); font-weight: 600; }

.ad-timer-row {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
  font-size: .8rem; color: var(--text-2); text-align: center;
}
.ad-timer-row strong { color: var(--cyan); font-family: var(--font-head); font-size: 1rem; }

.ad-bar      { width: 100%; height: 4px; background: var(--bg-raised); border-radius: 2px; overflow: hidden; }
.ad-bar-fill { height: 100%; background: var(--grad); width: 0%; transition: width 1s linear; }

.ad-notice { font-size: .72rem; color: var(--text-3); text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r-full);
  padding: 10px 20px;
  font-family: var(--font-head); font-size: .62rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap; z-index: 900;
  box-shadow: var(--shadow-lg), var(--glow-indigo);
  animation: toastIn .25s var(--ease-spring) both;
  max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
.toast.hidden { display: none !important; }

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   SHAKE (access error)
═══════════════════════════════════════════════════════════════ */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-8px); }
  80%      { transform: translateX(8px); }
}

/* ═══════════════════════════════════════════════════════════════
   MULTIPLICA MONEDAS — Coin Boost Zone
═══════════════════════════════════════════════════════════════ */

/* CTA button on main menu */
.cta-boost {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: linear-gradient(135deg, #1a1040, #0f2a1a);
  border: 1.5px solid rgba(250,204,21,.25);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  cursor: pointer;
  margin-bottom: 14px;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  touch-action: manipulation;
  text-align: left;
}
.cta-boost:hover  { border-color: rgba(250,204,21,.5); box-shadow: 0 0 24px rgba(250,204,21,.12); }
.cta-boost:active { transform: scale(.97); }
.cta-boost-icon   { font-size: 1.8rem; flex-shrink: 0; }
.cta-boost-text   { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cta-boost-label  {
  font-family: var(--font-head); font-size: .88rem; font-weight: 800;
  color: #facc15; letter-spacing: .3px;
}
.cta-boost-sub    { font-size: .72rem; color: var(--text-2); }
.cta-boost-badge  {
  font-family: var(--font-head); font-size: .6rem; font-weight: 800;
  color: #facc15; background: rgba(250,204,21,.1);
  border: 1px solid rgba(250,204,21,.2);
  border-radius: var(--r-full); padding: 4px 10px;
  flex-shrink: 0; white-space: nowrap;
}

/* Boost screen balance */
.boost-balance {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(250,204,21,.08), rgba(250,204,21,.03));
  border: 1px solid rgba(250,204,21,.2);
  border-radius: var(--r-md); padding: 14px 18px;
  margin-bottom: 14px;
}
.boost-balance-label { font-size: .78rem; color: var(--text-2); font-weight: 600; }
.boost-balance-val   {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; color: #facc15;
}

/* Individual boost cards */
.boost-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 14px;
}

.boost-card-header {
  display: flex; align-items: center; gap: 12px;
}
.boost-card-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.boost-icon--flip { background: rgba(250,204,21,.1); border: 1px solid rgba(250,204,21,.2); }
.boost-icon--num  { background: rgba(6,182,212,.1);  border: 1px solid rgba(6,182,212,.2); }
.boost-icon--slot { background: rgba(236,72,153,.1); border: 1px solid rgba(236,72,153,.2); }

.boost-card-name {
  font-family: var(--font-head); font-size: .9rem; font-weight: 800; color: var(--text);
}
.boost-card-meta { font-size: .72rem; color: var(--text-2); margin-top: 2px; }

.boost-card-mult {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 800;
  color: #facc15; background: rgba(250,204,21,.1);
  border: 1px solid rgba(250,204,21,.2);
  border-radius: var(--r-md); padding: 6px 12px;
}
.boost-mult--med  { color: var(--cyan);  background: rgba(6,182,212,.1);  border-color: rgba(6,182,212,.2); }
.boost-mult--high { color: var(--pink);  background: rgba(236,72,153,.1); border-color: rgba(236,72,153,.2); }

/* Wager row */
.boost-wager-row {
  display: flex; flex-direction: column; gap: 8px;
}
.boost-amounts {
  display: flex; gap: 7px; flex-wrap: wrap;
}
.amount-btn {
  background: var(--bg-raised); border: 1.5px solid var(--border-md);
  border-radius: var(--r-full); color: var(--text-2);
  cursor: pointer; font-family: var(--font-head);
  font-size: .7rem; font-weight: 800;
  padding: 6px 14px;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  touch-action: manipulation;
}
.amount-btn:hover   { background: rgba(250,204,21,.1); border-color: rgba(250,204,21,.3); color: #facc15; }
.amount-btn:active  { transform: scale(.92); }
.amount-btn.active  { background: rgba(250,204,21,.15); border-color: #facc15; color: #facc15; }

.boost-wager-info {
  font-size: .78rem; color: var(--text-2);
}
.boost-wager-info strong { color: #facc15; font-family: var(--font-head); }

/* Coin flip choices */
.boost-choices {
  display: flex; gap: 10px;
}
.choice-btn {
  flex: 1; padding: 14px;
  border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--bg-raised); cursor: pointer;
  font-family: var(--font-head); font-size: .78rem; font-weight: 800;
  color: var(--text-2);
  transition: all var(--t); touch-action: manipulation;
}
.choice-btn:hover  { border-color: #facc15; color: #facc15; background: rgba(250,204,21,.07); }
.choice-btn:active { transform: scale(.95); }

/* Number guess */
.boost-num-choices {
  display: flex; gap: 8px; justify-content: center;
}
.num-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-raised); cursor: pointer;
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 800;
  color: var(--text-2);
  transition: all var(--t); touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.num-btn:hover  { border-color: var(--cyan); color: var(--cyan); background: rgba(6,182,212,.08); }
.num-btn:active { transform: scale(.92); }

/* Slots */
.slots-reels {
  display: flex; gap: 10px; justify-content: center;
}
.reel {
  width: 72px; height: 72px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  transition: transform .15s var(--ease-spring);
}
.reel.spinning { animation: reelSpin .6s var(--ease-spring); }
@keyframes reelSpin {
  0%   { transform: translateY(-8px) scale(.9); opacity: .4; }
  60%  { transform: translateY(4px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.spin-btn {
  width: 100%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border: none; border-radius: var(--r-md);
  color: #fff; cursor: pointer;
  font-family: var(--font-head); font-size: .82rem; font-weight: 800;
  padding: 14px; letter-spacing: .5px;
  box-shadow: 0 0 20px rgba(236,72,153,.3);
  transition: opacity var(--t), transform var(--t);
  touch-action: manipulation;
}
.spin-btn:hover  { opacity: .88; }
.spin-btn:active { transform: scale(.96); }
.spin-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Result messages */
.boost-result {
  min-height: 28px; text-align: center;
  font-family: var(--font-head); font-size: .72rem; font-weight: 800;
  transition: color .2s;
}
.boost-result.win  { color: #4ade80; }
.boost-result.lose { color: var(--red); }

/* Disclaimer */
.boost-disclaimer {
  text-align: center; font-size: .72rem; color: var(--text-3);
  margin-top: 4px; padding-bottom: 8px;
}


@media (min-width: 420px) {
  .cta-play-label { font-size: 1.2rem; }
  .rps-score { font-size: 2.4rem; }
}
@media (min-width: 600px) {
  .access-card { padding: 48px 40px; }
  .menu-heading { font-size: 2.8rem; }
  .game-list, .diff-list, .missions-list, .shop-list { max-width: 520px; margin: 0 auto; }
  .action-grid { max-width: 520px; margin: 0 auto 16px; }
  .cta-play { max-width: 520px; margin-left: auto; margin-right: auto; }
  #game-canvas { width: 380px; height: 506px; }
  .mini-ui { max-width: 400px; }
}
@media (min-width: 800px) {
  .screen:not(#access-screen):not(#game-screen) { max-width: 560px; margin: 0 auto; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   NUEVOS JUEGOS ORIGINALES
═══════════════════════════════════════════════════════════════ */

.cta-mining {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: linear-gradient(135deg, #052010, #0a2818);
  border: 1.5px solid rgba(52,211,153,.25);
  border-radius: var(--r-lg); padding: 14px 18px;
  cursor: pointer; margin-bottom: 10px;
  transition: border-color var(--t), transform var(--t);
  touch-action: manipulation; text-align: left;
}
.cta-mining:hover  { border-color: rgba(52,211,153,.5); }
.cta-mining:active { transform: scale(.97); }

.game-list-divider {
  font-family: var(--font-head); font-size: .6rem; font-weight: 800;
  color: var(--text-3); letter-spacing: 2px; text-transform: uppercase;
  padding: 10px 4px 4px; border-top: 1px solid var(--border); margin-top: 4px;
}

.ng-hud { display: flex; gap: 8px; margin-bottom: 10px; width: 100%; }
.ng-label { font-size: .82rem; color: var(--text-2); text-align: center; margin-bottom: 12px; line-height: 1.5; }

/* Grid Risk */
.ng-diff-row { display: flex; gap: 8px; margin-bottom: 12px; width: 100%; }
.ng-diff-btn {
  flex: 1; background: var(--bg-raised); border: 1.5px solid var(--border);
  border-radius: var(--r-md); color: var(--text-2);
  cursor: pointer; font-family: var(--font-head); font-size: .55rem; font-weight: 800;
  padding: 9px 4px; transition: all var(--t); touch-action: manipulation;
}
.ng-diff-btn:hover  { border-color: var(--orange); color: var(--orange); }
.ng-diff-btn.active { border-color: var(--orange); color: var(--orange); background: rgba(245,158,11,.08); }

.grid-board {
  display: grid; grid-template-columns: repeat(5,1fr);
  gap: 6px; width: 100%; max-width: 320px; margin: 0 auto;
}
.grid-cell {
  aspect-ratio: 1; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--bg-raised);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; transition: all .15s var(--ease-spring);
  touch-action: manipulation;
}
.grid-cell:hover:not(.revealed) { border-color: var(--indigo); transform: scale(1.08); }
.grid-cell.safe   { background: rgba(16,185,129,.15); border-color: var(--green); animation: cellPop .2s var(--ease-spring); }
.grid-cell.danger { background: rgba(239,68,68,.2);   border-color: var(--red); }
.grid-cell.revealed { cursor: default; }
@keyframes cellPop { from { transform: scale(.8); } to { transform: scale(1); } }

/* Precision bar */
.prec-track-wrap { width: 100%; margin-bottom: 12px; }
.prec-track { position: relative; height: 48px; background: var(--bg-raised); border-radius: var(--r-md); border: 1.5px solid var(--border); overflow: hidden; }
.prec-zone  { position: absolute; top: 0; bottom: 0; background: rgba(16,185,129,.35); border-left: 2px solid var(--green); border-right: 2px solid var(--green); }
.prec-cursor { position: absolute; top: 4px; bottom: 4px; width: 4px; background: var(--text); border-radius: 2px; box-shadow: 0 0 8px rgba(255,255,255,.6); }
.prec-info { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: 10px; }
.prec-zone-label { color: var(--text-2); }
.prec-mult { font-family: var(--font-head); font-weight: 800; color: var(--cyan); }

/* Multiplier */
.mult-display { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; text-align: center; margin-bottom: 12px; }
.mult-value { font-family: var(--font-head); font-size: 2.8rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: 6px; }
.mult-value.danger { background: linear-gradient(135deg,var(--red),var(--orange)); -webkit-background-clip: text; background-clip: text; }
.mult-status { font-size: .78rem; color: var(--text-2); }
.mult-bar-wrap { height: 8px; background: var(--bg-raised); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.mult-bar { height: 100%; width: 0%; border-radius: 4px; background: var(--grad); transition: width .1s linear; }
.mult-bar.danger { background: linear-gradient(90deg,var(--orange),var(--red)); }

/* Hi-Lo */
.hilo-card-area { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; }
.hilo-card { width: 80px; height: 100px; border-radius: var(--r-md); border: 2px solid var(--border); background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--text); transition: all .2s var(--ease-spring); }
.hilo-card.flip { animation: hiloFlip .3s var(--ease-spring); }
@keyframes hiloFlip { 0% { transform: rotateY(90deg) scale(.9); } 100% { transform: rotateY(0) scale(1); } }
.hilo-next-hint { font-family: var(--font-head); font-size: .65rem; color: var(--text-2); }
.hilo-btns { display: flex; gap: 8px; width: 100%; }
.hilo-btns .choice-btn { flex: 1; font-size: .72rem; }

/* ═══════════════════════════════════════════════════════════════
   MINERIA ARCCOIN
═══════════════════════════════════════════════════════════════ */
.mining-disclaimer { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); border-radius: var(--r-md); padding: 10px 14px; font-size: .75rem; color: var(--orange); margin-bottom: 14px; line-height: 1.5; }
.mining-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.mining-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.msc-label { font-size: .62rem; color: var(--text-3); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.msc-val   { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: #34d399; }
.offline-notice { background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.2); border-radius: var(--r-md); padding: 10px 14px; font-size: .82rem; color: #34d399; margin-bottom: 12px; }
.mine-section-title { font-family: var(--font-head); font-size: .65rem; font-weight: 800; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase; padding: 12px 0 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.miners-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; min-height: 40px; }
.miner-row { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; }
.miner-row-icon { font-size: 1.4rem; flex-shrink: 0; }
.miner-row-info { flex: 1; min-width: 0; }
.miner-row-name { font-weight: 700; font-size: .85rem; }
.miner-row-meta { font-size: .72rem; color: var(--text-2); margin-top: 2px; }
.miner-row-status { font-family: var(--font-head); font-size: .55rem; font-weight: 800; padding: 4px 10px; border-radius: var(--r-full); flex-shrink: 0; }
.miner-row-status.active   { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.2); }
.miner-row-status.inactive { background: rgba(239,68,68,.1);   color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.miner-empty { color: var(--text-3); font-size: .82rem; text-align: center; padding: 12px; }
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.market-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.market-icon { font-size: 1.4rem; }
.market-name { font-weight: 700; font-size: .82rem; }
.market-meta { font-size: .7rem; color: var(--text-2); }
.market-card--temp     { border-left: 3px solid var(--orange); }
.market-card--perm     { border-left: 3px solid var(--indigo); }
.market-card--battery  { border-left: 3px solid #34d399; }
.market-card--upgrade  { border-left: 3px solid var(--cyan); }
.market-btn { width: 100%; background: var(--bg-raised); border: 1.5px solid var(--border-md); border-radius: var(--r-full); color: var(--text); cursor: pointer; font-family: var(--font-head); font-size: .58rem; font-weight: 800; padding: 7px 8px; transition: all var(--t); touch-action: manipulation; text-align: center; }
.market-btn:hover  { filter: brightness(1.2); }
.market-btn:active { transform: scale(.94); }
.market-btn--perm    { border-color: var(--indigo); color: var(--indigo-lt); }
.market-btn--battery { border-color: #34d399; color: #34d399; }
.market-btn--upgrade { border-color: var(--cyan); color: var(--cyan); }
.inventory-row { display: flex; flex-direction: column; gap: 8px; }
.inv-item { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.inv-icon  { font-size: 1.3rem; flex-shrink: 0; }
.inv-label { flex: 1; font-size: .85rem; color: var(--text-2); }
.inv-label strong { color: var(--text); font-family: var(--font-head); }
.inv-use-btn { background: var(--grad); border: none; border-radius: var(--r-full); color: #fff; cursor: pointer; font-family: var(--font-head); font-size: .58rem; font-weight: 800; padding: 7px 14px; flex-shrink: 0; transition: opacity var(--t), transform var(--t); touch-action: manipulation; }
.inv-use-btn:hover  { opacity: .85; }
.inv-use-btn:active { transform: scale(.94); }
