/* =====================================================================
   HoodBet: global styles
   The first casino built for Robinhood. Black floor, neon feather.
   Dark, sharp, alive. Lime is earned, not sprayed.
   ===================================================================== */

:root {
  /* surfaces (dark) */
  --cream:        #0b0d09;   /* page base */
  --cream-deep:   #14180f;   /* hover / lifted */
  --paper:        #101309;   /* card + panel surface */
  --panel:        #14180f;
  --ink:          #050603;   /* deepest black: playfields, dark bands */
  --ink-soft:     #949c86;   /* muted secondary text */
  --bone:         #b7c0a6;   /* dim light text on dark */

  /* accents */
  --gold:         #cbf54a;   /* NEON LIME: the feather. primary accent */
  --gold-deep:    #a4d92f;   /* deeper lime for gradients / borders */
  --lime:         #cbf54a;
  --lime-bright:  #e4ff86;
  --blood:        #ff5347;   /* loss / down / red */
  --blood-deep:   #c93529;
  --jade:         #3fe08a;   /* win / up green */
  --bruise:       #8a6bff;
  --sky:          #55d3ff;

  /* text */
  --text:         #f0f4e9;   /* primary light text */
  --text-dim:     #949c86;

  /* lines + depth */
  --line:         rgba(203,245,74,0.15);   /* faint lime hairline */
  --line-2:       rgba(255,255,255,0.08);
  --glow:         0 0 26px rgba(203,245,74,0.28);
  --glow-soft:    0 0 40px rgba(203,245,74,0.10);
  --shadow-card:  0 14px 40px rgba(0,0,0,0.55);

  --font-display: "Anton", "Bebas Neue", Impact, sans-serif;
  --font-mono:    "IBM Plex Mono", "Menlo", monospace;
  --font-sans:    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script:  var(--font-mono);

  --shadow-stamp: var(--shadow-card);
  --shadow-soft:  0 6px 18px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 620px at 50% -8%, rgba(203,245,74,0.10) 0, transparent 60%),
    radial-gradient(900px 700px at 88% 12%, rgba(203,245,74,0.05) 0, transparent 55%),
    radial-gradient(760px 620px at 5% 88%, rgba(63,224,138,0.045) 0, transparent 55%);
  background-attachment: fixed;
}

/* faint film grain: sits above as texture, screen-blended so it lifts, not darkens */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }

/* ===== top ribbon (was CA bar; now a slim brand ribbon) ============== */

.ca-bar {
  position: relative;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 7px 24px;
  background: #060803;
  color: var(--bone);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow-x: auto;
}
.ca-bar__network {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--lime);
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 11px;
  flex: none;
}
.ca-bar__network .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink); animation: pulse-dot 1.5s infinite;
}
.ca-bar__sep { color: var(--bone); opacity: 0.3; flex: none; }
.ca-bar__label { font-family: var(--font-display); letter-spacing: 0.12em; color: var(--lime); font-size: 13px; }
.ca-bar__burn { font-family: var(--font-display); letter-spacing: 0.1em; font-size: 11px; color: var(--bone); flex: none; }
.ca-bar__burn b { color: var(--lime); font-weight: 400; }

/* ===== topbar ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 32px;
  background: rgba(9,11,7,0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark {
  height: 38px; width: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  box-shadow: 0 0 0 1px rgba(203,245,74,0.35), 0 0 18px rgba(203,245,74,0.35);
}
.brand__logo {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: var(--text);
}
.brand__logo em { font-style: normal; color: var(--lime); text-shadow: 0 0 18px rgba(203,245,74,0.5); }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 14px;
}
.topbar__nav a { color: var(--bone); transition: color 0.15s; }
.topbar__nav a:hover { color: var(--lime); }

.dot { color: var(--text-dim); opacity: 0.4; }

.balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(203,245,74,0.05);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.balance img { width: 16px; height: 16px; filter: drop-shadow(0 0 6px rgba(203,245,74,0.6)); }
.balance #balance-amount { color: var(--lime); text-shadow: 0 0 14px rgba(203,245,74,0.4); }
.balance__unit { color: var(--text-dim); font-size: 11px; }
.balance__paper {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.12em;
  background: var(--lime);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 100px;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
}
.session-pill .label { font-family: var(--font-display); letter-spacing: 0.1em; color: var(--text-dim); font-size: 10px; }
.session-pill .pnl.up { color: var(--jade); }
.session-pill .pnl.down { color: var(--blood); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 13px;
  border-radius: 100px;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--lime); box-shadow: var(--glow); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; }
.btn--blood { background: var(--blood); border-color: var(--blood); color: #fff; }
.btn--gold, .btn--connect {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  font-weight: 400;
  box-shadow: 0 0 22px rgba(203,245,74,0.28);
}
.btn--gold:hover, .btn--connect:hover { background: var(--lime-bright); border-color: var(--lime-bright); box-shadow: 0 0 30px rgba(203,245,74,0.5); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== lobby: hero ================================================== */

