/* =====================================================================
   BANGBOWBING OS — CASINO styles
   Lifted out of os/os.css byte-for-byte by the v3 scene phase (ledger item 33's
   css split, kept under the item 44-47 game frame) so phase-2 app workers edit
   disjoint files. Shell, the shared app kit, the emote/rarity tokens and the
   lightbox stay in os.css; this file owns the Casino app.
   Linked from desktop.html AFTER os.css — same cascade order for ties.
   ===================================================================== */

/* --- casino ------------------------------------------------------- */
.casino {
  position: relative;
  container-type: inline-size;
  container-name: casino;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cas-main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.cas-side { display: grid; gap: 14px; align-content: start; }

/* >=720px panel width (item 38): stage left, bet panel + recent wins right */
@container casino (min-width: 720px) {
  .casino { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: start; gap: 14px; }
  .cas-side { grid-column: 2; grid-row: 1 / -1; }
}
.cas-head { display: flex; align-items: center; gap: 12px; }
.cas-bal { display: grid; gap: 2px; }
.cas-bal .wal-num strong { font-size: 26px; }
.betbar { display: grid; gap: 5px; }
.bet-input { width: 118px; }
.bet-note { font-size: 11.5px; }
.cas-stage {
  min-height: 232px;
  padding: 15px;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(155, 124, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #22243f, #14152a);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 16px rgba(0, 0, 0, 0.4);
}
.game { display: grid; gap: 13px; justify-items: center; }
.game .hint { text-align: center; max-width: 52ch; }
.cas-result {
  padding: 9px 12px;
  border-radius: 9px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--screen-ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cas-result.good {
  color: #e6ffe0;
  background: linear-gradient(180deg, rgba(126, 224, 106, 0.24), rgba(126, 224, 106, 0.08));
  border-color: rgba(126, 224, 106, 0.45);
}
.cas-result.bad { color: #ffd6e2; background: rgba(255, 95, 200, 0.12); border-color: rgba(255, 95, 200, 0.34); }
.casino.is-busy .cas-stage { pointer-events: none; }
.casino.is-big .cas-stage {
  animation: bigwin 1.2s var(--ease);
  border-color: rgba(255, 209, 102, 0.75);
}
@keyframes bigwin {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 rgba(255, 209, 102, 0); }
  35% { box-shadow: inset 0 1px 0 #fff, 0 0 42px rgba(255, 209, 102, 0.85); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 rgba(255, 209, 102, 0); }
}
.cas-burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cas-burst i {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confetti 1.9s cubic-bezier(0.25, 0.6, 0.4, 1) forwards;
}
@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

/* coinflip */
.coin-wrap { perspective: 700px; padding: 8px 0; }
.coin {
  position: relative;
  width: 108px;
  height: 108px;
  transform-style: preserve-3d;
  transition: transform 0.26s var(--ease);
}
.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  backface-visibility: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: #4a2a00;
  background: radial-gradient(120% 120% at 32% 24%, #fff5d6, #ffd166 42%, #d9922a 70%, #b3701a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.85), inset 0 -6px 14px rgba(120, 62, 0, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.5);
}
.coin-face.tails {
  transform: rotateY(180deg);
  background: radial-gradient(120% 120% at 32% 24%, #f2fbff, #b9e6ff 42%, #63b6e6 70%, #3d86b8);
  color: #05314a;
}
.coin.is-flipping { animation: coinspin 0.42s linear infinite; }
@keyframes coinspin { to { transform: rotateY(360deg); } }
.coin.land-heads { transform: rotateY(0deg); }
.coin.land-tails { transform: rotateY(180deg); }

/* slots */
.reels {
  display: flex;
  gap: 9px;
  padding: 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, #0c0d18, #23253c);
  border: 1px solid rgba(0, 0, 0, 0.65);
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.65);
}
.reel {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(180deg, #f6f8ff, #cfd6e6);
  box-shadow: inset 0 -8px 14px rgba(20, 26, 44, 0.3), inset 0 8px 14px rgba(255, 255, 255, 0.9);
}
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 42%,
    rgba(20, 26, 44, 0.18));
}
.reel-strip { will-change: transform; }
.reel-strip.spinning { animation: reelspin 0.22s linear infinite; }
@keyframes reelspin { from { transform: translateY(0); } to { transform: translateY(-384px); } }
.sym {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 32px;
  line-height: 1;
}
.paytable { width: 100%; max-width: 420px; font-size: 12px; color: var(--screen-dim); }
.paytable summary {
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--aqua-lt);
}
.paytable table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.paytable th, .paytable td { padding: 3px 6px; text-align: right; }
.paytable th:first-child, .paytable td:first-child { text-align: left; }
.paytable th { font-weight: 600; font-size: 10.5px; color: var(--screen-dim); }
.paytable td { color: var(--screen-ink); }
.paytable td.sym { font-size: 19px; height: auto; width: auto; display: table-cell; }

/* dice */
.game.dice { width: 100%; }
.dice-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 14px rgba(127, 227, 255, 0.5);
}
.dice-num.win { color: var(--lime); text-shadow: 0 2px 16px rgba(126, 224, 106, 0.6); }
.dice-num.lose { color: #ff9ab5; text-shadow: none; }
.dice-track {
  position: relative;
  width: min(100%, 440px);
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0c0d18, #23253c);
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.dice-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(126, 224, 106, 0.85), rgba(70, 178, 58, 0.7));
}
.dice-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}
.dice-roll {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 4px;
  margin-left: -2px;
  border-radius: 3px;
  background: var(--candy);
  box-shadow: 0 0 10px var(--candy);
  transition: left 0.12s linear;
}
.dice-read { display: grid; gap: 3px; justify-items: center; }
.dice-big { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; letter-spacing: 0.04em; }
.dice-range { width: min(100%, 440px); accent-color: #6a30d8; }

/* predictions + win feed */
.game.preds { width: 100%; justify-items: stretch; }
.pred-q { margin: 0; font-family: var(--font-ui); font-weight: 700; font-size: 15px; color: #fff; }
.predopts { display: grid; gap: 6px; }
.voteopt.mine { border-color: var(--lime); }
.voteopt:disabled { opacity: 0.9; }
.winlist { display: grid; gap: 3px; }
.winrow {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.win-name { font-weight: 700; color: var(--aqua-lt); }
.win-net { font-family: var(--font-display); font-weight: 700; color: var(--lime); }

/* --- narrow windows / phones -------------------------------------- */
@media (max-width: 759px) {
  .cas-stage { padding: 11px; }
  .coin { width: 88px; height: 88px; }
  .coin-face { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .coin.is-flipping { animation-duration: 1.2s; animation-iteration-count: 1; }
  .reel-strip.spinning { animation-duration: 0.6s; animation-iteration-count: 1; }
  .cas-burst i { display: none; }
  .casino.is-big .cas-stage { animation: none; }
}
