input[type=range] { accent-color: var(--accent); }
@keyframes hjResIn { 0% { opacity: 0; transform: translateY(6px) scale(.96); } 100% { opacity: 1; transform: none; } }

.casino {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start;
  gap: 24px; padding: 24px clamp(16px, 4vw, 48px) 40px; max-width: 1400px; width: 100%; margin: 0 auto;
}
.stage-card { grid-column: span 2; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 760px) { .stage-card { grid-column: auto; } }
.side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.side-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.side-card h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

.game-tabs { display: flex; gap: 4px; background: var(--inner); border-radius: 12px; padding: 4px; align-self: flex-start; flex-wrap: wrap; }
.game-tabs button { display: flex; align-items: center; gap: 8px; border: none; border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer; background: transparent; color: var(--muted); }
.game-tabs button.on { background: #3a4150; color: var(--text); }
.game-tabs button:disabled { cursor: default; }

.stage { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.game-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }

.reels { display: flex; gap: 12px; background: var(--inner); border-radius: 18px; padding: 14px; }
.reel { width: clamp(80px, 14vw, 120px); aspect-ratio: 3/4; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; transition: border-color .2s; }
.reel.win { border-color: rgba(143, 227, 168, .5); }
.reel .ms { font-size: clamp(44px, 7vw, 64px); }
.reel.spinning .ms { opacity: .55; filter: blur(1.5px); }
.paytable { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; }
.paytable > span { display: flex; align-items: center; gap: 6px; background: var(--inner); border-radius: 8px; padding: 5px 10px; }
.paytable .ms { font-size: 16px; }
.paytable .m { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); }
.paytable .pt-note { font-size: 12px; font-weight: 600; color: var(--muted-2); }

