/* ======================================================================
   STREAM GAMES (games.js): the bar on the video, the Games sheet, Blackjack cards, the wheel, Crowd Battle effects, Clout Gold borders.
   Motion uses transform / opacity / filter and is switched off for people who ask for less motion. No effect flashes more than once.
   ====================================================================== */

/* ---- the small bar on the video ---- */
.gstrip { position:absolute; right:10px; top:60px; z-index:6; max-width:min(340px, 52%); display:flex; align-items:center; gap:8px; padding:6px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.18); background:rgba(10,10,16,.72); color:#fff; font-weight:800; font-size:12.5px; cursor:pointer; backdrop-filter:blur(6px); white-space:nowrap; overflow:hidden; }
.gstrip.idle { padding:5px 10px; opacity:.85; }
.gstrip .gs-t { overflow:hidden; text-overflow:ellipsis; }
.gstrip .gclock { font-variant-numeric:tabular-nums; color:#ffd34d; }
.gstrip.crowd { flex-direction:column; align-items:stretch; gap:3px; border-radius:14px; min-width:220px; }
.gstrip.crowd .row { display:flex; justify-content:space-between; gap:10px; }
.hpbar { height:9px; border-radius:6px; background:rgba(255,255,255,.18); overflow:hidden; }
.hpbar > i { display:block; height:100%; border-radius:6px; background:linear-gradient(90deg,#ff3b5c,#ffb020 60%,#2ee59d); transition:width .4s ease; }

/* ---- effects the crowd throws on the video ---- */
.gfx { position:absolute; inset:0; z-index:5; pointer-events:none; overflow:hidden; }
.gfx .gfxchip { position:absolute; left:50%; top:104px; transform:translateX(-50%); padding:6px 14px; border-radius:999px; background:rgba(10,10,16,.8); color:#fff; font-weight:800; font-size:13px; animation:gfxChip 2.6s ease forwards; white-space:nowrap; }
.gfx .gfxchip.good { background:rgba(18,140,90,.9); } .gfx .gfxchip.bad { background:rgba(190,40,70,.9); }
.gfx .gfxbig { position:absolute; left:50%; top:30%; transform:translate(-50%,-50%); text-align:center; padding:12px 20px; border-radius:20px; background:linear-gradient(135deg,rgba(255,211,77,.95),rgba(255,140,40,.95)); color:#2a1500; font-weight:900; font-size:18px; animation:gfxBig 4s ease forwards; max-width:88%; }
.gfx .gfxflash { position:absolute; inset:0; background:#fff; opacity:0; animation:gfxFlash .55s ease-out forwards; }
.gfx .gfxfog { position:absolute; inset:0; background:radial-gradient(ellipse at 50% 60%, rgba(235,240,255,.78), rgba(210,220,240,.55) 60%, rgba(200,210,235,.35)); backdrop-filter:blur(6px); animation:gfxFade var(--secs,8s) ease forwards; }
.gfx .gfxaura { position:absolute; inset:0; box-shadow:inset 0 0 60px 16px rgba(46,229,157,.65); animation:gfxFade 1.6s ease forwards; }
.media { transition:transform .5s ease, filter .5s ease; }
.media.gfx-flip { transform:rotate(180deg); } .media.gfx-shrink { transform:scale(.55); } .media.gfx-blur { filter:blur(9px); }
.media.gfx-scare { animation:gfxShake .4s linear 1; }
@keyframes gfxChip { 0% { opacity:0; transform:translate(-50%,10px); } 12% { opacity:1; transform:translate(-50%,0); } 80% { opacity:1; } 100% { opacity:0; transform:translate(-50%,-8px); } }
@keyframes gfxBig { 0% { opacity:0; transform:translate(-50%,-50%) scale(.7); } 10% { opacity:1; transform:translate(-50%,-50%) scale(1); } 85% { opacity:1; } 100% { opacity:0; } }
@keyframes gfxFlash { 0% { opacity:.55; } 100% { opacity:0; } }
@keyframes gfxFade { 0% { opacity:0; } 10% { opacity:1; } 80% { opacity:1; } 100% { opacity:0; } }
@keyframes gfxShake { 0%,100% { transform:translate(0); } 20% { transform:translate(-5px,2px); } 40% { transform:translate(5px,-2px); } 60% { transform:translate(-3px,3px); } 80% { transform:translate(3px,-3px); } }

/* ---- the Games sheet ---- */
.gsheet { display:flex; flex-direction:column; gap:10px; }
.gsheet h3 { margin:0; }
.gbal { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; font-weight:800; }
.gbal .bal { padding:4px 10px; border-radius:999px; background:var(--bg); border:1px solid var(--line); font-variant-numeric:tabular-nums; }
.gtabs { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
.gtabs::-webkit-scrollbar { display:none; }
.gtab { flex:none; border:1px solid var(--line); background:var(--bg); color:var(--text); border-radius:999px; padding:6px 12px; font-weight:800; font-size:13px; cursor:pointer; }
.gtab.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.gbody { display:flex; flex-direction:column; gap:10px; min-height:120px; } .gbody > *, .gsheet > * { flex-shrink:0; }
.gcard { border:1px solid var(--line); background:var(--bg); border-radius:12px; padding:12px; }
.gcard h4 { margin:0 0 6px; font-size:14px; }
.gnote { font-size:12px; color:var(--mute); line-height:1.4; }
.gamt { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.gamt button { border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:10px; padding:6px 10px; font-weight:800; cursor:pointer; min-width:44px; }
.gamt button.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.gpay { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.gpay button { border:0; background:transparent; color:var(--text); padding:5px 11px; font-weight:800; cursor:pointer; font-size:12.5px; }
.gpay button.on { background:var(--accent); color:#fff; }
.grw { display:flex; gap:8px; flex-wrap:wrap; align-items:center; } .grw.sp { justify-content:space-between; }
.gcheck { display:flex; gap:8px; align-items:flex-start; font-size:13.5px; margin:6px 0; } .gcheck input { margin-top:3px; }
.gform label { display:block; font-size:12.5px; color:var(--soft); margin-top:6px; }
.gform input[type=text], .gform input[type=number], .gform select { margin:3px 0; }

/* ---- Blackjack ---- */
.bj { background:radial-gradient(ellipse at 50% 0%, #1f7a4d, #0d4a2d 70%); border-radius:14px; padding:12px; border:2px solid #0a3a24; color:#fff; }
.bj .hand { display:flex; align-items:center; gap:4px; flex-wrap:wrap; min-height:50px; }
.bj .seatrow { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 0; border-top:1px solid rgba(255,255,255,.12); }
.bj .seatrow.me { background:rgba(255,255,255,.1); border-radius:10px; padding:6px 8px; border-top:0; margin-top:3px; }
.bj .who { font-weight:800; font-size:13px; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.bj .who small { display:block; font-weight:600; color:#d8f5e5; }
.pcard { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; width:32px; height:46px; border-radius:6px; background:#fff; color:#111; font-weight:900; font-size:15px; line-height:1; box-shadow:0 1px 3px rgba(0,0,0,.4); animation:cardIn .25s ease; }
.pcard.red { color:#d62839; } .pcard small { font-size:13px; } .pcard.back { background:repeating-linear-gradient(45deg,#5b3df5,#5b3df5 4px,#3a22b8 4px,#3a22b8 8px); color:transparent; }
@keyframes cardIn { from { opacity:0; transform:translateY(-6px) scale(.9); } to { opacity:1; transform:none; } }
.tot { font-weight:900; font-size:14px; margin-left:6px; padding:2px 8px; border-radius:8px; background:rgba(0,0,0,.35); }
.res { font-weight:900; padding:2px 8px; border-radius:8px; font-size:12px; }
.res.win, .res.blackjack { background:#ffd34d; color:#2a1500; } .res.push { background:#9aa4b8; color:#111; } .res.lose, .res.bust { background:#8e1f33; color:#fff; }

/* ---- the wheel ---- */
.wheelwrap { display:flex; flex-direction:column; align-items:center; gap:8px; }
.wheel { width:190px; height:190px; border-radius:50%; position:relative; border:6px solid #2b2b3a; box-shadow:0 0 0 3px #ffd34d, 0 8px 24px rgba(0,0,0,.5);
  background:conic-gradient(#7c5cff 0 14.3%, #12b886 0 28.6%, #ff7a18 0 42.9%, #3b82f6 0 57.1%, #ff3b5c 0 71.4%, #ffd34d 0 85.7%, #c084fc 0); transition:transform 3.2s cubic-bezier(.12,.7,.1,1); }
.wheel::after { content:''; position:absolute; left:50%; top:50%; width:30px; height:30px; margin:-15px 0 0 -15px; border-radius:50%; background:#1a1a26; border:4px solid #ffd34d; box-sizing:border-box; }
.wheelpin { width:0; height:0; border-left:11px solid transparent; border-right:11px solid transparent; border-top:20px solid #ffd34d; margin-bottom:-14px; z-index:2; filter:drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.prize { text-align:center; padding:10px; border-radius:14px; border:2px solid var(--line); animation:cardIn .3s ease; }
.prize.common { border-color:#9aa4b8; } .prize.epic { border-color:#a855f7; background:rgba(168,85,247,.12); } .prize.legend { border-color:#ffd34d; background:rgba(255,211,77,.15); }
.prize .big { font-size:42px; }
.odds { width:100%; border-collapse:collapse; font-size:12.5px; } .odds td, .odds th { padding:4px 6px; border-bottom:1px solid var(--line); text-align:left; } .odds td:last-child, .odds th:last-child { text-align:right; }
.tier-common { color:#b8c0d0; } .tier-epic { color:#c084fc; } .tier-legend { color:#ffd34d; }

/* ---- predictions / trivia ---- */
.popt { position:relative; display:flex; justify-content:space-between; align-items:center; gap:10px; width:100%; padding:10px 12px; margin:5px 0; border-radius:12px; border:1px solid var(--line); background:var(--panel); color:var(--text); font-weight:800; cursor:pointer; overflow:hidden; text-align:left; }
.popt > i { position:absolute; left:0; top:0; bottom:0; background:rgba(124,92,255,.28); z-index:0; transition:width .4s; } .popt > span { position:relative; z-index:1; }
.popt.mine { border-color:#ffd34d; } .popt.correct { border-color:#2ee59d; background:rgba(46,229,157,.15); }
.popt:disabled { cursor:default; opacity:.9; }

/* ---- crowd battle ---- */
.fxgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:8px; }
.fxbtn { display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 4px; border-radius:12px; border:1px solid var(--line); background:var(--panel); color:var(--text); cursor:pointer; font-weight:800; font-size:12px; }
.fxbtn .e { font-size:26px; } .fxbtn.obstacle { border-color:rgba(255,59,92,.5); } .fxbtn.powerup { border-color:rgba(46,229,157,.55); }
.fxbtn:disabled { opacity:.45; cursor:not-allowed; } .fxbtn small { color:var(--mute); font-weight:700; }

/* ---- Clout shop ---- */
.cgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:8px; }
.citem { display:flex; flex-direction:column; align-items:center; gap:3px; padding:9px 6px; border-radius:12px; border:1px solid var(--line); background:var(--panel); text-align:center; font-size:12px; font-weight:700; }
.citem .e { font-size:28px; line-height:1.1; } .citem .p { color:#ffd34d; font-weight:900; } .citem.eq { border-color:#2ee59d; }
.citem .bsw { width:34px; height:34px; border-radius:50%; background:var(--bg); }
.citem button { margin-top:3px; }

/* ---- chat: Clout badge, avatar borders, big emotes ---- */
.cbadge { display:inline-block; margin-right:3px; font-size:13px; line-height:1; vertical-align:-1px; }
.m.bigemote { font-size:30px; line-height:1.15; }
[data-cbd] { border-radius:50%; display:inline-flex; }
[data-cbd="br-ember"] { box-shadow:0 0 0 2px #ff7a18, 0 0 9px 1px #ff3d00; }
[data-cbd="br-aurora"] { box-shadow:0 0 0 2px #22d3ee, 0 0 9px 1px #a78bfa; }
[data-cbd="br-neon"] { box-shadow:0 0 0 2px #39ff14, 0 0 9px 1px #00e5ff; }
[data-cbd="br-royal"] { box-shadow:0 0 0 2px #f5d76e, 0 0 9px 1px #b8860b; }
[data-cbd="br-void"] { box-shadow:0 0 0 2px #7c3aed, 0 0 9px 2px #0f172a; }

/* ---- docked menus (gifts, games): the stream stays visible above them and taps up there reach the stream ---- */
.overlay.dock { background:transparent; pointer-events:none; }
.overlay.dock .sheet { pointer-events:auto; max-height:46vh; border:1px solid var(--line); border-bottom:0; box-shadow:0 -10px 30px rgba(0,0,0,.5); }

/* ---- power-ups, the scare, the wheel on the stream, the crowd's win party, announcements ---- */
.gfx .gfxfloat { position:absolute; bottom:6%; line-height:1; will-change:transform,opacity; }
.gfx .gfxring { position:absolute; left:50%; top:46%; width:200px; height:200px; border-radius:50%; border:6px solid #fff; will-change:transform,opacity; }
.gfx .gfxpop { position:absolute; left:50%; top:46%; line-height:1; filter:drop-shadow(0 4px 14px rgba(0,0,0,.5)); will-change:transform,opacity; }
.gfx .gfxtint { position:absolute; inset:0; }
.gfx .gfxaura.shield { box-shadow:inset 0 0 60px 16px rgba(70,160,255,.65); } .gfx .gfxaura.boost { box-shadow:inset 0 0 60px 16px rgba(255,205,60,.75); }
.gfx .gfxscare { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 50%, rgba(110,0,0,.55) 0, rgba(0,0,0,.93) 78%); animation:gfxScareBg 1s ease-out forwards; }
.gfx .gsg { font-size:min(62vw,340px); line-height:1; filter:drop-shadow(0 0 30px rgba(255,255,255,.7)); animation:gfxScareG 1s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes gfxScareBg { 0% { opacity:0; } 8% { opacity:1; } 70% { opacity:1; } 100% { opacity:0; } }
@keyframes gfxScareG { 0% { transform:scale(.1) rotate(-8deg); } 25% { transform:scale(1.15) rotate(5deg); } 40% { transform:scale(1) rotate(-4deg); } 60% { transform:scale(1.1) rotate(4deg); } 100% { transform:scale(1.35) rotate(0); } }
.media.gfx-boost { animation:gfxPulse .6s ease-out 1; }
@keyframes gfxPulse { 0% { transform:scale(1); } 30% { transform:scale(1.05); } 100% { transform:scale(1); } }
.gfx .gwheelov { position:absolute; left:50%; bottom:84px; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 18px 12px; border-radius:22px; background:rgba(10,10,16,.8); border:1px solid rgba(255,255,255,.16); animation:gwIn .35s ease; max-width:90%; }
@keyframes gwIn { from { opacity:0; transform:translateX(-50%) scale(.8); } to { opacity:1; transform:translateX(-50%) scale(1); } }
.gwwho { color:#fff; font-weight:800; font-size:14px; text-align:center; }
.gwrim { position:relative; width:170px; height:170px; margin-top:8px; }
.gwpin { position:absolute; top:-14px; left:50%; margin-left:-11px; width:0; height:0; border-left:11px solid transparent; border-right:11px solid transparent; border-top:20px solid #ffd34d; z-index:2; filter:drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.gwdisc { position:relative; width:170px; height:170px; border-radius:50%; box-sizing:border-box; border:5px solid #2b2b3a; box-shadow:0 0 0 3px #ffd34d, 0 8px 24px rgba(0,0,0,.5); transition:transform 3.2s cubic-bezier(.12,.7,.1,1); will-change:transform; }
.gwdisc::after { content:''; position:absolute; left:50%; top:50%; width:26px; height:26px; margin:-13px 0 0 -13px; border-radius:50%; background:#1a1a26; border:4px solid #ffd34d; box-sizing:border-box; }
.gwe { position:absolute; left:50%; top:50%; margin:-12px 0 0 -12px; width:24px; height:24px; font-size:19px; line-height:24px; text-align:center; }
.gwres { min-height:62px; display:flex; align-items:flex-start; justify-content:center; }
.gwprize { display:flex; flex-direction:column; align-items:center; gap:1px; color:#fff; text-align:center; animation:cardIn .3s ease; }
.gwprize .gwpe { font-size:34px; line-height:1.1; } .gwprize small { color:#cfd3e4; font-size:12px; }
.gwprize.epic b { color:#d8b4fe; } .gwprize.legend b { color:#ffd34d; font-size:17px; }
.gfx .gfxwin { position:absolute; left:50%; top:42%; transform:translate(-50%,-50%); text-align:center; padding:16px 22px; border-radius:22px; background:linear-gradient(135deg,rgba(255,211,77,.97),rgba(255,140,40,.97)); color:#2a1500; box-shadow:0 10px 40px rgba(0,0,0,.5); animation:gwWin 9.5s ease forwards; max-width:92%; }
.gfxwin .gwt { font-weight:900; font-size:24px; } .gfxwin .gws { font-weight:700; font-size:14px; margin-top:4px; }
@keyframes gwWin { 0% { opacity:0; transform:translate(-50%,-50%) scale(.6); } 6% { opacity:1; transform:translate(-50%,-50%) scale(1.08); } 10% { transform:translate(-50%,-50%) scale(1); } 94% { opacity:1; } 100% { opacity:0; } }
.gfx .gfxann { position:absolute; left:8px; right:8px; top:58px; display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:16px; background:linear-gradient(135deg,#7c5cff,#c026d3); color:#fff; font-weight:800; box-shadow:0 6px 20px rgba(0,0,0,.45); z-index:3; }
.gfx .gfxann.big { background:linear-gradient(135deg,#ffd34d,#ff8c28); color:#2a1500; font-size:17px; padding:14px 16px; box-shadow:0 8px 28px rgba(255,170,40,.55); }
.gfxann .ae { font-size:26px; line-height:1; } .gfxann .at { display:flex; flex-direction:column; min-width:0; } .gfxann .at b { font-size:12px; opacity:.85; } .gfxann .at span { overflow-wrap:anywhere; }
.cbgoal.on { outline:2px solid var(--accent); }

@media (prefers-reduced-motion:reduce) {
  .gfx .gfxchip, .gfx .gfxbig, .gfx .gfxflash, .gfx .gfxfog, .gfx .gfxaura, .gfx .gfxscare, .gfx .gsg, .pcard, .prize { animation:none; } .gfx .gwheelov, .gfx .gfxwin { animation:none; } .media.gfx-boost { animation:none; } .gwdisc { transition:none; }
  .media.gfx-scare { animation:none; } .wheel { transition:none; } .media { transition:none; }
}
@media (max-width:520px) { .gstrip { top:56px; font-size:12px; max-width:50%; } .gfx .gfxchip { top:96px; } }

.gwcanvas { display:block; margin:10px auto 0; max-width:100%; filter:drop-shadow(0 8px 20px rgba(0,0,0,.5)); }
