*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#f4f6fa;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#1d2433}
#app{min-height:100%;display:flex;align-items:center;justify-content:center;padding:16px}
.screen{display:none;flex-direction:column;align-items:center;gap:14px;width:100%}
.screen.on{display:flex}
.card{display:flex;flex-direction:column;gap:12px;width:min(320px,100%)}
.card input[type=text]{font-size:18px;padding:12px 14px;border:2px solid #cfd6e4;border-radius:10px;outline:none;text-align:center}
.card input[type=text]:focus{border-color:#1e5bd6}
.btn{font-size:18px;font-weight:600;padding:12px 16px;border:0;border-radius:10px;background:#1e5bd6;color:#fff;cursor:pointer}
.btn:disabled{opacity:.5;cursor:default}
.btn.alt{background:#e3e8f2;color:#1d2433}
.opt{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;color:#4a5568}
.link{font-size:14px;padding:10px;background:#e9edf5;border-radius:8px;word-break:break-all;text-align:center;user-select:all}
.dot{width:14px;height:14px;border-radius:50%;display:inline-block;background:#9aa5b8;animation:p 1s infinite alternate}
@keyframes p{to{opacity:.3}}
/* game */
.players{display:flex;justify-content:space-between;gap:12px;width:var(--bw)}
.pl{flex:1;display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:#e9edf5;font-weight:600;font-size:clamp(14px,3.6vw,18px);border:3px solid transparent;min-width:0}
.pl span.n{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl i{flex:none;width:18px;height:18px;border-radius:50%}
.pl.p1 i{background:#e53935}.pl.p2 i{background:#fdd835}
.pl.turn{border-color:#1d2433;background:#fff}
.pl .y{display:none;flex:none;font-weight:400;color:#6b7589;white-space:nowrap}
.pl.you .y{display:inline}
@media (max-width:360px){.pl{padding:6px 8px;gap:5px;font-size:13px;border-width:2px}.pl i{width:14px;height:14px}.players{gap:8px}}
#board{--cell:min(calc((100vw - 48px)/7),calc((100vh - 170px)/6),84px);--bw:calc(var(--cell)*7 + 24px);
 display:grid;grid-template-columns:repeat(7,var(--cell));grid-template-rows:repeat(6,var(--cell));gap:0;padding:12px;background:#1e5bd6;border-radius:16px;box-shadow:0 6px 0 #164aa8,0 10px 24px rgba(0,0,0,.18);touch-action:manipulation;position:relative}
.screen#s-game{--bw:calc(min(calc((100vw - 48px)/7),calc((100vh - 170px)/6),84px)*7 + 24px)}
.cell{position:relative;width:var(--cell);height:var(--cell);display:flex;align-items:center;justify-content:center;cursor:pointer}
.cell::before{content:"";width:84%;height:84%;border-radius:50%;background:#f4f6fa;box-shadow:inset 0 3px 6px rgba(0,0,0,.35);transition:background .0s}
.cell.p1::before{background:#e53935;box-shadow:inset 0 -4px 0 rgba(0,0,0,.18)}
.cell.p2::before{background:#fdd835;box-shadow:inset 0 -4px 0 rgba(0,0,0,.18)}
.cell.new::before{animation:drop .35s ease-in}
.cell.win::before{outline:4px solid #fff;outline-offset:-4px;animation:pulse .8s infinite alternate}
@keyframes drop{from{transform:translateY(calc(var(--drop,3)*-100%))}to{transform:none}}
@keyframes pulse{to{transform:scale(.88)}}
#board.locked .cell{cursor:default}
#board:not(.locked) .cell:hover::before{filter:brightness(.97)}
.banner{min-height:28px;font-size:clamp(16px,4.4vw,22px);font-weight:700;text-align:center}
.banner.sub{font-size:14px;font-weight:500;color:#b3261e;min-height:18px}