.coin-wrap { perspective: 800px; }
.coin { width: 160px; height: 160px; position: relative; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.coin-face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .18), 0 16px 40px rgba(0, 0, 0, .4); }
.coin-face .ms { font-size: 72px; }
.coin-face.front { background: radial-gradient(circle at 35% 30%, #ffe39a, #f2b544 55%, #c98a2a); }
.coin-face.front .ms { color: #7a4a14; }
.coin-face.back { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #c9d6f7, #7FA2F0 55%, #4d6cb8); }
.coin-face.back .ms { color: #1f2f5a; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; }
.sides button { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--inner); border: 1px solid var(--line); color: var(--muted); }
.sides button.on { background: rgba(127, 162, 240, .14); border-color: rgba(127, 162, 240, .5); color: var(--text); }
.sides .ms { font-size: 20px; }
.win-note { font-size: 13px; color: var(--muted-2); font-weight: 600; }
.win-note .mono { color: var(--text); }

.roll { font-weight: 700; font-size: clamp(56px, 9vw, 88px); letter-spacing: -.02em; line-height: 1; transition: color .2s; }
.roll.win { color: var(--green); }
.roll.lose { color: var(--red); }
.dice-track { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.dice-bar { position: relative; height: 14px; border-radius: 999px; background: rgba(240, 110, 110, .25); }
.dice-win { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: 999px; background: var(--green); }
.dice-marker { position: absolute; top: -6px; width: 4px; height: 26px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 3px var(--bg); transition: left .5s cubic-bezier(.2, .7, .2, 1); }
.dice-track input { width: 100%; cursor: pointer; }
.dice-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 560px; }
.dice-stats > div { background: var(--inner); border-radius: 12px; padding: 10px 14px; }
.dice-stats .k { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.dice-stats .v { font-size: 16px; font-weight: 700; margin-top: 3px; }

.roulette { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; width: 100%; }
.wheel-box { position: relative; width: 240px; height: 240px; flex: none; }
.wheel-pointer { position: absolute; left: 50%; top: -6px; margin-left: -9px; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 16px solid var(--gold); z-index: 2; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.wheel-rim { position: absolute; inset: 0; border-radius: 50%; padding: 8px; background: #1d2027; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.wheel { position: relative; width: 100%; height: 100%; border-radius: 50%; transition: transform 4s cubic-bezier(.15, .75, .15, 1); }
.wheel .num { position: absolute; left: 50%; top: 0; width: 20px; margin-left: -10px; height: 50%; transform-origin: 50% 100%; display: flex; justify-content: center; padding-top: 5px; font-family: var(--mono); font-size: 10px; font-weight: 700; color: #fff; }
.wheel-hub { position: absolute; inset: 26%; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); }
.wheel-center { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 28px; transition: background .3s; z-index: 1; }
.board { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 360px; max-width: 520px; }
.board-numbers { display: flex; gap: 4px; }
.board .grid { flex: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid transparent; border-radius: 6px; color: #fff; font-family: var(--mono); font-weight: 700; font-size: 11px; cursor: pointer; }
.cell:hover { filter: brightness(1.2); }
.cell.zero { flex: none; width: 36px; aspect-ratio: auto; border-radius: 8px; font-size: 13px; }
.cell.picked { border-color: #fff; }
.cell.hit { border-color: var(--gold); }
.outside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.outside button { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 8px 4px; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--inner); border: 1px solid var(--line); color: var(--muted); }
.outside button.on { background: rgba(127, 162, 240, .16); border-color: rgba(127, 162, 240, .55); color: var(--text); }
.outside .dot { width: 10px; height: 10px; border-radius: 3px; }
.outside .pay { font-family: var(--mono); color: var(--dim); }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.bet-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.last { display: flex; gap: 3px; }
.last span { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 700; opacity: .6; }
.last span:first-child { opacity: 1; }

.result-slot { min-height: 44px; display: flex; align-items: center; }
.result { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 18px; animation: hjResIn .3s ease both; border: 1px solid transparent; }
.result .ms { font-size: 22px; }
.result .t { font-weight: 700; font-size: 15px; }
.result .a { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.result.win { background: rgba(143, 227, 168, .08); border-color: rgba(143, 227, 168, .3); color: var(--green); }
.result.push { background: var(--inner); border-color: var(--line); color: var(--text-2); }
.result.lose { background: rgba(240, 110, 110, .08); border-color: rgba(240, 110, 110, .25); color: var(--red); }
.result .t { color: var(--text); }
.result.error { background: rgba(240, 110, 110, .08); border-color: rgba(240, 110, 110, .25); color: var(--red); }

.bet-input { display: flex; align-items: center; gap: 10px; background: var(--inner); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px; }
.bet-input:focus-within { border-color: var(--accent); }
.bet-input.warn { border-color: rgba(240, 110, 110, .5); }
.bet-input .ms { font-size: 20px; color: #e0a85a; }
.bet-input input { flex: 1; min-width: 0; background: transparent; border: none; padding: 13px 0; color: var(--text); font-family: var(--mono); font-size: 18px; font-weight: 700; outline: none; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.presets button { background: var(--raised); border: none; border-radius: 9px; padding: 8px 0; color: var(--text-2); font-family: var(--mono); font-size: 13px; font-weight: 700; cursor: pointer; }
.presets button:hover { background: var(--raised-hover); color: #fff; }
.bet-error { font-size: 13px; font-weight: 600; color: var(--red); }
.play { justify-content: center; padding: 14px; border-radius: 12px; font-size: 16px; }
.play .ms { font-size: 20px; }
.play[disabled] { opacity: .45; cursor: not-allowed; }
.fine { font-size: 12px; color: var(--dim); text-align: center; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hist-head .mono { font-size: 13px; font-weight: 700; color: var(--muted); }
.hist-head .mono.plus { color: var(--green); }
.hist-head .mono.minus { color: var(--red); }
.hist-empty { border: 1px dashed var(--line-3); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted-2); font-size: 13px; }
.history { display: flex; flex-direction: column; gap: 6px; }
.history > div { display: flex; align-items: center; gap: 10px; background: var(--inner); border-radius: 10px; padding: 9px 12px; }
.history .ms { font-size: 18px; color: var(--muted-2); }
.history .l { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; }
.history .b { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.history .n { font-family: var(--mono); font-size: 13px; font-weight: 700; min-width: 72px; text-align: right; color: var(--muted); }
.history .n.plus { color: var(--green); }
.history .n.minus { color: var(--red); }
