/* =====================================================================
   TOKABU CASINO — global styles
   The Spirit of Gambling. Hand-drawn ink on cream. GLUWUWLU.
   ===================================================================== */

:root {
  --cream:        #f6f1e6;
  --cream-deep:   #ede6d3;
  --paper:        #fffaee;
  --ink:          #0d0d0d;
  --ink-soft:     #1d1c19;
  --bone:         #d8d1bd;
  --blood:        #d83a2c;
  --blood-deep:   #a82518;
  --gold:         #e6b94a;
  --gold-deep:    #b88a1f;
  --jade:         #2f6b3c;
  --bruise:       #5b3a8a;

  --font-display: "Anton", "Bebas Neue", Impact, sans-serif;
  --font-mono:    "IBM Plex Mono", "Menlo", monospace;
  --font-script:  "Caveat", "Marker Felt", cursive;

  --shadow-stamp: 4px 4px 0 var(--ink);
  --shadow-soft:  2px 2px 0 var(--ink);
}

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

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

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(216,58,44,0.04) 0, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(230,185,74,0.06) 0, transparent 50%);
}

/* Paper grain overlay — sits above everything as decoration */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.35;
  mix-blend-mode: multiply;
  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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 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; }

/* ===== CA bar ========================================================= */

.ca-bar {
  position: relative;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--ink);
  color: var(--bone);
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow-x: auto;
}

.ca-bar__label {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--gold);
  font-size: 13px;
}

.ca-bar__addr {
  font-family: var(--font-mono);
  color: var(--bone);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  user-select: all;
}

.ca-bar__copy {
  background: transparent;
  border: 1px solid var(--bone);
  color: var(--bone);
  padding: 3px 10px;
  border-radius: 3px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 11px;
  transition: all 0.15s ease;
}

.ca-bar__copy:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.ca-bar__copy.copied {
  background: var(--bone);
  color: var(--ink);
}

@media (max-width: 700px) {
  .ca-bar {
    font-size: 11px;
    padding: 8px 12px;
    gap: 8px;
    justify-content: flex-start;
  }
  .ca-bar__label { font-size: 12px; flex: none; }
  .ca-bar__addr {
    font-size: 11px;
    padding: 6px 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ca-bar__copy {
    font-size: 11px;
    padding: 8px 12px;
    min-height: 40px;
    min-width: 56px;
    flex: none;
  }
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
}

.brand__logo { height: 38px; display: block; }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 14px;
}

.topbar__nav a:hover { color: var(--blood); }

.dot { color: var(--ink-soft); opacity: 0.4; }

.balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}
.balance img { width: 16px; height: 16px; }
.balance__unit { color: var(--blood); font-size: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 13px;
  border-radius: 100px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--blood { background: var(--blood); border-color: var(--ink); color: var(--paper); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: var(--shadow-soft) !important; }

.btn--connect {
  background: var(--blood);
  color: var(--paper);
}

/* ===== lobby — hero ================================================== */

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

.hero {
  position: relative;
  text-align: center;
  padding: 80px 20px 60px;
}

.hero__eyes {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 24px;
  animation: blink 4s infinite;
}
.hero__eye { width: 28px; height: 28px; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }

@keyframes blink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

.hero__title {
  font-family: var(--font-display);
  line-height: 0.85;
  font-weight: 400;
  margin-bottom: 28px;
}
.hero__title .word {
  display: block;
  letter-spacing: 0.02em;
}
.hero__title .word--big {
  font-size: clamp(80px, 18vw, 240px);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 6px 6px 0 var(--blood);
  margin: -10px 0;
}
.hero__title .word:first-child { font-size: clamp(20px, 3vw, 32px); }
.hero__title .word:last-child { font-size: clamp(20px, 3vw, 32px); color: var(--blood-deep); }

.hero__sub {
  font-family: var(--font-script);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.3;
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero__sub em { font-style: italic; color: var(--blood); }
.mantra {
  font-family: var(--font-display);
  font-size: max(11px, 0.7em);
  letter-spacing: 0.15em;
  background: var(--ink);
  color: var(--cream);
  padding: 2px 8px;
  display: inline-block;
  transform: rotate(-2deg);
}

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

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.15em;
  margin: 60px 0 32px;
}
.section-title img { height: 28px; opacity: 0.7; }

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

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-stamp);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}
.game-card:hover {
  transform: translate(-3px, -3px) rotate(-0.3deg);
  box-shadow: 7px 7px 0 var(--ink);
  background: var(--cream-deep);
}
.game-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.game-card--feature {
  grid-column: span 2;
  background: var(--ink);
  color: var(--cream);
}
.game-card--feature .game-card__num { color: var(--gold); }
.game-card--feature p { color: var(--bone) !important; }
.game-card--feature h3 { color: var(--gold); }
.game-card--feature .tag { background: var(--cream); color: var(--ink); border-color: var(--cream); }