.lobby { padding: 0 32px 90px; max-width: 1280px; margin: 0 auto; }

.hero {
  position: relative;
  text-align: center;
  padding: 76px 20px 54px;
}

.hero__mascot {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  animation: charge 4s ease-in-out infinite;
}
.hero__chip {
  width: clamp(128px, 17vw, 190px);
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 0 46px rgba(203,245,74,0.55));
}
@keyframes charge {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(2deg); }
}

.hero__title {
  font-family: var(--font-display);
  line-height: 0.86;
  font-weight: 400;
  margin-bottom: 24px;
  color: var(--text);
}
.hero__title .word { display: block; letter-spacing: 0.02em; }
.hero__title .word--big {
  font-size: clamp(74px, 16vw, 210px);
  letter-spacing: -0.01em;
  color: var(--lime);
  text-shadow: 0 0 60px rgba(203,245,74,0.45);
  margin: 6px 0;
}
.hero__title .word:first-child { font-size: clamp(18px, 2.6vw, 30px); margin-bottom: 4px; color: var(--text); }
.hero__title .word:last-child { font-size: clamp(18px, 2.6vw, 30px); color: var(--bone); margin-top: 4px; }

.hero__sub {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.55;
  max-width: 600px;
  margin: 0 auto 30px;
  color: var(--bone);
}
.hero__sub em { font-style: normal; color: var(--lime); font-weight: 600; }
.mantra {
  font-family: var(--font-display);
  font-size: max(11px, 0.66em);
  letter-spacing: 0.15em;
  background: var(--lime);
  color: var(--ink);
  padding: 2px 8px;
  display: inline-block;
  border-radius: 3px;
}

.hero__buy { margin-bottom: 24px; padding: 14px 28px; font-size: 15px; }

.hero__scroll {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--text-dim);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ===== stat band ===================================================== */

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin: 8px 0 20px;
}
@media (max-width: 720px) { .stat-band { grid-template-columns: 1fr 1fr; } }
.stat-band .stat {
  background: #0c0f08;
  padding: 26px 18px;
  text-align: center;
}
.stat .stat__num {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1;
  color: var(--lime);
  text-shadow: 0 0 28px rgba(203,245,74,0.35);
}
.stat .stat__label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ===== section title ================================================= */

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.14em;
  margin: 64px 0 30px;
  color: var(--text);
}
.section-title img { height: 24px; opacity: 0; width: 0; }   /* drop the ink scrolls */
.section-title::before, .section-title::after {
  content: "";
  height: 1px; width: 54px;
  background: linear-gradient(90deg, transparent, var(--lime));
}
.section-title::after { background: linear-gradient(90deg, var(--lime), transparent); }

/* ===== games grid ===================================================== */

.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0e1109, #0a0c07);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.2s;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(203,245,74,0.5);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), var(--glow-soft);
}
.game-card:active { transform: translateY(-1px); }

.game-card--soon {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.12);
  box-shadow: none;
  opacity: 0.6;
  cursor: default;
}
.game-card--soon:hover { transform: none; box-shadow: none; border-color: rgba(255,255,255,0.12); }
.game-card--soon .game-card__art { background: transparent; color: var(--text-dim); }
.game-card--soon .game-card__icon { width: 48px; height: 48px; opacity: 0.6; }

