/* SharpLab HQ — Casino page.
   Builds on hqstyle.css (shared vars/header/nav/.btn/.card). Only casino-specific styling here. */

/* Tiny game-specific accents (not in the shared palette). */
:root {
  --roul-red:   #e5484d;
  --roul-black: #2b3040;
  --roul-green: #2ea043;
}

/* ── Page intro ── */
.casino-head { margin: 4px 0 20px; }
.casino-head h1 { font-size: 26px; margin: 0 0 4px; }
.casino-head p { color: var(--muted); margin: 0; font-size: 14px; }

.balancechip {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 11px; vertical-align: middle;
}

/* ── Game grid ── */
.gamegrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.gcard { display: flex; flex-direction: column; gap: 12px; }
.gcard .ghead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.gcard h2 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.gcard .gicon { font-size: 20px; }
.gcard .gpay { font-size: 11px; color: var(--muted); }
.gcard .gpay b { color: var(--fg); }

/* ── Bet input component ── */
.betrow { display: flex; flex-direction: column; gap: 6px; }
.betrow .betlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.betline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.betinput {
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; width: 120px; font-variant-numeric: tabular-nums;
}
.betinput:focus { outline: none; border-color: var(--accent); }
.chipbtns { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.chipbtn {
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 10px; transition: border-color var(--t), color var(--t);
}
.chipbtn:hover { border-color: var(--accent); color: var(--fg); }

/* ── Segmented toggles (side / direction) ── */
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.toggle button {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 0; padding: 8px 16px;
  transition: background var(--t), color var(--t);
}
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button:hover { color: var(--fg); }
.toggle button.on { background: var(--accent); color: var(--bg); }

/* ── Play button + result ── */
.playbtn { align-self: flex-start; }
.result { font-size: 13px; min-height: 18px; font-weight: 600; }
.result.win { color: var(--green); }
.result.loss { color: var(--red); }
.result.idle { color: var(--muted); font-weight: 400; }
.subline { font-size: 12px; color: var(--muted); min-height: 15px; }
.subline b { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ═══════════════════ Coinflip ═══════════════════ */
.coinstage { display: flex; justify-content: center; padding: 6px 0 2px; }
.coin {
  width: 84px; height: 84px; border-radius: 50%; position: relative;
  transform-style: preserve-3d; transition: transform .1s;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 900; color: var(--bg);
  background: radial-gradient(circle at 35% 30%, #f4d47a, var(--gold) 70%);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.18), 0 8px 20px rgba(0,0,0,.45);
}
.coin.flipping { animation: coin-flip .9s cubic-bezier(.3,.1,.3,1); }
@keyframes coin-flip {
  0% { transform: rotateX(0); }
  100% { transform: rotateX(1980deg); }
}
.coin .cface { position: absolute; backface-visibility: hidden; }

/* ═══════════════════ Dice ═══════════════════ */
.diceslider { width: 100%; accent-color: var(--accent); }
.dicescale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.dicereadout {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.dicereadout b { color: var(--fg); font-variant-numeric: tabular-nums; }
.dicetrack {
  position: relative; height: 26px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line); margin: 2px 0;
}
.dicetrack .winzone { position: absolute; top: 0; bottom: 0; background: var(--green-soft); }
.dicetrack .marker {
  position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--gold);
  transition: left .5s cubic-bezier(.3,.1,.3,1);
}
.dicetrack .rolledlbl {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  font-size: 12px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums;
  transition: left .5s cubic-bezier(.3,.1,.3,1); text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ═══════════════════ Slots ═══════════════════ */
.reels { display: flex; gap: 10px; justify-content: center; padding: 4px 0; }
.reel {
  width: 76px; height: 90px; border-radius: var(--r); overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 44px; line-height: 1;
}
.reel.win { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(224,175,104,.35); }
.reel .strip { display: flex; flex-direction: column; }
.reel.spin .strip { animation: reel-spin .6s linear infinite; }
@keyframes reel-spin { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* ═══════════════════ Roulette ═══════════════════ */
.roulwheel { display: flex; justify-content: center; padding: 4px 0; }
.roulnum {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; font-weight: 900; color: #fff; border: 3px solid rgba(255,255,255,.15);
  box-shadow: 0 8px 20px rgba(0,0,0,.45); background: var(--roul-black);
  transition: transform .2s;
}
.roulnum.spin { animation: roul-spin .7s ease-in-out; }
@keyframes roul-spin { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(.94); } 75% { transform: rotate(12deg) scale(1.06); } }
.roulnum.red { background: var(--roul-red); }
.roulnum.green { background: var(--roul-green); }
.roulnum.black { background: var(--roul-black); }

.betgroup { display: flex; flex-direction: column; gap: 6px; }
.betgroup .betlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.kindbtns { display: flex; gap: 5px; flex-wrap: wrap; }
.kindbtn {
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 11px; transition: border-color var(--t), color var(--t), background var(--t);
}
.kindbtn:hover { border-color: var(--accent); color: var(--fg); }
.kindbtn.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.kindbtn.red.on { background: var(--roul-red); border-color: var(--roul-red); color: #fff; }
.kindbtn.black.on { background: var(--roul-black); border-color: var(--line-strong); color: #fff; }
.roulnumin {
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--fg); width: 68px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}
.roulnumin:focus { outline: none; border-color: var(--accent); }
.roulnumwrap { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

/* ═══════════════════ Plinko ═══════════════════ */
.plinko-board {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 5 / 4; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: space-around;
  padding: 10px 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r);
}
.plinko-row { display: flex; justify-content: space-evenly; }
.peg { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.plinko-ball {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #f4d47a, var(--gold) 70%);
  box-shadow: 0 0 8px rgba(224,175,104,.6); transform: translate(-50%, -50%);
  left: 50%; top: 0; opacity: 0;
}
.plinko-buckets { display: flex; gap: 3px; }
.plinko-bucket {
  flex: 1; text-align: center; font-size: 10px; font-weight: 700; padding: 5px 2px;
  border-radius: var(--r-sm); background: var(--panel2); border: 1px solid var(--line);
  color: var(--muted); font-variant-numeric: tabular-nums;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.plinko-bucket.hit { background: var(--gold); color: var(--bg); border-color: var(--gold); box-shadow: 0 0 14px rgba(224,175,104,.4); }

/* ═══════════════════ Crash ═══════════════════ */
.crash-stage {
  display: flex; align-items: center; justify-content: center; height: 96px; overflow: hidden;
  border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line);
}
.crash-mult {
  font-size: 40px; font-weight: 900; color: var(--green); letter-spacing: .5px;
  font-variant-numeric: tabular-nums; transition: color .15s, transform .15s;
}
.crash-mult.cashed { color: var(--green); }
.crash-mult.crashed { color: var(--red); animation: crash-shake .4s; }
@keyframes crash-shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
.crash-targetrow { display: flex; gap: 8px; align-items: center; }
.crash-slider { flex: 1; accent-color: var(--accent); }
.crash-targetin {
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--fg); width: 72px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}
.crash-targetin:focus { outline: none; border-color: var(--accent); }
.crash-targetrow > span { color: var(--muted); font-size: 13px; }

/* ── Signed-out state ── */
.signedout { text-align: center; padding: 40px 20px; color: var(--muted); }
.signedout .big { font-size: 40px; margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  .coin.flipping, .reel.spin .strip, .roulnum.spin, .crash-mult.crashed { animation: none; }
  .dicetrack .marker, .dicetrack .rolledlbl, .plinko-ball, .plinko-bucket { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Copied verbatim from cards.css so the coins hub + toasts are styled on this
   page too (cards.css is only loaded on the Cards page).
   ═══════════════════════════════════════════════════════════════════════════ */
.coinschip { font-weight: 700; color: var(--gold); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; white-space: nowrap; cursor: pointer; transition: border-color .15s, transform .15s; }
.coinschip:hover { border-color: var(--gold); transform: translateY(-1px); }

/* Coins hub modal */
.hubov { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: rgba(5,7,11,.6); backdrop-filter: blur(3px); animation: cd-scrim-in .18s ease both; }
@keyframes cd-scrim-in { from { opacity: 0; } to { opacity: 1; } }
.hubcard { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; box-shadow: 0 24px 60px -20px #000; }
.hubhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hubhead h3 { margin: 0; font-size: 17px; }
.hubx { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.hubx:hover { color: var(--fg); background: var(--panel2); }
.hubrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.hubrow:first-of-type { border-top: 0; }
.hubicon { font-size: 20px; width: 30px; text-align: center; flex: 0 0 auto; }
.hubt { font-weight: 700; font-size: 14px; }
.hubd { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.hubfoot { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: right; }
.hubfoot b { color: var(--gold); }

.cardtoast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
