:root { --gold: #d4af37; --pink: #ff2d95; --cyan: #00e5ff; --bg: #0b0710; --panel: rgba(16, 10, 24, 0.92); --border: rgba(212, 175, 55, 0.35); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: #f3ecd8; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; transform: translate(-50%, -100%); font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; white-space: nowrap; text-align: center; }
.label .bubble { display: block; background: #fff; color: #111; border-radius: 10px; padding: 4px 8px; margin-bottom: 4px; font-weight: 500; text-shadow: none; max-width: 220px; white-space: normal; }
.label .rar { display: block; font-size: 10px; color: var(--gold); }
.hidden { display: none !important; }

#hud { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#hud .hud-left, #hud .hud-right { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.pill { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; backdrop-filter: blur(6px); }
.pill.chips { color: #ffd76a; } .pill.eth { color: #8ef0ff; }
.btn { background: linear-gradient(180deg, #2a1a3a, #170d22); color: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer; transition: transform .08s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 14px rgba(255, 45, 149, .35); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 999px; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; font-weight: 700; }
.btn.gold { background: linear-gradient(180deg, #f2cf5b, #b8892a); color: #1b1200; border-color: #ffe08a; }
.btn.danger { border-color: #ff5a5a; color: #ffb3b3; }
.btn.act { background: linear-gradient(180deg, #1e5f3d, #0f3a24); border-color: #4be08a; }

#prompt { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 14px; }
#prompt kbd { background: #fff; color: #000; border-radius: 4px; padding: 1px 6px; font-weight: 700; margin-right: 6px; }
#toasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 14px; animation: fade 4s forwards; }
.toast.win { border-color: #4be08a; color: #b8ffd6; } .toast.err { border-color: #ff5a5a; color: #ffb3b3; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-6px) } 8% { opacity: 1; transform: none } 85% { opacity: 1 } 100% { opacity: 0 } }

#chat { position: fixed; left: 12px; bottom: 12px; width: 340px; }
#chat-log { max-height: 160px; overflow-y: auto; font-size: 13px; padding: 6px 8px; background: rgba(0, 0, 0, .35); border-radius: 8px 8px 0 0; }
#chat-log div { margin: 2px 0; } #chat-log b { color: var(--gold); } #chat-log .sys { color: #8ef0ff; font-style: italic; }
#chat-input { width: 100%; background: var(--panel); color: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; padding: 8px; font-size: 13px; outline: none; }

.panel { position: fixed; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; backdrop-filter: blur(8px); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; letter-spacing: .5px; }
#table-panel { right: 12px; bottom: 12px; width: 460px; max-height: 70vh; overflow-y: auto; }
#table-body { padding: 12px 14px; font-size: 14px; }
#leaderboard, #help { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; max-height: 80vh; overflow: auto; }
#lb-body { padding: 10px 14px; } #lb-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
#lb-body td, #lb-body th { padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06); text-align: left; } #lb-body td:last-child { text-align: right; color: #8ef0ff; }
.help-body { padding: 10px 16px; font-size: 14px; line-height: 1.45; }

/* Cards */
.cards { display: flex; gap: 4px; flex-wrap: wrap; min-height: 44px; }
.card { width: 34px; height: 46px; border-radius: 5px; background: #fff; color: #111; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; justify-content: space-between; padding: 3px 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.card.red { color: #c62828; } .card.back { background: repeating-linear-gradient(45deg, #1a237e 0 4px, #283593 4px 8px); }
.card .s { text-align: right; font-size: 13px; }
.seat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; margin-bottom: 6px; background: rgba(255, 255, 255, .04); }
.seat.me { background: rgba(212, 175, 55, .12); border: 1px solid var(--border); } .seat.turn { box-shadow: 0 0 0 2px #4be08a inset; }
.seat .who { font-weight: 700; } .seat .info { font-size: 12px; color: #cbbfa8; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.actions input[type=range] { flex: 1; }
.timer { height: 4px; background: #4be08a; border-radius: 2px; transition: width 1s linear; margin: 6px 0; }
.status { font-size: 13px; color: #ffd76a; margin: 6px 0; min-height: 18px; }
.bet-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.chip-btn { border-radius: 999px; width: 44px; height: 44px; border: 3px dashed #fff; font-weight: 800; cursor: pointer; color: #fff; }
.chip-btn.c10 { background: #c62828; } .chip-btn.c50 { background: #1565c0; } .chip-btn.c100 { background: #2e7d32; } .chip-btn.c500 { background: #6a1b9a; }
.roulette-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; margin-top: 8px; }
.rnum { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border-radius: 4px; cursor: pointer; color: #fff; position: relative; }
.rnum.red { background: #c62828; } .rnum.black { background: #222; } .rnum.green { background: #2e7d32; grid-row: span 3; }
.rnum .amt { position: absolute; bottom: -2px; right: 1px; font-size: 9px; color: #ffd76a; }
.outside { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.outside .rnum { aspect-ratio: auto; padding: 6px 0; background: rgba(255, 255, 255, .08); }
.wheel-result { font-size: 28px; font-weight: 900; text-align: center; padding: 6px; }
.reels { display: flex; justify-content: center; gap: 8px; font-size: 42px; margin: 10px 0; }
.reel { width: 70px; height: 80px; background: #111; border: 2px solid var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.reel.spin { animation: spin .12s linear infinite; } @keyframes spin { from { filter: blur(0) } 50% { filter: blur(3px) } to { filter: blur(0) } }
.paytable { font-size: 12px; color: #cbbfa8; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-top: 8px; }
.claim-box { font-size: 14px; line-height: 1.5; } .claim-box code { display: block; word-break: break-all; background: #000; padding: 6px; border-radius: 6px; font-size: 11px; margin: 6px 0; }

/* Login */
#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(255, 45, 149, .18), transparent 60%), rgba(6, 3, 10, .82); z-index: 10; }
.login-card { width: 440px; max-width: 94vw; max-height: 96vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 26px 28px; box-shadow: 0 20px 80px rgba(0, 0, 0, .7); text-align: center; }
.login-card h1 { margin: 0; font-size: 44px; letter-spacing: 4px; color: #fff; text-shadow: 0 0 12px var(--pink), 0 0 30px var(--pink); }
.login-card h1 span { color: var(--gold); text-shadow: 0 0 12px var(--gold); }
.tag { color: #cbbfa8; margin: 6px 0 18px; }
.step { margin: 10px 0; } .muted { color: #a99d87; font-size: 13px; margin: 8px 0; } .muted.small { font-size: 11px; margin-top: 16px; }
.row { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.row input { background: #000; color: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
#dev-token { width: 80px; } #dev-name { flex: 1; }
#dev-preview { display: block; width: 220px; height: 260px; max-width: 100%; margin: 6px auto; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #2a1a3a, #0b0710); }
#gl { width: 100vw; height: 100vh; max-width: none; }
#pick-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#pick-list button { min-width: 120px; }