.game-card--feature {
  grid-column: span 2;
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(203,245,74,0.10), transparent 60%),
    linear-gradient(180deg, #0f1309, #0a0c06);
}
.game-card--feature .game-card__num { color: var(--lime); }
.game-card--feature h3 { color: var(--lime); text-shadow: 0 0 26px rgba(203,245,74,0.35); }
@media (max-width: 720px) { .game-card--feature { grid-column: span 1; } }

.game-card__art {
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  padding: 20px;
  color: var(--lime);
  background:
    radial-gradient(120px 120px at 50% 46%, rgba(203,245,74,0.10), transparent 70%);
}
.game-card--feature .game-card__art { border-bottom-color: var(--line); }

.game-card__icon {
  width: 88px; height: 88px; max-width: 100%;
  filter: drop-shadow(0 0 18px rgba(203,245,74,0.35));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game-card:hover .game-card__icon { transform: rotate(-6deg) scale(1.08); }

.game-card__body { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.game-card__num {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--lime);
  opacity: 0.75;
}
.game-card h3 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.03em;
  line-height: 0.92;
  color: var(--text);
}
.game-card p { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--bone); }
.game-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--bone);
  border-radius: 100px;
}
.tag--live { background: rgba(203,245,74,0.1); color: var(--lime); border-color: rgba(203,245,74,0.4); }
.tag--live::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime); margin-right: 5px; vertical-align: 1px;
  box-shadow: 0 0 8px var(--lime);
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.tag--hot { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* ===== ticker ========================================================= */

.ticker {
  margin: 46px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  overflow: hidden;
  background: #060803;
}
.ticker__track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: scroll 60s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.ticker__track:hover { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 10px; }
.ticker__item .win { color: var(--jade); font-weight: 700; }
.ticker__item .loss { color: var(--blood); font-weight: 700; }
.ticker__item .game-name { color: var(--lime); }
.ticker__item .sep { color: var(--text-dim); opacity: 0.5; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== features (was two-token engine) =============================== */

.engine { margin: 64px 0 20px; }

.engine__tokens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 820px) { .engine__tokens { grid-template-columns: 1fr; } }

.token-card {
  background: linear-gradient(180deg, #0e1109, #0a0c07);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.18s;
}
.token-card:hover { border-color: rgba(203,245,74,0.4); box-shadow: var(--shadow-card), var(--glow-soft); transform: translateY(-3px); }
.token-card--fire { }
.token-card__role {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--lime);
  display: block;
  margin-bottom: 10px;
}
.token-card__icon {
  width: 40px; height: 40px; margin-bottom: 14px;
  filter: drop-shadow(0 0 14px rgba(203,245,74,0.4));
}
.token-card h3 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  color: var(--text);
}
.token-card p { font-family: var(--font-sans); font-size: 14px; line-height: 1.6; color: var(--bone); }

/* ===== creed ========================================================== */

.creed {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 44px;
  align-items: center;
  padding: 56px 44px;
  background:
    radial-gradient(500px 400px at 12% 30%, rgba(203,245,74,0.08), transparent 60%),
    linear-gradient(180deg, #0e1109, #090b06);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  margin: 64px 0 20px;
}
@media (max-width: 720px) { .creed { grid-template-columns: 1fr; padding: 36px 24px; } }
.creed__art {
  width: 100%;
  border-radius: 16px;
  filter: drop-shadow(0 0 40px rgba(203,245,74,0.3));
}
.creed__text h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  color: var(--text);
}
.creed__text p { font-family: var(--font-sans); font-size: 15px; line-height: 1.7; margin-bottom: 14px; color: var(--bone); }
.creed__mantra {
  font-family: var(--font-display) !important;
  font-size: 32px !important;
  letter-spacing: 0.15em !important;
  color: var(--lime) !important;
  text-shadow: 0 0 24px rgba(203,245,74,0.4);
  margin-top: 12px !important;
}

/* ===== footer ========================================================= */

