@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{color-scheme:dark;--bg:#101c21;--panel:#18272d;--ink:#f0eee5;--muted:#93a3a7;--line:#ffffff16;--amber:#efb968;--blue:#86c7e0;font-family:'DM Sans',sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}button,a,select{-webkit-tap-highlight-color:transparent}button,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none}button:disabled{cursor:default;opacity:.35}button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--amber);outline-offset:4px}button:hover:not(:disabled){filter:brightness(1.16)}a{color:inherit;text-decoration:none}header{max-width:1440px;margin:auto;padding:22px 36px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.brand{display:flex;gap:12px;align-items:center;font-size:14px;letter-spacing:3px;font-weight:700}.brand-mark{font-size:32px;color:var(--amber);line-height:1}.edition{font-size:11px;color:var(--muted);letter-spacing:1px;margin-left:8px}nav{display:flex;gap:28px;font-size:12px;color:#c0cccd}nav button{padding:0;font-size:12px}nav span{margin-left:10px}main{max-width:1440px;margin:auto;padding:26px 36px 0}.intro{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:24px}.eyebrow{font-size:10px;letter-spacing:2.4px;font-weight:700;color:var(--muted);margin:0 0 15px}h1{font-family:Manrope,sans-serif;font-size:clamp(36px,4vw,54px);line-height:1.05;letter-spacing:-3px;font-weight:500;margin:0}h1 em{font-family:Georgia,serif;font-weight:normal;color:var(--amber)}.intro-copy{color:var(--muted);font-size:13px;line-height:1.8;margin:0 0 4px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}.arena{position:sticky;top:24px;min-height:480px;overflow:hidden;border:1px solid #ffffff0b;border-radius:20px;background:radial-gradient(ellipse at 50% 45%,#2b4148 0,#1b2d33 47%,#15242a 100%)}#scene{position:absolute;inset:0;touch-action:none}#scene canvas{display:block;width:100%;height:100%}.arena-top,.arena-bottom{position:absolute;left:24px;right:24px;display:flex;justify-content:space-between;align-items:center;z-index:2;pointer-events:none}.arena-top{top:22px}.arena-bottom{bottom:22px;font-size:11px;color:#abb9ba}.arena-top button,.arena-bottom button{pointer-events:auto;font-size:11px;color:#bcc9c9}.pill{font-size:9px;letter-spacing:1.5px;display:flex;align-items:center;gap:8px}.pill i{width:5px;height:5px;border-radius:50%;background:var(--amber)}.small-button{border:1px solid var(--line);border-radius:20px;padding:8px 11px}.arena-bottom b{padding:0 9px;color:#627a81}#render-error{position:absolute;top:40%;padding:30px;text-align:center;color:var(--amber)}.panel{background:var(--panel);padding:18px;border:1px solid var(--line);border-radius:20px}.mode-control{display:flex;background:#0d1b20;border:1px solid var(--line);padding:4px;border-radius:9px;gap:3px}.mode-control button{flex:1;padding:9px 3px;font-size:11px;border-radius:6px;color:var(--muted)}.mode-control button.active{background:#324148;color:var(--ink);box-shadow:0 2px 4px #0003}.turn-block{padding:20px 0 16px}.turn-block .eyebrow{font-size:8px;margin-bottom:10px;letter-spacing:1.8px}h2{font-family:Manrope,sans-serif;letter-spacing:-1px;font-weight:500;font-size:26px;margin:0 0 10px}#status{display:flex;align-items:center;justify-content:space-between;font-size:25px}.turn-dot{width:10px;height:10px;border-radius:50%;background:currentColor;box-shadow:0 0 25px currentColor}.amber{color:var(--amber)}.blue{color:var(--blue)}#status-detail{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.players{display:flex;gap:10px;margin-bottom:18px}.player{flex:1;display:flex;align-items:center;gap:8px;padding:12px 9px;border:1px solid var(--line);border-radius:9px;font-size:11px}.player.active{border-color:#efb96870;background:#efb96808}#player-2.active{border-color:#86c7e080;background:#86c7e008}.symbol{font-size:18px}.player small{display:block;color:var(--muted);font-size:9px;margin-top:4px}.player-tag{margin-left:auto;color:#839398;font-size:8px}.face-explorer{border-top:1px solid var(--line);margin-top:20px;padding-top:18px}.face-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.face-header h3{font-size:9px;letter-spacing:1.7px;color:var(--muted);font-weight:500;margin:0}.face-header>span{font-size:10px;color:var(--muted)}.face-net{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:". back ." ". top ." "left front right" ". bottom .";gap:3px;max-width:300px;margin:auto}.net-face{background:#22363e;border:1px solid #ffffff1a;padding:4px;border-radius:5px;min-width:0}.net-back{grid-area:back}.net-top{grid-area:top}.net-left{grid-area:left}.net-front{grid-area:front}.net-right{grid-area:right}.net-bottom{grid-area:bottom}.net-title{display:block;width:100%;padding:5px 0 7px;font-size:9px;letter-spacing:1px;color:#b5c4c5}.face-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}.cell{aspect-ratio:1;padding:0;background:#2c424a;border:1px solid #ffffff0a;border-radius:3px;position:relative;font-size:16px;min-width:0}.cell:disabled{opacity:1}.cell[data-player="1"]{background:#efb96819;color:var(--amber);border-color:#efb96860}.cell[data-player="2"]{background:#86c7e019;color:var(--blue);border-color:#86c7e060}.cell:not(:disabled):hover{background:#3b515a}.cell.winning{box-shadow:inset 0 0 0 2px currentColor}.cell.linked{outline:1px solid #c9d6cf88;outline-offset:-1px}.cell .coord{position:absolute;left:2px;top:2px;font-size:6px;opacity:.4;line-height:1}.cell-mark{display:block;padding-top:5px}.face-note{font-size:10px;color:var(--muted);line-height:1.7;margin:14px 0 0}.actions{display:flex;gap:8px}.actions button{border:1px solid #ffffff21;border-radius:7px;padding:11px 13px;font-size:11px}.actions button:last-child{flex:1;background:var(--ink);color:#18272d;display:flex;justify-content:space-between}details{border-top:1px solid var(--line);margin-top:21px;padding-top:15px;font-size:11px}summary{cursor:pointer;color:#c7d1cf}summary span{float:right;color:var(--muted);font-size:9px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.history-scroll{max-height:140px;overflow:auto;margin-top:12px;border-radius:6px;background:#101c2150;scrollbar-width:thin}#history-table{width:100%;border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums}#history-table th,#history-table td{padding:7px 12px;text-align:left}#history-table th:first-child{width:34px;color:var(--muted);text-align:center;padding:7px 4px;background:#ffffff09;border-right:1px solid var(--line)}#history th{font-size:12px;font-weight:400}#history td{font-size:15px;font-weight:500;letter-spacing:.2px}#history tr:nth-child(even){background:#ffffff04}#history .latest-move.amber{background:var(--amber);color:var(--bg);font-weight:700}#history .latest-move.blue{background:var(--blue);color:var(--bg);font-weight:700}#history-empty{color:var(--muted);font-size:11px}footer{padding:25px 0;display:flex;justify-content:space-between;align-items:center;color:var(--muted);gap:20px}footer>span{font-size:8px;letter-spacing:1.4px}footer p{font-size:11px;margin:0}footer em{color:var(--ink)}dialog{background:#1b2c32;color:var(--ink);border:1px solid #ffffff25;border-radius:18px;padding:36px;max-width:540px;width:calc(100% - 32px);box-shadow:0 30px 120px #0008}dialog::backdrop{background:#061116bb;backdrop-filter:blur(7px)}dialog h2{font-size:34px}dialog p{color:#b8c6c7;font-size:13px;line-height:1.7}.close{position:absolute;right:20px;top:12px;font-size:30px;color:var(--muted)}.rule-cards b{display:block;color:var(--amber);font-size:12px}.rule-cards p{padding-bottom:12px;border-bottom:1px solid var(--line)}.primary{background:var(--amber);color:#172328;padding:13px 20px;border-radius:7px;font-size:12px;font-weight:700}.muted{font-size:11px!important}.dialog-actions{display:flex;justify-content:flex-end;gap:20px;margin-top:25px}.dialog-actions button{font-size:12px}@media(min-width:1500px){.arena{min-height:540px}}@media(max-width:900px){header{padding:22px 24px}main{padding:28px 24px 0}.game-layout{grid-template-columns:minmax(0,1fr) 330px;gap:14px}.panel{padding:16px}.arena{min-height:480px}.intro-copy{font-size:11px}footer>span:last-child{display:none}.arena-top,.arena-bottom{left:15px;right:15px}.pill{font-size:8px}}@media(max-width:680px){header{padding:18px 20px}.brand{font-size:11px;gap:8px;letter-spacing:2px}nav{gap:16px}main{padding:26px 16px 0}.intro{margin-bottom:22px}.intro h1{font-size:43px;letter-spacing:-2px}.intro-copy{display:none}.game-layout{grid-template-columns:1fr}.arena{position:relative;top:auto;min-height:350px}.panel{padding:20px}.face-net{max-width:300px}.cell{font-size:clamp(12px,3.4vw,16px)}.turn-block{padding:20px 0}.players{margin-bottom:22px}footer{justify-content:center;flex-wrap:wrap;text-align:center;padding:22px 0;gap:10px}footer p{width:100%}.eyebrow{font-size:9px}.arena-bottom{font-size:10px}}

.arena-bottom>span{max-width:75%;line-height:1.6;font-size:10px}

.online-panel{margin-top:15px;padding:12px;border:1px solid var(--line);border-radius:9px;background:#101c2140;font-size:11px}.online-panel[hidden]{display:none}.online-panel p{line-height:1.6;color:var(--muted)}.online-panel label{display:block;margin:12px 0 5px;color:var(--muted)}.online-row{display:flex;gap:5px;margin-bottom:10px}.online-row input{min-width:0;flex:1;background:#101c21;border:1px solid var(--line);border-radius:5px;color:var(--ink);padding:8px;font:inherit}.online-row button{background:var(--amber);color:var(--bg);border-radius:5px;padding:7px 10px}#online-status{margin-top:0}

/* Keep the board clear of its controls and give celebrations room. */
.intro{margin-bottom:18px;align-items:center}.intro .eyebrow{margin:0}.intro-copy{margin:0}.arena{min-height:560px}#scene{top:52px;bottom:76px}.win-confetti{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}.win-confetti i{position:absolute;left:var(--x);top:-16px;width:8px;height:14px;border-radius:2px;box-shadow:0 0 10px #fff4;animation:confetti-fall 3.8s var(--delay) both ease-out}.win-confetti i.star{width:14px;height:14px;clip-path:polygon(50% 0,62% 36%,100% 50%,62% 62%,50% 100%,36% 62%,0 50%,36% 36%)}@keyframes confetti-fall{0%{opacity:0;transform:translate(0,-16px) rotate(0)}8%,72%{opacity:1}100%{opacity:0;transform:translate(var(--drift),620px) rotate(var(--spin))}}@media(min-width:1500px){.arena{min-height:620px}}@media(max-width:680px){.arena{min-height:480px}#scene{top:56px;bottom:82px}.intro{margin-bottom:16px}.arena-bottom>span{max-width:72%;font-size:9px}}@media(prefers-reduced-motion:reduce){.win-confetti{display:none}}

body.full-width header,body.full-width main{max-width:none}body.full-width .game-layout{grid-template-columns:1fr}body.full-width main{padding-left:16px;padding-right:16px}body.full-width .arena{position:relative;top:auto}body.full-width .panel{width:100%;max-width:720px;justify-self:center}.board-status{position:absolute;top:66px;left:24px;z-index:2;margin:0;padding:8px 12px;border:1px solid currentColor;border-radius:8px;background:#101c21df;font-size:12px;font-weight:700;pointer-events:none}.board-status[hidden]{display:none}.player strong{font-weight:600}.online-panel details{margin-top:10px;padding-top:10px}.online-panel summary{color:var(--ink)}#online-status{color:var(--ink);font-weight:500}#room-setup[hidden]{display:none}@media(min-width:681px){body.full-width .arena{height:clamp(560px,calc(100vw - 32px),1100px)}}@media(max-width:680px){body.full-width .game-layout{grid-template-columns:1fr}header{flex-wrap:wrap;gap:14px}nav{gap:16px}#width-toggle{font-size:11px}.board-status{left:15px;top:66px;font-size:11px}}

#room-color{display:block;width:100%;margin:0 0 12px;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:10px;font-size:12px}

#room-code{font-size:18px;letter-spacing:3px;font-weight:700;text-align:center}#resume-room{margin-bottom:8px}#code-controls[hidden]{display:none}

.arena-tools{display:flex;align-items:center;gap:12px;pointer-events:auto}.notation-control{display:flex;align-items:center;gap:7px;font-size:10px;color:#bcc9c9}.notation-control input{width:80px;accent-color:var(--amber);cursor:pointer}.notation-control output{width:30px;font-variant-numeric:tabular-nums;font-size:9px}@media(max-width:900px){.notation-control{gap:4px}.notation-control input{width:55px}.arena-tools{gap:7px}.notation-control>span{font-size:9px}}@media(max-width:680px){.arena-top{flex-wrap:wrap;gap:12px}.arena-tools{width:100%;justify-content:space-between}.notation-control input{width:100px}#scene{top:96px}.board-status{top:102px}.arena-tools #view-reset{font-size:10px}}

/* Fit the board to the available viewport height, including the page heading. */
@media(min-width:681px){.arena,body.full-width .arena{height:max(380px,calc(100dvh - var(--arena-offset,180px) - 24px));min-height:380px}}

#ai-setup{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;font-size:11px;color:var(--muted)}#ai-setup[hidden]{display:none}#ai-color{max-width:70%;padding:8px;border:1px solid var(--line);border-radius:7px;background:#101c21;color:var(--ink)}

/* Six muted variations of the cube palette, echoed in its unfolded net. */

.cell.last-move{outline:2px solid currentColor;outline-offset:-2px}.cell.last-move::after{content:'';position:absolute;right:3px;bottom:3px;width:4px;height:4px;border-radius:50%;background:currentColor;box-shadow:0 0 6px currentColor}
.net-face .cell[data-player="0"]{background:#ffffff08}

.time-control{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;font-size:11px;color:var(--muted)}.time-control select{padding:8px;border:1px solid var(--line);border-radius:7px;background:#101c21}.clock{margin-left:auto;font-size:18px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}.clock.running{color:var(--ink)}.clock.low.running{color:var(--amber)}.clock:not([hidden])+.player-tag{display:none}

.replay-controls{display:flex;align-items:center;gap:10px;margin:12px 0;font-size:11px;color:var(--muted)}.replay-controls button{border:1px solid var(--line);border-radius:6px;padding:7px 10px;color:var(--ink)}.replay-controls output{margin-left:auto;font-variant-numeric:tabular-nums}#history td button{display:block;width:100%;text-align:left;font:inherit;color:inherit;padding:0}#history td button:focus-visible{outline-offset:1px}

#sound{display:flex;align-items:center;gap:4px;min-width:44px;min-height:32px}#sound svg{width:32px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#sound span{font-size:10px;font-variant-numeric:tabular-nums}.volume-pop svg{animation:volume-pop .28s ease-out}@keyframes volume-pop{40%{transform:scale(1.2) rotate(-8deg)}100%{transform:scale(1) rotate(0)}}@media(prefers-reduced-motion:reduce){.volume-pop svg{animation:none}}

.board-review{position:absolute;top:66px;left:24px;right:24px;z-index:4;display:flex;flex-wrap:wrap;gap:10px;align-items:center;pointer-events:none}.board-review .board-status{position:static;max-width:100%}.return-live{pointer-events:auto;background:#101c2133;color:var(--muted);border:1px solid var(--line);border-radius:8px;padding:8px 11px;font-size:11px;font-weight:500;text-align:left}.return-live:hover{background:#ffffff06;color:var(--ink);border-color:#ffffff40}.return-live>span[aria-hidden]{margin-right:6px;font-size:14px}.return-live[hidden],.online-session[hidden]{display:none}.online-session{margin-top:16px;display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:11px}.online-session p{margin:0;color:var(--muted)}.online-session #switch-room{margin-left:auto;color:var(--ink)}@media(max-width:680px){.board-review{left:15px;right:15px;top:102px;gap:7px}.return-live{padding:8px 10px;font-size:11px}}

#free-rotation[aria-pressed="true"]{background:#a7b19c;color:#101c21;border-color:#a7b19c}.arena-tools{flex-wrap:wrap;justify-content:flex-end}

.replay-controls{flex-wrap:wrap}#ai-opponent-setup[hidden]{display:none}#notation-text{width:100%;resize:vertical;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:14px;color:var(--ink);font:13px/1.6 monospace}#notation-dialog [hidden]{display:none}

.draw-notice{margin:0;background:#e5e6de;color:#18272d;border:1px solid #fff8;border-radius:10px;padding:12px 16px;box-shadow:0 3px 18px #0005;max-width:100%;font-size:13px}.draw-notice strong,.draw-notice span{display:block}.draw-notice span{margin-top:4px;font-size:11px}.draw-notice[hidden]{display:none}

.opening-panel{padding:16px;border:1px solid #9baba4;border-radius:12px;background:#20312c;margin:12px 0}.opening-panel p{font-size:.85rem;color:var(--muted);line-height:1.5}.opening-choices{display:flex;flex-wrap:wrap;gap:8px}.opening-choices button{padding:10px;border:1px solid #9baba4;border-radius:8px;background:#34453e;color:#fff}

/* Keep a usable cube canvas after reserving room for touch controls. */
@media(max-width:680px){.arena,body.full-width .arena{min-height:620px;height:max(620px,82svh)}#scene{top:106px;bottom:88px}.arena-bottom{bottom:20px}.board-review{top:108px}}
@media(max-width:680px) and (max-height:520px){.arena,body.full-width .arena{min-height:560px;height:560px}}

/* An optional skin, with the same board rules and color ownership. */
#wizard-theme{border:1px solid var(--line);border-radius:20px;padding:6px 10px;white-space:nowrap}
#wizard-theme[aria-pressed="true"]{color:#d8e2d0;border-color:#849b77;background:#354137}
body.wizard-theme{--bg:#191820;--panel:#24212c;--muted:#a8a2b2;--line:#d6c5e21f}
.wizard-theme .arena{background:radial-gradient(ellipse at 50% 45%,#424345 0,#2b2935 47%,#1e1c27 100%);border-color:#c8b6d328}
.wizard-theme .brand-mark{color:#b3c9a3}.wizard-theme .symbol img{display:block;width:32px;height:32px;object-fit:contain}.wizard-theme .cell-mark{position:absolute;inset:5px 0 0;padding:0;display:grid;place-items:center}.wizard-theme .cell-mark img{width:85%;height:85%;object-fit:contain}
.spell-review{position:absolute;left:24px;bottom:66px;z-index:5;padding:10px 14px;border:1px solid #b9f5ba;border-radius:10px;background:#243629ed;color:#e0f6db;font:600 12px 'DM Sans',sans-serif;box-shadow:0 0 18px #88d99226;text-align:left}.spell-review small{display:block;font-size:10px;color:#bed2b5;font-weight:400;margin-top:3px}.spell-review[hidden]{display:none}
.spell-cast::after{content:'';position:absolute;inset:0;border-radius:inherit;z-index:3;pointer-events:none;animation:spell-light 3.3s ease-out forwards}
@keyframes spell-light{0%,14%{box-shadow:inset 0 0 20px #8aff8c00}22%{box-shadow:inset 0 0 70px #8aff8c48}65%{box-shadow:inset 0 0 28px #8aff8c16}78%{box-shadow:inset 0 0 95px #8aff8c70}100%{box-shadow:inset 0 0 0 #8aff8c00}}
@media(prefers-reduced-motion:reduce){.spell-cast::after{animation:none;box-shadow:inset 0 0 14px #8aff8c26}}
@media(max-width:680px){.spell-review{left:15px;bottom:90px;padding:8px 11px}#wizard-theme{font-size:10px;padding:5px 8px}}

.spell-name{margin:0;padding:9px 13px;border:1px solid #9fd5a0;border-radius:9px;background:#243629ed;color:#d8f5d4;font-size:12px;font-weight:600;box-shadow:0 0 16px #77c27924}.spell-name[hidden]{display:none}

/* Keep instructions outside the board; settings belong with game controls. */
.arena-column{min-width:0;position:sticky;top:24px}body.full-width .arena-column{position:relative;top:auto}.arena-column .arena{position:relative;top:auto}
.arena-hint{margin:10px 6px 0;color:var(--muted);font-size:11px;line-height:1.65}.arena-hint b{margin:0 7px;color:#627a81}
.arena-bottom{justify-content:flex-end}.notation-settings{margin-top:14px;border-bottom:1px solid var(--line);padding-bottom:14px}.notation-settings .notation-control{font-size:11px;justify-content:space-between;width:100%;gap:10px}.notation-settings .notation-control input{flex:1;min-width:60px;width:auto;max-width:160px}.notation-settings .notation-control output{width:34px;text-align:right;font-size:10px}
.arena-clocks{position:absolute;bottom:15px;left:24px;z-index:3;display:flex;flex-wrap:wrap;gap:6px;max-width:calc(100% - 96px);pointer-events:none}.arena-clocks[hidden]{display:none}.arena-clock-side{min-width:86px;padding:7px 11px;border:1px solid #ffffff29;border-radius:9px;background:#101c21df;display:flex;flex-direction:column;gap:2px}.arena-clock-side>span{font-size:9px;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c8d1cd}.arena-clock-side strong{font-size:21px;line-height:1.1;letter-spacing:.3px;font-variant-numeric:tabular-nums;font-weight:600}.arena-clock-side.active{border-color:currentColor;box-shadow:0 0 0 1px currentColor}.arena-clock-side:not(.active) strong{opacity:.65}.arena-clocks small{align-self:center;color:#c8d1cd;font-size:9px;padding:0 6px}.arena-clocks strong.low{color:#f08b83}
@media(min-width:681px){.arena-column .arena,body.full-width .arena-column .arena{height:max(380px,calc(100dvh - var(--arena-offset,180px) - 66px))}.arena-column #scene{top:62px;bottom:78px}}
@media(max-width:680px){.arena-column{position:relative;top:auto}.arena-column #scene{top:94px;bottom:85px}.arena-clocks{left:15px;max-width:calc(100% - 82px);bottom:15px}.arena-clock-side{min-width:76px;max-width:118px;padding:7px 9px}.arena-clock-side strong{font-size:20px}.arena-clock-side>span{max-width:98px;font-size:8px}.arena-clocks small{width:100%;padding:0;margin-top:-2px}.arena-hint{font-size:10px}.notation-settings .notation-control>span{font-size:11px}}

/* A beginner can follow the rules from a familiar flat board to the cube. */
.rules-basics p{margin:18px 0;line-height:1.65}.rules-basics p>b{display:block;color:var(--ink);margin-bottom:4px}.rules-cube{margin:18px 0;padding:12px;background:#101c21;border:1px solid var(--line);border-radius:12px}.rules-cube img{display:block;width:min(100%,300px);height:auto;margin:auto}.rules-cube figcaption{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 18px;font-size:12px;color:var(--ink);line-height:1.6}.rules-cube figcaption span{display:flex;align-items:center;gap:7px}.rules-key{display:inline-block;width:10px;height:10px;border-radius:2px}.rules-key.corner{background:var(--amber)}.rules-key.edge{background:var(--blue)}.rules-try{color:var(--ink)}.rules-extra{margin:18px 0 24px}.rules-extra p{font-size:13px;line-height:1.65}

.rules-grow{margin:14px 0 22px;padding:12px;background:#101c21;border:1px solid var(--line);border-radius:12px}.rules-grow img{display:block;width:100%;height:auto}.rules-grow figcaption{text-align:center;color:var(--muted);font-size:12px;line-height:1.6}

.rules-lines{margin:16px 0;padding:12px;background:#101c21;border:1px solid var(--line);border-radius:12px}.rules-lines img{display:block;width:100%;height:auto}.rules-cube img{width:min(100%,400px)}

@media(max-width:600px){#rules{padding:24px 20px}.rules-grow img{max-width:280px;margin:auto}.rules-grow{padding:16px 12px}#rules h2{font-size:26px}}

/* Keep notation dense without shrinking its type. */
#history-table th:first-child{width:26px;padding:3px 4px}#history-table th,#history-table td{padding:3px 8px;line-height:1.25}#history th{font-size:11px}#history td{font-size:14px}#history td button{line-height:1.25}.history-scroll{scrollbar-gutter:stable}

#history-table col.history-number{width:26px}#history-table th,#history-table td{padding-top:2px;padding-bottom:2px}

.online-top{margin:16px 0 20px;padding:16px;border-color:#efb96855}.online-top h3{margin:0 0 12px;font-size:17px}.online-heading{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px}.online-heading strong{font-size:12px}.online-top [hidden]{display:none!important}.online-flow-options{display:flex;gap:8px;margin:14px 0}.online-flow-options button{flex:1;border-radius:8px;min-height:42px}.online-flow-options button[aria-pressed="true"]{background:var(--amber);color:var(--bg)}.online-top select{width:100%;padding:9px;border:1px solid var(--line);border-radius:6px;background:var(--bg)}.online-top .primary{width:100%;margin-top:14px;padding:12px;border-radius:7px;background:var(--amber);color:var(--bg)}.online-top #invite-controls{border-top:1px solid var(--line);margin-top:12px;padding-top:4px}.online-top #room-code{text-align:center;font-size:20px;letter-spacing:2px;font-weight:700}.online-top #copy-invite{white-space:nowrap;font-size:11px}.online-top #online-match-settings{font-size:11px}.online-top #connection-state[data-state="connected"]{color:#a8d6ac}.online-top #connection-state[data-state="disconnected"]{color:var(--amber)}

.online-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;list-style:none;font-size:14px;font-weight:700}.online-summary::-webkit-details-marker{display:none}.online-summary::before{content:"▸";color:var(--muted)}.online-top[open]>.online-summary::before{content:"▾"}.online-summary #online-panel-title{flex:1}.online-summary #connection-state{font-size:11px;white-space:nowrap}.online-room-body{margin-top:12px}.online-top:not([open]){padding:11px 12px;margin-bottom:12px}.replay-controls .notation-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;padding:6px;border-radius:6px}.notation-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.replay-controls{display:grid;grid-template-columns:minmax(0,1fr) repeat(4,30px);gap:6px}.replay-controls button{min-width:0;height:30px;padding:5px 4px;white-space:nowrap}.replay-controls output{grid-column:1/-1;margin-left:0;text-align:right}.replay-controls output:empty{display:none}

#animate-last-move[aria-pressed="true"],.cube-follow-toggle[aria-pressed="true"]{border-color:var(--amber);background:#efb96818;color:var(--amber)}.player.your-color{border:2px solid var(--amber);background:#efb96818;box-shadow:0 0 0 2px #efb96815}#player-2.your-color{border-color:var(--blue);background:#86c7e018;box-shadow:0 0 0 2px #86c7e015}.arena-clock-side.your-color{border:2px solid currentColor;background:#efb96820;box-shadow:0 0 0 2px #efb96818}.arena-clock-side.blue.your-color{background:#86c7e020;box-shadow:0 0 0 2px #86c7e018}.arena-clock-side.your-color strong{opacity:1}.arena-tools{flex-wrap:wrap;justify-content:flex-end}@media(max-width:680px){.arena-top .pill{display:none}.arena-top{justify-content:flex-end}.arena-tools .small-button{padding:6px 8px;font-size:10px}}

/* Board appearance stays local and does not change the existing game controls. */
.board-style-control{pointer-events:auto;margin-right:auto;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted)}
.board-style-control select{max-width:160px;background:#15262d;border:1px solid var(--line);border-radius:7px;padding:7px 8px;font-size:11px}
@media(max-width:420px){.board-style-control{gap:5px;font-size:9px}.board-style-control select{max-width:125px;font-size:10px}}

/* Persistent people-first header; optional clocks never control its visibility. */
.player-header{position:absolute;top:16px;left:16px;right:16px;z-index:3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:clamp(12px,8vw,160px);row-gap:5px;pointer-events:none}
.player-header-card{--player-color:#9badb2;min-width:0;display:flex;align-items:center;gap:12px;padding:12px 15px;border:1px solid #ffffff18;border-radius:9px;background:#101c2170;color:var(--player-color)}
.player-header-card.amber{--player-color:var(--amber)}.player-header-card.blue{--player-color:var(--blue)}
.player-header-card.active{border-color:var(--player-color);background:linear-gradient(110deg,#ffffff08,#ffffff02);box-shadow:inset 0 0 22px #ffffff04,0 0 12px #0002}
.header-orb{flex:none;width:26px;height:26px;border-radius:50%;background:radial-gradient(circle at 32% 25%,var(--orb-light),var(--orb-base) 55%,var(--orb-shadow));box-shadow:inset -2px -3px 5px #0002,0 2px 5px #0004}
.header-player-copy{min-width:0;display:flex;flex-direction:column;gap:3px;color:var(--ink)}.header-player-copy>span{font-size:12px}.header-player-copy>small{font-size:10px;line-height:1.3;color:#aebdc0}
.player-header-card.active .header-player-copy>small{color:var(--ink)}
.player-header-card>strong{margin-left:auto;font-size:24px;line-height:1;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:.3px}.player-header-card:not(.active)>strong{color:#aebdc0}.player-header-card>strong.low{color:#f08b83}
.player-header>#arena-clock-note{grid-column:1/-1;text-align:center;font-size:9px;color:var(--muted)}.player-header [hidden]{display:none}
.arena-column .arena-top{top:105px}.arena-column #scene{top:151px}.arena-column .board-review{top:153px}
@media(max-width:680px){.player-header{left:15px;right:15px;column-gap:10px}.player-header-card{padding:10px 9px;gap:7px;min-height:61px}.header-orb{width:20px;height:20px}.header-player-copy>span{font-size:11px}.header-player-copy>small{font-size:9px}.player-header-card>strong{font-size:19px}.arena-column .arena-top{top:106px}.arena-column #scene{top:170px}.arena-column .board-review{top:170px}}
@media(max-width:380px){.player-header-card{gap:5px;padding:9px 7px}.header-orb{width:16px;height:16px}.player-header-card>strong{font-size:16px}}
@media(max-width:380px){.player-header-card{display:grid;grid-template-columns:16px minmax(0,1fr);gap:3px 6px}.player-header-card>strong{grid-column:2;margin-left:0}}
@media(min-width:681px) and (max-width:900px){.player-header{column-gap:8px;left:12px;right:12px}.player-header-card{display:grid;grid-template-columns:20px minmax(0,1fr);padding:8px;gap:4px 6px}.header-orb{width:20px;height:20px}.player-header-card>strong{grid-column:2;margin-left:0;font-size:18px}.header-player-copy>span{font-size:11px}.header-player-copy>small{font-size:9px}.arena-column .arena-top{top:124px}.arena-column #scene,.arena-column .board-review{top:190px}}
@media(max-width:380px){.arena-column .arena-top{top:124px}.arena-column #scene,.arena-column .board-review{top:190px}}

/* One navigation control for the four visual themes. */
.theme-control{display:flex;align-items:center;gap:7px;white-space:nowrap;color:var(--muted)}
.theme-control>span{margin:0;font-size:11px}
.theme-control select{max-width:175px;background:#15262d;color:var(--ink);border:1px solid var(--line);border-radius:18px;padding:7px 10px;font-size:11px;cursor:pointer}
.wizard-theme .theme-control select{background:#2b2935;border-color:#849b77}
header nav{align-items:center;flex-wrap:wrap;justify-content:flex-end}
@media(max-width:900px){header{flex-wrap:wrap;gap:14px}header nav{gap:14px}.theme-control select{max-width:160px}}
@media(max-width:680px){header nav{justify-content:flex-start;width:100%;gap:12px}.theme-control select{font-size:10px;padding:6px 8px}}

/* A small board in the trigger, and a gallery of the actual surface styles. */
.theme-picker{position:relative;z-index:10}.theme-picker [hidden]{display:none!important}
#theme-toggle{display:flex;align-items:center;gap:8px;text-align:left;padding:4px 10px 4px 6px;border:1px solid #829ba24a;border-radius:10px;background:linear-gradient(125deg,#24373d,#15262d);box-shadow:0 3px 12px #0002;min-width:0}
#theme-toggle>span:nth-child(2){display:inline-flex;align-items:center;gap:8px;white-space:nowrap}#theme-toggle small{font-size:8px;letter-spacing:1.4px;color:var(--muted)}#theme-toggle strong{font-size:11px;font-weight:500}#theme-preview{width:28px;height:28px;display:block;flex-shrink:0}#theme-preview svg{width:100%;height:100%}.theme-chevron{margin-left:auto;color:var(--amber);font-size:19px;transition:transform .2s}#theme-toggle[aria-expanded="true"] .theme-chevron{transform:rotate(180deg)}
#theme-options{position:absolute;top:calc(100% + 12px);right:0;width:440px;max-width:calc(100vw - 32px);padding:18px;border:1px solid #829ba255;border-radius:20px;background:#15252bf5;box-shadow:0 24px 70px #0008;backdrop-filter:blur(18px)}
.theme-menu-heading{display:grid;gap:6px;margin:0 2px 16px}.theme-menu-heading>span{font-size:16px;color:var(--ink)}.theme-menu-heading small{font-size:11px;color:var(--muted)}#theme-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.theme-card{position:relative;text-align:left;border:1px solid #829ba233;border-radius:13px;overflow:hidden;background:#101e24;transition:border-color .15s,background .15s;min-width:0}.theme-card:hover{background:#22363e;border-color:#a3bec3}.theme-card[aria-checked="true"]{border-color:var(--amber);background:#efb9680d}.theme-card-art{display:block;background:radial-gradient(ellipse at 50% 80%,#3e596655,transparent 70%);height:132px}.theme-card-art svg{width:100%;height:100%}.theme-card-copy{display:grid;gap:6px;padding:0 12px 16px}.theme-card-copy strong{font-size:12px;font-weight:500}.theme-card-copy small{font-size:10px;line-height:1.5;color:var(--muted)}.theme-check{display:none;position:absolute;top:9px;right:9px;width:20px;height:20px;align-items:center;justify-content:center;background:var(--amber);color:var(--bg);border-radius:50%;font-size:12px}.theme-card[aria-checked="true"] .theme-check{display:flex}.theme-picker button:focus-visible{outline:2px solid var(--blue);outline-offset:3px}footer>a{font-size:11px;color:var(--muted);border-bottom:1px solid #ffffff25;padding:6px 0}footer>a:hover{color:var(--ink)}
@media(max-width:680px){#theme-options{left:0;right:auto;width:350px;padding:14px}.theme-card-art{height:113px}#theme-toggle{min-width:192px}.theme-picker{flex-shrink:0}}
@media(prefers-reduced-motion:reduce){.theme-picker *{transition:none}}

.theme-card-art svg{filter:drop-shadow(0 7px 8px #0004);transition:transform .2s}.theme-card:hover .theme-card-art svg{transform:translateY(-3px)}.theme-card[data-theme="potter"] .theme-card-art{background:radial-gradient(ellipse at 50% 75%,#38835844,transparent 65%),#0a1411}.theme-card[data-theme="potter"] .theme-card-copy strong{color:#c3e6c9}
@media(max-width:680px){.play-page #theme-toggle{min-width:0;width:42px;height:40px;padding:0;justify-content:center;border-radius:10px}.play-page #theme-preview{width:38px;height:38px}.play-page #theme-toggle>span:nth-child(2),.play-page .theme-chevron{display:none}.theme-card:hover .theme-card-art svg{transform:none}}
@media(prefers-reduced-motion:reduce){.theme-card-art svg{transition:none}}
@media(max-width:680px){.play-page main{padding-top:12px}.play-page #theme-options{position:fixed;top:72px;left:16px;right:16px;width:auto;max-width:none}.play-page .arena,.play-page.full-width .arena{height:max(420px,calc(100svh - 130px));min-height:420px;border-radius:15px}.play-page .player-header{top:12px;left:12px;right:12px;gap:8px}.play-page .player-header-card{display:flex;min-height:46px;padding:7px 9px;gap:7px}.play-page .header-orb{width:17px;height:17px;flex-shrink:0}.play-page .header-player-copy>span{font-size:10px}.play-page .header-player-copy>small{font-size:9px}.play-page .player-header-card>strong{font-size:17px;margin-left:auto}.play-page .arena-column .arena-top{top:68px;left:12px;right:12px;gap:0}.play-page .arena-tools{flex-wrap:nowrap;gap:6px;justify-content:space-between;width:100%}.play-page .arena-tools .small-button{padding:7px 8px;font-size:9px;white-space:nowrap;min-height:32px}.play-page .arena-column #scene,.play-page .arena-column .board-review{top:108px}.play-page .arena-column #scene{bottom:48px}.play-page .arena-bottom{bottom:12px}.play-page .arena-hint{font-size:9px;line-height:1.5;margin:8px 0 16px}}

.theme-card-art img{display:block;width:100%;height:100%;object-fit:contain}#theme-preview img{display:block;width:100%;height:100%;object-fit:contain}

/* Header-wide span spacing must not shift the gallery artwork or captions. */
.theme-picker span{margin-left:0}.theme-card{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:0}.theme-card-art{flex:none;width:100%;margin:0;display:grid;place-items:center}.theme-card-art>img,.theme-card-art>svg{display:block;margin:0;object-position:center}.theme-card-copy{flex:1;align-content:start;min-width:0}.theme-card-copy strong{line-height:1.4;min-height:2.8em}.theme-card-copy small{line-height:1.5;min-height:3em}
.theme-card-art{display:flex;align-items:center;justify-content:center;overflow:hidden}.theme-card-art>img,.theme-card-art>svg{flex:none;min-height:0;max-width:100%;max-height:100%}.theme-card-copy{padding-top:10px}

/* Draft settings apply only to the next round, beside the mode controls. */
.round-clock-controls{margin:20px 0 16px}
.round-clock-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.timer-switch{display:flex;align-items:center;gap:8px;font-size:12px;min-height:38px}
.timer-switch input{appearance:none;width:30px;height:18px;border-radius:12px;border:1px solid #62767b;background:#30454b;margin:0;position:relative;flex-shrink:0;cursor:pointer}
.timer-switch input::after{content:'';position:absolute;top:3px;left:3px;width:10px;height:10px;border-radius:50%;background:#bdc8ca}
.timer-switch input:checked{background:#efb968;border-color:#efb968}
.timer-switch input:checked::after{left:15px;background:#18272d}
.round-clock-row select{width:190px;max-width:65%;height:38px;background:#0d1b20;border:1px solid #ffffff16;border-radius:8px;padding:0 8px;font-size:11px}
.round-clock-row :disabled{opacity:.45;cursor:default}
#next-round-summary{margin:7px 0 0;color:#a8b8bd;font-size:11px;line-height:1.5}
#cancel-rematch{margin-top:8px;color:#efb968}
@media(pointer:coarse){.timer-switch{min-height:44px}.round-clock-row select{min-height:44px}}
#replay-view-lock{grid-column:1/4;justify-self:start;display:flex;align-items:center;gap:6px;padding:5px 8px}
#replay-view-lock svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#replay-view-lock[aria-pressed="true"]{color:var(--amber);background:#efb9680a;border-color:#efb96850}
#replay-view-lock[aria-pressed="true"] .open-shackle,#replay-view-lock[aria-pressed="false"] .locked-shackle{display:none}
.replay-controls #replay-position{grid-column:4/-1;align-self:center}
#undo-notice:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0;font-size:11px;color:var(--muted)}
#undo-notice .small-button{flex-shrink:0}
.turn-block[hidden],.players[hidden]{display:none}

/* Optional review tools use the existing board typography. */
#face-explorer>summary{margin-bottom:0}
#face-explorer[open]>summary{margin-bottom:16px}
#face-explorer .notation-settings{border-bottom:0;margin-bottom:0;padding-bottom:0}
#undo{white-space:normal;line-height:1.15;font-size:10px}
.game-insights{margin-top:16px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.game-insights[hidden]{display:none}
.game-insights>summary{color:var(--amber)}
#insights-player{margin-top:12px;width:100%;padding:8px;border:1px solid var(--line);border-radius:7px;background:var(--bg);font-size:12px}
#insights-status{font-size:12px;color:var(--muted);line-height:1.5}
.insight-card{border:1px solid var(--line);border-radius:9px;padding:12px;margin-top:10px}
.insight-card h4{font-size:12px;line-height:1.5;margin:0}
.insight-card p,#insights-list>p{font-size:11px;line-height:1.65;color:var(--muted);margin:7px 0}
.insight-card[data-kind="strength"] h4{color:var(--blue)}
.insight-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.insight-scope{font-size:10px!important}

/* Post-game coaching stays in the main board column and its current theme. */
#game-insights>summary{font-size:13px;font-weight:500;min-height:28px}
.postgame-tips{position:absolute;right:24px;bottom:20px;z-index:4;display:grid;gap:4px;text-align:left;padding:11px 15px;border:1px solid #efb96870;border-radius:9px;background:#101c21ed;color:var(--amber)}
.postgame-tips[hidden]{display:none}
.postgame-tips strong{font-size:12px;font-weight:500}
.postgame-tips span{font-size:10px;color:var(--muted)}
@media(max-width:680px){.postgame-tips{right:12px;bottom:12px;padding:9px 12px}}
#insight-story[hidden],#insights-list[hidden]{display:none}
#insight-title{font-family:Manrope,sans-serif;font-size:17px;font-weight:500;letter-spacing:-.5px;margin:18px 0 14px}
.insight-steps{display:flex;gap:6px}
.insight-steps button{flex:1;min-width:0;border-top:2px solid var(--line);padding:9px 2px;text-align:left;font-size:10px;line-height:1.4;color:var(--muted)}
.insight-steps button[aria-current="step"]{border-color:var(--amber);color:var(--ink)}
.insight-playback{display:flex;align-items:center;gap:8px;margin:14px 0 10px}
.insight-playback .primary{padding:11px 14px}
.insight-playback output{margin-left:auto;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
#insight-follow{color:var(--amber);font-size:11px}
.insight-takeaway{border-left:2px solid var(--amber);margin-top:20px;padding-left:12px}
.insight-takeaway>span{font-size:9px;letter-spacing:1.5px;color:var(--muted)}
.insight-takeaway p{font-size:12px;line-height:1.6;margin:7px 0 0}
.alternative-review{border-color:var(--amber);color:var(--amber)}
.cell.insight-highlight{outline:2px dashed var(--amber);outline-offset:-3px}
.cell.review-muted .cell-mark{opacity:.42;filter:saturate(.35)}
.insight-caption{display:none;position:absolute;left:16px;right:16px;bottom:48px;z-index:3;padding:12px;border:1px solid var(--line);border-radius:9px;background:#101c21ed;pointer-events:none}
.insight-caption strong,.insight-caption span{display:block;font-size:11px;line-height:1.5}
.insight-caption span{color:var(--muted);margin-top:4px}
.reviewing-tip .insight-caption:not([hidden]){display:block}
.insight-caption .insight-playback{margin:10px 0 0;pointer-events:auto}
.insight-caption .insight-playback button{min-height:36px}
.insight-caption .insight-playback .primary{padding:7px 12px;font-size:11px}
.insight-caption .insight-playback output{margin-left:0}
.insight-caption #board-insight-back{margin-left:auto}
.reviewing-tip .arena-column #scene{bottom:190px}
@media(max-width:680px){
 .reviewing-tip .arena-column #scene{bottom:215px}
 .play-page.reviewing-tip .arena{min-height:520px}
 .insight-steps button{min-height:44px}
}
@media(pointer:coarse){.insight-playback button,#insight-follow,#insight-back,.insight-actions button{min-height:44px}}

#animate-last-move{display:inline-flex;align-items:center;justify-content:center;gap:6px}.phone-rotate-icon{width:17px;height:17px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.game-controls{display:flex;align-items:flex-start;gap:8px}.game-controls .mode-control{flex:1;min-width:0;flex-wrap:wrap}.game-controls #new-game{flex:none;min-height:42px;border-radius:9px;background:var(--ink);color:var(--bg);padding:10px 12px;font-size:11px}.game-controls #new-game span{margin-left:8px}.game-controls .mode-control button{min-height:32px}.mode-control #mode-tournaments{flex:1 0 100%;padding:9px 8px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);text-align:center;border-radius:0 0 6px 6px}.mode-control #mode-tournaments:hover{color:var(--amber);background:#efb9680b}

.arena-top{justify-content:flex-end}
.arena-tools .check-alert-toggle{min-width:34px;padding:4px 7px;font-size:22px;line-height:1}
.check-alert-toggle[hidden],.check-alert[hidden]{display:none!important}
.check-alert-toggle[aria-pressed="true"]{color:var(--amber);border-color:#efb96870}
.check-alert-toggle.has-threat{background:#efb96820;box-shadow:0 0 12px #efb96830}
.check-alert{position:absolute;top:153px;right:24px;z-index:3;max-width:calc(100% - 48px);margin:0;padding:9px 12px;border:1px solid #efb96870;border-radius:9px;background:#101c21ed;color:var(--amber);font-size:12px;line-height:1.5;pointer-events:none}
.check-alert[data-kind="own"]{border-color:#86c7e080;color:var(--blue)}
@media(max-width:680px){.check-alert{top:110px;left:12px;right:12px;max-width:none;font-size:11px}.play-page .arena-tools .check-alert-toggle{min-width:32px;min-height:32px;padding:3px 6px;font-size:21px}}

@media(max-width:680px){.play-page #animate-last-move>span{display:none}.play-page #animate-last-move{min-width:34px;flex:none}}

/* Glass is a dark optical setting across the page, lit by the board pieces. */
body.glass-theme{--bg:#05080d;--panel:#0b111a;--ink:#eef3f7;--muted:#9ba9ba;--line:#9bc5ed20;background:var(--bg)}
.glass-theme header,.glass-theme footer{background:#05080d;border-color:var(--line)}
.glass-theme .arena{background:radial-gradient(ellipse at 50% 48%,#0a111c 0,#060b12 55%,#03060b 100%);border-color:#aaccee15}
.glass-theme .panel,.glass-theme dialog,.glass-theme .theme-picker{background:#0b111a;border-color:#aaccee26}
.glass-theme .mode-control,.glass-theme .small-button,.glass-theme .theme-toggle,.glass-theme .board-player,.glass-theme .player{background:#0b121d;border-color:#aaccee26}
.glass-theme .mode-control button.active{background:#213044;color:#f3f7ff}
.glass-theme .net-face{background:#101b29}.glass-theme .cell{background:#172538}
.glass-theme select,.glass-theme input,.glass-theme textarea{background:#070d15;color:var(--ink);border-color:#aaccee26}
.glass-theme .theme-option{background:#070e17;border-color:#aaccee26}

.glass-theme .player-header-card{background:#080e18;border-color:#9bc5ed29}
.glass-theme .player-header-card.active{background:linear-gradient(115deg,#142030,#080e18);border-color:var(--player-color)}
.glass-theme .header-orb{background:radial-gradient(circle,#fff 0 18%,var(--orb-light) 32%,var(--orb-base) 60%,transparent 75%);box-shadow:0 0 12px var(--orb-base)}
.glass-theme #theme-toggle{background:linear-gradient(125deg,#152335,#080e18);border-color:#9bc5ed40}
.glass-theme #theme-menu{background:#0b111af5;border-color:#9bc5ed40}
.glass-theme .theme-card{background:#080e18;border-color:#9bc5ed26}
.glass-theme .theme-card:hover{background:#122034}.glass-theme .theme-card[aria-checked="true"]{background:#172030;border-color:var(--amber)}
/* Shared primary navigation: only the current destination is underlined.
   Game-only display controls stay outside the navigation landmark. */
.site-header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:28px;align-items:center;padding-top:16px;padding-bottom:16px}
.site-header .brand{grid-column:1;grid-row:1}
.site-header .game-header-tools{grid-column:3;grid-row:1;display:flex;align-items:center;gap:24px;font-size:12px;color:#c0cccd}
.site-header .game-header-tools button{font-size:12px}
.site-header .primary-nav{grid-column:2;grid-row:1;display:flex;flex-wrap:nowrap;gap:24px;width:auto;justify-content:flex-end}
.site-header .primary-nav a{display:inline-block;white-space:nowrap;padding:10px 0 6px;border-bottom:2px solid transparent;color:var(--muted);font-weight:500}
.site-header .primary-nav a:hover{color:var(--ink)}
.site-header .primary-nav a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--amber);font-weight:700}
@media(max-width:900px){
 .site-header{gap:16px}
 .site-header .primary-nav{gap:16px}
}
@media(max-width:680px){
 .site-header{padding:14px 12px;gap:10px}
 .site-header .brand{font-size:10px;letter-spacing:1.5px;gap:6px}
 .site-header .brand-mark{font-size:22px}
 .site-header .game-header-tools{gap:8px}
 .site-header .primary-nav{gap:12px;font-size:11px}
 .site-header .primary-nav a{display:inline-block}
 .play-page #theme-options{top:72px}
}
/* The room continues behind the overlay controls; no separate backdrop frame. */
.glass-theme #scene{inset:0}
.glass-theme .arena{background:#03060b}
.play-page.glass-theme .arena-column #scene{inset:0}

@media(pointer:coarse){.return-live{min-height:44px}}

/* The callout and its pointer share arena coordinates with the projected move. */
.insight-arrow{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none;opacity:.85}
.insight-arrow[hidden]{display:none}
.reviewing-tip .insight-caption[data-anchored]{left:0;right:auto;top:0;bottom:auto;width:260px;max-width:calc(100% - 32px);max-height:calc(100% - 180px);overflow:auto;z-index:4;box-shadow:0 8px 24px #0003}
.insight-caption .insight-playback{flex-wrap:wrap;gap:6px}
.insight-caption .insight-playback button{font-size:10px;padding:7px 9px}
@media(max-width:680px){.reviewing-tip .insight-caption[data-anchored]{width:calc(100% - 32px)}}

/* Screen-space references stay legible while the cube rotates below them. */
.orientation-guides{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}
.orientation-guides[hidden],.orientation-guides [hidden]{display:none!important}
.orientation-guides svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke:#b8ccca;stroke-width:.75;opacity:.28}
.orientation-face,.orientation-floor{position:absolute;left:0;top:0;white-space:nowrap;line-height:1;color:#b8ccca;text-shadow:0 1px 5px #101c21}
.orientation-face{width:40px;height:16px;min-height:0;padding:1px 2px;border:1px solid transparent;border-radius:6px;background:transparent;font-size:10px;font-weight:400;letter-spacing:.15px;pointer-events:auto;cursor:pointer}
.orientation-face[data-primary="true"]{color:#dfd0b6}
.orientation-face:hover,.orientation-face:focus-visible{color:var(--ink);border-color:#e7d5b540;background:#17282dd9}
.orientation-floor{width:20px;height:20px;display:grid;place-items:center;font-size:12px;font-weight:500;letter-spacing:1px;color:#e7d5b5;background:#101c2166;border-radius:50%}
.arena-tools .orientation-toggle{min-width:36px;font-size:10px;letter-spacing:.6px;padding:5px 6px}
.orientation-toggle[aria-pressed="true"]{color:#dfc99f;border-color:#dfc99f50}
@media(pointer:coarse){.orientation-face::after{content:"";position:absolute;inset:-8px 0}}

/* Width is a board-view action; the corners switch direction when expanded. */
.arena-tools .width-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:32px;padding:5px 7px}
.width-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.width-toggle .width-contract,.width-toggle[aria-pressed="true"] .width-expand{display:none}
.width-toggle[aria-pressed="true"] .width-contract{display:initial}
.width-toggle[aria-pressed="true"]{color:#dfc99f;border-color:#dfc99f50}

.arena-bottom{gap:12px}#music{font-size:11px;min-height:32px}#music[aria-pressed="false"]{color:var(--muted)}
/* One control height keeps text labels, the rook and expansion icon aligned. */
.play-page .arena-tools .small-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:32px;min-height:32px;line-height:1;padding-top:0;padding-bottom:0}
.play-page .arena-tools .check-alert-toggle{font-size:18px;padding:0 7px}

/* A key moment first, with explicit recorded/alternative navigation. */
.insight-card.primary-insight{border-color:#efb96866;background:#efb96808}
.insight-compare{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.insight-compare[hidden]{display:none}
.insight-compare button{border:1px solid var(--line);border-radius:7px;padding:9px 10px;font-size:11px;color:var(--muted)}
.insight-compare button[aria-pressed="true"]{border-color:var(--amber);color:var(--ink);background:#efb9680d}
#history-table thead th{font-size:10px;font-weight:500;padding-top:6px;padding-bottom:6px}

.round-clock-row + .round-clock-row{margin-top:8px;font-size:12px}
/* The annotated review shares the main area with the existing WebGL canvas.
   Settings move below it; no alternate renderer or camera state is introduced. */
.insight-workspace[hidden],.insight-steps[hidden]{display:none}
.reviewing-tip .game-layout{grid-template-columns:minmax(0,1fr)}
.reviewing-tip .arena-column{display:grid;grid-template-columns:minmax(340px,.95fr) minmax(0,1.05fr);gap:0 20px;align-items:start;position:relative;top:auto}
.reviewing-tip .insight-workspace{grid-column:1;grid-row:1 / 3;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--panel);min-width:0}
body.reviewing-tip .arena-column .arena{grid-column:2;grid-row:1;position:sticky;top:16px;width:100%;height:650px;min-height:650px}
.reviewing-tip .arena-hint{grid-column:2;grid-row:2}
.reviewing-tip .game-insights{grid-column:1 / -1}
.reviewing-tip .arena-column #scene{bottom:55px}
.reviewing-tip .insight-caption,.reviewing-tip .insight-arrow{display:none!important}
.insight-camera-hint{font-size:11px;color:var(--muted);line-height:1.5;margin:0 0 15px}
.insight-table{width:100%;table-layout:fixed;border-collapse:collapse}
.insight-table caption{text-align:left;padding:12px 8px 4px;color:var(--ink);font-size:12px;font-weight:600}
.insight-table .insight-move-column{width:37%}
.insight-table th{padding:8px;text-align:left;color:var(--muted);font-size:11px;font-weight:500;border-bottom:1px solid var(--line)}
.insight-table td{font-size:11px;line-height:1.4;padding:7px 8px;color:var(--ink);vertical-align:middle;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.insight-table tbody tr:not(.insight-branch-heading){height:64px;cursor:pointer}
.insight-row-comment{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.insight-workspace [hidden]{display:none!important}
.insight-table button{display:flex;align-items:center;flex-wrap:wrap;gap:5px;width:100%;min-height:44px;padding:0;text-align:left;font-size:11px}
.insight-table button strong{font-weight:500}
.insight-table button[data-player="1"]{color:#ffce6b}
.insight-table button[data-player="2"]{color:#7dd9ff}
.insight-player-orb{display:inline-block;width:9px;height:9px;flex-shrink:0;border-radius:50%}
.insight-table [data-player="1"] .insight-player-orb{background:radial-gradient(circle at 30% 22%,#ffed8c,#ffca35 38%,#d98504)}
.insight-table [data-player="2"] .insight-player-orb{background:radial-gradient(circle at 30% 22%,#5de0ff,#0798ff 38%,#0648d8)}
.insight-table tr[data-emphasis="decision"] td:first-child{box-shadow:inset 3px 0 #e9b565}
.insight-table tr[data-emphasis="forced"] td:first-child{box-shadow:inset 3px 0 #d78c7e}
.insight-table tr[data-selected="true"] td{background:#294750}
.insight-table tr:hover td{background:#ffffff08}
.insight-table tr[data-selected="true"]:hover td{background:#294750}
.insight-table .insight-branch-heading th{padding-top:18px;color:var(--amber)}
.insight-table tr[data-alternative="true"] td{border-bottom-style:dashed}
.insight-selected-detail{padding-top:14px}
.insight-selected-detail h4{font-size:13px;font-weight:500;margin:0 0 6px}
.insight-selected-detail p{font-size:12px;line-height:1.6;color:var(--muted);margin:0}
@media(max-width:900px){.reviewing-tip .arena-column{grid-template-columns:minmax(0,1fr)}body.reviewing-tip .arena-column .arena{grid-column:1;grid-row:1;position:relative;top:0;height:560px;min-height:560px}.reviewing-tip .arena-hint{grid-column:1;grid-row:2}.reviewing-tip .insight-workspace{grid-column:1;grid-row:3}.reviewing-tip .arena-column #scene{bottom:55px}.reviewing-tip .game-insights{grid-row:4}}
