/* ===========================================================================
 * jolt8 — Roulette styles
 * ======================================================================== */
.roul { max-width: 1000px; margin: 0 auto; padding-bottom: 30px; }
.roul [hidden] { display: none !important; }

/* top bar */
.roul-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.roul-bal-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--surface, #181b34); border: 1px solid var(--line, #2a2e50);
  border-radius: 99px; padding: 7px 14px; font-weight: 700; color: #ffe8a3; white-space: nowrap; }
.roul-bal-pill svg { color: #ffd23f; }
.roul-period { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-3, #14172e); border: 1px solid var(--line, #2a2e50); border-radius: 10px; padding: 6px 12px; font-size: 13px; color: var(--muted, #9aa0c8); }
.roul-period b { color: var(--text, #fff); font-variant-numeric: tabular-nums; }
.roul-per-label { text-transform: uppercase; font-size: 10px; letter-spacing: 1.5px; }
.roul-count { color: #ffd23f; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.roul-history { display: flex; align-items: center; gap: 5px; overflow-x: auto; flex: 1; min-width: 120px; scrollbar-width: none; }
.roul-history::-webkit-scrollbar { display: none; }
.rh-label { font-size: 10px; letter-spacing: 1.5px; color: #8c7c58; text-transform: uppercase; }
.rh-chip { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; color: #fff; border: 1.5px solid rgba(255,255,255,.2); flex: 0 0 auto; }

/* stage */
/* bind the stage to the viewport so the board + bet controls fit without scrolling */
.roul-stage { display: flex; gap: 16px; align-items: stretch; height: clamp(420px, calc(100vh - 230px), 780px); }
.roul-wheel-wrap { position: relative; flex: 1; min-width: 0; border-radius: 16px; overflow: hidden; background: #0a0705;
  border: 1px solid var(--line, #2a2e50); box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.roul-wheel-wrap canvas { display: block; width: 100%; height: 100%; }
.roul-board-wrap { flex: 0 0 auto; height: 100%; }                                /* width follows the board height */
.roul-board-wrap canvas { height: 100%; width: auto; max-width: 100%; display: block; cursor: pointer; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

.roul-status { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 800; letter-spacing: 1.5px;
  padding: 6px 16px; border-radius: 99px; background: rgba(8,7,6,.55); border: 1px solid rgba(231,194,112,.25); backdrop-filter: blur(6px); color: #e7c270; white-space: nowrap; }
.roul-status.spin { color: #ff9a9a; border-color: rgba(220,40,40,.4); }
.roul-result { position: absolute; top: 50px; left: 50%; transform: translateX(-50%) scale(.85); display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 19px; padding: 8px 22px; border-radius: 99px; color: #fff; background: rgba(8,7,6,.66); border: 1px solid rgba(231,194,112,.25);
  backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s cubic-bezier(.2,1.3,.4,1); }
.roul-result.show { opacity: 1; transform: translateX(-50%) scale(1); }
.rr-dot { width: 15px; height: 15px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.roul-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #7a6f5a; letter-spacing: 4px; font-size: 12px; }

/* controls */
.roul-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.roul-rack { display: flex; gap: 9px; }
.roul-chip { width: 46px; height: 46px; border-radius: 50%; cursor: pointer; border: 3px dashed rgba(255,255,255,.6); font-weight: 800; color: #fff; font-size: 13px; transition: transform .12s, box-shadow .12s; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.roul-chip:hover { transform: translateY(-3px); }
.roul-chip.sel { transform: translateY(-5px) scale(1.06); box-shadow: 0 0 0 3px #f6e6a8, 0 6px 14px rgba(0,0,0,.6); }
.roul-chip[data-v="1"] { background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf); color: #222; }
.roul-chip[data-v="5"] { background: radial-gradient(circle at 35% 30%, #e23b3b, #9e0b0b); }
.roul-chip[data-v="25"] { background: radial-gradient(circle at 35% 30%, #34c06a, #0c7a39); }
.roul-chip[data-v="100"] { background: radial-gradient(circle at 35% 30%, #3a3a3a, #0a0a0a); }
.roul-chip[data-v="500"] { background: radial-gradient(circle at 35% 30%, #a45cff, #5e189e); }
.roul-btns { display: flex; gap: 9px; margin-left: auto; align-items: center; }
.roul-act { cursor: pointer; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 800; font-size: 13px; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 6px; transition: transform .08s, filter .15s; }
.roul-act:active { transform: translateY(1px); }
.roul-act.ghost { background: var(--bg-3, #14172e); border: 1px solid var(--line, #2a2e50); color: var(--muted, #aeb2e0); }
.roul-act.ghost:hover { color: #fff; }
.roul-act.confirm { background: linear-gradient(180deg, #3DC55B, #229A46); color: #fff; flex-direction: column; gap: 0; padding: 9px 24px; }
.roul-act.confirm b { font-size: 12px; font-weight: 700; opacity: .9; }
.roul-act.confirm.dim { filter: grayscale(.5) brightness(.7); }

.roul-msg { min-height: 0; text-align: center; margin-top: 10px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s; }
.roul-msg.show { opacity: 1; }
.roul-msg.ok { color: #4dffa0; } .roul-msg.err { color: #ff6d7e; }

/* mobile betting sheet */
.roul-betnow { display: none; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px;
  padding: 15px; border: 0; border-radius: 13px; background: linear-gradient(180deg, #5cd97a 0%, #2fb455 48%, #137a36 100%); color: #fff;
  font-weight: 800; font-size: 16px; letter-spacing: 1px; cursor: pointer; box-shadow: 0 6px 16px rgba(19,122,54,.35); }
.roul-modal { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(4,3,2,.78); backdrop-filter: blur(4px); align-items: flex-end; justify-content: center; }
.roul-modal-card { width: 100%; max-width: 520px; max-height: 94vh; background: var(--bg-2, #10142a); border: 1px solid var(--line, #2a2e50); border-bottom: 0;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -10px 40px rgba(0,0,0,.6); animation: roulSheet .25s ease; }
@keyframes roulSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
.roul-modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line, #2a2e50); flex: 0 0 auto; }
.roul-modal-count { font-size: 13px; color: var(--muted, #9aa0c8); }
.roul-modal-count b { color: #ffd23f; font-variant-numeric: tabular-nums; }
.roul-modal-close { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-3, #14172e); border: 1px solid var(--line, #2a2e50); color: #fff; font-size: 16px; cursor: pointer; }
.roul-modal-body { overflow-y: auto; padding: 14px; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 880px) {
  .roul-stage { flex-direction: column; height: auto; gap: 12px; }
  .roul-wheel-wrap { height: 96vw; min-height: 380px; max-height: 560px; }
  .roul-stage .roul-board-wrap { display: none; }       /* board lives in the sheet */
  .roul > #roulControls { display: none; }              /* controls live in the sheet */
  .roul-betnow { display: flex; }
  .roul-modal.open { display: flex; }
  .roul-modal-body .roul-board-wrap { display: block; width: 100%; max-width: 440px; margin: 0 auto; }
  .roul-modal-body .roul-board-wrap canvas { width: 100%; height: auto; }
  .roul-modal-body #roulControls { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: -1px;
    margin: 12px -14px -14px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #0e1326; border-top: 1px solid var(--line, #2a2e50); box-shadow: 0 -10px 22px rgba(0,0,0,.55); }
  .roul-modal-body .roul-chip { width: 44px; height: 44px; }
  .roul-modal-body .roul-btns { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ── win modal ───────────────────────────────────────────────────── */
.roul-win {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,7,16,.6); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s; cursor: pointer;
}
.roul-win.show { opacity: 1; }
.roul-win[hidden] { display: none; }
.roul-win-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 30px 44px; text-align: center; border-radius: 22px;
  background: radial-gradient(ellipse at 50% 30%, #1c2b18, #0a1206 75%);
  border: 2px solid #e7c270;
  box-shadow: 0 24px 70px rgba(0,0,0,.65), 0 0 60px rgba(231,194,112,.5), inset 0 0 30px rgba(120,90,20,.4);
  transform: scale(.65) translateY(14px);
  transition: transform .32s cubic-bezier(.25,1.5,.5,1);
}
.roul-win.show .roul-win-card { transform: scale(1) translateY(0); }
.roul-win-title {
  font-weight: 900; letter-spacing: 4px; font-size: 18px;
  color: #ffe9a8; text-shadow: 0 0 14px rgba(255,200,80,.7);
}
.roul-win-amt {
  font-family: 'Lilita One', system-ui, sans-serif; line-height: 1;
  font-size: clamp(44px, 12vw, 72px);
  background-image: linear-gradient(180deg, #fff7d6 0%, #ffd24a 55%, #f0980e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(120,70,0,.5)) drop-shadow(0 0 28px rgba(255,200,50,.75));
  animation: roulWinPulse 1.3s ease-in-out infinite;
}
.roul-win-amt span { font-family: system-ui, sans-serif; font-size: .35em; font-weight: 800; color: rgba(255,225,150,.8); -webkit-text-fill-color: rgba(255,225,150,.8); }
@keyframes roulWinPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.roul-win-sub { font-size: 13px; color: rgba(255,235,180,.8); font-weight: 700; }
.roul-win-sub b { color: #ffd24a; }