.footer {
  background: #060803;
  color: var(--bone);
  padding: 60px 32px 30px;
  border-top: 1px solid var(--line);
}
.footer__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto 40px;
}
@media (max-width: 720px) { .footer__row { grid-template-columns: 1fr 1fr; } }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer__logo { height: 36px; width: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(203,245,74,0.3), 0 0 14px rgba(203,245,74,0.3); }
.footer__brand .brand__logo { font-size: 20px; }
.footer__col p { font-family: var(--font-sans); font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.footer__col p em { color: var(--lime); font-style: normal; }
.footer__col h4 { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.15em; margin-bottom: 14px; color: var(--lime); }
.footer__col a { display: block; font-family: var(--font-sans); font-size: 13px; padding: 4px 0; color: var(--text-dim); transition: color 0.15s; }
.footer__col a:hover { color: var(--lime); }

.footer__bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer__chant { font-family: var(--font-display); color: var(--lime); letter-spacing: 0.2em; }

/* =====================================================================
   GAME PAGE COMMON
   ===================================================================== */

.game-page { padding: 26px 32px 80px; max-width: 1100px; margin: 0 auto; }

.game-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.game-header__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--text);
}
.game-header__title small {
  display: block;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--lime);
  margin-bottom: 6px;
}
.game-header__back {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.14em;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255,255,255,0.02);
  color: var(--bone);
  transition: all 0.15s;
}
.game-header__back:hover { border-color: var(--lime); color: var(--lime); box-shadow: var(--glow); }

.game-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; }
@media (max-width: 900px) { .game-layout { grid-template-columns: 1fr; } }

.stage {
  background: linear-gradient(180deg, #0d100a, #090b06);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.controls {
  background: linear-gradient(180deg, #0e1109, #0a0c07);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: fit-content;
}

.control-row { display: flex; flex-direction: column; gap: 6px; }
.control-row label { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.14em; color: var(--text-dim); }
.control-row input, .control-row select {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: #0a0c06;
  color: var(--text);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.control-row input:focus, .control-row select:focus { border-color: var(--lime); box-shadow: var(--glow); }

.bet-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.bet-quick button {
  flex: 1;
  min-width: 50px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--bone);
  border-radius: 8px;
  transition: all 0.12s;
}
.bet-quick button:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }

.action-btn {
  width: 100%;
  padding: 16px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  border: 1px solid var(--lime);
  background: var(--lime);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 0 26px rgba(203,245,74,0.3);
  transition: all 0.12s;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(203,245,74,0.55); background: var(--lime-bright); }
.action-btn:active { transform: translateY(0); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.action-btn--gold { background: var(--lime); color: var(--ink); }
.action-btn--ink { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--line); box-shadow: none; }
.action-btn--ink:hover { border-color: var(--lime); color: var(--lime); box-shadow: var(--glow); background: rgba(203,245,74,0.06); }

.history { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.history h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.15em; color: var(--text-dim); margin-bottom: 8px; }
.history__list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
  font-family: var(--font-mono); font-size: 12px;
}
.history__item {
  display: flex; justify-content: space-between;
  padding: 5px 9px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-2);
  border-radius: 7px;
}
.history__item.win { color: var(--jade); border-color: rgba(63,224,138,0.2); }
.history__item.loss { color: var(--blood); border-color: rgba(255,83,71,0.2); }

