:root{color-scheme:dark;--bg: #1a1d24;--bg-2: #232730;--board: #5a3a2a;--board-edge: #2c1a10;--point-light: #c79e74;--point-dark: #6e3b1f;--bar: #3a2418;--checker-w: #f5f1e6;--checker-w-edge: #b6ad96;--checker-b: #2c2c33;--checker-b-edge: #595963;--highlight: #ffd24a;--legal: #6dd47e;--hint: #6ec9ff;--text: #e8e6e0;--text-dim: #9a958a;--accent: #ffb347;--danger: #ff7e7e;--good: #6dd47e}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overscroll-behavior:none;user-select:none;-webkit-tap-highlight-color:transparent}@media(max-height:540px),(max-width:700px){html{font-size:18px}}@media(max-height:420px),(max-width:500px){html{font-size:19px}}#app{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}button{font-family:inherit;font-size:1rem;padding:.55em 1.1em;border:1px solid #4a4f5a;background:#2b303b;color:var(--text);border-radius:8px;cursor:pointer;transition:background .12s,border-color .12s}button:hover:not(:disabled){background:#353b48;border-color:#6a7080}button:disabled{opacity:.4;cursor:default}button.primary{background:var(--accent);color:#1a1d24;border-color:var(--accent);font-weight:600}button.primary:hover:not(:disabled){background:#ffc56b;border-color:#ffc56b}.topbar{display:flex;align-items:center;justify-content:space-between;padding:calc(.5rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) .5rem calc(1rem + env(safe-area-inset-left));background:var(--bg-2);border-bottom:1px solid #2c2f38;flex:0 0 auto}.topbar .title{font-weight:600;letter-spacing:.04em}.topbar .score{font-variant-numeric:tabular-nums;color:var(--text-dim)}.main{flex:1 1 auto;display:flex;flex-direction:row;min-height:0;min-width:0}.board-wrap{flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding-left:env(safe-area-inset-left);padding-bottom:env(safe-area-inset-bottom);background:var(--board-edge);min-height:0;min-width:0}.board-svg{width:100%;height:100%;max-height:100%;touch-action:none}.sidebar{flex:0 0 calc(56px + env(safe-area-inset-right));width:calc(56px + env(safe-area-inset-right));display:flex;flex-direction:column;gap:.4rem;padding:calc(.4rem + env(safe-area-inset-top)) calc(.3rem + env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) .3rem;background:var(--bg-2);border-left:1px solid #2c2f38;overflow-y:auto}.sidebar .tutor-slot{min-height:0}.sidebar .actions{display:flex;flex-direction:column;gap:.4rem}.sidebar .actions-bottom{margin-top:auto}.sidebar .actions button{width:100%;display:flex;align-items:center;justify-content:center;padding:.2em 0;min-height:44px;line-height:1}.sidebar .actions button .label{display:none}.sidebar .actions button .icon{display:inline-flex;align-items:center;justify-content:center;font-size:1.9rem;line-height:1}.hint-modal-backdrop{background:transparent;align-items:flex-end;justify-content:center;padding:0 1rem 1rem;pointer-events:none}.hint-modal-backdrop .modal{pointer-events:auto;max-width:480px;background:#232730f0;backdrop-filter:blur(6px)}.hint-modal .hint-body{margin:.5rem 0 1rem;min-height:3em}.hint-table tr.hint-row.selected{background:#ffd24a2e;outline:1px solid rgba(255,210,74,.55)}.hint-table{width:100%;border-collapse:collapse}.hint-table tr{border-bottom:1px solid #2c2f38}.hint-table tr:last-child{border-bottom:none}.hint-table tr.hint-row{cursor:pointer;transition:background .1s}.hint-table tr.hint-row:hover{background:#2b303b}.hint-table td{padding:.35rem .5rem}.hint-table td.rank{width:1.5em;color:var(--text-dim);text-align:right}.hint-table td.moves{font-variant-numeric:tabular-nums}.hint-table td.equity{text-align:right;color:var(--text-dim);font-variant-numeric:tabular-nums;white-space:nowrap;padding-right:.75rem}.hint-table td.loss{text-align:right;color:var(--text-dim);font-variant-numeric:tabular-nums;white-space:nowrap}.hint-table tr.best td.loss{color:var(--good)}.rotate-prompt{display:none}.modal-backdrop{position:fixed;inset:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:100;padding:1rem}.modal{background:var(--bg-2);border:1px solid #353b48;border-radius:12px;padding:1.25rem 1.5rem;max-width:480px;width:100%;max-height:90vh;max-height:90dvh;overflow-y:auto}.modal-backdrop{padding:.5rem}.modal h2{margin-top:0}.modal label{display:flex;flex-direction:column;margin-bottom:.75rem;font-size:.95rem;color:var(--text-dim)}.modal label>span{margin-bottom:.25rem}.modal select,.modal input[type=text],.modal input[type=number]{background:#1f232c;color:var(--text);border:1px solid #3a3f4a;border-radius:6px;padding:.45em .6em;font-family:inherit;font-size:1rem}.modal .checkbox{flex-direction:row;align-items:center;gap:.5rem}.modal .actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.tutor-modal-backdrop{background:transparent;pointer-events:none}.tutor-modal-backdrop .modal{pointer-events:auto;max-width:480px;background:#232730c7;backdrop-filter:blur(8px)}.tutor-analysis-modal .tutor-head{margin:0 0 .5rem}.tutor-analysis-modal.error .tutor-head{color:var(--accent)}.tutor-analysis-modal.blunder .tutor-head{color:var(--danger)}.tutor-analysis-modal.error .hint-table tr.hint-row.yours{background:#f4d03f4d}.tutor-analysis-modal.error .hint-table tr.hint-row.yours.selected{background:#f4d03f73;outline-color:#f4d03fbf}.tutor-analysis-modal.blunder .hint-table tr.hint-row.yours{background:#e74c3c52}.tutor-analysis-modal.blunder .hint-table tr.hint-row.yours.selected{background:#e74c3c7a;outline-color:#e74c3ccc}.hint-table tr.hint-row.yours{background:#ff7e7e1a}.hint-table tr.hint-row.yours.selected{background:#ffd24a2e}.tutor-chip{display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:.2rem auto 0;border-radius:50%;font-weight:700;font-size:1.05rem;line-height:1;cursor:help;color:#1a1d24}.tutor-chip.doubtful{background:#e6c44a}.tutor-chip.error{background:var(--accent)}.tutor-chip.blunder{background:var(--danger);color:#fff}.report{font-size:.95rem}.report table{width:100%;border-collapse:collapse}.report td{padding:.25rem .5rem}.report td:last-child{text-align:right;font-variant-numeric:tabular-nums}@media(orientation:landscape)and (max-height:540px){.topbar{display:none}.sidebar{flex:0 0 calc(64px + env(safe-area-inset-right));width:calc(64px + env(safe-area-inset-right));padding:max(1.2rem,calc(.4rem + env(safe-area-inset-top))) calc(.3rem + env(safe-area-inset-right)) max(1.2rem,calc(.4rem + env(safe-area-inset-bottom))) .3rem}}@media(orientation:landscape)and (max-height:420px){.sidebar{flex:0 0 calc(70px + env(safe-area-inset-right));width:calc(70px + env(safe-area-inset-right))}}@media(max-width:540px),(max-height:540px){.modal{padding:.7rem .85rem;border-radius:10px;font-size:.9rem}.modal h2{font-size:1.05rem;margin-bottom:.4rem}.modal label{margin-bottom:.35rem;font-size:.85rem}.modal label>span{margin-bottom:.1rem}.modal select,.modal input[type=text],.modal input[type=number]{padding:.25em .45em;font-size:.92rem}.modal .actions{margin-top:.45rem}.modal .actions button{padding:.35em .75em;font-size:.9rem}}@media(orientation:landscape)and (max-height:540px){.modal{max-width:640px}.modal .row{display:flex;gap:.6rem}.modal .row>label{flex:1 1 0;min-width:0}.modal .row>label.checkbox{flex:0 1 auto;align-self:end}}@media(orientation:portrait)and (max-width:900px){.topbar,.main{display:none}.rotate-prompt{display:flex;position:fixed;inset:0;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:2rem;text-align:center;background:var(--bg);color:var(--text);font-size:1.1rem;z-index:200}.rotate-prompt .rotate-icon{font-size:3rem;color:var(--accent);animation:rotate-hint 2s ease-in-out infinite}}@keyframes rotate-hint{0%,to{transform:rotate(0)}50%{transform:rotate(90deg)}}
