:root{--bg:#f1f0ea;--paper:#fbfaf6;--white:#fff;--ink:#252b25;--muted:#858b82;--line:#e7e8e1;--green:#506d55;--greenlight:#e8eee7;--wood:#e8c98e}*{box-sizing:border-box}html,body{height:100%}body{margin:0;background:var(--bg);color:var(--ink);font:13px -apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans SC",sans-serif;display:grid;place-items:center;padding:22px}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.42;cursor:not-allowed}.window{width:min(1360px,100%);height:min(880px,calc(100vh - 44px));min-height:640px;background:var(--paper);border:1px solid #e1e2db;border-radius:17px;box-shadow:0 28px 80px #18251e22,0 4px 14px #18251e0b;overflow:hidden;display:flex;flex-direction:column}.titlebar{height:55px;flex:none;display:flex;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);position:relative;background:#fdfcf9}.window-title{position:absolute;left:50%;transform:translateX(-50%);color:#6f756d;font-size:12px;font-weight:600;letter-spacing:.02em}.title-end{margin-left:auto;display:flex;gap:7px;align-items:center;color:#8a9188;font-size:11px}.offline-dot{width:6px;height:6px;border-radius:50%;background:#8caa88}.shell{flex:1;min-height:0;display:grid;grid-template-columns:218px minmax(0,1fr)}.sidebar{background:#f8f8f3;border-right:1px solid var(--line);padding:23px 13px;display:flex;flex-direction:column}.nav-label{padding:0 12px 9px;color:#a0a69c;font-size:10px;font-weight:700;letter-spacing:.1em}.secondary-label{padding-top:26px}#navigation{display:flex;flex-direction:column;gap:4px}#navigation button{border:0;background:transparent;text-align:left;color:#747d72;padding:10px 12px;border-radius:9px;font-size:13px;display:flex;gap:12px;align-items:center}#navigation button span{font-size:16px;width:18px;text-align:center}#navigation button:hover{background:#f0f2ed}#navigation button.active{background:var(--greenlight);color:#45654b;font-weight:600}.sidebar-bottom{margin-top:auto;border-top:1px solid var(--line);padding:17px 8px 0;display:grid;grid-template-columns:10px 1fr;column-gap:9px;color:#747c72;font-size:11px}.sidebar-bottom small{grid-column:2;color:#a6aaa1;font-size:10px;margin-top:4px}.tiny-stone{height:9px;width:9px;border-radius:50%;background:#252b25;margin-top:2px}.content{min-width:0;min-height:0;overflow:auto}.statusbar{height:34px;flex:none;border-top:1px solid var(--line);padding:0 18px;display:flex;align-items:center;justify-content:space-between;color:#a0a69c;font-size:10px}#toast{position:fixed;bottom:52px;left:50%;transform:translate(-50%,10px);background:#27372b;color:#fff;padding:10px 16px;border-radius:9px;opacity:0;pointer-events:none;transition:.2s;z-index:30;box-shadow:0 10px 25px #0002}#toast.show{opacity:1;transform:translate(-50%,0)}.page{padding:40px clamp(25px,5vw,70px)}.eyebrow{font-size:11px;letter-spacing:.07em;color:#929a8f}.page h1{font-size:32px;letter-spacing:-.045em;margin:10px 0 8px}.lead{color:#8a9088;font-size:13px;margin:0 0 28px}.section-title{font-size:13px;font-weight:700;margin:31px 0 11px}.card,.record-row,.friend-row,.watch-card,.stat-card{background:var(--white);border:1px solid var(--line);border-radius:12px}.card{padding:16px}.btn{border:0;border-radius:8px;padding:9px 13px;font-size:11px;font-weight:600;background:var(--greenlight);color:#4c6b52}.btn:hover{filter:brightness(.96)}.btn.primary{background:var(--green);color:#fff}.btn.ghost{background:#fff;border:1px solid var(--line);color:#6e776e}.btn.danger{color:#a15d53;background:#f5eae6}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar select,.toolbar input,.form-row input,.chat-form input{border:1px solid var(--line);background:#fff;border-radius:8px;padding:9px 11px;color:var(--ink);outline:none}.toolbar select:focus,.toolbar input:focus,.form-row input:focus,.chat-form input:focus{border-color:#a9bba8}.muted{color:var(--muted)}.empty{border:1px dashed #dce0d7;border-radius:12px;padding:34px;text-align:center;color:#8b9288;background:#fffaf5}.home-hero{background:#eaf0e8;padding:27px;border-radius:14px;display:flex;justify-content:space-between;gap:20px;align-items:center}.home-hero h2{font-size:24px;letter-spacing:-.04em;margin:10px 0 7px}.home-hero p{color:#7c897d;margin:0}.home-hero .btn{white-space:nowrap}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px}.stat-card{padding:18px}.stat-card strong{display:block;font-size:25px;font-weight:650;margin:10px 0 3px}.stat-card small{color:#929a90}.action-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}.action-card{text-align:left;padding:17px;background:#fff;border:1px solid var(--line);border-radius:12px;color:var(--ink)}.action-card b{display:block;margin-bottom:6px}.action-card span{color:var(--muted);font-size:11px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;min-height:100%;height:100%}.game-main{padding:22px 25px;min-width:0;display:flex;flex-direction:column;align-items:center;overflow:auto}.game-top{align-self:stretch;display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.pill{border:1px solid var(--line);border-radius:20px;background:white;padding:6px 11px;color:#7f887c;font-size:11px}.board-frame{width:min(100%,calc(100vh - 240px),610px);aspect-ratio:1;background:linear-gradient(145deg,#ebcb94,#ddb87b);padding:3px;border:1px solid #c7a574;border-radius:8px;box-shadow:0 13px 30px #755d341d,inset 0 1px 1px #fff8}.board-frame svg{width:100%;height:100%;display:block;touch-action:manipulation}.board-frame.playable svg{cursor:default}.game-bottom{width:min(100%,calc(100vh - 240px),610px);display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:15px}.turn-label{color:#5f685e;display:flex;align-items:center;gap:9px;font-size:12px}.turn-stone,.player-stone{display:inline-block;flex:none;border-radius:50%;height:20px;width:20px;background:radial-gradient(circle at 35% 30%,#626262,#151715 70%);box-shadow:0 2px 3px #0002}.turn-stone.white,.player-stone.white{background:radial-gradient(circle at 35% 30%,#fff,#e6e5de 72%);border:1px solid #cfd0c9}.game-controls{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.square-btn{border:1px solid var(--line);border-radius:7px;background:#fff;color:#717b70;min-width:32px;height:31px;padding:0 7px}.square-btn:hover{border-color:#b5c4b3;color:var(--green)}.game-side{border-left:1px solid var(--line);background:#fdfcf9;padding:17px 15px;display:flex;flex-direction:column;gap:12px;overflow:auto}.player-card{padding:12px 13px;background:#fff;border:1px solid var(--line);border-radius:11px}.player-top{display:flex;gap:9px;align-items:center}.player-stone{height:26px;width:26px}.player-name{font-weight:600;font-size:12px}.player-sub{color:#a1a69f;font-size:10px;margin-top:4px}.player-captures{margin-left:auto;color:#9ba198;font-size:10px}.player-captures b{color:#556057}.player-clock{border-top:1px solid #f0f0eb;margin-top:11px;padding-top:9px;display:flex;justify-content:space-between;align-items:center;color:#9ba198;font-size:10px}.player-clock strong{font-size:15px;color:#4b554a;font-variant-numeric:tabular-nums}.card-title{font-weight:600;font-size:12px;display:flex;justify-content:space-between;gap:8px}.small-line{display:flex;justify-content:space-between;color:#929a90;font-size:11px;margin-top:12px}.small-line b{color:#596459;font-weight:500}.chat-card{margin-top:auto;min-height:180px;display:flex;flex-direction:column}.chat-log{display:flex;flex-direction:column;gap:7px;overflow:auto;max-height:160px;min-height:75px;margin-top:14px;font-size:11px;color:#727b70}.chat-log b{color:#506451}.chat-form{display:flex;gap:6px;margin-top:auto;padding-top:9px}.chat-form input{width:100%;min-width:0;font-size:11px}.chat-form button{border:0;border-radius:7px;background:var(--green);color:white;width:30px;flex:none}.record-list,.friend-list{display:flex;flex-direction:column;gap:9px}.record-row,.friend-row{display:flex;align-items:center;gap:12px;padding:13px}.row-symbol,.friend-avatar{height:37px;width:37px;border-radius:10px;display:grid;place-items:center;flex:none;background:#edf1e9;color:#60735f}.friend-avatar{font-size:15px;font-weight:700}.friend-avatar.alt{background:#ece9e1;color:#7b7365}.friend-avatar.blue{background:#e5ecef;color:#657f88}.row-main{flex:1;min-width:0}.row-main b{display:block;font-size:12px;margin-bottom:4px}.row-main small{color:#979f95;font-size:10px}.row-status{color:#8b9489;font-size:10px}.inline-actions{display:flex;gap:6px;margin-left:auto}.watch-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.watch-card{padding:20px}.watch-card h3{font-size:17px;margin:14px 0 7px}.watch-card p{color:#7e887d;font-size:12px;margin:0 0 16px}.watch-card small{display:block;color:#a3aaa0;margin-bottom:17px}.tag{color:#678467;text-transform:uppercase;font-size:10px;letter-spacing:.08em;font-weight:700}.review-layout{display:grid;grid-template-columns:minmax(300px,460px) minmax(220px,1fr);gap:22px;align-items:start}.review-board,.puzzle-board{background:linear-gradient(145deg,#ebcb94,#ddb87b);border-radius:8px;padding:3px;border:1px solid #c7a574;aspect-ratio:1;box-shadow:0 12px 28px #755d3416}.review-board svg,.puzzle-board svg{height:100%;width:100%;display:block}.review-panel{display:flex;flex-direction:column;gap:13px}.review-move{font-size:28px;font-weight:650;letter-spacing:-.04em}.range{width:100%;accent-color:var(--green)}.move-list{max-height:280px;overflow:auto;display:flex;flex-wrap:wrap;gap:6px}.move-list button{padding:6px 8px;border:1px solid var(--line);background:white;border-radius:6px;font-size:10px;color:#778176}.move-list button.active{background:var(--green);color:white}.puzzle-layout{display:grid;grid-template-columns:minmax(300px,460px) minmax(220px,1fr);gap:22px}.puzzle-panel{padding:20px}.puzzle-panel h2{font-size:20px;margin:13px 0 8px}.puzzle-panel p{color:#879087;line-height:1.6}.feedback{min-height:36px;margin-top:16px;font-size:12px;color:#537456}.feedback.error{color:#a9675b}.friend-note{color:#929b91;margin-top:16px;font-size:11px}.form-row{display:flex;gap:8px}.form-row input{min-width:0;flex:1}.filterbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:15px}.filterbar input{margin-left:auto}.chip{background:transparent;border:0;border-radius:7px;padding:8px 11px;color:#849084;font-size:11px}.chip.active{background:var(--greenlight);color:#4a6850;font-weight:600}.notice{padding:12px 14px;background:#eff2ec;border-radius:9px;color:#758274;font-size:11px;margin-bottom:16px}.modal{width:min(420px,100%);background:#fff;padding:23px;border-radius:14px;box-shadow:0 18px 45px #0003}.modal h2{margin:0 0 9px}.modal p{color:#838b81;line-height:1.55}.modal .toolbar{justify-content:flex-end;margin-top:19px}@media(max-width:1100px){.game-layout{grid-template-columns:minmax(0,1fr) 235px}.game-main{padding:18px 14px}.game-side{padding:13px 10px}.shell{grid-template-columns:68px minmax(0,1fr)}.sidebar{padding:19px 9px}#navigation button{font-size:0}.nav-label,.sidebar-bottom{display:none}#navigation button{justify-content:center;padding:11px 0}#navigation button span{font-size:17px}.secondary-label{padding:10px}}@media(max-width:750px){body{padding:0}.window{height:100vh;min-height:0;border-radius:0;border:0}.shell{grid-template-columns:55px minmax(0,1fr)}.sidebar{padding:16px 5px}.page{padding:25px 18px}.page h1{font-size:25px}.stats,.action-grid,.watch-grid{grid-template-columns:1fr}.game-layout{display:block;height:auto}.game-side{border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(2,1fr)}.game-side .chat-card{grid-column:1/-1}.game-main{min-height:0}.board-frame,.game-bottom{width:min(100%,calc(100vw - 105px))}.review-layout,.puzzle-layout{grid-template-columns:1fr}.friend-row,.record-row{flex-wrap:wrap}.row-status{display:none}.title-end{font-size:0}.window-title{font-size:11px}.home-hero{display:block}.home-hero .btn{margin-top:16px}}
/* Keep the board anchored while stones are added. The board occupies the flexible middle row. */
.game-content{overflow:hidden}.game-layout{height:100%;min-height:0}.game-main{display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;overflow:hidden;min-height:0}.game-top{width:100%;margin-bottom:10px}.board-frame{width:auto;height:min(100%,610px);max-width:100%;min-height:0;aspect-ratio:1;align-self:center;justify-self:center;flex:none}.game-bottom{width:min(100%,610px);min-width:0;padding-top:10px;align-self:start}.game-side{min-height:0}.panel-toggle{display:none}
@media(max-height:730px){body{padding:0}.window{height:100dvh;min-height:0;border-radius:0}.game-main{padding-top:10px;padding-bottom:10px}.game-top{margin-bottom:6px}.game-bottom{padding-top:6px}.game-side{gap:8px;padding-top:10px;padding-bottom:10px}.player-card{padding:8px 10px}.player-clock{margin-top:7px;padding-top:6px}}
@media(max-width:750px){.game-layout{display:block;position:relative;height:100%}.game-main{height:100%;padding:10px 12px}.game-side{display:none;position:absolute;inset:0 0 0 auto;width:min(290px,calc(100% - 28px));z-index:5;box-shadow:-16px 0 35px #1c2b1c24;grid-template-columns:1fr;grid-auto-rows:max-content;overflow:auto}.game-layout.panel-open .game-side{display:grid}.game-side .chat-card{grid-column:auto;margin-top:0}.panel-toggle{display:inline-block}.board-frame{width:auto;height:min(100%,610px);max-width:100%}.game-bottom{width:100%;flex-wrap:wrap}.game-controls{flex:1}.turn-label{white-space:nowrap}.statusbar{display:none}}
@media(max-width:440px){.game-main{padding:8px}.game-top{margin-bottom:4px}.game-bottom{padding-top:4px;gap:5px}.game-controls{gap:3px}.square-btn{font-size:10px;min-width:27px;height:28px;padding:0 5px}.turn-label{font-size:10px}.turn-stone{height:14px;width:14px}}
@media(max-height:620px){.game-side{overflow:hidden}.game-side>.card:not(.chat-card){display:none}.game-side .chat-card{min-height:0;flex:1}.game-side .chat-log{min-height:0;flex:1}.game-side .player-sub{display:none}.game-side .player-clock{margin-top:5px;padding-top:4px}}
.window{position:relative}.sidebar-bottom{display:block;padding:14px 4px 0}.friend-launcher{display:grid;grid-template-columns:23px 1fr;column-gap:9px;align-items:center;width:100%;border:0;border-radius:9px;background:#e9eee6;color:#496b4d;text-align:left;padding:10px}.friend-launcher>span{grid-row:span 2;font-size:18px;text-align:center}.friend-launcher b{font-size:12px}.friend-launcher small{font-size:10px;color:#8b9b89}.friend-launcher:hover,.friend-launcher[aria-expanded=true]{background:#dce9da}.friend-window{position:absolute;left:226px;bottom:43px;width:355px;height:min(490px,calc(100% - 85px));z-index:10;background:#fff;border:1px solid #dfe5dc;border-radius:13px;box-shadow:0 16px 45px #1d2c202c;display:flex;flex-direction:column;overflow:hidden}.friend-window[hidden]{display:none}.friend-window-head{display:flex;align-items:center;justify-content:space-between;padding:13px 15px;border-bottom:1px solid var(--line);flex:none}.friend-window-head b{font-size:13px}.friend-window-head small{display:block;margin-top:3px;color:#9aa69a;font-size:10px}.friend-close{border:0;background:transparent;color:#879287;font-size:20px;line-height:1}.friend-window-body{display:grid;grid-template-columns:115px minmax(0,1fr);flex:1;min-height:0}.friend-contacts{background:#f8faf6;border-right:1px solid var(--line);padding:8px 6px;overflow:auto}.friend-contact{width:100%;border:0;background:transparent;border-radius:7px;text-align:left;padding:8px 7px;color:#5b6b5c;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.friend-contact.active,.friend-contact:hover{background:#e6eee3}.friend-conversation{display:flex;flex-direction:column;min-width:0;min-height:0}.friend-conversation-head{padding:10px 12px;border-bottom:1px solid var(--line);font-size:11px;font-weight:600}.friend-conversation-head small{display:block;color:#a0a9a0;font-weight:400;margin-top:3px}.friend-messages{flex:1;overflow:auto;padding:11px;display:flex;flex-direction:column;gap:8px}.friend-bubble{align-self:flex-end;max-width:95%;border-radius:10px 10px 2px 10px;padding:8px 10px;background:#e9f0e7;color:#48604c;font-size:11px;line-height:1.45;word-break:break-word}.friend-bubble small{display:block;color:#91a090;font-size:9px;margin-top:3px}.friend-empty{color:#9aa49a;font-size:10px;line-height:1.5;margin:auto;text-align:center;padding:10px}.friend-compose{display:flex;gap:5px;border-top:1px solid var(--line);padding:9px}.friend-compose input{flex:1;min-width:0;border:1px solid var(--line);border-radius:7px;padding:8px;font-size:11px;outline:none}.friend-compose button{width:28px;border:0;border-radius:7px;background:var(--green);color:white}.friend-window-foot{border-top:1px solid var(--line);padding:9px 10px;display:flex;gap:7px;flex:none}.friend-window-foot input{flex:1;min-width:0;border:1px solid var(--line);border-radius:7px;padding:7px;font-size:10px}.friend-window-foot button{border:0;border-radius:7px;background:#e9f0e7;color:var(--green);font-size:10px;padding:0 8px}
@media(max-width:1100px){.sidebar-bottom{display:block;padding:8px 0 0}.friend-launcher{display:flex;justify-content:center;padding:9px 0}.friend-launcher b,.friend-launcher small{display:none}.friend-window{left:74px}}
@media(max-width:750px){.friend-window{left:59px;bottom:8px;width:min(355px,calc(100% - 66px));height:min(490px,calc(100% - 65px))}}
/* The app fills the browser viewport at every window size. */
html,body{width:100%;height:100%;overflow:hidden}body{display:block;padding:0;margin:0}.window{width:100%;height:100vh;height:100dvh;min-height:0;max-width:none;max-height:none;border:0;border-radius:0;box-shadow:none}.shell{min-height:0}.content{min-height:0}.window:fullscreen{width:100vw;height:100vh;height:100dvh}
@media(max-width:750px){.title-end{font-size:0}}
/* The middle grid track is an independent measuring area for the square board. */
.game-main{width:100%;height:100%;grid-template-rows:auto minmax(0,1fr) auto}.board-slot{width:100%;height:100%;min-width:0;min-height:0;display:grid;place-items:center;overflow:hidden}.board-slot .board-frame{box-sizing:border-box;display:block;width:100%;height:auto;max-width:none;max-height:none;aspect-ratio:1;min-width:0;min-height:0}.board-slot .board-frame svg{width:100%;height:100%}

.setup-layout{grid-template-columns:minmax(0,1fr)}
.setup-top{gap:8px}
.setup-top h1{font-size:clamp(19px,3vw,27px);margin:4px 0 0}
.setup-size{display:flex;align-items:center;gap:6px;white-space:nowrap;color:var(--muted)}
.setup-size select{color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:7px;padding:5px}
.setup-bottom{flex-direction:column;justify-content:center;gap:6px}
.setup-bottom .game-controls{justify-content:center}
.board-step-slider{display:flex;align-items:center;gap:8px;width:100%;min-width:0;min-height:29px;color:#526950}
.game-bottom>.board-step-slider{max-width:610px}
#fox-game .game-bottom>.board-step-slider{flex:0 0 100%}
.board-step-range{flex:1;min-width:0;width:100%;margin:0;min-height:27px;accent-color:var(--green);cursor:pointer}
.board-step-range:disabled{cursor:default}
.board-step-range:focus-visible{outline:2px solid #7b9e7b;outline-offset:2px;border-radius:6px}
.board-step-slider>span,.board-step-slider>label{flex:none;white-space:nowrap;font-size:11px}
.board-step-value{flex:none;white-space:nowrap;font-size:11px;font-variant-numeric:tabular-nums;text-align:right}
.board-step-slider button{flex:none;white-space:nowrap}
@media(max-width:440px){.board-step-slider{gap:5px}.board-step-value{font-size:10px}}
.setup-turn{margin:0;gap:6px;min-height:16px;font-variant-numeric:tabular-nums}
.setup-turn .turn-stone{width:13px;height:13px}
.setup-turn .turn-stone[hidden]{display:none}
.setup-bottom button:disabled{opacity:.5;cursor:default}
@media(max-width:440px){.setup-size{flex-direction:column;gap:3px;font-size:10px}}

.puzzle-lookup{min-width:0;margin:16px 0 12px}
.puzzle-lookup label{display:block;font-weight:650;margin-bottom:5px}
.puzzle-lookup-actions{display:flex;flex-wrap:wrap;gap:7px}
.puzzle-lookup input{flex:1 1 12rem;min-width:0;padding:7px 10px;border:1px solid #cad4ca;border-radius:6px;background:#fff;color:var(--ink)}
.puzzle-lookup button{white-space:nowrap}
#puzzle-lookup-error{margin:5px 0 0;color:#a13731}
#puzzle-lookup-error:empty{display:none}
.puzzle-embed{display:block;width:100%;height:clamp(450px,76dvh,1000px);border:1px solid var(--line);border-radius:12px;background:#fff}
.puzzle-source{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin:0 0 10px;color:var(--muted)}
.puzzle-source a{color:var(--green);font-weight:600;text-underline-offset:2px}
.fox-official{max-width:680px}
.fox-official .btn{display:inline-flex;align-items:center;text-decoration:none}
.fox-official > a{color:var(--green);text-underline-offset:2px}
.learning-toolbar{justify-content:space-between;gap:12px;margin-bottom:16px}
.learning-tabs{display:flex;flex-wrap:wrap;gap:6px}
.learning-review-head{justify-content:space-between;gap:12px;margin-bottom:12px}
.learning-review-head h2{font-size:18px;margin:0;overflow-wrap:anywhere}
.review-move .muted{font-size:13px}
.titlebar{z-index:12}
.title-brand{display:flex;align-items:center;gap:8px;color:#233c32;font-size:16px;font-weight:720;letter-spacing:.05em;white-space:nowrap}
.title-brand img{display:block;flex:none}
.account-wrap{position:relative;margin-left:5px}
.account-toggle{width:32px;height:32px;padding:0;display:grid;place-items:center;border:1px solid #dbe4d8;border-radius:50%;background:#e8eee5;color:#375a45;font-size:14px;font-weight:700}
.account-toggle:hover,.account-toggle[aria-expanded="true"]{background:#dce9da;border-color:#a8bba3}
.account-toggle svg{fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round}
.account-toggle [hidden],.account-panel[hidden]{display:none}
.account-panel{position:absolute;right:0;top:calc(100% + 10px);width:min(290px,calc(100vw - 24px));max-height:calc(100dvh - 66px);overflow:auto;padding:15px;border:1px solid #dfe5dc;border-radius:13px;background:#fff;box-shadow:0 12px 34px #1d2c202b;color:var(--ink);font-size:13px;text-align:left}
.account-panel h2{font-size:15px;margin:0 0 8px}
.account-panel p{margin:6px 0 12px;color:#677364;overflow-wrap:anywhere}
.account-name{display:block;font-size:16px;overflow-wrap:anywhere}
.account-form,.account-form label{display:grid;gap:5px}
.account-form{gap:9px}
.account-form input{min-width:0;width:100%;padding:7px 8px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink)}
.account-actions{display:flex;flex-wrap:wrap;gap:6px}
.account-panel .account-message{color:#a23b2e;margin:0 0 7px}
.account-panel .account-message:empty{display:none}
.account-panel a{text-decoration:none}
@media(max-width:440px){
  .titlebar{padding:0 11px}
  .title-brand{gap:6px}
  .title-brand img{width:24px;height:24px}
}

.fox-page{max-width:1320px}
.fox-page>h1{margin:9px 0 5px;font-size:clamp(27px,4vw,42px)}
.fox-page p{color:var(--muted);margin:6px 0;line-height:1.5;overflow-wrap:anywhere}
.fox-page>.card{margin-top:20px;border:1px solid var(--line);border-radius:15px;background:#fff}
.fox-page h2{font-size:16px;margin:0}
.fox-connection-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.fox-login{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:12px;margin:16px 0 10px}
.fox-login label{font-size:12px;display:grid;gap:5px}
#fox-login{grid-template-columns:minmax(0,1fr);max-width:360px}
#fox-login button[type="submit"]{justify-self:start}
.fox-controls{display:flex;gap:8px;flex-wrap:wrap}
.fox-page button:disabled{opacity:.5;cursor:default}
.fox-page [hidden]{display:none}
.fox-lobby-grid{display:grid;grid-template-columns:minmax(176px,.85fr) minmax(245px,1.4fr) minmax(222px,1fr);align-items:start;gap:14px;margin-top:16px}
.fox-lobby-grid>.card{min-width:0}
.fox-lobby-actions{display:grid;gap:14px;min-width:0}
.fox-lobby-actions .card{min-width:0}
.fox-match-presets{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin-top:10px}
.fox-match-preset{display:grid;gap:3px;min-width:0;padding:9px 10px;border:1px solid #dbe5d9;border-radius:8px;background:#f1f5ef;text-align:left;color:#3c5d45}
.fox-match-preset strong{font-size:13px}
.fox-match-preset span,.fox-match-preset small{font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.fox-match-preset span{color:#5a705e}
.fox-match-preset small{color:#666e64}
.fox-match-preset:hover:not(:disabled),.fox-match-preset[aria-pressed="true"]{background:#e2eee0;border-color:#a3bda4}
.fox-page .fox-match-preset.waiting:disabled{opacity:1}
.fox-lobby-actions button:focus-visible,.fox-challenge-form select:focus-visible{outline:2px solid #739675;outline-offset:2px}
.fox-match-controls{display:grid;gap:8px;margin-top:12px}
.fox-challenge-form{display:grid;gap:7px;margin-top:10px;min-width:0}
.fox-challenge-form label{display:grid;gap:5px;color:var(--muted);font-size:12px}
.fox-challenge-form select{width:100%;min-width:0;padding:7px 8px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink)}
.fox-challenge-actions{display:flex;flex-wrap:wrap;gap:6px}
.fox-lobby-rules{margin-top:14px;padding-top:12px;border-top:1px solid var(--line);color:#4c6250}
.fox-lobby-rules summary{font-weight:650;cursor:pointer}
.fox-lobby-rules ul{margin:8px 0 0;padding-left:17px;color:#5c6b5d;font-size:12px;line-height:1.55}
.fox-lobby-rules li+li{margin-top:4px}
.fox-lobby-watch #fox-watch-status:empty{display:none}
.fox-lobby-watch .fox-room-list{max-height:clamp(200px,48dvh,480px)}
.fox-lobby-watch .fox-lobby-rules{margin-top:5px}
.fox-roster #fox-search{width:100%;margin-top:10px}
.fox-players{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:6px;max-height:265px;overflow:auto}
.fox-players li{padding:8px 9px;background:var(--greenlight);border-radius:8px;font-size:12px;overflow-wrap:anywhere}
.fox-online .offline-dot{background:#4d9661}
@media(max-width:900px){.fox-lobby-grid{grid-template-columns:minmax(0,1fr)}.fox-match-controls{display:flex}.fox-match-presets{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:440px){.fox-match-presets{grid-template-columns:minmax(0,1fr)}}
@media(max-width:560px){.fox-login{grid-template-columns:1fr}}
.fox-page .fox-players li{padding:0}
.fox-players button{background:none;border:0;padding:8px 9px;width:100%;text-align:left;overflow-wrap:anywhere;color:inherit}
.fox-players button[aria-pressed="true"]{background:#d8e8d7;border-radius:8px}
.fox-peer{align-items:center;margin:12px 0;font-size:12px}
.fox-chat .chat-log{white-space:pre-wrap;overflow-wrap:anywhere}
.fox-chat .fox-outgoing{text-align:right}
.fox-inline-status{font-size:11px;margin:0;min-height:0}
.fox-game [hidden]{display:none}
.fox-game .game-side>.chat-card{margin-top:auto}
.fox-game .game-top{gap:8px}




.fox-game .game-bottom{flex-wrap:wrap}
.fox-rooms{overflow:hidden;min-height:0;display:flex;flex-direction:column;gap:8px}
.fox-room-list{overflow:auto;display:grid;gap:6px}
#navigation .fox-game-nav{background:#e8f0e6;color:#3b623e;box-shadow:inset 0 0 0 1px #cfdfcc;font-weight:650}
#navigation .fox-game-nav:hover{background:#dce9da}
#navigation .fox-game-nav.active{background:#446b4a;color:#fff;box-shadow:none}
#navigation .fox-game-nav[hidden]{display:none}
.fox-room-list button{border:1px solid var(--line);background:#fff;color:inherit;border-radius:8px;padding:9px;text-align:left;font-size:12px;display:grid;gap:7px;overflow-wrap:anywhere;min-width:0}
.fox-room-list button:enabled:hover{border-color:#a5baa1;background:#f3f7f1}
.fox-rooms .fox-room-list button[aria-current="true"]{border-color:#91aa8d;background:#d8e8d7;opacity:1}
.fox-room-list small{color:#626d60}
.fox-room-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.fox-room-player{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px}
.fox-room-player:last-child{grid-template-columns:minmax(0,1fr) auto;text-align:right}
.fox-room-player:last-child .player-stone{grid-area:1/2}
.fox-room-player:last-child>span{grid-area:1/1}
.fox-room-player .player-stone{width:13px;height:13px}
.fox-room-player b,.fox-room-player small{display:block}
.fox-room-meta{display:flex;flex-wrap:wrap;gap:4px 7px;align-items:center;border-top:1px solid var(--line);padding-top:5px}
.fox-room-state{background:#e8f0e6;color:#3b623e;padding:2px 5px;border-radius:4px;font-size:10px}
.fox-room-viewers{margin-left:auto}
.fox-room-list button:is([data-state="ended"],[data-state="closed"]):disabled{opacity:1;color:#626d60}
.fox-room-list button:not([data-state="playing"]) .fox-room-state{background:#edece6;color:#565b52}
.fox-game button:disabled{opacity:.5;cursor:default}

.fox-friend-body{display:flex;flex:1;min-height:0;flex-direction:column;padding:12px}
.fox-friend-body select{padding:7px 9px;border:1px solid var(--line);border-radius:8px;width:100%;background:#fff}
.fox-friend-body .fox-chat{min-height:0;flex:1;padding:10px 3px 0;gap:5px}
.fox-friend-body .chat-log{min-height:0;max-height:none;flex:1}

dialog.modal{border:1px solid var(--line);color:var(--ink);max-height:calc(100dvh - 40px);overflow:auto;margin:auto}
dialog.modal::backdrop{background:#1b281b80;backdrop-filter:blur(2px)}
dialog.game-action-modal{position:fixed;inset:0;width:min(390px,calc(100% - 32px));text-align:center}
.game-action-modal .toolbar{justify-content:center}
.game-announcement{position:fixed;inset:0;z-index:24;display:grid;place-items:center;pointer-events:none;padding:16px}
.game-announcement-card{max-width:min(440px,100%);padding:13px 21px;border:1px solid #c6d7c478;border-radius:13px;background:#26392f;color:#fff;text-align:center;overflow-wrap:anywhere;box-shadow:0 9px 26px #26392f45}
.game-announcement-card strong{display:block;font-size:clamp(15px,2.4vw,19px)}
.game-announcement-card span{display:block;margin-top:5px;color:#dbe8dc;font-size:12px}
.game-announcement-card span:empty{display:none}
.match-info{display:grid;gap:9px;flex:none;min-width:0;padding:12px;background:#fff;border:1px solid var(--line);border-radius:11px}
.match-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}
.match-heading h2{font-size:13px;margin:0}
.match-heading span,.match-meta,.match-player small,.match-clock small{font-size:11px;color:var(--muted)}
.match-players{display:grid;gap:5px}
.match-player{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;min-width:0;padding:7px;border:1px solid transparent;border-radius:8px}
.match-player.turn{background:#edf3ea;border-color:#e4ebe1}
.match-player .player-stone{width:17px;height:17px}
.match-player-label,.match-clock{display:grid;gap:2px;min-width:0}
.match-player-label b,.match-player-label span{font-size:11px;line-height:1.2;overflow-wrap:anywhere}
.match-player-label span{color:#52634f}
#fox-watch .match-players{grid-template-columns:repeat(2,minmax(0,1fr))}
#fox-watch .match-player{grid-template-columns:auto minmax(0,1fr)}
#fox-watch [data-match-player="2"]{grid-template-columns:minmax(0,1fr) auto;text-align:right}
#fox-watch [data-match-player="2"] .player-stone{grid-area:1/2}
#fox-watch [data-match-player="2"] .match-player-label{grid-area:1/1}
#fox-watch .match-player [data-match-detail]{line-height:1.35;overflow-wrap:anywhere}
#fox-watch .match-clock{grid-column:1/-1;grid-row:2;text-align:inherit;white-space:normal}
#fox-watch .match-clock small{line-height:1.35;overflow-wrap:anywhere}
.fox-watch-head-actions{align-items:center;justify-content:flex-end;min-width:0;gap:5px}
.fox-watch-bottom{flex-direction:column;align-items:center;gap:5px}
.fox-watch-bottom .fox-controls{justify-content:center}
.fox-watch-review,.fox-watch-tools,.fox-watch-trial{align-items:center;min-width:0;max-width:100%;gap:5px}
.fox-watch-review button,.fox-watch-tools button{white-space:nowrap}
.fox-watch-step{
  display:inline-flex;align-items:center;gap:4px;white-space:nowrap;
  font-size:11px;font-variant-numeric:tabular-nums;color:#465b43;
}
.fox-watch-step input{
  width:4.4em;min-width:0;padding:4px;border:1px solid var(--line);
  border-radius:6px;background:#fff;color:var(--ink);text-align:center;
}
.fox-watch-save{display:flex;justify-content:flex-end;flex:none}
.fox-watch-room-panel{
  display:grid;flex:1;min-width:0;min-height:0;
  grid-template-rows:minmax(128px,1fr) minmax(156px,1.2fr);
  gap:8px;overflow:auto;overscroll-behavior:contain;
}
.fox-watch-room-panel .fox-rooms,.fox-watch-chat{
  display:flex;flex-direction:column;gap:6px;min-width:0;min-height:0;margin:0;padding:10px;
}
.fox-watch-room-panel .fox-rooms>.btn{padding:6px 9px}
.fox-watch-room-panel .fox-room-list,.fox-watch-chat-log{
  flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;
}
.fox-watch-room-panel .fox-room-list{align-content:start}
.fox-watch-chat-log{
  max-height:none;margin:0;padding:0;color:#586555;font-size:11px;line-height:1.5;
  white-space:pre-wrap;overflow-wrap:anywhere;
}
.fox-watch-chat-log b{color:#3d5740}
.fox-watch-chat-log p{margin:0}
.fox-watch-chat-notice{margin:0;color:#687365;font-size:11px;line-height:1.35;overflow-wrap:anywhere}
.fox-watch-chat-notice:empty{display:none}
.match-clock{text-align:right;white-space:nowrap}
.match-clock strong{font-size:16px;line-height:1.05;font-variant-numeric:tabular-nums;color:#3e503c}
.match-clock.urgent strong,.match-clock.urgent small{color:#a73a2e}
.match-info [hidden]{display:none}
.match-status{font-size:12px;color:#465b43;line-height:1.35;overflow-wrap:anywhere}
.match-status:empty,.match-meta:empty{display:none}
.match-clock-control{justify-self:start}
.match-layout .game-side>.chat-card{margin-top:auto}
.match-layout .game-side>.fox-rooms{margin-top:0;flex:1;overflow:hidden}
.match-layout button:disabled{opacity:.5;cursor:default}
.match-layout .game-controls{justify-content:center;flex:1}
.move-numbers{white-space:nowrap}
@media(max-height:620px) and (min-width:751px){
  .match-info{gap:5px;padding:8px}
  .match-player{padding:3px}
}
@media(max-width:750px){
  .match-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  #fox-watch{grid-template-rows:auto minmax(0,1fr) auto}
  .fox-watch-save{grid-area:3/1;padding:0 8px 7px}
  .match-layout .game-side,.match-layout.panel-open .game-side{display:contents}
  .match-layout .match-info{grid-row:1;grid-column:1;align-self:start;justify-self:end;width:min(100%,430px);margin:6px 6px 0 0;padding:7px;gap:4px}
  .match-layout .game-main{grid-row:2;grid-column:1}
  .match-players{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
  .match-player{gap:4px;padding:4px}
  .match-player .player-stone{width:12px;height:12px}
  .match-player-label small,.match-clock small{font-size:9px}
  .match-clock strong{font-size:13px}
  .match-clock-control{padding:4px 6px}
  .match-layout .game-side>.chat-card{display:none;position:absolute;right:7px;bottom:43px;width:min(310px,calc(100% - 14px));max-height:calc(100% - 65px);overflow:auto;box-shadow:0 10px 36px #22312338;background:#fff;z-index:5}
  .match-layout.panel-open .game-side>.chat-card{display:flex}
  .fox-watch-room-panel{
    display:none;position:absolute;right:7px;bottom:79px;
    width:min(330px,calc(100% - 14px));height:min(460px,62dvh);
    max-height:calc(100% - 87px);padding:6px;
    grid-template-rows:minmax(126px,.8fr) minmax(146px,1.2fr);
    border:1px solid var(--line);border-radius:12px;
    background:var(--paper);box-shadow:0 10px 36px #22312338;z-index:5;
  }
  #fox-watch.panel-open .fox-watch-room-panel{display:grid}
  #fox-watch.panel-open .fox-watch-head-actions{position:relative;z-index:6}
  .fox-watch-room-panel .fox-rooms>.card-title{align-items:center;justify-content:flex-start;gap:6px}
  .fox-watch-room-panel .fox-rooms>.card-title .muted{order:1}
  .fox-watch-panel-close{padding:4px 7px}
  .fox-watch-step input{width:2.9em;padding-inline:2px;font-size:16px;appearance:textfield}
  .fox-watch-step input::-webkit-inner-spin-button{appearance:none}
}
@media(max-width:440px){
  .fox-watch-tools{gap:3px}
  .fox-watch-tools .btn{padding-inline:6px}
  .fox-watch-step{gap:2px}
}

.fox-bridge-link{margin-top:14px}
.fox-bridge-link a{text-decoration:none}
.fox-access{grid-template-columns:minmax(0,1fr) auto;max-width:480px}
.ai-page{max-width:1420px;padding:clamp(14px,3vh,28px) clamp(18px,3vw,42px);margin-inline:auto}
.ai-heading{margin-bottom:14px}
.ai-heading h1{margin:4px 0 5px;font-size:clamp(24px,3vw,34px);line-height:1.15}
.ai-heading p{margin:0;color:var(--muted);line-height:1.5}
.ai-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.ai-toolbar label,.ai-board-controls label,.ai-analysis-controls label,.ai-auto,[data-ai-engine-switch]{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.ai-toolbar select,.ai-analysis-controls select,#ai-engine{max-width:100%;border:1px solid var(--line);border-radius:8px;padding:6px 8px;background:white;color:var(--ink)}
.ai-page button:disabled{opacity:.5;cursor:default}
.ai-page [hidden]{display:none}
.ai-workspace{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(268px,1fr);align-items:start;gap:clamp(12px,2vw,25px)}
.ai-board-column,.ai-sidebar{display:grid;min-width:0;gap:12px;align-content:start}
.ai-board{width:min(100%,640px,max(250px,calc(100dvh - 274px)));height:auto;aspect-ratio:1;justify-self:center;min-width:0}
.ai-board-column:has([data-ai-replay]:not([hidden])) .ai-board{width:min(100%,640px,max(250px,calc(100dvh - 351px)))}
.ai-board svg{display:block;width:100%;height:100%;touch-action:manipulation}
.ai-board-controls{display:flex;align-items:center;flex-wrap:wrap;justify-content:center;gap:6px;min-width:0}
.ai-board-controls output{color:#526950;font-size:12px}
.ai-replay{display:grid;gap:8px;min-width:0}
.ai-replay-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;color:#536a57;font-size:12px}
.ai-replay-head strong{min-width:0;overflow-wrap:anywhere}
.ai-replay-head output{white-space:nowrap}
.ai-replay input[type="range"]{width:100%;margin:0}
.ai-panel{min-width:0;padding:clamp(11px,2vw,19px)}
.ai-panel h2,.ai-panel h3{margin:0;font-size:14px}
.ai-engine-status,.ai-variation{line-height:1.5;overflow-wrap:anywhere}
.ai-engine-status{color:#536a57;margin:6px 0 10px}
.ai-requirements{margin-top:13px;padding-top:11px;border-top:1px solid var(--line);font-size:12px;color:var(--muted);line-height:1.6}
.ai-requirements summary{cursor:pointer;font-weight:600;color:#526b58}
.ai-requirements ul{padding-left:18px;margin:8px 0}
.ai-requirements li+li{margin-top:5px}
.ai-panel .notice a{color:var(--green);font-weight:600;text-underline-offset:3px}
[data-ai-engine-switch]{margin-top:8px}
[data-ai-engine-mode],[data-ai-engine-privacy]{margin:6px 0;line-height:1.45;font-size:12px}
.ai-auto{margin-top:8px;font-size:12px}
.ai-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:10px 0 0}
.ai-metrics>div{min-width:0;padding:9px 7px;background:#f2f5ef;border-radius:8px;color:#56715b;font-size:11px}
.ai-metrics b{display:block;margin:3px 0 0;font-size:clamp(13px,2vw,18px);color:#304f3c;font-variant-numeric:tabular-nums}
.ai-candidate-list{display:grid;gap:4px;min-width:0}
.ai-candidate{width:100%;min-width:0;display:grid;grid-template-columns:18px minmax(26px,.55fr) repeat(3,minmax(0,1fr));align-items:center;gap:5px;padding:7px 8px;text-align:left;color:var(--ink);background:white;border:1px solid var(--line);border-radius:7px;font-size:11px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.ai-candidate:hover,.ai-candidate[aria-pressed="true"],.ai-candidate.active{border-color:#8eae92;background:#e9f1e7}
.ai-candidate b{color:#365c45}
.ai-candidate-rank{display:grid;place-items:center;min-height:18px;border-radius:5px;background:#eef2eb;color:#577759;font-weight:700}
.ai-variation{margin-top:11px;font-size:12px;color:#586858}
.ai-variation-head{display:flex;align-items:center;justify-content:space-between;gap:6px}
.ai-rules-notice{color:#795f3d;font-size:12px;line-height:1.5;margin:0 0 10px}
.ai-variation ol{display:flex;flex-wrap:wrap;gap:5px;margin:5px 0 0;padding:0;list-style:none}
.ai-variation li,.ai-variation li button{display:inline-flex;align-items:center;gap:4px;padding:4px 6px;border-radius:5px;background:#f0f3ee;color:#526650}
.ai-variation li:has(button){padding:0}
.ai-variation li button{border:1px solid transparent}
.ai-variation li button:hover,.ai-variation li button[aria-pressed="true"]{border-color:#8eae92;background:#e3eddf}
.ai-variation-stone{width:8px;height:8px;border-radius:50%;background:#3b453a;flex:none}
.ai-variation-stone.white{border:1px solid #a3ada0;background:white}
.ai-game-controls{display:grid;gap:5px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.ai-game-controls small{line-height:1.4}
.ai-game-progress{display:grid;gap:5px;margin-top:3px;color:#526950;font-size:12px}
.ai-game-progress progress{width:100%;height:7px;accent-color:var(--green)}
.ai-history-chart{margin-top:10px;min-width:0}
.ai-history-chart-head{display:flex;justify-content:space-between;align-items:baseline;gap:6px;color:#5e715f;font-size:12px}
.ai-history-chart-head output{font-variant-numeric:tabular-nums}
[data-ai-history] svg{display:block;width:100%;max-height:140px;margin-top:4px;overflow:hidden;background:#f7f9f5;border-radius:7px;cursor:pointer;touch-action:pan-y}
[data-ai-history] svg:focus-visible{outline:2px solid #537c59;outline-offset:2px}
.ai-history-axis{stroke:#a9b8a7;stroke-width:1;stroke-dasharray:4 4}
.ai-history-cursor{stroke:#526b58;stroke-width:1;stroke-dasharray:3 3}
.ai-history-line{fill:none;stroke:#4f7e58;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ai-history-chart [data-ai-chart="lead"] .ai-history-line{stroke:#597b8e}
.ai-history-point{fill:#4f7e58}
.ai-history-point.mistake{fill:#ae5542;stroke:#fff;stroke-width:1.1}
.ai-history-point.active{stroke:#273e2f;stroke-width:1.8}
.ai-history-legend{display:block;margin-top:8px;line-height:1.5}
.ai-history-legend span{display:block;margin-top:3px;color:#845346}
.ai-move-review{margin-top:10px;padding:9px;border-radius:8px;background:#f0f4ee;color:#46624d;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.ai-move-review p{margin:4px 0}
.ai-mistake-badge{display:inline-block;margin-left:6px;padding:1px 5px;background:#fae5de;color:#8c4334;border-radius:4px;font-size:11px}
.ai-move-review button{margin-top:6px}
.ai-marker{pointer-events:none}
.ai-marker circle{fill:#dcebd6;stroke:#527454;stroke-width:1.4}
.ai-marker text{fill:#24462d;font-weight:700}
.ai-marker.active circle{fill:#497853;stroke:#fff;stroke-width:2}
.ai-marker.active text{fill:#fff}
@media(max-width:820px){.ai-workspace{grid-template-columns:minmax(0,1fr)}.ai-board,.ai-board-column:has([data-ai-replay]:not([hidden])) .ai-board{width:min(100%,550px)}}
@media(max-width:440px){.ai-page{padding:12px 8px}.ai-panel{padding:9px}.ai-toolbar{gap:5px}.ai-toolbar button{padding:8px}.ai-candidate{padding:6px 4px}.ai-metrics>div{padding:6px 4px}}

/* Yiwu workspace: quiet canvas, clear actions and a consistent navigation rail. */
:root{--bg:#f3f5f3;--paper:#f5f6f3;--ink:#23372f;--muted:#65756d;--line:#dfe6e1;--green:#23745b;--greenlight:#e7f1eb;--wood:#e8c98e}
body{font-size:14px;-webkit-font-smoothing:antialiased}
button,a,input,select,summary{-webkit-tap-highlight-color:transparent}
button,a,input,select,summary{transition:background-color .16s,border-color .16s,box-shadow .16s}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #32866a;outline-offset:3px}
input:not([type="range"]):not([type="checkbox"]):not([type="file"]),select{min-width:0;border:1px solid #cedbd3;border-radius:8px;background:#fff;color:var(--ink);padding:9px 11px;outline:none}
input:not([type="range"]):focus,select:focus{border-color:#32866a;box-shadow:0 0 0 3px #32866a18}
input::placeholder{color:#77847d}
.titlebar{height:60px;background:#fff;border-bottom-color:var(--line);padding-inline:24px}
.title-brand{gap:10px;font-size:19px;letter-spacing:.08em}
.title-brand img{width:31px;height:31px}
.window-title{font-size:13px;color:#586d60}
.title-end{color:#64796c;font-size:12px;gap:9px}
.account-toggle{width:35px;height:35px;background:#f1f5f1}
.shell{grid-template-columns:196px minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.sidebar{background:#1e352c;border:0;padding:27px 12px 16px;min-height:0}
.nav-label{color:#94aca0;font-size:10px;letter-spacing:.16em;padding-inline:14px}
.secondary-label{padding-top:27px}
#navigation{gap:6px;min-height:0;overflow-y:auto;scrollbar-width:none}
#navigation button{color:#c3d1c8;font-size:13px;padding:12px 14px;border-radius:9px;gap:12px;min-height:43px}
#navigation button span{width:20px;height:20px;display:grid;place-items:center;flex:none;font-size:18px}
#navigation button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#navigation button:hover{background:#ffffff0c;color:#fff}
#navigation button.active{background:#365b49;color:#fff;box-shadow:inset 3px 0 #a0cbb3;font-weight:600}
#navigation .fox-game-nav{background:#294c3b;color:#d7eddf;box-shadow:inset 0 0 0 1px #4b705b}
#navigation .fox-game-nav.active{background:#368365;color:#fff;box-shadow:inset 3px 0 #b6e6cc}
.sidebar-bottom{border-top-color:#ffffff16;padding-top:14px;flex:none}
.friend-launcher{background:#ffffff08;color:#dae7dd;padding:12px 10px}
.friend-launcher small{color:#9ab2a3}
.friend-launcher:hover,.friend-launcher[aria-expanded="true"]{background:#ffffff14}
.friend-launcher svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.friend-window{left:208px}
.statusbar{height:28px;background:#fff;color:#6d7c72}
.page{padding:30px clamp(20px,3.5vw,52px);max-width:1440px;margin-inline:auto}
.page h1,.fox-page>h1{font-size:30px;font-weight:680;line-height:1.25;letter-spacing:-.035em;margin:7px 0 10px}
.eyebrow{font-size:10px;letter-spacing:.13em;color:#6c8274;font-weight:600}
.lead{font-size:13px;line-height:1.65;color:var(--muted)}
.card,.record-row,.watch-card,.stat-card{border-color:var(--line);box-shadow:0 2px 5px #20352b03}
.card{border-radius:12px;padding:18px}
.btn{font-size:12px;min-height:35px;border-radius:8px;padding:8px 13px;line-height:1.4}
.btn.primary{background:var(--green);box-shadow:0 2px 3px #1f5e4414}
.btn.primary:hover{background:#195d48;filter:none}
.btn.ghost{color:#50675a;background:#fff}
.btn.danger{color:#9c5144;background:#faf0ec}
.square-btn{color:#526c5b;border-color:#d6e1d8;min-height:32px}
.chip{font-size:12px;color:#627468}
.chip.active{color:#205e47;background:#e4eee7}
.empty{background:#fff;border:1px dashed #c9d7cd;color:#627468;line-height:1.7;padding:32px 20px}
.empty p{margin:0 0 14px}
.notice{color:#536c5b;line-height:1.6}
.learning-tabs{background:#e9ede8;border-radius:9px;padding:4px}
.learning-tabs .chip.active{background:#fff;box-shadow:0 1px 4px #1d3c2210}
.record-row{padding:16px}
.row-main b{font-size:13px}
.row-main small{font-size:11px;color:#687c6c}
.filterbar input{margin-left:0;flex:1;max-width:360px}
.game-side{background:#edf1ec;border-left-color:#dce5de;padding:14px}
.game-main{background:#f5f6f3}
.board-frame,.review-board,.puzzle-board{border-radius:5px;box-shadow:0 5px 18px #66523113,inset 0 1px 0 #fff6}
.game-top .pill{color:#506956;font-size:12px}
.match-info{padding:13px;border-color:#d9e4db}
.match-heading h2,.card-title{font-size:13px}
.match-clock strong{font-size:20px;font-weight:650;letter-spacing:-.025em}
.match-player.turn{background:#e7f2e9;border-color:#cce0d1}
.match-player-label b{font-size:12px}
.chat-log,.fox-watch-chat-log{font-size:12px;line-height:1.6}
.ai-panel h2{font-size:15px}
.ai-candidate{font-size:12px;padding-block:9px}
.ai-metrics>div{background:#edf4ee}
.ai-metrics b{font-size:21px}
.ai-heading{margin-bottom:18px}
.fox-page{max-width:1500px}
.fox-page>.card{margin-top:22px}
.fox-page .fox-connection{padding:0;overflow:hidden;display:grid;grid-template-columns:minmax(260px,1fr) minmax(260px,1fr)}
.fox-connection-main{padding:26px;min-width:0}
.fox-connection:has(.fox-login-intro[hidden]){grid-template-columns:minmax(0,1fr)}
.fox-connection:has(.fox-login-intro[hidden]) .fox-connection-main{padding:16px 20px}
.fox-connected .fox-connection-main{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 20px}
.fox-connected .fox-connection-head{flex:1;align-items:center}
.fox-connected #fox-connection-controls{margin-top:0;flex:none}
.fox-login-intro{display:flex;flex-direction:column;justify-content:center;background:#e9f0e8;border-left:1px solid #dae5d9;padding:32px;min-width:0}
.fox-login-intro h3,.fox-login-intro h2{font-size:24px;letter-spacing:-.04em;margin:0 0 12px;color:#254934}
.fox-login-intro p{max-width:340px;color:#5e7565}
.fox-login-intro ul{list-style:none;padding:0;margin:22px 0 0;display:grid;gap:12px;font-size:13px;color:#365a42}
.fox-login-intro li::before{content:"";display:inline-block;width:6px;height:6px;margin-right:10px;border-radius:50%;background:#6d9679;vertical-align:2px}
#fox-login{max-width:380px;margin-top:22px;gap:15px}
.fox-login label{gap:7px;font-size:12px;color:#53695c}
.fox-login input{width:100%;min-height:41px}
#fox-login button[type="submit"]{justify-self:stretch;min-height:41px;margin-top:3px}
#fox-connection-controls{margin-top:12px}
#fox-connection-controls .btn{font-size:11px;min-height:30px;padding-block:6px;background:#f0f4ef;color:#506b58}
.fox-lobby-grid{grid-template-columns:minmax(195px,.82fr) minmax(310px,1.65fr) minmax(210px,.95fr);gap:16px;margin-top:20px}
.fox-lobby-actions{gap:16px}
.fox-lobby-grid h2{font-size:15px}
.fox-lobby-grid .card{padding:16px}
.fox-match-preset{padding:13px 12px;gap:5px;border-color:#d7e3d8;background:#f1f6ef;border-radius:9px}
.fox-match-preset strong{font-size:16px;font-variant-numeric:tabular-nums}
.fox-match-preset span{font-size:12px;color:#52705b}
.fox-match-preset:hover:not(:disabled){background:#e3f0e4;border-color:#89b294}
.fox-match-preset.waiting{background:#e3f0e4;border-color:#69a17e}
.fox-match-preset:disabled{opacity:.65}
.fox-lobby-filters{display:grid;gap:8px;min-width:0;margin:4px 0}
.fox-lobby-search{width:100%;min-width:0}
.fox-lobby-filter-options{display:flex;gap:8px;flex-wrap:wrap}
.fox-lobby-filter-options label{display:grid;gap:4px;flex:1;min-width:105px;font-size:11px;color:var(--muted)}
.fox-lobby-filter-options select{width:100%;font-size:12px;padding:7px 8px}
.fox-lobby-empty{padding:24px 14px;background:#f5f7f3;border:1px dashed #cedbce;border-radius:9px;color:#617769;text-align:center;font-size:12px;line-height:1.6}
.fox-room-list{gap:8px;scrollbar-width:thin;scrollbar-color:#b9c9bd transparent}
.fox-room-list button{padding:12px;border-color:#dfe8df;border-radius:9px;gap:10px}
.fox-room-list button:enabled:hover{border-color:#89ab91;background:#f1f7f0}
.fox-room-list .fox-room-player b{font-size:12px;line-height:1.5}
.fox-room-meta{padding-top:8px}
.fox-room-state{padding:3px 6px;border-radius:5px}
.fox-lobby-watch .fox-room-list{max-height:clamp(260px,51dvh,580px)}
.fox-players{max-height:380px;gap:3px}
.fox-players li{background:#f3f6f1}
.fox-players button{padding:11px 9px}
.fox-players button:hover{background:#e7efe4;border-radius:7px}
.fox-page p{font-size:12px;line-height:1.65}
.fox-challenge-actions .primary{flex:1}
.home-page{max-width:1240px;padding-top:24px}
.home-heading{margin-bottom:24px}
.home-heading .lead{margin:0}
.home-hero{position:relative;isolation:isolate;overflow:hidden;background:#254b3b;color:#fff;padding:28px 32px;border:0;border-radius:16px;min-height:218px;gap:28px}
.home-hero .eyebrow{color:#b4d3bb}
.home-hero h2{font-size:clamp(26px,3.1vw,34px);font-weight:650;line-height:1.3;margin:10px 0;letter-spacing:-.04em}
.home-hero p{color:#c6dbcb;font-size:13px;line-height:1.75;max-width:430px}
.home-hero-copy{position:relative;z-index:1;flex:1;min-width:0}
.home-hero-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:23px}
.home-hero .btn{min-height:40px;padding:10px 17px}
.home-hero .btn.primary{background:#d6eaca;color:#23442f;box-shadow:none}
.home-hero .btn.primary:hover{background:#e5f2dd}
.home-hero .btn.ghost{border-color:#729482;background:#ffffff09;color:#edf7ef}
.home-hero-art{width:172px;height:172px;flex:none;position:relative;border:12px solid #d9bd83;border-radius:6px;background-color:#d9bd83;background-image:repeating-linear-gradient(0deg,transparent 0 19px,#786a4770 19px 20px),repeating-linear-gradient(90deg,transparent 0 19px,#786a4770 19px 20px);box-shadow:0 15px 24px #11281f35;transform:rotate(-6deg);opacity:.95}
.home-hero-art::before,.home-hero-art::after{content:"";position:absolute;width:27px;height:27px;border-radius:50%;box-shadow:0 3px 4px #0003}
.home-hero-art::before{background:radial-gradient(circle at 35% 25%,#586059,#1d2821 75%);top:34px;left:66px}
.home-hero-art::after{background:radial-gradient(circle at 35% 25%,#fff,#dedfd2 85%);top:94px;left:106px}
.home-status{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:#c9dece}
.home-status i{width:6px;height:6px;border-radius:50%;background:#a1b1a4}
.home-status.is-connected i{background:#ace1ae}
.home-hero-art svg{width:170px;height:170px;display:block}
.home-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:28px 0 13px}
.home-section-head h2{margin:0;font-size:16px}
.home-section-head p,.home-section-head small{margin:0;font-size:12px;color:var(--muted)}
.home-learning-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.home-learning-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:10px;padding:22px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);text-align:left}
.home-learning-card:hover{border-color:#9bb5a3;box-shadow:0 5px 18px #254b3b08;background:#fcfdfb}
.home-learning-card b,.home-learning-card h3{font-size:16px;margin:0}
.home-learning-card p,.home-learning-card small{font-size:12px;line-height:1.65;margin:0;color:var(--muted)}
.home-learning-card svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.home-card-icon{display:grid;place-items:center;width:39px;height:39px;border-radius:10px;background:#edf3e9;color:#52744f;margin-bottom:4px}
.home-card-link{margin-top:auto;padding-top:8px;color:var(--green);font-size:12px;font-weight:600}
.home-resume{margin-top:20px;padding:18px 22px;border:1px solid var(--line);border-radius:12px;background:#fff;display:flex;align-items:center;gap:18px;justify-content:space-between}
.home-resume h3{font-size:14px;margin:0 0 5px}
.home-resume p{color:var(--muted);font-size:12px;margin:0;line-height:1.6}
.home-resume .btn{flex:none}
.home-learning-icon{display:grid;place-items:center;width:39px;height:39px;border-radius:10px;background:#edf3e9;color:#52744f;font-size:15px;font-weight:650;margin-bottom:3px}
.home-learning-card:nth-child(2) .home-learning-icon{background:#f5eee0;color:#8b7042}
.home-learning-card:nth-child(3) .home-learning-icon{background:#e9eff4;color:#51758a}
.home-learning-copy{display:grid;gap:7px}
.home-learning-copy strong{font-size:16px}
.home-learning-copy>span{font-size:12px;line-height:1.65;color:var(--muted)}
.home-learning-arrow{position:absolute;top:28px;right:22px;color:#75927b;font-size:19px}
.home-resume strong{display:block;font-size:14px;margin-bottom:6px}
@media(max-width:750px){.home-learning-icon{grid-column:1;grid-row:1/3;margin:0}.home-learning-copy{grid-column:2;padding-right:15px}.home-learning-arrow{right:16px;top:22px}.match-layout .match-info{width:min(calc(100% - 12px),430px)}}
@media(max-width:1180px){.fox-lobby-grid{grid-template-columns:minmax(180px,.8fr) minmax(280px,1.4fr)}.fox-roster{grid-column:1/-1}.fox-players{grid-template-columns:repeat(3,minmax(0,1fr));max-height:220px}.fox-roster #fox-search{max-width:380px}}
@media(max-width:1000px){.shell{grid-template-columns:66px minmax(0,1fr)}.sidebar{padding:22px 8px 12px}.nav-label{display:none}#navigation button{font-size:0;justify-content:center;padding:12px 0}.sidebar-bottom{display:block;padding:12px 0 0}.friend-launcher{display:grid;grid-template-columns:1fr;padding:12px 0;justify-items:center}.friend-launcher b,.friend-launcher small{display:none}.friend-window{left:74px}.home-hero{padding:28px}.home-hero-art{width:160px;height:160px}.home-hero-art svg{width:140px;height:140px}}
@media(min-width:1001px) and (max-width:1100px){.nav-label,.sidebar-bottom{display:block}#navigation button{justify-content:flex-start}.friend-launcher{grid-template-columns:23px 1fr}}
@media(max-width:750px){.page{padding:22px 18px}.page h1,.fox-page>h1{font-size:25px}.titlebar{height:52px;padding-inline:13px}.title-end{font-size:0;gap:6px}.window-title{font-size:11px}.fox-lobby-grid{grid-template-columns:minmax(0,1fr)}.fox-roster{grid-column:auto}.fox-lobby-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.fox-match-presets{grid-template-columns:1fr}.fox-players{grid-template-columns:repeat(2,minmax(0,1fr))}.fox-page .fox-connection{grid-template-columns:1fr}.fox-login-intro{border-left:0;border-top:1px solid #dae5d9;padding:22px}.fox-login-intro h3{font-size:20px}.fox-login-intro ul{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px}.fox-connection-main{padding:22px}#fox-login{max-width:none}.home-heading{margin-bottom:18px}.home-hero-art{display:none}.home-hero .btn{margin-top:0}.home-learning-grid{grid-template-columns:1fr}.home-learning-card{display:grid;grid-template-columns:42px minmax(0,1fr);gap:5px 14px;padding:18px}.home-card-icon{grid-column:1;grid-row:1/4;margin:0}.home-learning-card b,.home-learning-card h3,.home-learning-card p,.home-learning-card small,.home-card-link{grid-column:2}.home-card-link{padding-top:6px}.home-section-head{margin-top:24px}.game-side{padding:10px}.match-clock strong{font-size:15px}}
@media(max-width:480px){.shell{grid-template-columns:58px minmax(0,1fr)}.sidebar{padding-inline:4px}#navigation button{font-size:9px;flex-direction:column;gap:5px;padding:10px 2px;min-height:53px;border-radius:7px}#navigation button span{width:19px;height:19px}#navigation button svg{width:19px;height:19px}.friend-launcher{padding:10px 0}.friend-launcher b{display:block;font-size:9px;margin-top:5px}.friend-window{left:63px;width:calc(100% - 70px)}.page{padding:20px 13px}.home-hero{padding:23px 20px;min-height:240px}.home-hero h2{font-size:27px}.home-hero-actions{gap:8px}.home-hero .btn{padding:10px 12px}.home-heading .lead{max-width:230px}.home-section-head p,.home-section-head small{display:none}.home-resume{padding:16px;flex-wrap:wrap;gap:12px}.fox-lobby-actions{grid-template-columns:1fr}.fox-players{grid-template-columns:1fr}.fox-connection-main{padding:18px}.fox-login-intro{padding:20px}.fox-login-intro ul{display:grid}.ai-page{padding:18px 10px}.ai-candidate{font-size:11px;padding:7px 4px}.ai-metrics b{font-size:17px}.window-title{max-width:95px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.record-row{padding:12px}}
@media(prefers-reduced-motion:reduce){button,a,input,select,summary,#toast{transition:none;scroll-behavior:auto}}
@media(max-width:750px) and (max-height:620px){
  .match-layout .match-info{padding:6px;gap:3px}
  .match-layout .match-heading{display:none}
  .match-layout .match-player-label b{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .match-layout .match-meta,.match-layout .match-status{font-size:10px;line-height:1.3}
  .match-layout .game-top .pill{font-size:10px;padding:4px 6px}
  .match-layout .game-top .btn,.match-layout .game-bottom .btn,.fox-watch-save .btn{min-height:27px;padding:5px 7px;font-size:10px}
  .match-layout .game-top{gap:4px}
  .fox-watch-head-actions{gap:4px}
  .fox-watch-bottom{gap:3px}
}

.portal-link { color: inherit; font-size: .8rem; white-space: nowrap; }
