:root {
    --green: #1db954; --green-2: #1ed760; --black: #121212; --deep: #0a0a0a; --text: #ffffff; --muted: #b3b3b3; --dim: #727272;
    --glass: rgba(255, 255, 255, .06); --glass-2: rgba(255, 255, 255, .1); --stroke: rgba(255, 255, 255, .12); --hot: #ff4d6d; --gold: #f5c451;
    --radius: 22px; --blur: blur(22px) saturate(160%);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--deep); color: var(--text); font: 15px/1.5 "Circular Std", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { letter-spacing: -.02em; }
h2 { margin: 0 0 14px; font-size: 1rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 700px at 10% -10%, #0d3b22 0, transparent 60%), radial-gradient(900px 600px at 110% 10%, #10233d 0, transparent 60%), var(--deep); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: float 22s ease-in-out infinite; }
.b1 { width: 520px; height: 520px; background: var(--green); top: -160px; left: -120px; }
.b2 { width: 420px; height: 420px; background: #0e7a8a; bottom: -140px; right: -80px; animation-delay: -7s; }
.b3 { width: 300px; height: 300px; background: #6b2cff; top: 40%; left: 55%; opacity: .22; animation-delay: -14s; }
.grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(circle at 50% 30%, #000 0, transparent 75%); }
@keyframes float { 50% { transform: translate(60px, 40px) scale(1.12); } }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; }
.glass { position: relative; min-width: 0; overflow: hidden; background: linear-gradient(135deg, var(--glass-2), var(--glass)); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(30,215,96,.45), transparent 35%, transparent 65%, rgba(255,255,255,.18)); pointer-events: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.glass.inner { margin: 0; background: rgba(255,255,255,.04); box-shadow: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 18px; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 500; }
.brand b { color: var(--green-2); font-weight: 800; margin-left: 2px; }
.logo { width: 34px; height: 34px; filter: drop-shadow(0 0 12px rgba(30,215,96,.6)); }
.tabs { display: flex; gap: 4px; background: rgba(0,0,0,.35); padding: 4px; border-radius: 999px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: .2s; }
.tab.active { background: var(--green); color: #000; box-shadow: 0 0 20px rgba(30,215,96,.45); }
.me { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--stroke); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.chip:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.chip.on { border-color: var(--green); color: var(--green-2); }
.chip.user { cursor: default; }

.label { display: flex; align-items: center; gap: 8px; text-transform: uppercase; font-size: .7rem; letter-spacing: .18em; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 10px var(--green-2); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.meta, .hint { color: var(--muted); font-size: .88rem; }
.error { color: #ff8fa3; margin: 8px 0 0; font-size: .92rem; }
.lead { color: var(--muted); max-width: 640px; }

.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 1px solid var(--stroke); background: rgba(255,255,255,.08); color: var(--text); padding: 11px 20px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px) scale(1.02); background: rgba(255,255,255,.14); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn small { font-weight: 500; opacity: .75; font-size: .75rem; }
.btn.primary { background: var(--green); border-color: transparent; color: #000; box-shadow: 0 8px 30px rgba(30,215,96,.35); }
.btn.primary:hover:not(:disabled) { background: var(--green-2); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255,77,109,.12); border-color: rgba(255,77,109,.55); color: #ffd0d9; }
.btn.danger:hover:not(:disabled) { background: rgba(255,77,109,.25); box-shadow: 0 0 24px rgba(255,77,109,.35); }
.btn.small { padding: 7px 14px; font-size: .82rem; }
.btn.big { font-size: 1.25rem; padding: 18px 40px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(30,215,96,.12), 0 8px 30px rgba(30,215,96,.45); } }
input { width: 100%; padding: 13px 16px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--stroke); background: rgba(0,0,0,.35); color: var(--text); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,215,96,.2); }

.auth { margin-top: 28px; }
.auth-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.auth-hero h1 span { background: linear-gradient(90deg, var(--green-2), #8ef0b4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }

.banner { text-align: center; font-weight: 700; padding: 14px 18px; background: linear-gradient(90deg, rgba(245,196,81,.22), rgba(255,140,60,.18)); border-color: rgba(245,196,81,.4); }

.hero { display: grid; grid-template-columns: 150px 1fr auto auto; gap: 26px; align-items: center; }
.cover { position: relative; width: 150px; height: 150px; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #1f1f1f, #0b2e19); display: grid; place-items: center; box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 40px rgba(30,215,96,.15); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-emoji { font-size: 3.4rem; }
.eq { position: absolute; bottom: 10px; left: 10px; display: none; gap: 3px; align-items: flex-end; height: 22px; padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,.55); }
.eq.on { display: flex; }
.eq i { width: 4px; background: var(--green-2); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; } .eq i:nth-child(5) { animation-delay: -.45s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.theme { font-size: 2.3rem; font-weight: 900; line-height: 1.05; letter-spacing: -.03em; }
.playlist { display: inline-block; margin: 6px 0 4px; font-size: 1.1rem; color: var(--text); font-weight: 600; }
a.playlist[href] { color: var(--green-2); }
.intro { margin-top: 6px; display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(245,196,81,.14); border: 1px solid rgba(245,196,81,.4); color: #ffe6a8; font-size: .85rem; }
.clock { position: relative; width: 150px; height: 150px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: rgba(255,255,255,.08); }
.ring-fg { stroke: var(--green-2); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(30,215,96,.7)); }
.clock-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.clock-text .label { justify-content: center; margin: 0; font-size: .6rem; }
.timer { font: 800 1.9rem/1.1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); white-space: nowrap; }
.timer.text { font: 800 1.15rem/1.2 inherit; color: var(--green-2); }
.hero-actions { display: grid; gap: 10px; justify-items: stretch; }

.turn { text-align: center; font-size: 1.12rem; min-height: 1.7em; margin-bottom: 18px; }
.turn strong { color: var(--green-2); }
.reels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.reel-box { min-width: 0; }
.reel { position: relative; width: 100%; height: 112px; overflow: hidden; contain: paint; border-radius: 18px; background: rgba(0,0,0,.45); border: 1px solid var(--stroke); box-shadow: inset 0 0 30px rgba(0,0,0,.6);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.reel .strip { display: flex; height: 100%; will-change: transform; }
.reel.spinning .strip { animation: loop 1.1s linear infinite; }
@keyframes loop { to { transform: translateX(-50%); } }
.reel .marker { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 180px; transform: translateX(-50%); border: 2px solid var(--green-2); border-radius: 14px; pointer-events: none; box-shadow: 0 0 26px rgba(30,215,96,.5), inset 0 0 20px rgba(30,215,96,.25); }
.reel.landed .marker { animation: glow .6s ease-in-out 3; }
@keyframes glow { 50% { box-shadow: 0 0 60px rgba(30,215,96,.9), inset 0 0 34px rgba(30,215,96,.55); } }
.tile { flex: 0 0 180px; height: 100%; padding: 10px 8px; display: grid; place-items: center; }
.tile span { display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; padding: 8px 10px; border-radius: 12px; text-align: center; font-weight: 800; font-size: .92rem; line-height: 1.2; word-break: break-word; overflow: hidden;
    background: linear-gradient(145deg, hsla(var(--h), 65%, 42%, .85), hsla(calc(var(--h) + 50), 70%, 22%, .9)); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.tile.win span { outline: 2px solid #fff; transform: scale(1.05); transition: transform .3s; box-shadow: 0 0 30px hsla(var(--h), 80%, 50%, .6); }
.actions { text-align: center; margin-top: 22px; }

.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols > .glass { margin-bottom: 18px; }
.master-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.master-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.player { margin-top: 16px; }
.player iframe { border-radius: 14px; }
.players, .history { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; color: var(--dim); padding: 6px 4px; }
.players li.on { color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #3a3a3a; flex: none; }
.on .dot { background: var(--green-2); box-shadow: 0 0 10px var(--green-2); }
.tag { font-size: .7rem; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); padding: 2px 8px; border-radius: 999px; color: var(--muted); }
.tag.hot { background: var(--green); color: #000; border-color: transparent; font-weight: 700; }
.history li { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; padding: 10px 14px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; }
.history li.vetoed strong { text-decoration: line-through; color: var(--dim); }
.history li.playing { border-color: rgba(30,215,96,.45); box-shadow: inset 3px 0 0 var(--green); }
.history .time { font-family: ui-monospace, monospace; color: var(--green-2); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { margin: 0; padding: 18px; }
.kpi .value { font-size: 2.1rem; font-weight: 900; letter-spacing: -.03em; background: linear-gradient(90deg, #fff, var(--green-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .name { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: .92rem; }
.bar .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--green-2)); box-shadow: 0 0 12px rgba(30,215,96,.5); }
.bars.hot .fill { background: linear-gradient(90deg, #c9184a, var(--hot)); box-shadow: 0 0 12px rgba(255,77,109,.5); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.table tr:first-child td:first-child::before { content: "👑 "; }
.timeline { display: flex; gap: 10px; align-items: flex-end; height: 160px; overflow-x: auto; }
.col { flex: 1 0 44px; display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; font-size: .72rem; color: var(--muted); }
.col .stack { width: 26px; display: flex; flex-direction: column-reverse; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.05); }
.col .s1 { background: var(--green); } .col .s2 { background: var(--hot); }
.empty { color: var(--dim); }

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; max-width: min(380px, calc(100vw - 36px)); }
.toast { padding: 14px 18px; border-radius: 16px; background: rgba(18,18,18,.82); border: 1px solid rgba(30,215,96,.5); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 14px 40px rgba(0,0,0,.6); animation: slide .4s ease-out; }
.toast strong { display: block; color: var(--green-2); }
@keyframes slide { from { transform: translateY(20px); opacity: 0; } }
.confetti { position: fixed; top: -12px; width: 8px; height: 14px; background: hsl(var(--h) 90% 60%); z-index: 99; pointer-events: none; animation: fall linear forwards; border-radius: 2px; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .7; } }

@media (max-width: 900px) {
    .hero { grid-template-columns: 110px 1fr; }
    .cover { width: 110px; height: 110px; }
    .clock { width: 120px; height: 120px; }
    .hero-actions { align-content: center; }
    .cols, .cols.even { grid-template-columns: 1fr; }
    .theme { font-size: 1.7rem; }
}
@media (max-width: 760px) {
    .topbar { border-radius: var(--radius); }
    .table thead { display: none; }
    .table tr { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
    .table td { border: 0; padding: 4px 6px; }
    .table td::after { content: attr(data-label); display: block; color: var(--dim); font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .blob, .eq i, .btn.big, .live-dot { animation: none; } }

.roulette[hidden] { display: none; }

.country-show { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 75%, #f7b267 0, #c8553d 38%, #2b1b17 80%); animation: cs-in .5s ease-out; }
.country-show.out { animation: cs-out .7s ease-in forwards; }
.country-show .sun { position: absolute; bottom: 18%; left: 50%; width: 360px; height: 360px; margin-left: -180px; border-radius: 50%; background: radial-gradient(circle, #ffe8a3 0, #ffb347 55%, transparent 70%); filter: blur(2px); animation: sun 5s ease-out forwards; }
.country-show .dust { position: absolute; inset: auto 0 0; height: 28%; background: linear-gradient(transparent, #3d2314 60%); }
.country-show .tumbleweed { position: absolute; bottom: 14%; left: -120px; font-size: 5rem; animation: roll 4.5s linear forwards; filter: sepia(1) saturate(2) hue-rotate(-15deg); }
.country-show .boots { position: absolute; bottom: 9%; font-size: 3rem; animation: stomp .5s ease-in-out infinite alternate; }
.country-card { position: relative; text-align: center; padding: 30px 48px; border-radius: 28px; background: rgba(43, 27, 23, .45); border: 2px solid rgba(255, 220, 160, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 80px rgba(255, 179, 71, .45); animation: card 1s cubic-bezier(.2, 1.6, .4, 1) .2s both; }
.country-card .hat { font-size: 5.5rem; animation: hat 1.2s ease-in-out infinite; transform-origin: 50% 80%; }
.country-card .big { font: 900 clamp(3rem, 11vw, 7.5rem)/1 Georgia, "Rockwell", serif; color: #fff4dc; letter-spacing: .02em; text-shadow: 0 4px 0 #8a3b12, 0 8px 0 #4a1f0b, 0 0 40px rgba(255, 200, 120, .8); }
.country-card .big span { color: #ffd166; }
.country-card .sub { margin-top: 12px; font-weight: 700; color: #ffe6b8; letter-spacing: .08em; }
@keyframes cs-in { from { opacity: 0; } }
@keyframes cs-out { to { opacity: 0; transform: scale(1.08); } }
@keyframes sun { from { transform: translateY(160px); opacity: .4; } }
@keyframes roll { to { transform: translateX(calc(100vw + 240px)) rotate(1080deg); } }
@keyframes stomp { to { transform: translateY(-14px); } }
@keyframes card { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
@keyframes hat { 50% { transform: rotate(-14deg) translateY(-6px); } }
