/* Оформление. Цвета берутся из config.js (colors), здесь только расстановка. */
:root { --felt: #0F3D2E; --feltDark: #0A2A20; --wine: #7A1F2B; --gold: #E0B252; --cream: #F6EBD3; --ink: #15110F; --red: #B3262E; --black: #1B1B1F; --green: #1E7A4C; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--feltDark); color: var(--cream); font: 16px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
.serif { font-family: Georgia, 'Times New Roman', serif; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--felt) center top / cover no-repeat; position: relative; }
#app.hall { background-image: linear-gradient(rgba(10, 42, 32, .15), rgba(10, 42, 32, .55) 60%, var(--feltDark)), url(art/bg_hall.webp); }
#app.table { background-image: linear-gradient(rgba(10, 42, 32, .35), rgba(10, 42, 32, .6)), url(art/bg_table.webp); }

.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(21, 17, 15, .82); border-bottom: 2px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.top .title { flex: 0 1 auto; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .bal { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.top .bal img { width: 26px; height: 26px; }
.top .bal.up { animation: pop .5s; color: #9be29b; } .top .bal.down { animation: pop .5s; color: #ff9d9d; }
@keyframes pop { 30% { transform: scale(1.25); } }
.demo-tag { flex: none; padding: 2px 7px; border-radius: 8px; background: var(--wine); color: var(--cream); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(246, 235, 211, .12); font-size: 18px; }
.back { padding: 6px 12px; border-radius: 18px; background: rgba(246, 235, 211, .14); font-weight: 600; }

main { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card { background: rgba(21, 17, 15, .78); border: 1.5px solid rgba(224, 178, 82, .55); border-radius: 16px; padding: 14px; }
.btn { display: block; width: 100%; padding: 14px; border-radius: 14px; background: linear-gradient(#f0c96b, var(--gold)); color: var(--ink); font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 #8a6a25; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6a25; }
.btn[disabled] { opacity: .45; }
.btn.ghost { background: rgba(246, 235, 211, .12); color: var(--cream); box-shadow: none; border: 1.5px solid rgba(246, 235, 211, .35); font-size: 16px; padding: 11px; }
.btn.wine { background: linear-gradient(#9a2f3d, var(--wine)); color: var(--cream); box-shadow: 0 3px 0 #4a1019; }
.muted { opacity: .75; font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
input[type=text], select { width: 100%; padding: 13px; border-radius: 12px; border: 1.5px solid rgba(224, 178, 82, .6); background: var(--cream); color: var(--ink); font-size: 17px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
label.check input { width: 22px; height: 22px; flex: none; accent-color: var(--gold); }

/* зал */
.hero { display: flex; align-items: flex-end; gap: 6px; min-height: 150px; }
.hero img { height: 150px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.hero .say { flex: 1; background: var(--cream); color: var(--ink); border-radius: 16px 16px 16px 4px; padding: 10px 12px; font-weight: 600; margin-bottom: 30px; }
.game { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 16px; background: linear-gradient(rgba(122, 31, 43, .92), rgba(74, 16, 25, .95)); border: 2px solid var(--gold); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.game:active { transform: scale(.98); }
.game img { width: 64px; height: 64px; }
.game b { display: block; font-size: 19px; color: var(--gold); font-family: Georgia, serif; }
.game span { font-size: 13.5px; opacity: .85; }
.game.live { animation: glow 1.2s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 18px 3px var(--gold); } }
.game[disabled] { filter: grayscale(.8); opacity: .5; }
.place { display: flex; justify-content: space-between; font-weight: 600; }

/* фишки и ставка */
.chips { display: flex; justify-content: center; gap: 8px; }
.chip { width: 58px; height: 58px; border-radius: 50%; background: center / contain no-repeat; font-weight: 800; font-size: 14px; color: var(--ink); opacity: .6; transition: transform .12s, opacity .12s; }
.chip.on { opacity: 1; transform: translateY(-5px) scale(1.12); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); }
.result { min-height: 30px; text-align: center; font-weight: 800; font-size: 19px; }
.result.win { color: #ffe08a; } .result.lose { color: #f3b0b0; font-weight: 600; font-size: 16px; }

/* рулетка */
.wheel-box { position: relative; width: min(52vw, 33vh, 260px); aspect-ratio: 1; margin: 6px auto 0; }
.wheel-box canvas { position: absolute; inset: 7%; width: 86%; height: 86%; border-radius: 50%; transition: transform 5s cubic-bezier(.12, .65, .1, 1); }
.wheel-box .frame, .wheel-box .hub { position: absolute; pointer-events: none; }
.wheel-box .frame { inset: 0; width: 100%; height: 100%; }
.wheel-box .hub { left: 34%; top: 34%; width: 32%; transition: transform 5s cubic-bezier(.12, .65, .1, 1); }
.wheel-box .arrow { position: absolute; left: 50%; top: -4%; width: 12%; transform: translateX(-50%); z-index: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.wheel-box .num { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 800 34px Georgia, serif; border: 3px solid var(--gold); z-index: 3; transition: transform .3s; }
.wheel-box .num.show { transform: translate(-50%, -50%) scale(1); }
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
#app.table main { gap: 8px; padding: 10px 12px; }
.chips .chip { width: 50px; height: 50px; }
.cell { position: relative; padding: 6px 0; border-radius: 8px; font-weight: 800; text-align: center; border: 1.5px solid rgba(246, 235, 211, .35); font-variant-numeric: tabular-nums; }
.cell.red { background: var(--red); } .cell.black { background: var(--black); } .cell.green { background: var(--green); grid-column: span 6; }
.cell.out { background: rgba(246, 235, 211, .12); font-size: 14px; padding: 8px 0; }
.cell.w2 { grid-column: span 2; } .cell.w3 { grid-column: span 3; }
.cell .stake { position: absolute; right: -4px; top: -7px; min-width: 24px; padding: 1px 5px; border-radius: 12px; background: var(--gold); color: var(--ink); font-size: 11.5px; font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); z-index: 1; }
.cell.hit { outline: 3px solid #ffe08a; animation: pop .6s 2; }

/* красное или белое */
.wine-stage { display: flex; justify-content: space-around; align-items: flex-end; min-height: 200px; position: relative; }
.wine-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 18px; border: 2px solid transparent; font-weight: 800; font-size: 18px; }
.wine-pick img { height: 130px; transition: transform .2s; }
.wine-pick:active img { transform: scale(.94); }
.wine-pick.pick { border-color: var(--gold); background: rgba(224, 178, 82, .15); }
.wine-pick.won img { animation: pop .6s 2; } .wine-pick.dim { opacity: .35; }
.cloche { position: absolute; left: 50%; bottom: 44px; height: 120px; transform: translateX(-50%); transition: transform .5s, opacity .5s; z-index: 2; pointer-events: none; opacity: 0; }
.cloche.down { opacity: 1; } .cloche.up { transform: translate(-50%, -170px) rotate(-12deg); opacity: 0; }
.reveal { position: absolute; left: 50%; bottom: 44px; height: 120px; transform: translateX(-50%); opacity: 0; z-index: 1; }
.reveal.show { opacity: 1; }

/* скачки */
.horse-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: 12px; background: rgba(21, 17, 15, .7); border: 2px solid transparent; text-align: left; }
.horse-row.on { border-color: var(--gold); background: rgba(224, 178, 82, .18); }
.horse-row .no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.horse-row .pic { width: 74px; height: 48px; background: 0 0 / 400% 100% no-repeat; flex: none; }
.horse-row b { flex: 1; font-size: 17px; }
.horse-row .odds { font-weight: 800; color: var(--gold); font-size: 18px; }
canvas.track { width: 100%; border-radius: 14px; border: 2px solid var(--gold); background: #e9d9b5; display: block; }
.timer { font: 800 26px Georgia, serif; color: var(--gold); text-align: center; }

/* таблица */
.rows { display: flex; flex-direction: column; gap: 5px; }
.rows .r { display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(21, 17, 15, .7); align-items: center; }
.rows .r.me { outline: 2px solid var(--gold); }
.rows .r i { width: 26px; font-style: normal; font-weight: 800; color: var(--gold); }
.rows .r b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r small { opacity: .7; margin-left: 6px; font-weight: 400; }
.rows .r span { font-weight: 800; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: 90%; padding: 11px 18px; border-radius: 22px; background: var(--ink); border: 1.5px solid var(--gold); font-weight: 600; z-index: 20; text-align: center; animation: rise .25s; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 15; overflow: hidden; }
.confetti img { position: absolute; top: -120px; width: 110px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(115vh) rotate(300deg); opacity: .6; } }
[hidden] { display: none !important; }
