:root{--bg:#12100c;--surface:#1e1a14;--surface2:#2a241a;--text:#f2ead8;--muted:#b8ab8d;--border:#3a3325;--accent:#e8c874;--on-accent:#1a1508;--danger:#e5534b;--ok:#57ab5a;--warn:#d29922;--info:#539bf5}:root[data-theme=noir-or]{--bg:#0a0805;--surface:#171208;--surface2:#241b0a;--text:#f5e6bd;--muted:#c9b078;--border:#4a3a14;--accent:#f0c040;--on-accent:#171106}:root[data-theme=vert]{--bg:#0f1512;--surface:#182420;--surface2:#22352c;--text:#e6f2e9;--muted:#a7c4b0;--border:#2e4a3a;--accent:#7fd08a;--on-accent:#0c1a10}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:15px}button{font:inherit;cursor:pointer;border-radius:10px;border:1px solid var(--border);background:var(--surface2);color:var(--text);padding:8px 12px}button:active{transform:translateY(1px);box-shadow:inset 0 2px 4px #0006}button.primary{background:var(--accent);color:var(--on-accent);border-color:transparent;font-weight:600}button.danger{border-color:var(--danger);color:var(--danger)}button:disabled{opacity:.45;cursor:default}input,select{font:inherit;background:var(--surface2);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:8px 10px;width:100%}label{font-size:13px;color:var(--muted);display:block;margin-bottom:4px}h1{font-size:20px;margin:0}h2{font-size:17px;margin:0 0 8px}h3{font-size:15px;margin:0 0 6px}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px}.muted{color:var(--muted);font-size:13px}.small{font-size:12px}.app-shell{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.app-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid var(--border);flex:0 0 auto}.app-header .gear{background:none;border:none;font-size:20px;padding:4px;color:var(--accent)}.app-main{flex:1 1 auto;overflow-y:auto;padding:12px 12px 8px}.app-main.no-scroll{overflow:hidden;display:flex;flex-direction:column}.bottom-nav{flex:0 0 auto;display:flex;border-top:1px solid var(--border);background:var(--surface);padding-bottom:env(safe-area-inset-bottom)}.bottom-nav button{flex:1;background:none;border:none;border-radius:0;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px;font-size:11px;color:var(--muted)}.bottom-nav button.active{color:var(--accent)}.bottom-nav svg{width:22px;height:22px}.board-wrap{width:min(92vw,560px);margin:0 auto}.board-frame{padding:8px;background:#241c10;border-radius:12px}.board-frame.off{padding:0;background:none}.board{position:relative;width:100%;aspect-ratio:1;-webkit-user-select:none;user-select:none;touch-action:none;border-radius:4px;overflow:hidden}.sq{position:absolute;width:12.5%;height:12.5%}.sq .coord{position:absolute;font-size:9px;font-weight:700;opacity:.85;pointer-events:none}.piece{position:absolute;width:12.5%;height:12.5%;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:3}.piece img{pointer-events:none}.piece .glyph{font-weight:700;line-height:1;text-shadow:0 1px 2px rgba(0,0,0,.5)}.dot{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:26%;height:26%;border-radius:50%;background:#143c1459;pointer-events:none;z-index:2}.ring{position:absolute;top:4%;right:4%;bottom:4%;left:4%;border-radius:50%;border:4px solid rgba(20,60,20,.4);pointer-events:none;z-index:2}.capture-ring{position:absolute;top:2%;right:2%;bottom:2%;left:2%;border-radius:50%;border:5px solid rgba(180,40,30,.55);pointer-events:none;z-index:2}.moves-grid{display:grid;grid-template-columns:32px 1fr 1fr;gap:2px 6px;font-size:14px;overflow-y:auto}.moves-grid .cur{background:var(--accent);color:var(--on-accent);border-radius:6px;padding:0 4px;font-weight:700}.moves-grid span{padding:0 4px;border-radius:6px}.badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:700;color:#111}.evalbar{width:14px;border-radius:6px;background:#333;position:relative;overflow:hidden;min-height:120px}.evalbar .white{position:absolute;bottom:0;left:0;right:0;background:#f5f5f5;transition:height .5s ease}.playerbar{display:flex;align-items:center;gap:8px;padding:6px 4px}.captured{display:flex;flex-wrap:wrap;gap:0}.captured img{width:18px;height:18px;margin-left:-4px}.row{display:flex;gap:8px;align-items:center}.col{display:flex;flex-direction:column;gap:8px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000a6;display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}.modal{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px;max-width:480px;width:100%;max-height:90dvh;overflow-y:auto}.promo-picker{display:flex;gap:8px;justify-content:center}.promo-picker button{width:64px;height:64px;padding:4px}.promo-picker img{width:100%;height:100%}.list-item{display:block;width:100%;text-align:left;margin-bottom:8px}.bar-row{display:flex;align-items:center;gap:8px;font-size:13px}.bar-track{flex:1;height:10px;background:var(--surface2);border-radius:6px;overflow:hidden}.bar-fill{height:100%;background:var(--accent);transition:width .4s}.alert-box{border:1px solid var(--warn);background:#d299221f;border-radius:10px;padding:8px;font-size:13px}.login-wrap{min-height:100dvh;display:grid;place-items:center;padding:16px}.kbd-tabs{display:flex;gap:6px;flex-wrap:wrap}.kbd-tabs button.active{background:var(--accent);color:var(--on-accent);border-color:transparent;font-weight:600}.play-layout{display:flex;flex-direction:column;gap:8px;height:100%;min-height:0}.play-board-zone{flex:0 1 auto;display:flex;flex-direction:column;min-height:0}.play-side{flex:1 1 auto;display:flex;flex-direction:column;gap:8px;min-height:0;min-width:0;overflow-y:auto}.app-main.no-scroll>*{min-height:0}@media (min-width:1024px){.app-header{padding:6px 16px}.bottom-nav button{padding:5px 2px}.app-main{padding:8px}.play-layout{display:grid;grid-template-columns:minmax(0,1fr) clamp(320px,26vw,400px);gap:16px}.play-board-zone{height:100%}.play-side{height:100%}.playerbar{padding:3px 4px}.board-wrap{width:min(92vw,720px)}.play-board-zone .board-wrap{width:min(100%,calc(100dvh - 254px))}}.thinking{animation:thinking-pulse 1.2s ease-in-out infinite}@keyframes thinking-pulse{0%,to{opacity:.45}50%{opacity:1}}@keyframes stats-in{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}.stats-anim{animation:stats-in .35s ease both}.stats-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;border-bottom:1px solid var(--border);padding-bottom:6px;margin-bottom:2px}.stats-section-head h3{margin:0}.rating-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}@media (min-width:720px){.rating-grid{grid-template-columns:repeat(4,1fr)}}.rating-card{background:var(--surface);border:1px solid var(--border);border-top:3px solid var(--accent);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:4px;min-width:0}.rating-label{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);display:flex;align-items:center;gap:6px}.rating-glyph{font-size:15px;color:var(--accent);letter-spacing:0;text-transform:none}.rating-num{font-size:34px;font-weight:800;line-height:1.05;font-variant-numeric:tabular-nums}.wdl-bar{display:flex;height:6px;border-radius:3px;overflow:hidden;background:var(--surface2);margin-top:4px}.wdl-bar>span{display:block;height:100%;transition:width .6s ease}.kpi-row{display:flex;gap:16px;flex-wrap:wrap}.kpi{display:flex;flex-direction:column}.kpi-num{font-size:24px;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}.kpi-label{font-size:12px;color:var(--muted)}.donut-flex{display:flex;gap:16px;align-items:center;flex-wrap:wrap}.donut-wrap{position:relative;width:132px;height:132px;flex:0 0 auto}.donut-wrap svg{transform:rotate(-90deg)}.donut-center{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.donut-center .big{font-size:26px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}.legend{display:flex;flex-direction:column;gap:6px;font-size:13px;min-width:140px;flex:1}.legend-item{display:flex;align-items:center;gap:8px}.legend-dot{width:10px;height:10px;border-radius:3px;flex:0 0 auto}.legend-item .val{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:600}.stats-bar{position:relative;height:12px;background:var(--surface2);border-radius:6px;overflow:hidden;flex:1;min-width:60px}.stats-bar-fill{height:100%;border-radius:6px;transition:width .7s ease}.stats-bar-row{display:flex;align-items:center;gap:8px;font-size:13px}.stats-bar-row .lab{flex:0 0 auto}.stats-bar-row .val{flex:0 0 auto;font-variant-numeric:tabular-nums;min-width:74px;text-align:right}.stats-threshold{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--text);opacity:.55}.stats-threshold-lab{position:absolute;top:-15px;transform:translate(-50%);font-size:10px;color:var(--muted);white-space:nowrap}.seg-bar{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--surface2)}.seg-bar>span{display:block;height:100%;transition:width .6s ease}.rank-chip{flex:0 0 auto;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-weight:800;font-size:13px;display:flex;align-items:center;justify-content:center}.prio-item{display:flex;gap:10px;align-items:flex-start}.chip-list{display:flex;flex-wrap:wrap;gap:6px}.chip{border:1px solid var(--border);background:var(--surface2);border-radius:999px;padding:3px 10px;font-size:12px}.empty-note{border:1px dashed var(--border);border-radius:10px;padding:12px;color:var(--muted);font-size:13px;background:#ffffff05}