.fair-strip {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.05em;
}
.fair-strip code {
  background: rgba(203,245,74,0.06);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  color: var(--lime);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0c0f08;
  color: var(--text);
  padding: 14px 28px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 14px;
  box-shadow: var(--shadow-card), var(--glow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.win { border-color: var(--jade); color: var(--jade); box-shadow: var(--shadow-card), 0 0 26px rgba(63,224,138,0.35); }
.toast.loss { border-color: var(--blood); color: var(--blood); box-shadow: var(--shadow-card), 0 0 26px rgba(255,83,71,0.3); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(3,4,2,0.8);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: linear-gradient(180deg, #0e1109, #0a0c07);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card), var(--glow-soft);
  max-width: 520px;
  padding: 32px;
  position: relative;
}
.modal h3 { font-family: var(--font-display); font-size: 32px; letter-spacing: 0.04em; margin-bottom: 16px; color: var(--text); }
.modal p { font-family: var(--font-sans); font-size: 13px; line-height: 1.6; margin-bottom: 12px; color: var(--bone); }
.modal code { color: var(--lime); font-family: var(--font-mono); font-size: 12px; }
.modal a { color: var(--lime); }
.modal__close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 28px; font-family: var(--font-display); color: var(--bone); }

.fade-in { opacity: 0; transform: translateY(20px); animation: fadein 0.6s ease forwards; }
@keyframes fadein { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   MOBILE: comprehensive overrides for ≤640px
   ============================================================ */

@media (max-width: 640px) {
  .topbar { padding: 10px 14px 12px; flex-wrap: wrap; row-gap: 8px; }
  .brand { display: inline-flex; align-items: center; min-height: 36px; padding: 2px 0; }
  .brand__mark { height: 30px; width: 30px; }
  .brand__logo { font-size: 18px; }

  .topbar__nav { width: 100%; justify-content: space-between; gap: 8px; font-size: 11px; }
  .topbar__nav > a:not(.brand) { display: none; }
  .topbar__nav .dot { display: none; }

  .balance { padding: 8px 10px; font-size: 12px; gap: 5px; min-height: 40px; }
  .balance img { width: 14px; height: 14px; }
  .balance__unit { display: none; }
  .balance__paper { font-size: 8px; padding: 2px 5px; }

  .session-pill { padding: 6px 10px; font-size: 11px; min-height: 40px; }
  .btn--connect { padding: 9px 13px; font-size: 11px; letter-spacing: 0.04em; min-height: 40px; }

  html { overflow-x: clip; }
  .lobby { padding: 0 16px 60px; }

  .hero { padding: 34px 8px 26px; }
  .hero__title { line-height: 1.05; }
  .hero__title .word--big { font-size: clamp(54px, 16vw, 84px); margin: 6px 0; }
  .hero__title .word:first-child, .hero__title .word:last-child { font-size: clamp(13px, 3.6vw, 18px); }
  .hero__sub { font-size: 14px; padding: 0 12px; }
  .hero__chip { width: 108px; }

  .stat-band .stat { padding: 20px 12px; }

  main.game-page { padding: 20px 16px 60px; }
  .game-header__title { font-size: clamp(40px, 11vw, 64px); }
  .game-header__title small { font-size: 12px; }
  .game-header__back { padding: 12px 18px; font-size: 13px; }

  .game-layout { gap: 16px; }
  .controls { padding: 16px; gap: 14px; }
  .control-row input, .control-row select { font-size: 16px; padding: 12px 14px; }

  .bet-quick { gap: 8px; }
  .bet-quick button { min-width: 48px; min-height: 44px; padding: 10px 12px; font-size: 13px; }

  .stage { min-height: 320px; }
  .fair-strip { font-size: 11px; padding: 12px 14px; flex-wrap: wrap; gap: 6px; }
  .fair-strip code { font-size: 11px; word-break: break-all; }

  body { padding-bottom: env(safe-area-inset-bottom, 0px); }

  .game-card__art { height: 130px; padding: 14px; }
  .game-card__body { padding: 16px; }
  .game-card h3 { font-size: 24px; }
  .game-card p { font-size: 13px; }

  .ticker { font-size: 11px; }
  footer { padding: 30px 16px; }

  .action-btn { min-height: 52px; font-size: 16px; }

  .mines-grid { gap: 6px !important; padding: 10px !important; }
  .tile { font-size: 18px; }
  .coin { width: 200px !important; height: 200px !important; }
  .die { width: 80px !important; height: 80px !important; }
}

@media (max-width: 380px) {
  .hero__title .word--big { font-size: 16vw; }
  .topbar { padding: 10px 12px; }
  .lobby { padding: 0 12px 50px; }
  .balance { font-size: 12px; padding: 6px 10px; }
  .btn--connect { font-size: 11px; padding: 9px 12px; letter-spacing: 0.04em; }
}

@supports (padding: env(safe-area-inset-top)) {
  .ca-bar { padding-top: max(7px, env(safe-area-inset-top)); }
}

/* ===== currency switch + hood boost ================================== */

.currency-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.currency-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color 0.15s, background 0.15s;
}
.currency-switch button:hover { color: var(--text); }
.currency-switch button.selected {
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 0 18px rgba(203,245,74,0.35);
}
.currency-switch button em {
  font-style: normal;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 100px;
  background: rgba(203,245,74,0.14);
  color: var(--lime);
}
.currency-switch button.selected em {
  background: var(--ink);
  color: var(--lime);
  text-shadow: 0 0 10px rgba(203,245,74,0.6);
}
body[data-currency="HOOD"] .currency-switch {
  border-color: rgba(203,245,74,0.45);
  box-shadow: 0 0 22px rgba(203,245,74,0.12);
}

.ticker__item .boost-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 100px;
  background: rgba(203,245,74,0.12);
  border: 1px solid rgba(203,245,74,0.3);
  color: var(--lime);
}

/* lobby banner */
.boost-banner {
  margin: 26px 0 8px;
  border: 1px solid rgba(203,245,74,0.35);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 12% 50%, rgba(203,245,74,0.12), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(203,245,74,0.06);
  overflow: hidden;
}
.boost-banner__inner {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 30px 38px;
}
.boost-banner__pct {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1;
  color: var(--lime);
  text-shadow: 0 0 34px rgba(203,245,74,0.55);
  white-space: nowrap;
  animation: boostPulse 3.2s ease-in-out infinite;
}
@keyframes boostPulse {
  0%, 100% { text-shadow: 0 0 26px rgba(203,245,74,0.4); }
  50% { text-shadow: 0 0 52px rgba(203,245,74,0.75); }
}
.boost-banner__copy { flex: 1; }
.boost-banner__copy h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  color: var(--text);
}
.boost-banner__copy h3 b { color: var(--lime); font-weight: 400; text-shadow: 0 0 18px rgba(203,245,74,0.5); }
.boost-banner__copy p {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bone);
  max-width: 560px;
}
.boost-banner .btn { white-space: nowrap; }