@media (max-width: 720px) {
  .game-card--feature { grid-column: span 1; }
}

.game-card__art {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid currentColor;
  padding: 20px;
  color: var(--ink);
  background:
    repeating-linear-gradient(45deg,
      transparent 0 12px,
      rgba(13,13,13,0.04) 12px 13px);
}
.game-card--feature .game-card__art { color: var(--gold); background: transparent; border-bottom-color: var(--bone); }

.game-card__icon {
  width: 90px;
  height: 90px;
  max-width: 100%;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game-card:hover .game-card__icon { transform: rotate(-8deg) scale(1.05); }

.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(--blood);
  opacity: 0.8;
}
.game-card h3 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  line-height: 0.9;
}
.game-card p {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  background: var(--cream);
  border-radius: 3px;
}
.tag--live {
  background: var(--ink);
  color: var(--paper);
}
.tag--live::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blood);
  margin-right: 4px;
  vertical-align: 1px;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.tag--hot {
  background: var(--gold);
  border-color: var(--ink);
}

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

.ticker {
  margin: 48px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 14px 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
}
.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.05em;
}
.ticker__track:hover { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 10px; }
.ticker__item .win { color: var(--gold); font-weight: 700; }
.ticker__item .loss { color: var(--blood); font-weight: 700; }
.ticker__item .game-name { color: var(--bone); }
.ticker__item .sep { color: var(--ink-soft); opacity: 0.5; }
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

.creed {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: center;
  padding: 60px 40px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-stamp);
  margin: 60px 0 20px;
}
@media (max-width: 720px) {
  .creed { grid-template-columns: 1fr; }
}
.creed__art {
  width: 100%;
  border: 2px solid var(--ink);
  filter: contrast(1.1);
}
.creed__text h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.creed__text p {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--ink-soft);
}
.creed__mantra {
  font-family: var(--font-display) !important;
  font-size: 32px !important;
  letter-spacing: 0.15em !important;
  color: var(--blood) !important;
  margin-top: 10px !important;
}

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

.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 60px 32px 30px;
  border-top: 2px solid var(--ink);
}
.footer__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto 40px;
}
@media (max-width: 720px) {
  .footer__row { grid-template-columns: 1fr 1fr; }
}
.footer__logo { height: 36px; filter: invert(1); margin-bottom: 14px; }
.footer__col p { font-size: 14px; line-height: 1.6; color: var(--bone); }
.footer__col p em { color: var(--gold); }
.footer__col h4 {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.15em;
  margin-bottom: 14px;
  color: var(--gold);
}
.footer__col a {
  display: block;
  font-size: 13px;
  padding: 4px 0;
  color: var(--bone);
  transition: color 0.15s;
}
.footer__col a:hover { color: var(--cream); }

.footer__bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(246,241,230,0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
}
.footer__chant {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 0.2em;
}

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

.game-page {
  padding: 24px 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: 2px solid var(--ink);
}
.game-header__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.85;
  letter-spacing: 0.02em;
}
.game-header__title small {
  display: block;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--blood);
  margin-bottom: 4px;
}
.game-header__back {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.15em;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  background: var(--paper);
}
.game-header__back:hover { background: var(--ink); color: var(--cream); }

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

.stage {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-stamp);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.controls {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-stamp);
  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.15em;
  color: var(--ink-soft);
}
.control-row input,
.control-row select {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--cream);
  border-radius: 3px;
  outline: none;
  transition: background 0.1s;
}
.control-row input:focus,
.control-row select:focus { background: var(--paper); border-color: var(--blood); }

.bet-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bet-quick button {
  flex: 1;
  min-width: 50px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  background: var(--cream);
  border-radius: 3px;
  transition: all 0.1s;
}
.bet-quick button:hover { background: var(--ink); color: var(--cream); }

.action-btn {
  width: 100%;
  padding: 16px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  border: 2.5px solid var(--ink);
  background: var(--blood);
  color: var(--paper);
  border-radius: 4px;
  box-shadow: var(--shadow-stamp);
  transition: all 0.1s;
}
.action-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.action-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: var(--shadow-stamp) !important; }
.action-btn--gold { background: var(--gold); color: var(--ink); }
.action-btn--ink { background: var(--ink); color: var(--cream); }

