:root{--sa-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));--sa-right: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));--sa-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));--sa-left: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));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;--board-left: 0px;--board-top: 0px;--board-width: 100vw;--board-height: 100dvh}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}button.primary.danger{background:var(--danger);border-color:var(--danger);color:#2a1416}button.primary.danger:hover:not(:disabled){background:#ff9a9a;border-color:#ff9a9a}button:focus-visible,select:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}input[type=checkbox]{accent-color:var(--accent);width:1.05rem;height:1.05rem;flex:0 0 auto}.modal select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239a958a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .7em center}.topbar{display:flex;align-items:center;justify-content:space-between;padding:calc(.5rem + var(--sa-top)) calc(1rem + var(--sa-right)) .5rem calc(1rem + var(--sa-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)}.topbar .score .dash{margin:0 .45em;opacity:.6}.topbar .score .pl{transition:color .2s}.topbar .score .pl.active{color:var(--accent);font-weight:600}.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:var(--sa-left);padding-bottom:var(--sa-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 + var(--sa-right));width:calc(56px + var(--sa-right));display:flex;flex-direction:column;gap:.4rem;padding:calc(.4rem + var(--sa-top)) calc(.3rem + var(--sa-right)) calc(.4rem + var(--sa-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}.sidebar .actions button .icon svg{width:1.45rem;height:1.45rem;display:block}.toast{position:fixed;left:50%;bottom:calc(1.2rem + var(--sa-bottom));transform:translate(-50%,8px);background:#14161ceb;border:1px solid #4a4f5a;color:var(--text);padding:.55em 1.1em;border-radius:999px;font-size:.95rem;opacity:0;pointer-events:none;transition:opacity .22s,transform .22s;z-index:90;max-width:min(80vw,480px);text-align:center}.toast.show{opacity:1;transform:translate(-50%)}.analyzing-pill{position:fixed;left:50%;top:calc(3.4rem + var(--sa-top));transform:translate(-50%);background:#14161ce0;border:1px solid #4a4f5a;color:var(--text-dim);padding:.3em .9em;border-radius:999px;font-size:.85rem;opacity:0;pointer-events:none;transition:opacity .2s;z-index:90}.analyzing-pill.show{opacity:1;animation:analyzing-pulse 1.4s ease-in-out infinite}@keyframes analyzing-pulse{0%,to{color:var(--text-dim)}50%{color:var(--text)}}.modal-backdrop.hint-modal-backdrop{background:transparent;align-items:center;justify-content:center;padding: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 thead th{font-size:.72rem;font-weight:600;color:var(--text-dim);text-align:right;padding:0 .5rem .25rem}.hint-table thead th.moves{text-align:left}.hint-table tbody tr{border-bottom:1px solid #2c2f38}.hint-table tbody 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.win{text-align:right;color:var(--text-dim);font-variant-numeric:tabular-nums;white-space:nowrap}.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)}.hint-table tr.hint-row.rank-gap td{border-top:1px dashed var(--text-dim)}.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-backdrop.board-anchored{inset:var(--board-top) auto auto var(--board-left);width:var(--board-width);height:var(--board-height)}.board-anchored .modal{max-height:100%}.modal h2{margin-top:0}.settings-footnote{margin:.9rem 0 0;font-size:.85rem;color:var(--text-dim)}.settings-footnote a{color:var(--hint)}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.5rem}.modal-head h2{margin:0}.peek-btn{flex:none;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:8px;background:transparent;border:1px solid #3a3f4a;color:var(--text-dim);cursor:pointer;touch-action:none}.peek-btn svg{width:1.1rem;height:1.1rem}.peek-btn:hover{color:var(--text)}.hint-modal-backdrop .modal,.tutor-modal-backdrop .modal{transition:opacity .12s ease}.modal-backdrop .modal.peeking{opacity:.05;backdrop-filter:none}.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 select{padding-right:2.1em}.modal .checkbox{flex-direction:row;align-items:center;gap:.5rem}.modal .actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.menu-warning{margin:-.25rem 0 .75rem;color:var(--danger);font-size:.88rem}.phase-overlay.celebrate{animation:overlay-fade .3s ease-out .45s backwards}.phase-overlay.celebrate .modal{animation:modal-pop .34s cubic-bezier(.18,.9,.32,1.2) .45s backwards}.phase-overlay.celebrate .modal h2{font-size:1.55rem;letter-spacing:.01em}.phase-overlay.celebrate .report,.phase-overlay.celebrate .actions{animation:overlay-fade .28s ease-out .7s backwards}@keyframes overlay-fade{0%{opacity:0}to{opacity:1}}@keyframes modal-pop{0%{opacity:0;transform:scale(.92) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}.modal-backdrop.tutor-modal-backdrop{background:transparent;pointer-events:none}.tutor-summary{margin:0 0 .6rem;color:var(--text-dim);font-size:.92rem;line-height:1.35}.tutor-modal-backdrop .modal{pointer-events:auto;max-width:480px;background:#232730c7;backdrop-filter:blur(8px)}.tutor-analysis-modal .tutor-head{margin:0}.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}.report-note{margin:.5rem 0 0;font-size:.78rem;line-height:1.35;opacity:.7}.confirm-modal p{margin:.4rem 0 1rem;opacity:.85}@media(orientation:landscape)and (max-height:540px){.topbar{display:none}.analyzing-pill{top:calc(.35rem + var(--sa-top))}.sidebar{flex:0 0 calc(64px + var(--sa-right));width:calc(64px + var(--sa-right));padding:max(1.2rem,calc(.4rem + var(--sa-top))) calc(.3rem + var(--sa-right)) max(1.2rem,calc(.4rem + var(--sa-bottom))) .3rem}}@media(orientation:landscape)and (max-height:420px){.sidebar{flex:0 0 calc(70px + var(--sa-right));width:calc(70px + var(--sa-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 select{padding-right:2em}.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}.rotate-prompt .rotate-title{font-size:1.5rem;font-weight:600;letter-spacing:.06em}}@keyframes rotate-hint{0%,to{transform:rotate(0)}50%{transform:rotate(90deg)}}@media(max-height:540px){.report{font-size:.85rem}.report td,.phase-overlay .modal h2{padding:.12rem .4rem;margin-bottom:.3rem}.report h3{margin:.3rem 0;font-size:.95rem}.phase-overlay.celebrate .modal h2{font-size:1.2rem}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}