@media (max-width: 820px) {
  .boost-banner__inner { flex-direction: column; text-align: center; gap: 18px; padding: 28px 22px; }
  .boost-banner__copy p { max-width: none; }
}
@media (max-width: 640px) {
  .currency-switch button { padding: 6px 9px; font-size: 11px; }
  .currency-switch button em { display: none; }
}

/* ===== X (twitter) link ============================================== */

.x-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255,255,255,0.03);
  color: var(--bone);
  transition: transform 0.1s ease, box-shadow 0.2s ease, color 0.15s, border-color 0.15s;
}
.x-link svg { width: 15px; height: 15px; display: block; }
.x-link:hover {
  color: var(--lime);
  border-color: var(--lime);
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.footer__x {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--bone);
  transition: color 0.15s;
}
.footer__x svg { width: 13px; height: 13px; display: block; fill: currentColor; }
.footer__x:hover { color: var(--lime); }

@media (max-width: 640px) {
  .x-link { width: 32px; height: 32px; }
  .x-link svg { width: 13px; height: 13px; }
}

/* ===== ca-bar additions (copy button + buy link) ===================== */

.ca-bar__ca {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
  min-width: 0;
}
.ca-bar__ca:hover { color: var(--lime); }
.ca-bar__ca svg { width: 13px; height: 13px; flex: none; opacity: 0.7; }
.ca-bar__addr { overflow: hidden; text-overflow: ellipsis; }

.ca-bar__buy {
  flex: none;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  background: var(--lime);
  color: var(--ink);
  padding: 4px 14px;
  border-radius: 100px;
  box-shadow: 0 0 16px rgba(203,245,74,0.3);
  transition: background 0.15s, box-shadow 0.2s;
}
.ca-bar__buy:hover { background: var(--lime-bright); box-shadow: 0 0 26px rgba(203,245,74,0.55); }

@media (max-width: 640px) {
  .ca-bar { padding: 6px 10px; gap: 8px; font-size: 11px; }
  .ca-bar__addr { max-width: 34vw; }
  .ca-bar__label { font-size: 11px; }
}