.history {
  margin-top: 16px;
  border-top: 1.5px dashed var(--ink-soft);
  padding-top: 16px;
}
.history h4 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  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: 4px 8px;
  background: var(--cream);
  border-radius: 3px;
}
.history__item.win { color: var(--jade); }
.history__item.loss { color: var(--blood); }

/* fairness footer line under each game */
.fair-strip {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.fair-strip code {
  background: var(--paper);
  padding: 2px 6px;
  border: 1px solid var(--bone);
  border-radius: 2px;
  font-size: 11px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--cream);
  padding: 14px 28px;
  border: 2px solid var(--ink);
  border-radius: 100px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 14px;
  box-shadow: var(--shadow-stamp);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.win { background: var(--jade); }
.toast.loss { background: var(--blood); }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 8px 8px 0 var(--ink);
  max-width: 520px;
  padding: 32px;
  position: relative;
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.modal p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--ink-soft);
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  font-family: var(--font-display);
}

/* fancy scroll animation utility */
.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 — collapse to brand + balance + small connect button */
  .topbar { padding: 12px 14px; }
  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 4px 0;
  }
  .brand__logo { height: 28px; }

  .topbar__nav { gap: 10px; font-size: 11px; }
  /* hide ancillary nav links on phone */
  .topbar__nav > a:not(.brand) { display: none; }
  .topbar__nav .dot { display: none; }

  /* compact balance pill */
  .balance {
    padding: 8px 12px;
    font-size: 13px;
    gap: 5px;
    min-height: 40px;
  }
  .balance img { width: 14px; height: 14px; }
  .balance__unit { font-size: 11px; }

  /* CONNECT WALLET → small primary action */
  .btn--connect {
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: 0.06em;
    min-height: 40px;
  }

  /* main padding */
  .lobby { padding: 0 16px 60px; }

  /* hero scaled down so words don't overlap */
  .hero { padding: 36px 8px 28px; }
  .hero__title { line-height: 1; }
  .hero__title .word--big {
    font-size: clamp(64px, 16vw, 88px);
    margin-top: -4px;
    margin-bottom: 4px;
  }
  .hero__title .word:first-child,
  .hero__title .word:last-child {
    font-size: clamp(14px, 4vw, 22px);
  }
  .hero__sub { font-size: 13px; padding: 0 12px; }

  /* eyes — bigger and crisper */
  .hero__eye { width: 22px; height: 22px; }
  .hero__eyes { gap: 90px; }

  /* Game pages: paths/tag chips align center */
  main.game-page { padding: 20px 16px 60px; }

  .game-header__title {
    font-size: clamp(40px, 11vw, 64px);
  }
  .game-header__title small { font-size: 12px; }

  /* "← BACK TO LOBBY" — make it bigger / center */
  .game-header__back {
    padding: 12px 18px;
    font-size: 13px;
  }

  /* game-layout already collapses at <900px — tighten spacing on small phones */
  .game-layout { gap: 16px; }

  /* controls panel: looser padding, taller bet inputs */
  .controls { padding: 16px; gap: 14px; }

  .control-row input,
  .control-row select {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 12px 14px;
  }

  /* bet quick presets — proper tap targets, single row scroll if needed */
  .bet-quick { gap: 8px; }
  .bet-quick button {
    min-width: 48px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* stage — reduce min-height on mobile */
  .stage { min-height: 320px; }

  /* fairness strip text */
  .fair-strip { font-size: 11px; padding: 12px 14px; flex-wrap: wrap; gap: 6px; }
  .fair-strip code { font-size: 11px; word-break: break-all; }

  /* bottom-of-page breathing room (safe-area + home indicator) */
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* lobby cards: smaller art, tighter padding */
  .game-card__art { height: 130px; padding: 14px; }
  .game-card__body { padding: 16px; }
  .game-card h3 { font-size: 22px; }
  .game-card p { font-size: 13px; }

  /* ticker tighter */
  .ticker { font-size: 11px; }

  /* footer */
  footer { padding: 30px 16px; }

  /* action buttons (e.g. Place bet, Cash out) — taller for tap */
  .action-btn { min-height: 52px; font-size: 16px; }

  /* mines grid */
  .mines-grid { gap: 6px !important; padding: 10px !important; }
  .tile { font-size: 18px; }

  /* coin face */
  .coin { width: 200px !important; height: 200px !important; }

  /* dice */
  .die { width: 80px !important; height: 80px !important; }
}

/* very narrow — under 380 */
@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; }
}

/* notch / safe-area top — push CA bar down */
@supports (padding: env(safe-area-inset-top)) {
  .ca-bar { padding-top: max(7px, env(safe-area-inset-top)); }
}
