:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);color-scheme:light;--bg:#eeece8;--panel:#faf9f6;--ink:#302e2b;--muted:#716d66;--line:#d8d4cd;--accent:#557444;--paper:#fff;--navy:#302e2b;--red:#292929;--move-duration:180ms;--capture-duration:210ms;--board-size:min(560px,calc(100vw - 24px))}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 'Segoe UI',Arial,sans-serif;min-height:100svh;padding:var(--safe-top) var(--safe-right) calc(82px + var(--safe-bottom)) var(--safe-left)}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;background:transparent;border:0;border-radius:5px;min-height:44px;cursor:pointer;touch-action:manipulation}button:hover:not(:disabled){background:#00000008}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #557444;outline-offset:3px}a{color:var(--accent)}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.svg-library{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
h1{font-size:25px;line-height:1.25;font-weight:600;margin:0 0 12px}h2{font-size:20px;font-weight:600;margin:0}p{margin:10px 0}main{width:min(var(--board-size),100%);margin:16px auto 20px}.game{display:flex;flex-direction:column}.play-layout{width:100%}.board-frame{position:relative;order:2;border:1px solid #8a7056;padding:0;background:#b58863;box-shadow:0 2px 6px #30281826}#board{display:grid;grid-template-columns:repeat(10,1fr);aspect-ratio:1;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
.square{--tile:#f0d9b5;position:relative;min-width:0;min-height:0;border:0;border-radius:0;aspect-ratio:1;padding:0;background:var(--tile);display:grid;place-items:center;touch-action:none}.square.dark{--tile:#b58863}.square:disabled{opacity:1}.square:hover:not(:disabled){background:var(--tile)}.square:focus-visible{outline-offset:-3px;z-index:3}.square.last{box-shadow:inset 0 0 0 100px #c9dd5880}.square.selected,.square.target.drop-target{background:#91a85e!important}.square.dark::before{content:attr(data-number);position:absolute;left:3px;top:1px;font-size:clamp(7px,1.2vw,10px);line-height:1.2;color:#503a28;opacity:.55;pointer-events:none}.square.target::after{content:'';position:absolute;width:25%;height:25%;border-radius:50%;background:#302e2b40;pointer-events:none}.square.target.drop-target::after{width:72%;height:72%;background:transparent;border:3px solid #304b3277}
.piece{width:79%;height:79%;border-radius:50%;position:relative;pointer-events:none;transform:translateY(-1px);z-index:1;border:1px solid;display:grid;place-items:center}.piece.white{background:linear-gradient(145deg,#fff,#e0dfd8);border-color:#fff;box-shadow:0 2px 0 #b4b1a9,0 3px 2px #0005,inset 0 0 0 2px #d6d3ca}.piece.black{background:linear-gradient(145deg,#424242,#161616);border-color:#171717;box-shadow:0 2px 0 #050505,0 3px 2px #0005,inset 0 0 0 2px #555}.piece::after{content:'';position:absolute;inset:18%;border:1px solid #7778;border-radius:50%}.piece.white::after{border-color:#aaa}.piece.king{--stack:clamp(1px,.35vw,2px);transform:translateY(calc(-2 * var(--stack)))}.piece.white.king{box-shadow:0 2px 0 #aaa,0 3px 0 #777,0 5px 0 #fff,0 7px 0 #aaa,0 8px 3px #0005,inset 0 0 0 2px #d6d3ca}.piece.black.king{box-shadow:0 2px 0 #111,0 3px 0 #888,0 5px 0 #333,0 7px 0 #050505,0 8px 3px #0005,inset 0 0 0 2px #555}.piece.captured{opacity:.25}.square.playable .piece{outline:2px solid #758e50;outline-offset:1px}.piece.drag-piece{position:fixed;z-index:1000;margin:0;transform:translate(-50%,-50%)!important;pointer-events:none;will-change:left,top;visibility:visible!important}.capture-layer{position:absolute;inset:0;pointer-events:none;z-index:2}
.scoreboard{order:0;display:flex;align-items:center;gap:12px;margin:0 0 8px}.player{display:flex;align-items:center;gap:8px;min-width:0;flex:1;padding:8px 10px;border-bottom:2px solid transparent;min-height:44px}.player.active{border-color:var(--accent);background:#5574440b}.player-name{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player b{margin-left:auto;font-variant-numeric:tabular-nums}.avatar{width:18px;height:18px;border-radius:50%;flex-shrink:0}.white-mini{background:#fff;border:1px solid #bbb}.black-mini{background:#252525;border:1px solid #111}.active-dot{width:5px;height:5px;border-radius:50%;background:var(--accent);opacity:0}.active .active-dot{opacity:1}.vs{color:var(--muted);font-size:12px}
.turn-status{order:1;display:flex;align-items:center;gap:8px;min-height:44px;margin-bottom:6px}.turn-status h2{font-size:13px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-marker{width:13px;height:13px;background:#fff;border:1px solid #999;border-radius:50%;flex-shrink:0}body[data-turn='black'] .status-marker{background:#292929;border-color:#111}.status-line{flex:1}#sound-toggle{display:grid;place-items:center;min-width:44px;width:44px;height:44px;color:var(--muted)}#sound-toggle svg{width:18px;height:18px}#sound-toggle .sound-muted{display:none}#sound-toggle[aria-pressed='false'] .sound-muted{display:block}#sound-toggle[aria-pressed='false'] .sound-waves{display:none}.hint{order:3;min-height:32px;visibility:hidden;font-size:12px;color:var(--muted);margin:8px 0;line-height:1.4}body[data-guidance='true'] .hint{visibility:visible}.puzzle-mode .hint{display:none}
#puzzle-controls{margin-top:14px}#puzzle-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;background:var(--panel);border:1px solid var(--line);border-radius:6px}#puzzle-bar small{display:block;font-size:10px;color:var(--muted);letter-spacing:.6px}#puzzle-bar strong{display:block;font-size:24px;line-height:1.4;font-weight:600;font-variant-numeric:tabular-nums}.puzzle-level{flex:1;max-width:190px;font-size:12px;text-align:center;color:var(--muted)}.puzzle-level progress{display:block;width:100%;height:5px;margin-top:8px;accent-color:var(--accent)}#puzzle-feedback{min-height:24px;text-align:center;font-size:13px;color:var(--accent);margin:12px 0}.puzzle-actions{display:flex;justify-content:center;gap:10px}.puzzle-actions button{padding:10px 22px;border:1px solid var(--line);background:var(--panel);flex:1;font-size:13px}.puzzle-actions .primary{background:var(--accent);color:white;border-color:var(--accent)}.puzzle-footer{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font-size:11px;color:var(--muted)}.puzzle-footer a{color:var(--muted)}#puzzle-exit{display:none}.square.puzzle-hint-square{outline:3px solid #4675a1;outline-offset:-3px}#puzzle-feedback.good{color:#1f9d55;font-weight:600}#puzzle-feedback.bad{color:#c0392b;font-weight:600}.square.puzzle-good{box-shadow:inset 0 0 0 4px #2ecc71}.square.puzzle-bad{box-shadow:inset 0 0 0 4px #e74c3c;animation:puzzle-shake .3s}@keyframes puzzle-shake{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}@media(prefers-reduced-motion:reduce){.square.puzzle-bad{animation:none}}
.toolbar{display:flex;justify-content:center;align-items:center;gap:10px;border-top:1px solid var(--line);padding:8px 0;margin-top:4px}.toolbar button{width:44px;height:44px;display:grid;place-items:center;color:var(--muted)}.toolbar svg{width:20px;height:20px}.tool-separator{height:22px;width:1px;background:var(--line)}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;justify-content:center;background:#faf9f6f5;border-top:1px solid var(--line);padding:5px max(8px,var(--safe-right)) calc(5px + var(--safe-bottom)) max(8px,var(--safe-left));height:calc(68px + var(--safe-bottom))}.bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex:1;max-width:185px;font-size:11px;font-weight:500;color:var(--muted);border-radius:4px}.bottom-nav button[aria-current='page']{color:var(--accent);background:#55744410}.bottom-nav svg{width:21px;height:21px}
.launch,.page-state,.leaderboard-panel{width:min(500px,calc(100% - 32px));margin:48px auto 24px}.launch>p,.subtitle,.page-state p{color:var(--muted);font-size:13px}.mode-choice{display:flex;align-items:center;text-align:left;width:100%;gap:16px;background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:18px;margin-top:12px;font-size:16px;min-height:82px}.mode-choice small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.mode-choice>span:last-child{margin-left:auto}.mode-icon{font-size:22px;color:var(--accent)}.mode-choice.is-last{border-color:var(--accent)}.levels-back{margin-top:16px;color:var(--muted)}.page-state{min-height:300px;display:flex;flex-direction:column;justify-content:center;text-align:center}.page-state button,#leaderboard-retry{align-self:center;background:var(--panel);border:1px solid var(--line);padding:8px 18px}
#leaderboard-list{list-style:none;margin:20px 0;padding:0}#leaderboard-list li{display:grid;grid-template-columns:24px 40px minmax(0,1fr) auto;column-gap:12px;align-items:center;padding:16px 12px;border-bottom:1px solid var(--line);background:var(--panel)}#leaderboard-list li.is-me{background:#55744413}#leaderboard-list li>span{grid-row:span 2;color:var(--muted);font-variant-numeric:tabular-nums}#leaderboard-list strong{font-weight:500;overflow-wrap:anywhere}#leaderboard-list b{grid-column:4;grid-row:span 2;font-size:20px;font-variant-numeric:tabular-nums}#leaderboard-list small{grid-column:3;color:var(--muted);font-size:11px}#leaderboard-status{font-size:13px;color:var(--muted)}
.room-lobby{margin-top:40px}.room-seats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}.room-seat{display:flex;flex-direction:column;justify-content:center;gap:12px;min-height:120px;padding:15px;border:1px solid var(--line);background:var(--panel);border-radius:6px;overflow-wrap:anywhere}.room-seat span{font-size:12px;color:var(--muted)}.room-seat.is-ready{border-color:var(--accent);background:#55744410}.room-actions{display:flex;gap:12px}.room-actions button{flex:1}#cancel-wait{margin-top:18px;color:var(--muted)}.primary{background:var(--accent);color:#fff;padding:10px 18px}
#notice{width:min(540px,calc(100% - 24px));margin:12px auto;padding:12px 16px;background:#fff4df;color:#785b2f;border:1px solid #e5d3af;border-radius:5px;font-size:13px}#connection-status{position:fixed;top:calc(var(--safe-top) + 8px);left:50%;transform:translateX(-50%);z-index:50;padding:9px 14px;background:#302e2b;color:white;border-radius:4px;font-size:12px;white-space:nowrap;pointer-events:none}
dialog{color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:24px;width:440px;max-width:calc(100% - var(--safe-left) - var(--safe-right) - 28px);max-height:calc(100svh - var(--safe-top) - var(--safe-bottom) - 36px);box-shadow:0 16px 50px #0003}dialog::backdrop{background:#24211d88}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.icon-button{width:44px;height:44px;display:grid;place-items:center}.eyebrow{display:none}.history-labels,.history-row{display:grid;grid-template-columns:28px 1fr 1fr;gap:12px;padding:12px 8px;border-bottom:1px solid var(--line)}.history-labels{font-size:11px;color:var(--muted)}#history{height:300px;overflow:auto}.history-row{font-size:13px}.history-row:last-child{background:#5574440c}.empty{padding:70px 10px;text-align:center;color:var(--muted);font-size:13px}.rule-list{padding-left:20px}.rule-list li{padding:0 0 12px 4px}.rule-list p,.rules-note{font-size:12px;color:var(--muted)}.source-link{font-size:12px}dialog form{display:flex;gap:10px;margin-top:20px}dialog form button{flex:1;padding:8px 15px;border:1px solid var(--line)}#result-dialog{text-align:center;width:360px}.result-kicker{font-size:11px;color:var(--muted);letter-spacing:1px}.result-emblem{font-size:40px;color:var(--accent);margin:12px}.result-emblem i{display:none}#result-title{font-size:30px}#result-subtitle,#result-rating{font-size:13px;color:var(--muted)}.result-score strong{font-size:42px;font-weight:600;color:var(--accent)}.result-score span{font-size:12px;margin-left:6px}#result-menu{width:100%;margin-top:12px}.result-review{font-size:12px;margin-top:6px}
#loading{position:fixed;inset:0;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg);color:var(--ink)}#loading strong{font-size:28px;font-weight:600}#loading p{font-size:13px;color:var(--muted)}#retry{padding:8px 20px;border:1px solid var(--line)}
@media(min-width:761px){:root{--board-size:min(560px,calc(100svh - 310px))}main{min-width:360px;margin-top:18px}}
@media(max-width:380px){#puzzle-bar{gap:10px;padding:12px}#puzzle-bar strong{font-size:21px}.puzzle-level{font-size:11px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

#leaderboard-list .leaderboard-avatar{position:relative;grid-column:2;grid-row:span 2;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;overflow:hidden;background:#e0e5d9;color:#456039;font-size:17px;font-weight:600}#leaderboard-list .leaderboard-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--panel)}

.mode-icon{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border-radius:10px;background:#5574441a}.mode-icon svg{width:24px;height:24px}.mode-choice .chev{margin-left:auto;flex-shrink:0;width:18px;height:18px;color:var(--muted)}.mode-choice:hover:not(:disabled){border-color:var(--accent);background:var(--panel)}
.puzzle-actions button{display:flex;align-items:center;justify-content:center;gap:8px;border-radius:8px;min-height:48px;font-weight:500}.puzzle-actions svg{width:18px;height:18px}#puzzle-hint svg{color:#b08a2e}#puzzle-giveup svg{color:#a94436}#puzzle-bar{border-radius:10px}
#leaderboard-list li:first-child{border-radius:10px 10px 0 0}#leaderboard-list li:last-child{border-radius:0 0 10px 10px;border-bottom:0}#leaderboard-list{border:1px solid var(--line);border-radius:10px;overflow:hidden}#leaderboard-list li:nth-child(-n+3)>span:first-child{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;color:#fff;font-weight:600;font-size:12px}#leaderboard-list li:nth-child(1)>span:first-child{background:#c9a227}#leaderboard-list li:nth-child(2)>span:first-child{background:#9aa0a6}#leaderboard-list li:nth-child(3)>span:first-child{background:#b0703c}
.puzzle-footer{display:none}
.move-mark{position:absolute;z-index:5;top:2%;right:2%;width:40%;height:40%;display:grid;place-items:center;border-radius:50%;pointer-events:none;box-shadow:0 2px 6px #0006,0 0 0 2px #fff;animation:mark-pop .35s cubic-bezier(.3,1.6,.5,1)}.move-mark.good{background:#3fa34d}.move-mark.bad{background:#d9534f}.move-mark svg{width:72%;height:72%;stroke:#fff;stroke-width:3.5}@keyframes mark-pop{from{transform:scale(.3);opacity:0}}
.square.puzzle-good{box-shadow:inset 0 0 0 100px #3fa34d55}.square.puzzle-bad{box-shadow:inset 0 0 0 100px #d9534f55}
.board-frame.solved-glow{animation:board-glow 1.2s ease-out}@keyframes board-glow{0%{box-shadow:0 0 0 0 #4ba34be6,0 2px 6px #30281826}100%{box-shadow:0 0 0 22px #4ba34b00,0 2px 6px #30281826}}
@media(prefers-reduced-motion:reduce){.move-mark,.board-frame.solved-glow{animation:none}}
.fly-check{position:fixed;z-index:70;display:grid;place-items:center;border-radius:50%;background:#3fa34d;box-shadow:0 0 0 2px #fff,0 4px 18px #4ba34bb3;pointer-events:none}.fly-check svg{width:72%;height:72%;stroke:#fff;stroke-width:3.5}
#puzzle-bar>div:first-child{position:relative}.elo-plus{position:absolute;left:100%;top:4px;margin-left:-8px;color:#2f8a3c;font-size:18px;font-weight:700;pointer-events:none;animation:elo-plus 1.1s ease-out forwards}@keyframes elo-plus{0%{transform:translateY(10px) scale(.5);opacity:0}25%{transform:translateY(-4px) scale(1.2);opacity:1}70%{opacity:1}100%{transform:translateY(-18px);opacity:0}}
#puzzle-rating.elo-bump{animation:elo-bump .5s cubic-bezier(.2,1.4,.4,1);color:#2f8a3c}@keyframes elo-bump{0%{transform:scale(1)}40%{transform:scale(1.18)}100%{transform:none}}

/* ===== v2: Хөлөг ===== */
:root{--bg:#eef0eb;--panel:#fbfcf9;--ink:#1d2924;--muted:#66736c;--line:#d9ded6;--accent:#2e6a4e;--gold:#d99a1e;--bad:#c4473d;--wood:#8a5a3b;--maple:#ebd5af;--radius-l:20px;--radius-m:14px;--radius-s:10px}
body{background:radial-gradient(120% 60% at 50% 0%,#f6f8f3 0%,var(--bg) 60%) fixed;font:15px/1.5 Manrope,'Segoe UI',Arial,sans-serif}
h1,h2,#loading strong{font-family:Unbounded,Manrope,sans-serif;letter-spacing:-.01em}
h1{font-size:26px;font-weight:700}
button:focus-visible,a:focus-visible{outline-color:var(--accent)}
.board-frame{padding:8px;background:linear-gradient(160deg,#9b6a48,#6f4529);border:0;border-radius:var(--radius-m);box-shadow:inset 0 1px 0 #ffffff30,0 1px 0 #00000020,0 14px 28px -12px #3b241466}
#board{border-radius:6px;box-shadow:0 0 0 1px #00000033}
.square{--tile:var(--maple)}.square.dark{--tile:var(--wood)}
.square.dark::before{color:#f3dfbd;opacity:.45;font-family:Manrope,sans-serif;font-weight:600}
.square.last{box-shadow:inset 0 0 0 100px #e8c34a55}
.square.selected,.square.target.drop-target{background:#5f8a5a!important}
.square.target::after{background:#1d292455}
.square.playable .piece{outline:2px solid #ffffffd0;outline-offset:2px}
.turn-status{min-height:48px;margin-bottom:8px}
.turn-status h2{font-family:Manrope,sans-serif;font-size:15px;font-weight:700;letter-spacing:0}
.status-marker{width:16px;height:16px;box-shadow:0 1px 2px #0003}
#sound-toggle{border-radius:50%}
.scoreboard{gap:8px;margin-bottom:10px}.scoreboard .vs{display:none}
.player{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-s);padding:8px 12px}
.player.active{background:var(--panel);border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.player-name{font-size:13px;font-weight:600}.player b{font-family:Unbounded,sans-serif;font-size:15px}
#puzzle-controls{margin-top:16px}
#puzzle-bar{display:grid;grid-template-columns:1fr auto;grid-template-areas:"elo streak" "level level";gap:10px 16px;padding:16px 18px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-l)}
#puzzle-bar>div:first-child{grid-area:elo}#puzzle-bar>div:last-child{grid-area:streak;text-align:right}
#puzzle-bar small{font-size:12px;letter-spacing:0;color:var(--muted);font-weight:600}
#puzzle-bar #puzzle-rating{font-family:Unbounded,sans-serif;font-size:34px;line-height:1.1;font-weight:700;color:var(--ink)}
#puzzle-bar #puzzle-streak{font-family:Unbounded,sans-serif;font-size:24px;line-height:1.3;color:var(--gold)}
#puzzle-streak::before{content:'';display:inline-block;width:14px;height:18px;margin-right:6px;vertical-align:-1px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath d='M7 0c1 4 6 6 6 11a6 6 0 0 1-12 0c0-3 2-4 3-6 0 2 1 3 2 3 0-3-1-5 1-8Z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath d='M7 0c1 4 6 6 6 11a6 6 0 0 1-12 0c0-3 2-4 3-6 0 2 1 3 2 3 0-3-1-5 1-8Z'/%3E%3C/svg%3E") center/contain no-repeat}
#puzzle-bar .puzzle-level{grid-area:level;max-width:none;display:flex;align-items:center;gap:12px;text-align:left;font-size:12px;font-weight:600}
.puzzle-level progress{flex:1;height:6px;margin:0;-webkit-appearance:none;appearance:none;border:0;border-radius:99px;background:#e3e7df;overflow:hidden}
.puzzle-level progress::-webkit-progress-bar{background:#e3e7df;border-radius:99px}.puzzle-level progress::-webkit-progress-value{background:var(--accent);border-radius:99px}.puzzle-level progress::-moz-progress-bar{background:var(--accent);border-radius:99px}
#puzzle-feedback{font-size:15px;font-weight:600;min-height:26px;margin:14px 0}
#puzzle-feedback.good{color:var(--accent)}#puzzle-feedback.bad{color:var(--bad)}
.puzzle-actions button{min-height:52px;border-radius:var(--radius-m);font-size:15px;font-weight:700;background:var(--panel);border:1px solid var(--line);box-shadow:0 1px 0 #1d292410}
.puzzle-actions button:active:not(:disabled){transform:translateY(1px)}
#puzzle-hint svg{color:var(--gold)}#puzzle-giveup,#puzzle-giveup svg{color:var(--bad)}
.puzzle-actions .primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:inset 0 -3px 0 #00000026}
.elo-plus{color:var(--accent);font-family:Unbounded,sans-serif}
#puzzle-bar #puzzle-rating.elo-bump{color:var(--accent)}
.move-mark.good,.fly-check{background:var(--accent)}.move-mark.bad{background:var(--bad)}
.toolbar{border:1px solid var(--line);background:var(--panel);border-radius:var(--radius-m);margin-top:14px;padding:4px}
.toolbar button{border-radius:var(--radius-s);color:var(--ink)}
.bottom-nav{background:#fbfcf9ee;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.bottom-nav button{font-size:12px;font-weight:600}
.bottom-nav button[aria-current='page']{color:var(--accent);background:transparent}
.bottom-nav svg{width:56px;height:30px;padding:4px 16px;border-radius:99px}
.bottom-nav button[aria-current='page'] svg{background:#2e6a4e1f}
.launch>p,.subtitle{font-size:14px;font-weight:600}
.mode-choice{border-radius:var(--radius-l);padding:18px;min-height:88px;font-size:17px;font-weight:700;box-shadow:0 1px 0 #1d292410}
.mode-choice small{font-size:13px;font-weight:500}
.mode-icon{width:48px;height:48px;border-radius:var(--radius-m);background:#2e6a4e18;color:var(--accent);font-size:16px;letter-spacing:-2px}
#friend-mode{background:var(--accent);border-color:var(--accent);color:#fff}#friend-mode small,#friend-mode .chev{color:#ffffffcc}#friend-mode .mode-icon{background:#ffffff26;color:#fff}
#friend-mode:hover:not(:disabled){background:var(--accent);filter:brightness(1.05)}
.levels-back{font-weight:600}
#leaderboard-list{border-radius:var(--radius-l);background:var(--panel)}
#leaderboard-list li{padding:14px 16px}
#leaderboard-list strong{font-weight:700}
#leaderboard-list b{font-family:Unbounded,sans-serif;font-size:17px;font-weight:700}
#leaderboard-list li.is-me{background:#2e6a4e14}
#leaderboard-list li:nth-child(1)>span:first-child{background:var(--gold)}
dialog{border-radius:var(--radius-l);border:0;box-shadow:0 24px 60px -12px #1d292466}
dialog form button{border-radius:var(--radius-m);min-height:50px;font-weight:700}
dialog form .primary,#result-menu{border-radius:var(--radius-m);min-height:52px;font-weight:700;background:var(--accent)}
#result-title{font-size:28px}.result-score strong{font-family:Unbounded,sans-serif;color:var(--accent)}
.page-state button,#leaderboard-retry,#retry{border-radius:var(--radius-m);font-weight:700}
#notice{border-radius:var(--radius-m)}
.room-seat{border-radius:var(--radius-l)}.room-actions .primary{border-radius:var(--radius-m);min-height:52px;font-weight:700}
@media(max-width:380px){#puzzle-bar #puzzle-rating{font-size:30px}}
#puzzle-level{display:none}
#puzzle-bar>div:first-child>small{display:none}
#puzzle-bar #puzzle-rating.elo-down{color:var(--bad);animation:elo-shake .45s ease-in-out .25s}@keyframes elo-shake{0%,100%{transform:none}20%{transform:translateX(-4px)}40%{transform:translateX(4px)}60%{transform:translateX(-3px)}80%{transform:translateX(2px)}}
.elo-minus{position:absolute;left:100%;top:-6px;margin-left:6px;color:var(--bad);font-family:Unbounded,sans-serif;font-size:22px;font-weight:700;white-space:nowrap;pointer-events:none;animation:elo-minus 1.2s forwards}@keyframes elo-minus{0%{transform:translateY(-26px) scale(1.4);opacity:0;animation-timing-function:cubic-bezier(.5,0,.75,0)}25%{transform:translateY(2px) scale(.94);opacity:1;animation-timing-function:cubic-bezier(.2,.8,.3,1)}38%{transform:translateY(-3px) scale(1.04)}55%{transform:none;opacity:1;animation-timing-function:cubic-bezier(.6,0,.9,.4)}100%{transform:translate(var(--dx),var(--dy)) scale(.35);opacity:0}}
#puzzle-bar #puzzle-rating.elo-down{animation:elo-shake .45s ease-in-out}
.puzzle-level progress.loss{animation:loss-flash .7s ease-out}.puzzle-level progress.loss::-webkit-progress-value{background:var(--bad)}.puzzle-level progress.loss::-moz-progress-bar{background:var(--bad)}@keyframes loss-flash{0%{box-shadow:0 0 0 0 #c4473d99}100%{box-shadow:0 0 0 8px #c4473d00}}
@media(prefers-reduced-motion:reduce){#puzzle-bar #puzzle-rating.elo-down,.elo-minus,.puzzle-level progress.loss{animation:none}}
#puzzle-bar>div:first-child{justify-self:start}
#puzzle-bar{background:none;border:0;border-radius:0;padding:4px 2px 0}
#puzzle-bar #puzzle-rating{font-size:44px}
#puzzle-bar #puzzle-rating{font-size:38px}
.puzzle-actions{flex-wrap:wrap;gap:4px;margin-top:4px}
.puzzle-actions button:not(.primary){flex:1 1 0;flex-direction:column;gap:4px;min-height:60px;padding:6px 2px;background:none;border:0;box-shadow:none;border-radius:var(--radius-m);font-size:13px;font-weight:600;color:var(--ink)}
.puzzle-actions button:not(.primary) svg{width:24px;height:24px}
.puzzle-actions button:not(.primary):hover:not(:disabled){background:#1d29240a}
#puzzle-back svg,#puzzle-forward svg{color:var(--ink)}
.puzzle-actions .primary{flex:1 1 100%;order:5;min-height:54px}
.streak-row{display:flex;align-items:center;justify-content:flex-end;gap:10px}
#puzzle-bar #puzzle-feedback{min-height:0;margin:0;font-size:14px;font-weight:700;text-align:right;line-height:1.2}
#puzzle-bar #puzzle-feedback:empty{display:none}
.puzzle-actions{margin-top:14px}
body{font-family:Rubik,'Segoe UI',Roboto,sans-serif}
.turn-status h2,.square.dark::before{font-family:Rubik,sans-serif}
.puzzle-actions button:not(.primary){font-size:12px;font-weight:700}
.puzzle-actions button svg{width:26px;height:26px}
.puzzle-actions svg.fill{fill:currentColor;stroke:none}
.puzzle-actions svg.stroke{fill:none;stroke:currentColor;stroke-width:2.4}
.puzzle-actions button:disabled{color:var(--muted);opacity:.45}
.puzzle-actions button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#puzzle-hint,#puzzle-hint svg,#puzzle-back svg,#puzzle-forward svg,#puzzle-replay svg{color:var(--ink)}
.puzzle-actions #puzzle-tryagain.retry{flex-direction:row;align-self:center;min-height:52px;background:var(--accent);color:#fff;font-size:16px;font-weight:800;box-shadow:inset 0 -4px 0 #0000002e}
.puzzle-actions #puzzle-tryagain.retry:hover:not(:disabled){background:var(--accent);filter:brightness(1.05)}
.puzzle-actions #puzzle-tryagain.retry:active{transform:translateY(1px)}
:root{--wood:#b58863;--maple:#f0d9b5}
.board-frame{background:linear-gradient(160deg,#a5774f,#7a5233)}
.piece.black{background:radial-gradient(circle at 35% 30%,#4a4a4a,#141414 70%);border-color:#000;box-shadow:0 2px 0 #000,0 3px 3px #0007,inset 0 0 0 2px #5c5c5c,inset 0 1px 0 3px #ffffff14}
.piece.black::after{border-color:#8a8a8a99}
.square.dark::before{color:#fff3df;opacity:.55}
.toolbar{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;margin-top:14px;padding:0;background:none;border:0;border-radius:0}
.toolbar .tool-separator{display:none}
.toolbar button{width:auto;height:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:60px;padding:6px 2px;border-radius:var(--radius-m);color:var(--ink);font-size:12px;font-weight:700}
.toolbar button svg{width:26px;height:26px}
.toolbar svg.fill{fill:currentColor;stroke:none}.toolbar svg.stroke{fill:none;stroke:currentColor;stroke-width:2.4}
.toolbar button:hover:not(:disabled){background:#1d29240a}
.toolbar button:disabled{color:var(--muted);opacity:.45}
.toolbar{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:1fr}
#chat-toggle{position:relative}
#chat-badge{position:absolute;top:4px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--bad);color:#fff;font-size:11px;font-weight:800;line-height:18px;text-align:center}
.chat-layer{position:fixed;inset:0;z-index:60}
.chat-backdrop{position:absolute;inset:0;width:100%;background:#1d292499;border-radius:0;animation:chat-fade .25s}
.chat-sheet{position:absolute;left:0;right:0;bottom:0;max-width:560px;margin:0 auto;height:min(78dvh,640px);display:flex;flex-direction:column;border-radius:24px 24px 0 0;background:var(--panel);padding-bottom:var(--safe-bottom);animation:chat-up .3s cubic-bezier(.2,.8,.2,1);box-shadow:0 -12px 40px -16px #1d292466}
@keyframes chat-up{from{transform:translateY(100%)}}@keyframes chat-fade{from{opacity:0}}
.chat-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid var(--line)}
.chat-head h2{font-size:17px}
.chat-close{width:40px;height:40px;min-height:40px;border-radius:12px;display:grid;place-items:center;background:#1d29240d}
.chat-close svg{width:18px;height:18px;stroke-width:2.4}
.chat-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line)}
.chat-tabs button{border-radius:0;font-weight:700;color:var(--muted);border-bottom:2px solid transparent}
.chat-tabs button.on{color:var(--ink);border-bottom-color:var(--accent)}
.chat-quick{flex:1;overflow:auto;padding:12px 14px;display:grid;gap:14px;align-content:start}
.chat-quick-msgs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.chat-quick-msgs button{min-height:42px;padding:0 10px;border-radius:12px;background:#1d29240a;text-align:left;font-weight:600;font-size:13px}
.chat-quick-emoji{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}
.chat-quick-emoji button{aspect-ratio:1;min-height:0;font-size:24px;border-radius:10px}
.chat-messages{list-style:none;margin:0;padding:12px 14px;flex:1;overflow:auto;display:grid;gap:10px;align-content:start}
.chat-messages li{display:flex}.chat-messages li.mine{justify-content:flex-end}
.chat-bubble{display:grid;gap:2px;max-width:78%;padding:8px 12px;border-radius:16px 16px 16px 4px;background:#1d29240d}
.chat-messages li.mine .chat-bubble{background:var(--accent);color:#fff;border-radius:16px 16px 4px 16px}
.chat-bubble small{font-size:11px;font-weight:700;opacity:.7}.chat-bubble p{margin:0;font-size:15px;overflow-wrap:anywhere}
.chat-empty{flex-direction:column;align-items:center;text-align:center;color:var(--muted);padding:30px 10px;gap:4px}.chat-empty span{font-size:34px}
.chat-form{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--line)}
.chat-form input{flex:1;min-height:46px;padding:0 14px;border-radius:14px;border:1px solid var(--line);background:#fff;color:var(--ink);font:inherit}
.chat-form button{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:var(--accent);color:#fff}
.chat-form button:disabled{opacity:.4}.chat-form svg{width:20px;height:20px}
.chat-quick[hidden],.chat-messages[hidden],.chat-form[hidden]{display:none}
@media(prefers-reduced-motion:reduce){.chat-sheet,.chat-backdrop{animation:none}}
.chat-quick-msgs{grid-template-columns:repeat(3,minmax(0,1fr))}.chat-quick-emoji{grid-template-columns:repeat(8,minmax(0,1fr))}.chat-quick button{min-width:0;padding:0}.chat-quick-msgs button{padding:0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-sheet{width:100%;overflow:hidden}

.move-strip{order:-1;list-style:none;margin:0 0 6px;padding:6px 2px;display:flex;gap:2px;min-height:34px;overflow-x:auto;white-space:nowrap;scrollbar-width:none;border-bottom:1px solid var(--line)}
.move-strip::-webkit-scrollbar{display:none}
.move-strip li{display:flex;align-items:center;gap:2px;flex:none}
.move-strip .move-no{margin-left:8px;color:var(--muted);font-size:12px;font-weight:600}.move-strip li:first-child .move-no{margin-left:0}
.move-strip .mv{padding:3px 6px;border-radius:6px;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.move-strip .mv.on{background:#1d292414}
.player-strip{display:flex;align-items:center;gap:10px;min-height:56px;padding:4px 2px;background:none;border:0;border-radius:0}
.player-strip.active{background:none;border:0;box-shadow:none}
.ps-avatar{position:relative;flex:none;width:44px;height:44px;border-radius:10px;overflow:hidden;display:grid;place-items:center;background:#2e6a4e1f;color:var(--accent);font-weight:700;font-size:18px}
.ps-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ps-avatar.bot{background:#1d29240f;color:var(--ink)}.ps-avatar svg{width:28px;height:28px;fill:currentColor;stroke:none}
.player-strip.active .ps-avatar{box-shadow:0 0 0 2px var(--accent)}
.ps-text{display:grid;gap:2px;min-width:0}
.player-strip .player-name{font-size:15px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.player-strip .player-name small{font-weight:500;color:var(--muted)}
.captured{display:flex;align-items:center;min-height:16px}
.captured .cap{width:13px;height:13px;margin-right:-5px;border-radius:50%;flex:none}
.captured .cap.black{background:radial-gradient(circle at 35% 30%,#555,#111);box-shadow:0 0 0 1px #fff}
.captured .cap.white{background:#fff;box-shadow:0 0 0 1px #9a958c}
.captured b{margin-left:10px;font-size:12px;color:var(--muted)}
#open-history{display:none}
.captured .cap{width:16px;height:16px;margin-right:-6px}.captured .cap.white{background:radial-gradient(circle at 35% 30%,#fff,#dcd9d2);box-shadow:0 0 0 1px #8f8a80}
body.in-game .bottom-nav,body.in-game .turn-status{display:none}
body.in-game{padding-bottom:calc(16px + var(--safe-bottom))}

#game-menu{width:min(420px,calc(100% - 24px));padding:8px;margin:auto auto calc(12px + var(--safe-bottom));border-radius:var(--radius-l)}
#game-menu::backdrop{background:#1d292488}
#game-menu .menu-list{display:grid}
#game-menu .menu-list button{display:flex;align-items:center;gap:14px;min-height:54px;padding:0 14px;border-radius:var(--radius-m);font-size:16px;font-weight:600;text-align:left;width:100%;height:auto}
#game-menu .menu-list button:hover:not(:disabled){background:#1d29240a}
#game-menu .menu-list svg{width:24px;height:24px;color:var(--ink)}
#game-menu svg.fill{fill:currentColor;stroke:none}#game-menu svg.stroke{fill:none;stroke:currentColor;stroke-width:2.4}
#game-menu #game-exit{color:var(--bad)}#game-menu #game-exit svg{color:var(--bad)}
#game-menu form{margin:6px 0 0}
#game-menu .menu-cancel{width:100%;min-height:52px;border-radius:var(--radius-m);background:#1d29240d;font-weight:700;border:0}
.hint{display:none!important}
.move-strip{height:36px;min-height:36px;box-sizing:border-box}
.player-strip{height:56px}
.captured{height:16px}
body.in-game{min-height:0;height:100svh;overflow:hidden;overscroll-behavior:none;padding-bottom:var(--safe-bottom)}
body.in-game main{margin:8px auto 0}
html:has(body.in-game){overflow:hidden;overscroll-behavior:none}

.room-lobby h1{margin-bottom:4px}#room-status{margin:0 0 18px;font-weight:600}
.room-duel{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin:0 0 18px}
.room-vs{font-family:Unbounded,sans-serif;font-size:15px;font-weight:700;color:var(--muted)}
.room-duel .room-seat{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:190px;padding:18px 10px;border:1px solid var(--line);background:var(--panel);border-radius:var(--radius-l);text-align:center;overflow-wrap:anywhere}
.room-duel .room-seat.ready{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset;background:var(--panel)}
.room-duel .room-seat.empty{justify-content:center;border-style:dashed;background:none}
.room-avatar{position:relative;width:64px;height:64px;border-radius:18px;display:grid;place-items:center;background:#2e6a4e1f;color:var(--accent);font-size:26px;font-weight:700;margin-bottom:6px}
.room-avatar img{position:absolute;inset:0;width:100%;height:100%;border-radius:18px;object-fit:cover}
.room-avatar i{position:absolute;right:-3px;bottom:-3px;width:16px;height:16px;border-radius:50%;background:#c9cfc6;box-shadow:0 0 0 3px var(--panel)}
.room-seat.ready .room-avatar i{background:var(--accent)}
.room-seat.empty .room-avatar{background:#1d29240a;color:var(--muted)}.room-avatar svg{width:32px;height:32px;fill:currentColor}
.room-duel strong{font-size:15px;font-weight:700;line-height:1.25}.room-duel small{font-size:12px;color:var(--muted);font-weight:600}
.room-seat-state{margin-top:6px;padding:3px 10px;border-radius:99px;background:#1d29240d;font-size:12px;font-weight:700;color:var(--muted)}
.room-seat.ready .room-seat-state{background:#2e6a4e1f;color:var(--accent)}
.room-invite{min-height:44px;padding:0 22px;border-radius:var(--radius-m);background:var(--accent);color:#fff;font-weight:700}
.room-invite:hover:not(:disabled){background:var(--accent);filter:brightness(1.05)}
.room-actions .primary{min-height:54px}
#room-ready:not(.on){background:var(--accent)}#room-ready.on{background:var(--panel);color:var(--accent);border:1px solid var(--accent)}
.room-foot{display:flex;justify-content:space-between;margin-top:14px}
.room-foot button{display:flex;align-items:center;gap:8px;padding:0 14px;border-radius:var(--radius-m);font-weight:700;color:var(--muted)}
.room-foot svg{width:22px;height:22px;fill:currentColor;stroke:none}
#cancel-wait{margin:0}

.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin:4px 0 18px;background:#1d29240d;border-radius:var(--radius-m)}
.seg button{min-height:40px;border-radius:10px;font-weight:700;color:var(--muted)}
.seg button.on{background:var(--panel);color:var(--ink);box-shadow:0 1px 3px #1d29241f}
#leaderboard-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;gap:0;border:0;background:none;border-radius:0;overflow:visible}
#leaderboard-list li{grid-column:1/-1;order:4;background:var(--panel);border-bottom:1px solid var(--line)}
#leaderboard-list li:not(.podium):nth-child(4){border-radius:var(--radius-l) var(--radius-l) 0 0;margin-top:14px}
#leaderboard-list li:last-child{border-radius:0 0 var(--radius-l) var(--radius-l);border-bottom:0}
#leaderboard-list li:nth-child(4):last-child{border-radius:var(--radius-l)}
#leaderboard-list li.podium{grid-column:auto;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:16px 6px 14px;margin:0 4px;border:0;border-radius:var(--radius-l) var(--radius-l) 0 0;background:var(--panel)}
#leaderboard-list li.p1{order:2;padding-top:22px;min-height:200px}#leaderboard-list li.p2{order:1;min-height:170px}#leaderboard-list li.p3{order:3;min-height:156px}
#leaderboard-list li.podium>span:first-child{order:3;width:26px;height:26px;margin-top:4px}
#leaderboard-list li.podium .leaderboard-avatar{width:52px;height:52px;font-size:20px;order:0}
#leaderboard-list li.p1 .leaderboard-avatar{width:64px;height:64px;box-shadow:0 0 0 3px var(--gold)}
#leaderboard-list li.podium strong{order:1;font-size:13px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#leaderboard-list li.podium b{order:2;font-size:18px}
#leaderboard-list li.podium small{order:4;font-size:11px}
#leaderboard-list li.podium:last-child{border-radius:var(--radius-l) var(--radius-l) 0 0}
:root{--board-size:min(560px,100vw)}
.board-frame{padding:0;background:none;border-radius:0;box-shadow:none}
#board{border-radius:0;box-shadow:none}
.game>:not(.board-frame),#puzzle-controls,.toolbar{padding-left:12px;padding-right:12px}
@media(min-width:761px){:root{--board-size:min(560px,calc(100svh - 310px))}}
.player-strip{position:relative}
.ps-bubble{position:absolute;left:62px;z-index:5;max-width:calc(100% - 80px);min-height:0;padding:7px 12px;border-radius:14px;background:var(--ink);color:#fff;font-size:14px;font-weight:600;line-height:1.3;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-shadow:0 6px 18px -6px #1d292480;animation:bubble-in .25s cubic-bezier(.2,1.3,.4,1)}
.ps-bubble::before{content:'';position:absolute;left:-5px;width:12px;height:12px;background:inherit;transform:rotate(45deg)}
.ps-bubble:hover:not(:disabled){background:var(--ink)}
.player-strip[style*="order: 3"] .ps-bubble{bottom:calc(100% - 6px);border-bottom-left-radius:4px}
.player-strip[style*="order: 3"] .ps-bubble::before{bottom:6px}
.player-strip:not([style*="order: 3"]) .ps-bubble{top:calc(100% - 6px);border-top-left-radius:4px}
.player-strip:not([style*="order: 3"]) .ps-bubble::before{top:6px}
.ps-bubble.out{opacity:0;transform:translateY(4px);transition:.3s}
@keyframes bubble-in{from{opacity:0;transform:scale(.6) translateY(6px)}}
@media(prefers-reduced-motion:reduce){.ps-bubble{animation:none}}
.player-strip .ps-bubble,.player-strip[style*="order: 3"] .ps-bubble,.player-strip:not([style*="order: 3"]) .ps-bubble{top:50%;bottom:auto;margin-top:-17px;height:34px;border-radius:14px;max-width:calc(100% - 70px)}
.player-strip .ps-bubble::before,.player-strip[style*="order: 3"] .ps-bubble::before,.player-strip:not([style*="order: 3"]) .ps-bubble::before{top:11px;bottom:auto}
.chat-layer{overscroll-behavior:contain;touch-action:none}
.chat-sheet{height:auto;max-height:min(72dvh,560px);touch-action:auto;animation-duration:.22s;transition:bottom .15s}
.chat-messages{height:min(46dvh,380px);flex:none;overscroll-behavior:contain}
.chat-quick{flex:none;padding:14px;gap:16px;overscroll-behavior:contain}
.chat-quick-msgs{display:flex;flex-wrap:wrap;gap:8px}
.chat-quick-msgs button{flex:none;min-height:38px;padding:0 14px;border-radius:99px;background:#1d29240d;font-size:14px;font-weight:600;white-space:nowrap}
.chat-quick-emoji{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
.chat-quick-emoji button{font-size:26px}
.chat-form input{font-size:16px}
.chat-head{padding:12px 16px 8px}
.chat-sheet{height:min(60dvh,460px)}
.chat-messages,.chat-quick{flex:1 1 0;height:auto;min-height:0;overflow:auto}

#result-dialog{position:fixed;width:min(340px,calc(100% - 32px));padding:24px 16px 16px;text-align:center}
.result-x{position:absolute;top:10px;right:10px;width:38px;height:38px;min-height:38px;border-radius:12px;display:grid;place-items:center;background:#1d29240d}
.result-x svg{width:18px;height:18px;stroke-width:2.4}
#result-dialog #result-title{font-size:30px;margin:4px 0 2px}
#result-dialog[data-outcome=win] #result-title{color:var(--accent)}#result-dialog[data-outcome=loss] #result-title{color:var(--bad)}
#result-dialog #result-subtitle{margin:0;font-size:14px;font-weight:600;color:var(--muted)}
.go-players{display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:6px;margin-top:20px}
.go-player{display:grid;justify-items:center;gap:4px;min-width:0}
.go-player .ps-avatar{width:60px;height:60px;border-radius:14px;font-size:24px;outline:3px solid transparent;outline-offset:2px}
.go-player .ps-avatar svg{width:36px;height:36px}
.go-player.winner .ps-avatar{outline-color:var(--accent)}.go-player.loser .ps-avatar{opacity:.5}
.go-player b{max-width:100%;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.go-player small{min-height:16px;font-size:12px;font-weight:700;color:var(--muted)}
.go-player .up{color:var(--accent)}.go-player .down{color:var(--bad)}
.go-vs{margin-top:22px;font-size:12px;font-weight:800;color:var(--muted)}
#result-dialog .go-main{width:100%;min-height:52px;margin-top:22px;border-radius:var(--radius-m);font-size:16px;font-weight:800;background:var(--accent);color:#fff;box-shadow:inset 0 -4px 0 #0000002e}
.go-actions{display:flex;gap:8px;margin-top:8px}
.go-actions button{flex:1;min-height:46px;border-radius:var(--radius-m);background:#1d29240d;font-weight:700;font-size:14px}
.leaderboard-panel{margin-top:20px}
.levels-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.levels-head h2{font-size:22px}
#levels-back.levels-back{margin:0;width:44px;height:44px;min-height:44px;display:grid;place-items:center;border-radius:var(--radius-m);background:var(--panel);border:1px solid var(--line);color:var(--ink)}
#levels-back svg{width:22px;height:22px;stroke-width:2.6}
#levels-back:hover:not(:disabled){background:var(--panel);border-color:var(--accent)}
html,body{touch-action:manipulation;-webkit-text-size-adjust:100%;text-size-adjust:100%}
input,textarea,select{font-size:16px}
#game-menu #menu-resign,#game-menu #menu-resign svg{color:var(--bad)}
#resign-dialog{width:min(340px,calc(100% - 32px))}
#resign-dialog form .primary{background:var(--bad)}
#waiting.searching .room-actions,#waiting.searching #room-chat{display:none}#waiting.searching .room-foot{justify-content:center}
.search-spin{width:44px;height:44px;border-radius:50%;border:4px solid var(--line);border-top-color:var(--accent);animation:search-spin .9s linear infinite}@keyframes search-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.search-spin{animation-duration:2.4s}}
