:root{color-scheme:dark;--bg:#101720;--panel:#192430;--line:#304152;--fg:#ecf3f7;--muted:#aabcca;--mint:#8de0c0}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 10% 0,#1c3240 0,transparent 40%),var(--bg);font:15px/1.5 system-ui,-apple-system,'Segoe UI',sans-serif;color:var(--fg)}.header{height:78px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 max(24px,calc((100vw - 1180px)/2));background:#131d28}.logo{display:flex;align-items:center;gap:13px;text-decoration:none;color:inherit}.mark{width:43px;height:43px;border-radius:11px;background:#c0ddcb;color:#182c29;font-size:26px;font-weight:800;display:grid;place-items:center}.logo small{display:block;color:var(--muted);font-size:9px;letter-spacing:2px}.header-pill{color:#a1dfc6;border:1px solid #42705e;border-radius:20px;padding:5px 12px;font-size:12px}main{max-width:1180px;margin:0 auto;padding:26px 24px 55px}.intro{margin:0 0 22px}.intro h1{font-size:clamp(25px,4vw,40px);margin:0}.intro p{margin:5px 0 0;color:var(--muted)}.intro .eyebrow{color:var(--mint);font-size:11px;letter-spacing:2px;font-weight:700}.layout{display:grid;grid-template-columns:minmax(0,620px) minmax(250px,1fr);align-items:start;gap:22px}.board-panel,.panel{border:1px solid var(--line);border-radius:14px;background:var(--panel)}.board-panel{padding:16px}.player{padding:7px 4px;font-size:13px;font-weight:700}.board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));width:100%;aspect-ratio:1;overflow:hidden;border-radius:8px;touch-action:none;user-select:none}.square{position:relative;display:grid;place-items:center;min-width:0;min-height:0;border:0;border-radius:0;padding:0;cursor:pointer;touch-action:none}.light{background:#d9e0d5}.dark{background:#718c84}.square.last{box-shadow:inset 0 0 0 100vmax #f9e16a45}.square.selected{box-shadow:inset 0 0 0 4px #fac86b}.square.target:after{content:"";position:absolute;width:24%;height:24%;background:#224d4f72;border-radius:50%}.square svg{height:82%;width:82%;pointer-events:none;filter:drop-shadow(0 2px 1px #18252a40);z-index:1}.coord{position:absolute;font-size:10px;font-weight:800;pointer-events:none}.rank{top:3px;left:4px}.file{bottom:2px;right:4px}.light .coord{color:#476d64}.dark .coord{color:#dae8df}.side{display:grid;gap:15px}.panel{padding:20px}.panel h2{margin:0;font-size:18px}.panel p{color:var(--muted)}.statusline{display:flex;align-items:center;justify-content:space-between}.chip{background:#274236;color:#b6ebcf;font-size:12px;border-radius:7px;padding:5px 9px}.actions{display:flex;gap:8px;flex-wrap:wrap}button{font:inherit;background:#32495a;color:#fff;border:1px solid #496274;border-radius:8px;padding:9px 12px;cursor:pointer}button:hover:not(:disabled){filter:brightness(1.12)}button:disabled{opacity:.4;cursor:default}.primary{background:#4c9d7d;border-color:#60b393;color:#071b13;font-weight:700}.danger{background:#5d3542;border-color:#7b4854}.note{font-size:13px;margin-bottom:0}.fine{font-size:13px}.fine p{margin-bottom:0}.moves{line-height:2;max-height:230px;overflow:auto;overflow-wrap:anywhere;color:#c6d4dd}.moves span{display:inline-block;padding:2px 6px;border-radius:4px;margin-right:5px;background:#243444}footer{border-top:1px solid var(--line);text-align:center;color:var(--muted);padding:20px}dialog{border-radius:14px;border:1px solid #496070;background:#1a2936;color:white;max-width:95vw}dialog::backdrop{background:#000a}.choices{display:flex;gap:8px;margin:16px 0}.choices button{width:65px;height:65px}.choices svg{width:48px;height:48px}.drag-ghost{position:fixed;pointer-events:none;z-index:1000;width:65px;height:65px;transform:translate(-50%,-50%);opacity:.9}.drag-ghost svg{width:100%;height:100%}@media(max-width:830px){.layout{grid-template-columns:minmax(0,1fr)}.board-panel{max-width:630px}.header{padding:0 16px}.header-pill{display:none}main{padding:22px 12px}.board-panel{padding:8px}.square .coord{font-size:8px}.side{grid-template-columns:minmax(0,1fr)}}

/* Treeengen multipage public site */
.site-nav{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}.site-nav a{padding:9px 12px;text-decoration:none;color:var(--muted);border-radius:9px;font-weight:600;font-size:13px}.site-nav a:hover,.site-nav a[aria-current=page]{background:#283d46;color:#aaf1d6}.site-main{max-width:1180px;margin:0 auto;padding:40px 24px 72px}.hero{padding:72px 0 55px;max-width:850px}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--mint);font-weight:700}.hero h1{font-size:clamp(42px,7vw,82px);letter-spacing:-.05em;line-height:1.06;margin:22px 0}.hero em{color:#8fdfbd;font-style:normal}.hero>p{font-size:18px;color:var(--muted);max-width:680px}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:27px}.big-button{padding:13px 21px;border-radius:9px;font-weight:700;text-decoration:none}.main-button{background:#91ddbb;color:#0b2520}.quiet-button{border:1px solid #506977;color:var(--fg)}.site-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0 30px}.mini-stat,.feature-card,.spectate-card,.spectate-info{border:1px solid var(--line);border-radius:14px;background:var(--panel)}.mini-stat{padding:18px 22px}.mini-stat span{display:block;color:var(--muted);font-size:12px}.mini-stat strong{font-size:25px;line-height:1.8}.feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.feature-card{padding:26px;text-decoration:none;color:inherit;min-width:0}.feature-card h2{font-size:20px;margin:10px 0}.feature-card p{color:var(--muted);font-size:14px;line-height:1.7}.feature-card .feature-icon{color:#97ddbf;font-size:30px}.feature-cta{color:var(--mint);font-weight:700;font-size:13px}.page-head{margin:0 0 28px}.page-head h1{font-size:clamp(30px,4vw,48px);margin:6px 0 10px}.page-head>p:last-child{color:var(--muted);max-width:750px}.live-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.spectate-card{padding:16px;min-width:0}.spectate-card .board{max-width:100%}.panel-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}.panel-top h2{font-size:16px;margin:0 0 5px}.subline{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.live-pill{background:#2a483e;color:#b0e9cb;border-radius:8px;padding:5px 8px;font-size:10px;font-weight:700;white-space:nowrap}.move-strip{display:flex;flex-wrap:wrap;gap:6px;padding:12px 0;font-size:12px;color:#b9cbda}.move-strip span{background:#233443;border-radius:6px;padding:4px 7px}.data-note{font-size:13px;color:var(--muted);margin:20px 0}.spectate-layout{display:grid;grid-template-columns:minmax(0,600px) minmax(0,1fr);gap:20px;align-items:start}.spectate-info{padding:24px}.spectate-info h2{margin:0 0 18px}.spectate-info h3{font-size:15px;margin-top:24px}.detail-row{display:flex;justify-content:space-between;gap:14px;border-bottom:1px solid #354657;padding:12px 0;font-size:13px}.detail-row span{color:var(--muted)}.detail-row strong{text-align:right}.loading{color:var(--muted)}@media(max-width:980px){.header{height:auto;min-height:77px;flex-wrap:wrap;justify-content:center;gap:12px;padding:12px 15px}.site-nav{order:3;width:100%}.site-stats,.feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.spectate-layout{grid-template-columns:minmax(0,1fr)}}@media(max-width:700px){.site-main{padding:24px 12px 55px}.hero{padding:44px 0}.site-stats,.feature-grid,.live-grid{grid-template-columns:minmax(0,1fr)}.site-nav a{padding:8px}.mini-stat strong{font-size:22px}}

/* Discord login — public navigation and play panel */
.auth-slot{display:flex;align-items:center;gap:10px;max-width:290px;justify-content:flex-end}.auth-login{display:inline-flex;align-items:center;justify-content:center;background:#5865f2;color:white;text-decoration:none;border-radius:9px;padding:9px 13px;font-weight:700;font-size:12px;white-space:nowrap}.auth-login:hover{background:#6d77f6}.auth-name{font-size:12px;color:var(--fg);max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.auth-logout{padding:7px 10px;font-size:12px}.auth-unavailable{font-size:11px;color:#e7b48f}.play-signin{margin:12px 0}.play-signin[hidden]{display:none}@media(max-width:980px){.auth-slot{order:2;max-width:100%}.site-nav{order:3}}

/* v1.2.3: Discord member sidebar; root chess is public and immediately playable. */
.header{position:relative;z-index:5}.header-tag{color:var(--muted);font-size:13px;margin-left:auto;margin-right:22px}.auth-slot{margin-left:auto}
.member-sidebar{position:fixed;top:78px;bottom:0;left:0;z-index:4;width:235px;overflow-y:auto;background:#111c28;border-right:1px solid var(--line);padding:20px 14px}
.member-sidebar[hidden]{display:none!important}.nav-section{margin:0 0 21px}.nav-section h3{font-size:10px;letter-spacing:1.6px;color:#84afcc;margin:0 8px 8px}
.nav-section a{display:block;padding:9px 12px;border-radius:8px;color:#adcee1;font-size:13px;text-decoration:none}.nav-section a:hover{background:#243847;color:#fff}.nav-section a[aria-current="page"]{background:#245346;color:#b3ffe0}
body.has-member-session main{margin-left:235px;max-width:none;padding-left:clamp(20px,3vw,46px);padding-right:clamp(20px,3vw,46px)}body.has-member-session footer{margin-left:235px}
.play-main{max-width:1240px}.play-main .layout{justify-content:center;grid-template-columns:minmax(0,610px) minmax(250px,1fr)}.header-tag{white-space:nowrap}
.archive-layout{display:grid;grid-template-columns:minmax(250px,380px) minmax(300px,640px);gap:18px;align-items:start}.archive-list{display:grid;gap:8px;max-height:680px;overflow:auto;margin-top:12px}.archive-entry{width:100%;text-align:left;font-size:13px;background:#243545}.replay-controls{display:flex;gap:10px;align-items:center;margin-top:14px}.replay-controls input{flex:1;min-width:30px}
@media(max-width:1100px){body.has-member-session main{padding-left:17px;padding-right:17px}.play-main .layout{grid-template-columns:minmax(0,550px) minmax(230px,1fr)}.archive-layout{grid-template-columns:1fr}}
@media(max-width:890px){.member-sidebar{position:static;width:auto;max-height:200px;display:flex!important;flex-direction:row;gap:24px;overflow:auto;border-right:0;border-bottom:1px solid var(--line);padding:8px 15px}.member-sidebar[hidden]{display:none!important}.nav-section{min-width:130px;margin:0}.nav-section a{white-space:nowrap;padding:6px 8px}body.has-member-session main,body.has-member-session footer{margin-left:0}.header-tag{display:none}}
@media(max-width:700px){.play-main .layout{grid-template-columns:minmax(0,1fr)}.member-sidebar{max-height:180px}.header{justify-content:space-between}.auth-slot{margin-left:0}}

/* v1.2.5 private Discord allowlist */
.access-login-main{display:grid;place-items:center;min-height:calc(100vh - 165px)}
.access-login-card{border:1px solid var(--line);background:var(--panel);border-radius:18px;padding:clamp(26px,5vw,48px);width:min(100%,560px)}
.access-login-card h1{font-size:clamp(29px,5vw,46px);margin:10px 0}
.access-login-card>p{color:var(--muted)}
.access-login-card .auth-login{margin-top:16px;padding:13px 19px}
.access-caption{font-size:12px;margin-top:24px}
.access-layout{display:grid;grid-template-columns:minmax(0,440px) minmax(0,1fr);gap:20px;align-items:start}
.access-layout .panel{min-width:0}.access-layout form{display:grid;gap:10px;margin-top:16px}
.access-layout label{font-size:13px;color:var(--muted)}
.access-layout input{width:100%;padding:12px;color:var(--fg);background:#101c29;border:1px solid var(--line);border-radius:8px;font:inherit}
.access-row,.access-owner{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:12px 0;font-size:14px}
.access-row span,.access-owner strong{overflow-wrap:anywhere}.access-owner span{color:var(--mint)}
@media(max-width:900px){.access-layout{grid-template-columns:1fr}}

.puzzle-watch {
  margin: 28px 0;
}
.puzzle-watch [hidden] {
  display: none;
}
.puzzle-watch h2,
.puzzle-watch h3 {
  margin: 0;
}
.puzzle-watch progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 12px 0 18px;
  accent-color: var(--mint);
}
.puzzle-watch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.puzzle-watch select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}
.puzzle-watch-solution {
  margin-top: 18px;
}
.puzzle-watch-solution summary {
  cursor: pointer;
}
.puzzle-watch .chip[data-result="solved"] {
  color: var(--mint);
}
.puzzle-watch .chip[data-result="missed"] {
  color: #ffbf9c;
}

.learning-live { margin-bottom: 22px; }
.learning-live h2, .learning-live h3 { margin: 0; }
.learning-live [hidden] { display: none; }
.learning-live progress { width: 100%; height: 9px; accent-color: var(--mint); }
.search-live-table { overflow-x: auto; }
.search-live-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.search-live-table th, .search-live-table td { padding: 9px 12px 9px 0; text-align: left; white-space: nowrap; }
.search-live-table th { color: var(--muted); font-size: .86rem; }
.search-live-table td { border-top: 1px solid rgba(160,188,204,.15); }
.learning-arena-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(265px,100%),1fr)); gap: 16px; }
.learning-arena-grid .board { max-width: 420px; margin-inline: auto; }

.play-main [hidden] {
  display: none;
}
.play-main .side {
  min-width: 0;
}
.game-pgn .statusline {
  gap: 12px;
}
.pgn-text {
  display: block;
  width: 100%;
  margin-top: 12px;
  resize: vertical;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.55 ui-monospace, monospace;
}
.pgn-copy-status {
  margin: 8px 0 0;
}
.pgn-copy-status:empty,
#review-status:empty {
  display: none;
}
.game-review .actions {
  margin-top: 12px;
}
.game-review progress {
  width: 100%;
  accent-color: var(--mint);
}
.game-review h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}
.game-review ul {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.review-move {
  width: 100%;
  text-align: left;
}
.review-move small {
  display: block;
  color: var(--muted);
}
#review-final {
  margin-top: 12px;
}
.review-position {
  margin: 6px 4px 0;
}
