:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#edf2ff;background:#0d1120;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.45;cursor:not-allowed}
a{color:#a7c8ff}
.eyebrow,.section-heading,small{font-size:.7rem;font-weight:800;letter-spacing:.1em;color:#aeb8d2}
.join-overlay:not([hidden]){position:fixed;inset:0;z-index:10;display:grid;place-items:center;padding:20px;background:#0d1120ed}
.join-card{display:flex;flex-direction:column;width:min(100%,360px);gap:12px;background:#18223a;border:1px solid #53627c;border-radius:18px;padding:24px}
.join-card h1{margin:0 0 10px;font-size:2rem}
.join-card label{font-weight:700}
.join-card input{padding:12px;border:1px solid #657595;background:#0d162a;border-radius:8px;color:white}
.join-card button{background:#f6d58b;color:#13192a;border:0;border-radius:8px;padding:13px;font-weight:800}
.qr-overlay:not([hidden]){position:fixed;inset:0;z-index:11;display:grid;place-items:center;padding:20px;background:#0d1120e8}
.qr-card{position:relative;display:flex;align-items:center;flex-direction:column;gap:12px;background:#edf2ff;color:#141b2e;border-radius:16px;padding:24px;width:min(100%,330px);overflow-wrap:anywhere;text-align:center}
.qr-card img{width:min(58vw,240px);height:min(58vw,240px)}
.qr-card a{color:#123c83;font-size:.8rem}
.qr-card #close-qr{align-self:end;border:0;background:transparent;color:#141b2e;font-size:1.8rem;line-height:1}
.gain{color:#55e6a6!important}.loss{color:#ff7283!important}
.player-page{overflow:hidden}
.play-shell{height:100vh;height:100dvh;max-height:100dvh;max-width:600px;margin:auto;padding:calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 10px);display:flex;flex-direction:column;gap:clamp(4px,1.2dvh,12px);overflow:hidden;background:radial-gradient(ellipse at 50% 48%,#212c50 0%,#0d1120 75%)}
.player-header{flex:none}
.player-header .eyebrow,.status-row,.section-heading,.play-shell footer{display:flex;justify-content:space-between;align-items:center;gap:8px}
#connection{color:#76e6bf;font-size:.65rem}
.health-row{display:flex;align-items:flex-end;justify-content:space-between;gap:clamp(10px,3vw,18px);margin-top:clamp(2px,.8dvh,8px);min-width:0}
.health-block{min-width:0;flex:1 1 auto}
.health-value{font-size:clamp(2.1rem,8vh,4.7rem);font-weight:900;letter-spacing:-.04em;line-height:1.05;padding-right:.08em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.delta{flex:none;font-size:clamp(1rem,3vh,1.5rem);font-weight:800;line-height:1;padding-bottom:clamp(4px,1.2vh,10px);color:#abb4c9;white-space:nowrap}
.status-row{margin-top:4px;font-size:clamp(.8rem,1.9vh,1rem);font-weight:700}
#place{color:#f6d58b}
.stake-row{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:clamp(3px,.8dvh,8px);padding:clamp(4px,.9dvh,8px) 12px;border:1px solid #6b5a2e;background:#2a2412;border-radius:10px;font-size:clamp(.72rem,1.7vh,.9rem);color:#d9cda8}
.stake-row div{display:flex;align-items:baseline;gap:8px;flex:none}
.stake-row small{font-size:.72em;letter-spacing:.08em;font-weight:800;color:#c8b67f}
.stake-row strong{color:#f6d58b;font-size:clamp(1.05rem,2.8vh,1.5rem);font-weight:900}
.stake-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.choices{flex:1;min-height:0;display:flex;justify-content:center;align-items:center}
.arena{height:min(100%,46dvh);width:min(100%,46dvh);min-height:145px;min-width:145px;position:relative}
.arena-ring{position:absolute;inset:9%;border:1px solid #637096;border-radius:50%;box-shadow:0 0 30px #597bdb24,inset 0 0 30px #597bdb18}
.move{--radius:min(31%,17dvh);position:absolute;top:calc(50% + var(--y));left:calc(50% + var(--x));transform:translate(-50%,-50%);width:clamp(64px,15.5dvh,116px);height:clamp(64px,15.5dvh,116px);border:2px solid #5a668b;background:#182542;border-radius:50%;box-shadow:0 6px 20px #0008;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;color:white;touch-action:manipulation}
.move span{font-size:clamp(1.5rem,5vh,2.7rem);line-height:1.1}.move small{font-size:clamp(.5rem,1.2vh,.7rem);color:#d6e1fa}
.move[aria-pressed="true"]{border-color:#fff0aa;background:#665225;box-shadow:0 0 0 5px #f6d58b78,0 0 24px #f6d58b9c,0 6px 20px #0008}
.move[aria-pressed="true"] small{color:#fff}
.move[aria-pressed="true"]::after{content:"✓";position:absolute;right:-4px;top:-4px;display:grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#f6d58b;color:#161a28;font-size:15px;font-weight:900}
.move:focus-visible{outline:3px solid #fff;outline-offset:4px}
.share-qr:not([hidden]){display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border:0;background:#edf2ff;border-radius:6px;padding:3px;width:clamp(38px,9dvh,70px);align-items:center;flex-direction:column;z-index:1;color:#141b2e}
.share-qr img{width:100%;aspect-ratio:1}
.share-qr small{font-size:clamp(.28rem,.7dvh,.52rem);line-height:1;color:#141b2e;letter-spacing:0}
.rock{--x:0px;--y:calc(-1 * var(--radius))}
.paper{--x:calc(.866 * var(--radius));--y:calc(.5 * var(--radius))}
.scissors{--x:calc(-.866 * var(--radius));--y:calc(.5 * var(--radius))}
.last-round{flex:none;border:1px solid #394767;background:#161f36;border-radius:14px;padding:clamp(7px,1.4dvh,14px)}
.section-heading{margin-bottom:clamp(4px,1dvh,10px)}
.percent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.percent-grid>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.percent-grid span{font-size:clamp(.65rem,1.55vh,.85rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.percent-grid strong{font-size:clamp(.9rem,2.4vh,1.35rem)}
.bar{height:4px;background:#34435f;border-radius:5px;overflow:hidden}.bar i{display:block;height:100%;background:#f6d58b}
.play-shell footer{flex:none;font-size:clamp(.67rem,1.6vh,.85rem);min-height:1.4rem}
.play-shell footer span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-height:560px){.play-shell{padding-top:calc(env(safe-area-inset-top) + 5px);padding-bottom:calc(env(safe-area-inset-bottom) + 3px);gap:3px}.arena{height:min(100%,40dvh);width:min(100%,40dvh);min-height:120px;min-width:120px}.move{--radius:min(33%,15dvh);width:clamp(52px,14dvh,76px);height:clamp(52px,14dvh,76px)}.move span{font-size:clamp(1.25rem,4vh,2rem)}.share-qr:not([hidden]){width:clamp(30px,8dvh,40px)}}
.dashboard{min-height:100vh;background:#0d1120}
.dashboard-shell{max-width:1100px;margin:auto;padding:16px clamp(14px,3vw,40px) 50px}
nav{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #343f59;padding:14px 0;font-size:.8rem}
.dashboard header{margin:30px 0}.dashboard h1{font-size:clamp(2rem,6vw,4rem);line-height:1;margin:10px 0}.dashboard h2{font-size:1.1rem;margin:0 0 16px}.dashboard p{color:#b5bfd2}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:14px 0}
.card,.stat-grid>div{background:#18223a;border:1px solid #36435e;border-radius:14px;padding:18px}
.stat-grid .card{display:flex;flex-direction:column;gap:10px}.stat-grid strong{font-size:clamp(1.3rem,3vw,2rem);display:block;overflow-wrap:anywhere}
.dashboard section.card{margin:18px 0}
.host-invite{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.host-invite img{width:clamp(180px,25vw,260px);height:clamp(180px,25vw,260px);background:white;border-radius:10px}
.host-invite .scoreboard-heading{margin-top:24px}.host-invite a{overflow-wrap:anywhere}.host-invite .actions{margin-top:12px}
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}
th,td{padding:12px 9px;border-bottom:1px solid #36435e}
th{font-size:.73rem;color:#b5bfd2;text-transform:uppercase}
.actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.actions button,form button{background:#f6d58b;color:#13192a;border:0;border-radius:9px;padding:11px 16px;font-weight:800}
.actions .secondary{background:#303f5f;color:#fff}
.actions .danger{background:#c9485b;color:#fff}
.actions button:disabled,.suggestion button:disabled{opacity:.45;cursor:not-allowed}
.suggestion{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 14px;padding:10px 12px;border:1px dashed #4a5b82;border-radius:9px}
.suggestion p{margin:0;flex:1 1 280px}
.suggestion button{background:#303f5f;color:#fff;border:0;border-radius:9px;padding:9px 14px;font-weight:800}
.stat-grid .card small+strong+small{display:block;margin-top:4px;color:#9fb0d0}
.health-form{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.health-form label{flex:1 1 220px}
.health-form button:disabled{opacity:.45;cursor:not-allowed}
.health-form .secondary{background:#303f5f;color:#fff}
.bot-form{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:10px 0 4px}
.bot-form label{flex:1 1 180px}
.bot-form select{width:100%;background:#0d162a;color:white;border:1px solid #53627c;border-radius:8px;padding:10px}
.bot-form button{background:#f6d58b;color:#13192a;border:0;border-radius:9px;padding:11px 16px;font-weight:800}
.bot-form .secondary,#bot-list button{background:#303f5f;color:#fff}
.bot-form button:disabled,#bot-list button:disabled{opacity:.45;cursor:not-allowed}
#bot-list td{overflow-wrap:anywhere}
#bot-list button{border:0;border-radius:8px;padding:6px 10px;font-weight:700}
#bot-list pre{white-space:pre-wrap;background:#0d162a;border-radius:8px;padding:8px;font-size:.8rem;user-select:all}
.hint{color:#9fb0d0;font-size:.9rem;margin:4px 0 8px}
.error{color:#ff9aa6;white-space:pre-line}
code{background:#0d162a;border-radius:5px;padding:1px 5px;overflow-wrap:anywhere}
#feedback{color:#f6d58b}
form{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px}
form label{display:flex;flex-direction:column;gap:7px;font-size:.85rem;color:#c5cde0}
form input:not([type=checkbox]){background:#0d162a;color:white;border:1px solid #53627c;border-radius:8px;padding:10px;width:100%}
form .checkbox{flex-direction:row;align-items:center}
form input[type=checkbox]{width:22px;height:22px}

.formulas { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; }
.formulas li { margin: 4px 0; }
.formula-now { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }

.choices[hidden],.out-panel[hidden]{display:none}
.out-panel{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px;border:1px solid #394767;background:#161f36;border-radius:14px;padding:clamp(8px,1.4dvh,14px);overflow:hidden}
.out-title{display:flex;justify-content:space-between;align-items:center;gap:8px}
.out-title>div{display:flex;flex-direction:column;min-width:0}
.out-title strong{font-size:clamp(.9rem,2.3dvh,1.25rem);color:#ff8d98;letter-spacing:.06em}
.out-title span{font-size:clamp(.75rem,1.8dvh,.95rem);color:#d6e1fa}
.out-title button{flex:none;padding:6px 12px;font-size:.8rem}
.mini-board{flex:1 1 0;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px;min-height:0;overflow:hidden}
.mini-board li{display:grid;grid-template-columns:2.6em minmax(0,1fr) auto;gap:6px;align-items:center;padding:clamp(3px,.8dvh,7px) 8px;border-radius:8px;background:#1d2946;font-size:clamp(.75rem,1.8dvh,.95rem)}
.mini-board li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-board li em{font-style:normal;color:#aeb8d2;white-space:nowrap}
.mini-board li.gone{opacity:.75}
.mini-board li.mine{background:#665225;outline:1px solid #f6d58b;opacity:1}
.mini-board li.mine em{color:#fff}
.mini-board li.gap{background:none;padding:0;justify-content:center;display:flex;color:#637096;line-height:1}
.health-graph{flex:none;border:1px solid #394767;background:#161f36;border-radius:14px;padding:clamp(5px,1dvh,10px) clamp(7px,1.4dvh,14px)}
.health-graph .section-heading{margin-bottom:3px}
.health-graph canvas{display:block;width:100%;height:clamp(38px,8dvh,84px)}
.legend{display:flex;align-items:center;gap:5px;letter-spacing:.04em}
.legend i{display:inline-block;width:14px;height:0;border-top:2.5px solid #6fd3ff;margin-left:6px}
.legend i.lead{border-top:2px dashed #f6d58b}
@media(max-height:700px){.out-panel{gap:3px;padding:6px 8px}.mini-board{gap:2px}.mini-board li{padding:2px 7px;font-size:.72rem}.mini-board li.gap{font-size:.7rem}.out-title span{font-size:.7rem}.health-graph canvas{height:clamp(32px,7dvh,60px)}}
@media(max-height:450px){.out-title{display:none}.mini-board li{padding:1px 7px;font-size:.68rem}}
@media(max-height:450px){.out-panel:not([hidden])~.health-graph,.out-panel:not([hidden])~.last-round{display:none}}
tr.gone td{opacity:.65}
.mini-board.scroll{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding-right:2px}
.mini-board li{flex:none}
.chart-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.chart-card canvas{display:block;width:100%;height:clamp(220px,38vh,420px)}
.chart-scale{display:inline-flex;border:1px solid #36435e;border-radius:999px;overflow:hidden}
.chart-scale button{background:transparent;color:#b5bfd2;border:0;border-radius:0;padding:5px 12px;font-size:.8rem;min-height:0;cursor:pointer}
.chart-scale button.on{background:#2d3b60;color:#fff}
.chart-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px;font-size:.85rem}
.chart-legend span{display:inline-flex;align-items:center;gap:6px}
.chart-legend span.gone{opacity:.6}
.chart-legend i{width:14px;height:4px;border-radius:2px;display:inline-block}
