/* GRAND ROULETTE — HUD styling. Stage is a fixed 1920x1080 scene scaled to fit. */
:root { --gold: #e9c250; --cream: #f3e9c8; --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif; --serif: Georgia, "Times New Roman", serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-family: var(--font); color: var(--cream); user-select: none; -webkit-user-select: none; }
#stage { position: fixed; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%); transform-origin: center center; }
#game { position: absolute; left: 0; top: 0; display: block; }

/* ---------------------------------------------------------- dealer panel */
#dealer { position: absolute; left: 40px; top: 40px; width: 520px; height: 292px; }
#dealer .screen { position: relative; width: 100%; height: 100%; border-radius: 14px; overflow: hidden; background: #000; border: 2px solid #5a4a1a; box-shadow: 0 0 0 1px #000, 0 20px 50px rgba(0,0,0,.8), inset 0 0 40px rgba(0,0,0,.4); }
#dealer img, #dealer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#dealer video { display: none; }
#dealer img { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
#dealer .live { position: absolute; left: 12px; top: 10px; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #fff; background: rgba(0,0,0,.45); padding: 4px 10px 4px 8px; border-radius: 6px; display: flex; align-items: center; gap: 6px; }
#dealer .live span { width: 8px; height: 8px; border-radius: 50%; background: #ff2a2a; box-shadow: 0 0 8px #ff2a2a; animation: blink 1.4s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
#dealer .dname { position: absolute; right: 12px; top: 10px; font-size: 12px; letter-spacing: 2px; color: var(--gold); background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 6px; font-weight: 700; }
#caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px; font-size: 18px; font-weight: 600; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.75)); opacity: 0; transition: opacity .25s; text-shadow: 0 1px 2px #000; }
#caption.show { opacity: 1; }

/* -------------------------------------------------------------- board */
#board { position: absolute; left: 820px; top: 56px; width: 1064px; height: 128px; padding: 10px 16px; border-radius: 12px; background: linear-gradient(180deg, rgba(14,12,20,.92), rgba(6,6,10,.92)); border: 1px solid #5a4a1a; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
#board .head { display: flex; align-items: center; gap: 16px; font-size: 13px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
#board .head .title { color: var(--cream); }
#board .timerwrap { margin-left: auto; width: 240px; height: 6px; background: #1a1a22; border-radius: 3px; overflow: hidden; }
#timer { height: 100%; width: 0; background: linear-gradient(90deg, #8a5a06, #f8d865); transition: width .25s linear; }
#tokens { display: flex; gap: 6px; margin-top: 10px; height: 44px; align-items: center; }
#tokens .tok { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; border: 2px solid rgba(255,255,255,.25); box-shadow: inset 0 -4px 8px rgba(0,0,0,.4), 0 3px 6px rgba(0,0,0,.5); }
#tokens .tok.red { background: radial-gradient(circle at 35% 30%, #ff6b6b, #b31f2a 60%, #6a0f16); }
#tokens .tok.black { background: radial-gradient(circle at 35% 30%, #5a5a66, #17171c 60%, #000); }
#tokens .tok.green { background: radial-gradient(circle at 35% 30%, #5fd98a, #1d7a40 60%, #0c4423); }
#tokens .tok.new { outline: 2px solid var(--gold); outline-offset: 2px; transform: scale(1.08); }
#tokens .empty { color: #8a7f5f; font-size: 14px; letter-spacing: 2px; }
#stats { margin-top: 8px; font-size: 13px; letter-spacing: 1px; color: #c9bb8f; }
#stats b { color: var(--gold); font-weight: 700; margin-left: 4px; }

/* -------------------------------------------------------------- seats */
#seats { position: absolute; left: 820px; top: 640px; width: 1064px; height: 100px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.seat { position: relative; border-radius: 12px; padding: 12px 14px 10px 44px; background: linear-gradient(180deg, rgba(10,10,16,.85), rgba(4,4,8,.9)); border: 1px solid rgba(233,194,80,.35); box-shadow: 0 8px 20px rgba(0,0,0,.5); transition: box-shadow .3s, border-color .3s; }
.seat .dot { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c), inset 0 -3px 4px rgba(0,0,0,.4); }
.seat .name { font-size: 15px; letter-spacing: 2px; color: var(--cream); font-weight: 700; } .seat .name small { color: #a89b78; font-weight: 400; letter-spacing: 0; }
.seat .bal { font-size: 28px; font-weight: 800; color: var(--gold); margin-top: 2px; font-variant-numeric: tabular-nums; }
.seat .last { position: absolute; right: 14px; top: 14px; font-size: 14px; color: #c9bb8f; letter-spacing: 1px; }
.seat.won { border-color: var(--gold); box-shadow: 0 0 24px rgba(233,194,80,.5); }
.seat.won .last { color: #7cff9d; font-weight: 700; font-size: 18px; }
#message { position: absolute; left: 820px; top: 760px; width: 1064px; text-align: center; font-family: var(--serif); font-size: 26px; letter-spacing: 3px; color: var(--cream); text-shadow: 0 2px 6px #000; }
#seats, #message { transition: opacity .5s; }
#stage.zoomed #seats, #stage.zoomed #message { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- bar */
#bar { position: absolute; left: 0; top: 950px; width: 1920px; height: 130px; display: flex; align-items: center; gap: 18px; padding: 0 60px; background: linear-gradient(180deg, #16141c, #0a090e); border-top: 2px solid #5a4a1a; box-shadow: 0 -10px 30px rgba(0,0,0,.6); }
#bar .group { text-align: center; min-width: 180px; }
#bar .label { font-size: 12px; letter-spacing: 3px; color: #a89b78; }
#bar .value { font-size: 36px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(233,194,80,.35); }
#tray { display: flex; gap: 12px; margin: 0 16px; }
.chip { width: 70px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 900; font-size: 20px; color: #fff; position: relative; box-shadow: inset 0 -5px 8px rgba(0,0,0,.45), inset 0 4px 6px rgba(255,255,255,.35), 0 6px 12px rgba(0,0,0,.6); transition: transform .12s;
  background-color: var(--bg); background-image: radial-gradient(circle, var(--bg) 0 60%, transparent 61%), repeating-conic-gradient(rgba(255,255,255,.9) 0 10deg, transparent 10deg 30deg); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.chip.c1 { --bg: #e8e8e8; color: #333; } .chip.c5 { --bg: #d8262c; } .chip.c25 { --bg: #1f8a3a; } .chip.c100 { --bg: #1b1b1f; } .chip.c500 { --bg: #7a2ea3; }
.chip:hover { transform: translateY(-4px); } .chip.sel { transform: translateY(-10px) scale(1.08); outline: 3px solid var(--gold); outline-offset: 3px; }
.btn { font-family: var(--font); font-weight: 800; letter-spacing: 2px; font-size: 16px; cursor: pointer; border: 1px solid #6a5a2a; color: var(--cream); background: linear-gradient(180deg, #2a2834, #15141b); border-radius: 10px; padding: 0 22px; height: 56px; box-shadow: 0 4px 0 #0a0a0e, 0 8px 16px rgba(0,0,0,.5); transition: transform .06s, filter .15s; }
.btn:hover { filter: brightness(1.15); } .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a0a0e; }
.btn:disabled { filter: grayscale(.6) brightness(.6); cursor: default; transform: none; }
.btn.gold { background: linear-gradient(180deg, #fff3bd, #e9c250 35%, #b8860b 80%, #8a640f); color: #2a1a00; border-color: #5a3d08; font-size: 22px; padding: 0 40px; height: 64px; }
.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.2) drop-shadow(0 0 14px rgba(255,220,120,.8)); } }
.side { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn.icon { width: 50px; height: 50px; border-radius: 50%; padding: 0; font-size: 20px; }
#btn-sound.muted { filter: grayscale(.7) brightness(.7); }
#vol { width: 160px; accent-color: var(--gold); cursor: pointer; }

/* ------------------------------------------------------------ overlays */
#help { position: absolute; inset: 0; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; z-index: 20; }
#help.hidden, #splash.hidden { display: none; }
#help .panel { width: 1000px; max-height: 940px; overflow: auto; padding: 30px 40px 36px; border-radius: 18px; background: linear-gradient(180deg, #1a1830, #0a0a14); border: 3px solid #b8942c; box-shadow: 0 0 60px rgba(0,0,0,.9); text-align: center; }
#help h2 { margin: 0 0 18px; font-family: var(--serif); font-size: 30px; letter-spacing: 4px; color: var(--gold); }
#help .btn { margin-top: 12px; }
table.pays { width: 100%; border-collapse: collapse; font-size: 19px; margin-bottom: 14px; }
table.pays td { padding: 8px 10px; border-bottom: 1px solid #2a2410; text-align: left; } table.pays td:last-child { text-align: right; color: var(--gold); font-weight: 700; }
.rules { text-align: left; font-size: 16px; line-height: 1.5; color: #e6d7b0; padding-left: 22px; margin: 10px 0; }
.hint { font-size: 15px; color: #c9bb8f; }
#splash { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; cursor: pointer; background: radial-gradient(ellipse at 50% 35%, rgba(50,20,30,.85) 0%, rgba(0,0,0,.96) 75%); }
#splash .inner { text-align: center; }
#splash .logo { width: 1000px; max-width: 90vw; filter: drop-shadow(0 0 30px rgba(255,200,90,.45)); }
#splash .sub { font-size: 18px; letter-spacing: 8px; color: #c9a84a; margin: 14px 0 50px; }
#splash-text { font-size: 30px; letter-spacing: 8px; color: #ffe9a8; font-family: var(--serif); }
#splash.ready #splash-text { animation: blink 1.4s ease-in-out infinite; }
#splash .note { margin-top: 40px; font-size: 14px; letter-spacing: 3px; color: #6f6140; }
