/* =====================================================================
   Chess Studio — styles
   ===================================================================== */
:root {
  --bg: #0e1014;
  --glass: rgba(30, 33, 41, .78);
  --glass-2: rgba(40, 44, 54, .8);
  --panel2: #262a34;
  --panel3: #2f3440;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eeebe6;
  --muted: #9aa1ae;
  --accent: #eab54d;
  --accent-2: #ffd27a;
  --accent-ink: #2a1d03;
  --sq-light: #eed8b4;
  --sq-dark: #a9784f;
  --board-tex: none;
  --frame: 12px;
  --bsize: max(300px, min(calc(100vh - 328px), calc(100vw - 650px), 840px));
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .03) inset;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 620px at 8% -8%, rgba(234, 181, 77, .13), transparent 62%),
    radial-gradient(900px 700px at 105% 105%, rgba(80, 140, 200, .12), transparent 60%),
    radial-gradient(700px 500px at 60% 40%, rgba(130, 90, 200, .05), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, .025) 0 25%, transparent 0 50%) 0 0 / 88px 88px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
}
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
svg { display: block; }
h1, h2, h3 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; }

/* ---------- piece images (CSS vars set by pieces.js) ---------- */
.wP { --img: var(--pc-wP); } .wN { --img: var(--pc-wN); } .wB { --img: var(--pc-wB); }
.wR { --img: var(--pc-wR); } .wQ { --img: var(--pc-wQ); } .wK { --img: var(--pc-wK); }
.bP { --img: var(--pc-bP); } .bN { --img: var(--pc-bN); } .bB { --img: var(--pc-bB); }
.bR { --img: var(--pc-bR); } .bQ { --img: var(--pc-bQ); } .bK { --img: var(--pc-bK); }
.piece, .piece-img, .drag-ghost { background-image: var(--img); background-size: 100% 100%; background-repeat: no-repeat; }
.piece-img { display: inline-block; width: 1em; height: 1em; flex: none; }
.piece-img.half { background: linear-gradient(90deg, #f3eee4 50%, #2d2723 50%); border-radius: 50%; width: .8em; height: .8em; border: 1px solid #0006; }

/* ---------- top bar ---------- */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 24px;
  background: rgba(14, 16, 20, .72); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; font-size: 19px; padding: 0; letter-spacing: .2px; }
.brand b { background: linear-gradient(180deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.brand-logo { font-size: 36px; filter: drop-shadow(0 0 12px rgba(234, 181, 77, .35)); }
.topnav { display: flex; gap: 2px; margin-left: 14px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.topnav button { background: none; border: 0; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 650; transition: .15s; }
.topnav button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.topnav button.on { color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 4px 14px rgba(234, 181, 77, .3); }
.gear { margin-left: auto; }

.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  background: var(--glass-2); border: 1px solid var(--line-2); cursor: pointer; color: var(--text); transition: .15s;
}
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn:hover { background: var(--panel3); border-color: rgba(234, 181, 77, .5); color: var(--accent-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--glass-2);
  cursor: pointer; font-weight: 650; transition: .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.btn:hover:not(:disabled) { background: var(--panel3); border-color: rgba(255, 255, 255, .22); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: #c8952f; box-shadow: 0 3px 0 #a3741d, 0 8px 20px rgba(234, 181, 77, .18); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe09a, #f2c25e); }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #a3741d; }
.btn.big { padding: 13px 16px; font-size: 15px; width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.sm.primary { box-shadow: 0 2px 0 #a3741d; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; }
.btn.on { border-color: var(--accent); color: var(--accent-2); }
.btn-row { display: flex !important; flex-direction: row !important; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---------- home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 46px 28px 64px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; margin-bottom: 48px; }
.hero h1 { font-size: 54px; line-height: 1.04; margin: 0 0 18px; letter-spacing: -1px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent-2), #f39a4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0; }
.hero-board-wrap { position: relative; perspective: 1500px; display: flex; justify-content: center; padding: 20px 0 30px; }
.hero-board {
  padding: 12px; border-radius: 16px; transform: rotateX(20deg) rotateY(-16deg) rotateZ(3deg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--sq-dark) 55%, #000), color-mix(in srgb, var(--sq-dark) 22%, #000));
  box-shadow: 30px 50px 80px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.hero-board:hover { transform: rotateX(8deg) rotateY(-6deg) rotateZ(1deg); }
#heroBoard { --bsize: 380px; width: 380px; height: 380px; }
.hero-tag {
  position: absolute; left: 0; bottom: 6px; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px;
  background: rgba(24, 27, 34, .92); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); backdrop-filter: blur(8px);
}
.hero-tag div { display: flex; flex-direction: column; }
.hero-tag b { color: #4fd6d0; }
.hero-tag span:not(.cbadge) { color: var(--muted); font-size: 12.5px; }
.mode-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1150px) { .mode-cards { grid-template-columns: repeat(2, 1fr); } }
.mode-card {
  position: relative; overflow: hidden; text-align: left; padding: 26px; border-radius: 20px; cursor: pointer;
  background: linear-gradient(180deg, rgba(44, 48, 59, .85), rgba(26, 29, 36, .85)); border: 1px solid var(--line-2);
  transition: transform .2s, border-color .2s, box-shadow .2s; display: flex; flex-direction: column;
}
.mode-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(234, 181, 77, .16), transparent 70%); transition: .3s; }
.mode-card:hover { transform: translateY(-5px); border-color: rgba(234, 181, 77, .65); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.mode-card:hover::after { transform: scale(1.4); }
.mc-icon { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; font-size: 56px; background: radial-gradient(circle at 30% 20%, #464d5c, #1f232b); margin-bottom: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 20px rgba(0, 0, 0, .4); }
.mode-card h3 { margin: 0 0 8px; font-size: 21px; }
.mode-card p { margin: 0 0 18px; color: var(--muted); flex: 1; }
.mc-cta { color: var(--accent-2); font-weight: 750; }
.legend { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.legend-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 7px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: #c9ccd3; font-weight: 650; font-size: 13px; }

/* ---------- workspace ---------- */
.workspace { display: flex; justify-content: center; align-items: stretch; gap: 20px; padding: 10px 20px 12px; }
.board-col { display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; gap: 12px; align-items: flex-start; }
.board-stack { display: flex; flex-direction: column; gap: 6px; }
.strip {
  height: 38px; width: calc(var(--bsize) + 2 * var(--frame)); display: flex; align-items: center; gap: 11px; padding: 0 12px 0 6px;
  border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 28px; background: var(--panel2); border: 1px solid var(--line-2); flex: none; overflow: hidden; }
.avatar.w { background: linear-gradient(180deg, #4c5260, #30343d); }
.bot-dot { width: 100%; height: 100%; display: grid; place-items: center; font-size: 27px; }
.pinfo { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.pname { font-weight: 750; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pname .elo { color: var(--muted); font-weight: 500; }
.captured { display: flex; align-items: center; height: 18px; font-size: 18px; }
.captured i { width: 18px; height: 18px; margin-right: -7px; }
.captured .adv { margin-left: 12px; color: var(--accent-2); font-size: 12px; font-weight: 800; }
.turn-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .08); transition: .3s; }
.turn-dot.on { background: var(--accent); box-shadow: 0 0 0 4px rgba(234, 181, 77, .2), 0 0 12px rgba(234, 181, 77, .6); }
.thinking { display: inline-flex; gap: 3px; margin-left: 4px; }
.thinking i, .typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.thinking i:nth-child(2), .typing i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3), .typing i:nth-child(3) { animation-delay: .3s; }
.typing { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 4px; }
.typing i { width: 6px; height: 6px; }
@keyframes blink { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- board frame ---------- */
.board-frame {
  padding: var(--frame); border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--sq-dark) 50%, #0c0b0a), color-mix(in srgb, var(--sq-dark) 20%, #070707));
  box-shadow: 0 26px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -2px 6px rgba(0, 0, 0, .4);
}

/* ---------- eval bar ---------- */
.eval-bar {
  width: 24px; height: calc(var(--bsize) + 2 * var(--frame)); margin-top: 44px; border-radius: 10px; overflow: hidden; position: relative;
  background: linear-gradient(90deg, #2b2b2e, #404044); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.eval-bar.flipped { justify-content: flex-start; }
.eval-fill { background: linear-gradient(90deg, #ffffff, #dcd8cf); height: 50%; transition: height .5s cubic-bezier(.2, .8, .2, 1); }
.eval-label { position: absolute; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 850; letter-spacing: -.3px; }
.eval-label.bottom { bottom: 6px; } .eval-label.top { top: 6px; }
.eval-label.on-white { color: #333; } .eval-label.on-black { color: #eee; }

/* ---------- board ---------- */
#board { width: var(--bsize); height: var(--bsize); }
.board { position: relative; user-select: none; -webkit-user-select: none; touch-action: none; }
.b-squares { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.b-texture { position: absolute; inset: 0; border-radius: 4px; pointer-events: none; background-image: var(--board-tex); background-size: cover; opacity: .55; mix-blend-mode: multiply; }
.b-pieces { position: absolute; inset: 0; pointer-events: none; }
.b-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.b-badges { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.sq { position: relative; }
.sq.light { background-color: var(--sq-light); }
.sq.dark { background-color: var(--sq-dark); }
.sq.last { background-image: linear-gradient(rgba(255, 213, 61, .45), rgba(255, 213, 61, .45)); }
.sq.sel { background-image: linear-gradient(rgba(255, 213, 61, .65), rgba(255, 213, 61, .65)); }
.sq.mark { background-image: linear-gradient(rgba(235, 90, 70, .75), rgba(235, 90, 70, .75)); }
.sq.check::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 40, 40, .95) 0%, rgba(230, 20, 20, .55) 32%, rgba(200, 0, 0, 0) 72%); }
.sq.dot::before { content: ''; position: absolute; inset: 37%; border-radius: 50%; background: rgba(20, 20, 20, .24); z-index: 1; }
.sq.ring::before { content: ''; position: absolute; inset: 0; background: radial-gradient(transparent 0 62%, rgba(20, 20, 20, .26) 63% 75%, transparent 76%); z-index: 1; }
.sq.hover { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .8); }
.coord { position: absolute; font-size: max(10px, calc(var(--bsize) * .019)); font-weight: 800; pointer-events: none; z-index: 1; opacity: .9; }
.coord.rank { top: 3px; left: 4px; }
.coord.file { bottom: 2px; right: 5px; }
.sq.light .coord { color: var(--sq-dark); }
.sq.dark .coord { color: var(--sq-light); }
.piece { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; will-change: transform; z-index: 2; }
.piece.moving { z-index: 3; }
.piece.anim { transition: transform .2s cubic-bezier(.25, .8, .35, 1); }
.piece.drag-src { opacity: .3; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -55%) scale(1.14); filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .55)); }
.board-badge { position: absolute; width: 5.4%; height: 5.4%; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
.board-badge .cbadge { width: 100%; height: 100%; font-size: calc(var(--bsize) * .026); box-shadow: 0 3px 8px rgba(0, 0, 0, .6), 0 0 0 2px #fff; }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1); } }
.b-promo { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); z-index: 6; border-radius: 4px; backdrop-filter: blur(1px); }
.promo-opt { position: absolute; width: 12.5%; height: 12.5%; background: radial-gradient(circle, #fff 30%, #ddd); cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.promo-opt .piece-img { width: 92%; height: 92%; transition: transform .12s; }
.promo-opt:hover { background: radial-gradient(circle, #fff 30%, #f3c96a); }
.promo-opt:hover .piece-img { transform: scale(1.08); }

/* ---------- classification badges ---------- */
.cbadge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; flex: none; font-weight: 900; font-size: 13px; letter-spacing: -1px; line-height: 1; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .3); }
.cbadge b { font-weight: 900; }
.cbadge svg { width: 62%; height: 62%; }
.cbadge.lg { width: 30px; height: 30px; font-size: 14px; }
.cbadge.md { width: 24px; height: 24px; font-size: 12px; }
.cbadge.sm { width: 20px; height: 20px; font-size: 10.5px; }
.cbadge.xs { width: 15px; height: 15px; font-size: 8px; letter-spacing: -.5px; box-shadow: none; }

/* ---------- under the board: coach / bot talk / editor ---------- */
.under {
  width: 100%; min-height: 84px; border-radius: var(--radius); padding: 10px 14px;
  background: var(--glass); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.coach { display: flex; gap: 14px; align-items: flex-start; }
.coach.enter { animation: coachIn .35s cubic-bezier(.2, .9, .3, 1); }
@keyframes coachIn { from { opacity: 0; transform: translateY(6px); } }
.coach-avatar {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 38px;
  background: linear-gradient(160deg, var(--accent-2), #c98a1d); box-shadow: 0 8px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.coach-avatar svg { width: 30px; height: 30px; fill: #2a1d03; }
.coach-bubble {
  --c: var(--accent); position: relative; flex: 1; min-width: 0; padding: 10px 14px 11px; border-radius: 4px 14px 14px 14px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line-2);
}
.coach-bubble::before { content: ''; position: absolute; left: -7px; top: 12px; width: 12px; height: 12px; background: inherit; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transform: rotate(45deg); background: #262931; }
.coach-bubble.rated { border-left: 3px solid var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(255, 255, 255, .03) 65%); }
.coach-bubble.rated::before { display: none; }
.c-brilliant { --c: #1baaa6; } .c-great { --c: #5b8bb4; } .c-best { --c: #7ea84b; } .c-excellent { --c: #8fb34a; }
.c-good { --c: #7d9765; } .c-book { --c: #a68a69; } .c-inaccuracy { --c: #eab83f; } .c-mistake { --c: #e5892c; }
.c-miss { --c: #ec6250; } .c-blunder { --c: #cc3330; } .c-forced { --c: #8a909a; }
.coach-head { display: flex; align-items: center; gap: 9px; margin-bottom: 3px; }
.ch-name { font-weight: 800; color: var(--accent-2); font-size: 13px; letter-spacing: .2px; }
.ch-title { font-weight: 850; font-size: 17px; }
.ch-eval { margin-left: auto; font-weight: 850; font-size: 12px; padding: 3px 9px; border-radius: 7px; background: #0e1014; color: var(--text); border: 1px solid var(--line-2); }
.coach-text { color: #dcd9d3; font-size: 14.5px; line-height: 1.42; }
.coach-text b { color: #fff; }
.coach-reply { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.coach-reply b { color: var(--text); }
.mini-av { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 19px; }
.coach-actions { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }

.edit-bar { display: flex; flex-direction: column; gap: 12px; justify-content: center; min-height: 78px; }
.eb-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent-2); margin-right: 4px; }
.eb-label svg { width: 16px; height: 16px; fill: currentColor; }
/* vertical piece palette beside the board while editing */
.pal-rail {
  width: 52px; height: calc(var(--bsize) + 2 * var(--frame)); margin-top: 44px; display: flex; flex-direction: column; gap: 6px;
  animation: coachIn .3s cubic-bezier(.2, .9, .3, 1);
}
.pal-group { display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); flex: 6; }
.pal { flex: 1; min-height: 0; width: 100%; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; transition: .12s; }
.pal .piece-img { width: auto; height: 90%; aspect-ratio: 1; max-width: 90%; }
.pal:hover { background: rgba(255, 255, 255, .08); }
.pal.on { background: rgba(234, 181, 77, .25); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(234, 181, 77, .3); }
.pal.erase { flex: 1; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); }
.pal.erase svg { width: 22px; height: 22px; fill: #e46a5a; }
.eb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eb-spacer { flex: 1; }
.tm { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .5); }
.tm.w { background: #f3efe8; } .tm.b { background: #1a1a1a; border-color: #666; }
.castle-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.castle-chips label { cursor: pointer; }
.castle-chips input { display: none; }
.castle-chips span { display: inline-block; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.castle-chips input:checked + span { background: rgba(234, 181, 77, .18); border-color: var(--accent); color: var(--accent-2); }
.castle-chips label.off { opacity: .35; cursor: not-allowed; }

/* ---------- side panel ---------- */
.side-panel { width: 390px; position: relative; flex: none; }
.panel-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent); }
.ph-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 34px; flex: none; background: linear-gradient(160deg, var(--accent-2), #c98a1d); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
.ph-icon svg { width: 24px; height: 24px; fill: #2a1d03; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.head-btn { margin-left: auto; }
.panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 12px; overflow-y: auto; }
.panel-body > div:not(.hidden):not(.status) { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.panel-body > *, .game-section > * { flex-shrink: 0; }
.panel-body > .moves, .game-section > .moves { flex: 1 0 150px; }
.game-section { flex: 1 0 auto !important; }
.game-section { flex: 1; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-head > span { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.sec-head > span svg { width: 15px; height: 15px; fill: var(--accent); }

.card { background: rgba(255, 255, 255, .035); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bot-card { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.bot-avatar { width: 76px; height: 76px; border-radius: 18px; display: grid; place-items: center; font-size: 62px; flex: none; box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .22), 0 8px 18px rgba(0, 0, 0, .45); transition: background .3s; }
.bot-name { font-size: 21px; font-weight: 850; }
.bot-elo { color: var(--accent-2); font-weight: 750; }
.bot-desc { color: var(--muted); font-size: 13px; }
.lbl { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; display: flex; justify-content: space-between; align-items: center; }
.elo-val { color: var(--accent-2); font-size: 16px; letter-spacing: 0; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--accent) var(--fill, 30%), #3a404c var(--fill, 30%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: pointer; }
.elo-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -4px; }
.seg { display: flex; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 4px; }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 650; color: var(--muted); white-space: nowrap; }
.seg button .piece-img { font-size: 22px; }
.seg button.on { background: var(--panel3); color: var(--text); box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 10px rgba(0, 0, 0, .3); }
.seg.small { padding: 3px; }
.seg.small button { padding: 6px 10px; font-size: 13px; }

.status { padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.status:empty { display: none; }
.status b { color: var(--text); }

/* toggles */
.toggles { display: flex !important; flex-direction: row !important; gap: 14px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; font-size: 12.5px; color: #cfccc6; }
.switch input { display: none; }
.switch i { width: 32px; height: 18px; border-radius: 99px; background: #3a404c; position: relative; transition: .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #cfd3da; transition: .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { left: 17px; background: #fff; }

/* engine lines */
.lines { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; }
.line { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-bottom: 1px solid rgba(255, 255, 255, .04); cursor: pointer; font-size: 13px; transition: background .12s; }
.line:hover { background: rgba(255, 255, 255, .05); }
.lscore { flex: none; min-width: 54px; text-align: center; font-weight: 850; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.lscore.w { background: #f2efe9; color: #222; }
.lscore.b { background: #3a3f49; color: #f2f2f2; }
.pv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d8d5cf; }
.pvn { color: var(--muted); margin-right: 3px; }
.pvm { font-weight: 650; }
.engine-meta { padding: 5px 10px; font-size: 11px; color: var(--muted); }
.line-msg { padding: 12px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }

/* moves list */
.moves { flex: 1; min-height: 120px; overflow-y: auto; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 12px; padding: 4px 0; position: relative; }
.moves .empty { padding: 18px; color: var(--muted); text-align: center; }
.mrow { display: grid; grid-template-columns: 40px 1fr 1fr; align-items: center; padding: 1px 6px; }
.mrow:nth-child(even) { background: rgba(255, 255, 255, .025); }
.mnum { color: var(--muted); font-size: 12px; padding-left: 4px; }
.mv { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; margin: 1px 3px; border-radius: 7px; cursor: pointer; font-weight: 650; font-size: 13.5px; transition: background .1s; }
.mv:hover { background: rgba(255, 255, 255, .07); }
.mv.cur { background: rgba(234, 181, 77, .16); box-shadow: inset 0 0 0 1px rgba(234, 181, 77, .55); }
.mv.blank { cursor: default; color: var(--muted); }
.mv.blank:hover { background: none; }
.mv.c-brilliant { color: #4fd6d0; } .mv.c-great { color: #8ab8de; } .mv.c-blunder { color: #ff7a70; }
.mv.c-mistake { color: #f4a85a; } .mv.c-inaccuracy { color: #f2cb6a; } .mv.c-miss { color: #ff8b7c; }

.nav { display: flex !important; flex-direction: row !important; gap: 6px; }
.nav .icon-btn { flex: 1; height: 36px; }

/* review / summary */
.review-progress { background: rgba(255, 255, 255, .035); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.rp-head { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 8px; }
.rp-bar { height: 6px; border-radius: 99px; background: #3a404c; overflow: hidden; }
.rp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.summary { background: rgba(255, 255, 255, .035); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.acc-box { border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.acc-box span { font-size: 12px; font-weight: 750; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-box b { font-size: 28px; line-height: 1.1; }
.acc-box small { font-size: 11px; opacity: .7; }
.acc-box.w { background: linear-gradient(180deg, #fbf9f5, #e7e2d9); color: #222; }
.acc-box.b { background: linear-gradient(180deg, #23262d, #121419); color: #f2f2f2; border: 1px solid var(--line-2); }
.sum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sum-table td { padding: 3px 4px; }
.sum-table .sv { width: 40px; text-align: center; font-weight: 850; }
.sum-table .sl { display: flex; align-items: center; gap: 8px; font-weight: 750; justify-content: center; }
.live-acc { padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.live-acc b { color: var(--accent-2); font-size: 15px; }

/* import */
.import-sec { padding-top: 4px; border-top: 1px solid var(--line); }
textarea {
  width: 100%; min-height: 54px; height: 54px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--text);
  font: 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; outline: none; resize: vertical; transition: height .2s, border-color .2s;
}
textarea:focus { border-color: var(--accent); height: 120px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(6, 7, 10, .62); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; animation: fade .2s; }
.modal-card { width: min(430px, 92vw); max-height: 90vh; overflow: auto; background: #1d2027; border: 1px solid var(--line-2); border-radius: 22px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); animation: rise .28s cubic-bezier(.2, 1, .3, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.go { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.go h2 { margin: 0; font-size: 30px; }
.go.win h2 { background: linear-gradient(90deg, var(--accent-2), #f39a4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.go-icon { font-size: 80px; margin: -6px auto 0; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .6)); }
.muted { color: var(--muted); margin: 0 0 8px; }
.center { text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

/* ---------- settings drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(6, 7, 10, 0); transition: background .2s; }
.drawer.open { background: rgba(6, 7, 10, .35); }
.drawer-card { position: absolute; top: 0; right: 0; bottom: 0; width: min(410px, 94vw); background: #1b1e25; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .9, .3, 1); box-shadow: -20px 0 60px rgba(0, 0, 0, .6); }
.drawer.open .drawer-card { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { padding: 16px 18px 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.drawer-body h3 { margin: 10px 0 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.preview-board { --bsize: 240px; width: 240px; height: 240px; margin: 4px auto 6px; border-radius: 6px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--sq-dark) 40%, #000), 0 18px 40px rgba(0, 0, 0, .6); }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-sw { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 4px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 11.5px; font-weight: 650; }
.theme-sw .sw { width: 40px; height: 40px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.theme-sw.on, .preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(234, 181, 77, .35); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-weight: 650; font-size: 12.5px; text-align: left; }
.preset .dots { display: flex; flex: none; }
.preset .dots i { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px #1b1e25, inset 0 -3px 5px rgba(0, 0, 0, .3); }
.preset .dots i + i { margin-left: -6px; }
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.color-row label { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 12.5px; font-weight: 650; }
input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .4); border-radius: 6px; }
.row-lbl { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 650; font-size: 13px; }
select { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #2a2f39; border: 1px solid rgba(255, 255, 255, .16); color: var(--text); padding: 11px 18px; border-radius: 12px; font-weight: 650; box-shadow: 0 12px 30px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #3a404c; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- clocks ---------- */
.clock {
  margin-left: auto; min-width: 74px; padding: 5px 10px; border-radius: 9px; text-align: right;
  font: 800 18px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px;
  background: rgba(0, 0, 0, .35); color: #b9bec8; border: 1px solid var(--line-2); transition: .2s;
}
.clock.run { background: #f1eee8; color: #1b1d22; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.clock.low { color: #ff7a70; }
.clock.run.low { background: #e5483d; color: #fff; border-color: #ff8c84; animation: pulseLow 1s infinite; }
@keyframes pulseLow { 50% { box-shadow: 0 0 0 5px rgba(229, 72, 61, .3); } }
.clock + .turn-dot { margin-left: 4px; }

/* premove & hint squares */
.sq.pre { background-image: linear-gradient(rgba(70, 140, 230, .55), rgba(70, 140, 230, .55)) !important; }
.sq.hint::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 4px #5fd16a, inset 0 0 22px rgba(95, 209, 106, .8); animation: hintGlow 1.2s ease-in-out infinite; z-index: 1; }
@keyframes hintGlow { 50% { box-shadow: inset 0 0 0 4px #5fd16a, inset 0 0 6px rgba(95, 209, 106, .3); } }

/* ---------- opening name & explorer ---------- */
.opening { display: flex; flex-direction: column; gap: 7px; padding: 9px 11px; border-radius: 12px; background: rgba(166, 138, 105, .1); border: 1px solid rgba(166, 138, 105, .35); }
.op-name { display: flex; align-items: center; gap: 8px; font-weight: 750; color: #e6cfae; font-size: 13.5px; }
.op-ic { width: 20px; height: 20px; border-radius: 6px; background: #a68a69; display: grid; place-items: center; flex: none; }
.op-ic svg { width: 13px; height: 13px; }
.op-book { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.op-book > span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-right: 3px; }
.op-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); cursor: pointer; font-weight: 750; font-size: 12.5px; }
.op-chip small { color: var(--muted); font-weight: 600; font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-chip:hover { border-color: var(--accent); background: rgba(234, 181, 77, .1); }

/* ---------- evaluation graph ---------- */
.graph { position: relative; height: 74px; flex: none; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid var(--line-2); }
.graph-svg { width: 100%; height: 100%; display: block; }
.graph-dots { position: absolute; inset: 0; pointer-events: none; }
.graph-dots i { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 1.5px #111; }
.graph:hover { border-color: rgba(234, 181, 77, .6); }

/* ---------- variations ---------- */
.moves .var { padding: 3px 10px 5px 46px; font-size: 12.5px; color: #b8bcc5; background: rgba(255, 255, 255, .02); border-left: 2px solid rgba(234, 181, 77, .35); margin: 1px 0; line-height: 1.9; }
.moves .var .mv { font-size: 12.5px; padding: 2px 5px; margin: 0 1px; font-weight: 600; }
.vnum { color: var(--muted); font-weight: 600; margin-right: 2px; }
.vparen { color: var(--muted); }
.vparen .mv { font-size: 12px; }
.var-tools { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(234, 181, 77, .08); border: 1px dashed rgba(234, 181, 77, .4); }
.var-tools.hidden { display: none !important; }
.var-tools > span { font-size: 12px; font-weight: 800; color: var(--accent-2); margin-right: auto; }

/* ---------- setup extras ---------- */
.style-desc { font-size: 12.5px; color: var(--muted); margin-top: -4px; min-height: 18px; }
.tc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.tc-grid button { padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .22); cursor: pointer; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tc-grid button.on { background: rgba(234, 181, 77, .18); border-color: var(--accent); color: var(--accent-2); }
.retry-btn { margin-top: 8px; border-color: rgba(229, 137, 44, .6); }
.retry-btn:hover:not(:disabled) { background: rgba(229, 137, 44, .15) !important; }
.btn.danger { background: #b83a30; border-color: #e05a4f; color: #fff; }

/* ---------- puzzles ---------- */
.drill-card { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line-2); }
.dc-top { display: flex; align-items: baseline; gap: 6px; }
.dc-top b { font-size: 18px; }
.dc-top span { color: var(--muted); }
.dc-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cfccc6; }
.dc-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.dc-stats b { color: var(--accent-2); font-size: 15px; }
.good-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 850; color: #9cd067; margin-right: 4px; }
.small-note { font-size: 12px; }
.empty-card { padding: 22px; text-align: center; color: var(--muted); border-radius: 14px; border: 1px dashed var(--line-2); }

/* ---------- library ---------- */
.library { max-width: 1000px; margin: 0 auto; padding: 34px 24px 60px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.lib-head h1 { margin: 0 0 4px; font-size: 32px; }
.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line-2); transition: border-color .15s, transform .15s; }
.lib-card:hover { border-color: rgba(234, 181, 77, .45); transform: translateY(-1px); }
.lc-res { width: 64px; flex: none; text-align: center; padding: 8px 0; border-radius: 10px; font-weight: 850; font-size: 13px; background: #3a3f49; color: #ddd; }
.lc-res.win { background: linear-gradient(180deg, #8bc34a, #5f9a2c); color: #fff; }
.lc-res.loss { background: linear-gradient(180deg, #e0574c, #a8322a); color: #fff; }
.lc-res.draw { background: linear-gradient(180deg, #9aa1ae, #6c727d); color: #fff; }
.lc-main { flex: 1; min-width: 0; }
.lc-title { display: flex; align-items: center; gap: 6px; font-weight: 750; font-size: 15px; flex-wrap: wrap; }
.lc-title .vs { color: var(--muted); font-weight: 500; }
.lc-tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: rgba(234, 181, 77, .15); color: var(--accent-2); }
.lc-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-actions { display: flex; gap: 6px; flex: none; }

/* ---------- settings: features ---------- */
.fx-list { display: flex; flex-direction: column; gap: 6px; }
.fx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; }
.fx-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.fx-row b { font-size: 13px; }
.fx-row small { color: var(--muted); font-size: 11.5px; }
.fx-row:hover { border-color: rgba(255, 255, 255, .25); }
.hint-note { margin: -4px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  :root { --bsize: min(calc(100vw - 110px), 620px); }
  .workspace { flex-direction: column; align-items: center; }
  .side-panel { width: min(100%, calc(var(--bsize) + 60px)); }
  .panel-inner { position: static; }
  .panel-body { overflow: visible; }
  .mode-cards { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin: 0 auto; }
  #heroBoard { --bsize: 300px; width: 300px; height: 300px; }
  .topnav button { padding: 8px 9px; font-size: 13px; }
}

/* phone / compact layout (automatic on small screens, or forced in Settings) */
body.mobile { --frame: 6px; --bsize: min(calc(100vw - 54px), calc(100vh - 250px), 640px); }
body.mobile .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
body.mobile .brand span:last-child { display: none; }
body.mobile .brand-logo { font-size: 30px; }
body.mobile .topnav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
body.mobile .topnav::-webkit-scrollbar { display: none; }
body.mobile .topnav button { flex: 1; padding: 7px 8px; font-size: 12.5px; white-space: nowrap; }
body.mobile .workspace { flex-direction: column; align-items: center; padding: 8px 8px 20px; gap: 12px; }
body.mobile .board-col { width: 100%; align-items: center; }
body.mobile .board-row { gap: 6px; flex-wrap: wrap; justify-content: center; }
body.mobile .eval-bar { width: 12px; margin-top: 44px; border-radius: 6px; }
body.mobile .eval-label { display: none; }
body.mobile .strip { height: 38px; }
body.mobile .avatar { width: 28px; height: 28px; font-size: 22px; }
body.mobile .clock { font-size: 16px; min-width: 62px; padding: 4px 7px; }
body.mobile .pal-rail { order: 5; width: 100%; height: 46px; margin-top: 0; flex-direction: row; }
body.mobile .pal-group { flex-direction: row; }
body.mobile .pal { height: 100%; }
body.mobile .pal .piece-img { height: 34px; }
body.mobile .under { padding: 10px; min-height: 0; }
body.mobile .coach-avatar { width: 40px; height: 40px; font-size: 32px; border-radius: 12px; }
body.mobile .coach-avatar svg { width: 22px; height: 22px; }
body.mobile .coach-text { font-size: 14px; }
body.mobile .side-panel { width: 100%; }
body.mobile .panel-inner { position: static; }
body.mobile .panel-body { overflow: visible; }
body.mobile .moves { max-height: 260px; }
body.mobile .tc-grid { grid-template-columns: repeat(3, 1fr); }
body.mobile .home { padding: 24px 14px 40px; }
body.mobile .hero { grid-template-columns: 1fr; text-align: center; gap: 10px; }
body.mobile .hero h1 { font-size: 34px; }
body.mobile .hero p { margin: 0 auto; font-size: 15px; }
body.mobile #heroBoard { --bsize: min(280px, calc(100vw - 80px)); width: var(--bsize); height: var(--bsize); }
body.mobile .hero-tag { position: static; margin-top: 10px; }
body.mobile .hero-board-wrap { flex-direction: column; align-items: center; }
body.mobile .mode-cards { grid-template-columns: 1fr; }
body.mobile .lib-card { flex-wrap: wrap; }
body.mobile .lc-actions { width: 100%; }
body.mobile .lc-actions .btn { flex: 1; }
body.mobile .drawer-card { width: 100vw; }
body.mobile .edit-bar .eb-row { gap: 6px; }

/* ---------- analysis tabs & game log ---------- */
.ptabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.ptabs button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px; }
.ptabs button svg { width: 15px; height: 15px; fill: currentColor; }
.ptabs button:hover { color: var(--text); }
.ptabs button.on { color: var(--accent-2); border-bottom-color: var(--accent); }
.pane { flex: 1 0 auto; }
.pane > * { flex-shrink: 0; }
.pane > .moves { flex: 1 0 150px; }
.pane > .status { display: block; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log-head > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.log-head b { font-size: 15px; }
.log-head .muted { margin: 0; font-size: 12px; }
.log-rating { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 10px; background: rgba(234, 181, 77, .1); border: 1px solid rgba(234, 181, 77, .35); }
.log-rating b { color: var(--accent-2); font-size: 16px; }
.log-search { width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-size: 13px; outline: none; }
.log-search:focus { border-color: var(--accent); }
.log-list { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; text-align: left; transition: .12s; }
.log-row:hover { border-color: rgba(234, 181, 77, .5); background: rgba(255, 255, 255, .06); }
.log-row.on { border-color: var(--accent); background: rgba(234, 181, 77, .1); }
.log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.log-title { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; flex-wrap: wrap; }
.log-title .elo { color: var(--accent-2); font-weight: 600; font-size: 12px; }
.log-title .vs { color: var(--muted); font-weight: 500; }
.log-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-res.sm { width: 28px; padding: 5px 0; font-size: 12px; border-radius: 8px; }
.lc-title .elo { color: var(--accent-2); font-weight: 600; font-size: 13px; }

/* ---------- rating ---------- */
.rdelta { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 850; background: rgba(255, 255, 255, .08); color: var(--muted); }
.rdelta.up { background: rgba(126, 168, 75, .2); color: #9cd067; }
.rdelta.down { background: rgba(204, 51, 48, .2); color: #ff7a70; }
.my-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 11px; border-radius: 11px; background: rgba(234, 181, 77, .08); border: 1px solid rgba(234, 181, 77, .3); font-size: 12.5px; color: var(--muted); }
.my-rating b { color: var(--accent-2); font-size: 17px; }
.my-rating small { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); }
.my-rating .stakes { width: 100%; font-size: 12px; }
.my-rating .stakes .rdelta { margin-left: 2px; }
.go-rating { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 4px; padding: 8px 14px; border-radius: 12px; background: rgba(234, 181, 77, .1); border: 1px solid rgba(234, 181, 77, .35); color: var(--muted); }
.go-rating b { color: var(--text); font-size: 18px; }
.go-rating .arrow { color: var(--accent); }
.lib-rating { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; padding: 8px 12px; border-radius: 12px; background: rgba(234, 181, 77, .08); border: 1px solid rgba(234, 181, 77, .3); color: var(--muted); }
.lib-rating b { color: var(--accent-2); font-size: 24px; }
.lib-rating small { font-size: 12px; }
.spark { display: block; }

/* ---------- piece-look gallery ---------- */
.look-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.look-cats button { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.look-cats button.on { background: rgba(234, 181, 77, .18); border-color: var(--accent); color: var(--accent-2); }
.look-grid { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 420px; overflow-x: hidden; overflow-y: auto; padding: 2px; }
.look { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; transition: .12s; }
.look:hover { border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.look.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(234, 181, 77, .35); }
.look-prev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-radius: 7px; overflow: hidden; }
.look-prev img { width: 100%; min-width: 0; aspect-ratio: 1; display: block; padding: 2px; }
.look-prev img:nth-child(1), .look-prev img:nth-child(4) { background: var(--sq-light); }
.look-prev img:nth-child(2), .look-prev img:nth-child(3) { background: var(--sq-dark); }
.look-name { font-size: 11.5px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-body > * { flex-shrink: 0; }

/* ---- Practice → Learn the move ratings ---- */
.panel-body > .prac-seg { flex-direction: row !important; }
.prac-seg button svg { width: 15px; height: 15px; }
.learn { gap: 10px; }
.learn-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.learn-top b { display: block; font-size: 15px; }
.learn-top small { color: var(--muted); font-size: 12px; }
.learn-count { font-weight: 850; color: var(--accent-2); font-size: 14px; white-space: nowrap; }
.learn-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.learn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #9cd067); border-radius: 99px; transition: width .4s; }
.learn-list { display: flex; flex-direction: column; gap: 5px; }
.learn-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 11px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.learn-row .lr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.learn-row .lr-text b { font-size: 13.5px; }
.learn-row .lr-text small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.learn-row .btn { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.btn.done { border-color: rgba(156, 208, 103, .5); color: #9cd067; background: rgba(156, 208, 103, .08); }
.btn.done svg { width: 13px; height: 13px; }
.learn-cur { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 13px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.learn-cur small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.learn-cur b { font-size: 17px; }
.learn-dots { display: flex; gap: 5px; justify-content: center; padding: 4px 0; }
.learn-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.learn-dots i.past { background: rgba(234, 181, 77, .5); }
.learn-dots i.now { background: var(--accent); box-shadow: 0 0 0 3px rgba(234, 181, 77, .25); }
.learn .row-btns { display: flex; gap: 8px; }
.learn .row-btns .btn { flex: 1; }
.learn-ask { padding: 11px 13px; border-radius: 12px; background: rgba(234, 181, 77, .08); border: 1px solid rgba(234, 181, 77, .3); line-height: 1.45; font-size: 14px; }
.learn-tries { color: var(--muted); font-size: 12.5px; text-align: center; }
.learn-win { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 14px; border-radius: 16px;
  background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--c) 35%, transparent), rgba(255, 255, 255, .03) 70%); border: 1px solid var(--c);
  animation: learnPop .5s cubic-bezier(.2, 1.6, .4, 1); }
.learn-win .cbadge { transform: scale(1.6); margin: 8px 0 6px; }
.learn-win > b { font-size: 22px; }
.learn-win small { color: var(--muted); }
@keyframes learnPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.learn-step { display: inline-block; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .08); font-size: 11px; font-weight: 800; color: var(--muted); margin-right: 3px; }

/* ---- Analysis: every move rated ---- */
.move-map { margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; max-height: 168px; overflow-y: auto; }
.mm-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.mm-head svg { width: 14px; height: 14px; }
.mm-wait { font-size: 12.5px; color: var(--muted); }
.mm-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.mm-cls { display: inline-flex; align-items: center; gap: 5px; width: 98px; flex: none; padding-top: 2px; }
.mm-moves { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mm-chip { padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--text); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.mm-chip:hover { background: rgba(234, 181, 77, .18); border-color: var(--accent); }
.mm-more { color: var(--muted); font-size: 11.5px; }
.mm-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 2px; }

/* ---- Look studio ---- */
.studio { display: flex; flex-direction: column; gap: 8px; }
.st-label { font-size: 12px; font-weight: 800; color: var(--accent-2); }
.st-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.st-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 4px 6px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 11px; font-weight: 700; color: var(--muted); font-family: inherit; min-width: 0; }
.st-tile:hover { border-color: rgba(234, 181, 77, .6); color: var(--text); }
.st-tile.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px rgba(234, 181, 77, .35); background: rgba(234, 181, 77, .08); }
.st-prev { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 7px; overflow: hidden; }
.st-prev img { width: 100%; aspect-ratio: 1; display: block; padding: 1px; min-width: 0; }
.st-prev img:nth-child(1) { background: var(--sq-light); }
.st-prev img:nth-child(2) { background: var(--sq-dark); }
.st-colors { display: flex; flex-direction: column; gap: 7px; }
.st-crow { display: flex; align-items: center; gap: 8px; }
.st-side { display: flex; align-items: center; gap: 4px; width: 62px; flex: none; font-size: 12px; font-weight: 700; }
.st-side img { width: 22px; height: 22px; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .18); cursor: pointer; padding: 0; position: relative; }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(234, 181, 77, .45); }
.swatch.pick { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.swatch.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.st-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.st-actions .btn svg { width: 14px; height: 14px; }
.look { position: relative; }
.look-del { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; z-index: 2; }
.look.mine:hover .look-del { display: flex; }
.look.mine { border-color: rgba(234, 181, 77, .35); }

/* ---- BRILLIANT!! shout ---- */
.board-frame { position: relative; }
.brill-yell { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: flex; align-items: center; justify-content: center; border-radius: 16px;
  background: radial-gradient(circle, rgba(27, 170, 166, .45), rgba(27, 170, 166, 0) 65%); animation: brillBg 2s ease-out forwards; }
.brill-yell span { font-size: calc(var(--bsize) * .13); font-weight: 950; letter-spacing: .02em; color: #fff; font-style: italic;
  text-shadow: 0 0 18px #1baaa6, 0 0 40px #1baaa6, 0 4px 0 #0d6e6b, 0 8px 18px rgba(0, 0, 0, .6);
  -webkit-text-stroke: 2px #0d6e6b; animation: brillPop 2s cubic-bezier(.2, 1.7, .4, 1) forwards; white-space: nowrap; }
@keyframes brillPop {
  0% { transform: scale(.2) rotate(-12deg); opacity: 0; }
  18% { transform: scale(1.15) rotate(-4deg); opacity: 1; }
  28% { transform: scale(1) rotate(-4deg); }
  38%, 46% { transform: scale(1.06) rotate(-2deg); }
  80% { transform: scale(1) rotate(-4deg); opacity: 1; }
  100% { transform: scale(1.3) rotate(-4deg); opacity: 0; }
}
@keyframes brillBg { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: .8; } 100% { opacity: 0; } }
.board-frame.shake { animation: brillShake .55s cubic-bezier(.36, .07, .19, .97); }
@keyframes brillShake {
  10%, 90% { transform: translate(-2px, 1px) rotate(-.4deg); }
  20%, 80% { transform: translate(4px, -2px) rotate(.6deg); }
  30%, 50%, 70% { transform: translate(-6px, 2px) rotate(-.8deg); }
  40%, 60% { transform: translate(6px, -1px) rotate(.8deg); }
}

/* ---- Brilliant shout settings ---- */
.brill-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid rgba(27, 170, 166, .45); background: rgba(27, 170, 166, .07); }
.bb-status { font-size: 13px; }
.bb-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.rec { background: #cc3330; border-color: #cc3330; color: #fff; animation: recPulse 1s infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 5px rgba(204, 51, 48, .3); } }
.row-lbl.dim { opacity: .5; }
.brill-box select { max-width: 100%; }
.brill-box .row-lbl { flex-direction: column; align-items: stretch; gap: 5px; }
.brill-box select { width: 100%; min-width: 0; }

/* ---- chess.com-style move badge entrance ---- */
.b-tints { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sq-tint { position: absolute; width: 12.5%; height: 12.5%; opacity: .5; }
.sq-tint.fx { animation: tintIn 1.05s ease-out; }
@keyframes tintIn { 0% { opacity: 0; } 25% { opacity: .85; } 60% { opacity: .75; } 100% { opacity: .5; } }
.board-badge.fx { animation: none; z-index: 5; }
.badge-label { position: absolute; transform: translateY(-50%); padding: .5% 1.6%; border-radius: 99px; color: #fff; font-weight: 900; white-space: nowrap;
  font-size: calc(var(--bsize) * .032); box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 0 2px rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  opacity: 0; animation: labelIn 2.6s ease forwards; animation-delay: .1s; z-index: 6; }
@keyframes labelIn {
  0%, 30% { opacity: 0; transform: translate(-12px, -50%) scale(.7); }
  42% { opacity: 1; transform: translate(0, -50%) scale(1.06); }
  48%, 85% { opacity: 1; transform: translate(0, -50%) scale(1); }
  100% { opacity: 0; transform: translate(0, -50%) scale(1); }
}
.badge-label.left { animation-name: labelInL; }
@keyframes labelInL {
  0%, 30% { opacity: 0; transform: translate(12px, -50%) scale(.7); }
  42% { opacity: 1; transform: translate(0, -50%) scale(1.06); }
  48%, 85% { opacity: 1; transform: translate(0, -50%) scale(1); }
  100% { opacity: 0; transform: translate(0, -50%) scale(1); }
}

/* ---------- Challenges ---------- */
.ch-type { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); }
.ch-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.ch-tabs button { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line-2); cursor: pointer; }
.ch-tabs button.on { color: #fff; background: var(--accent); border-color: transparent; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 290px; overflow-y: auto; padding: 2px 4px 2px 2px; }
.ch-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 46px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); border-bottom: 3px solid var(--c); color: var(--text); transition: transform .12s, background .12s; }
.ch-tile:hover { transform: translateY(-2px); background: rgba(255,255,255,.08); }
.ch-tile b { font-size: 14px; line-height: 1; }
.ch-tile small { font-size: 10px; color: var(--muted); font-weight: 700; }
.ch-tile.done { background: color-mix(in srgb, var(--c) 22%, transparent); }
.ch-tile.done small { color: #ffd45e; }
.ch-tile.on { outline: 2px solid #fff; outline-offset: 1px; }
/* ---------- Admin (game shout) ---------- */
.bb-code { gap: 8px; }
.bb-code input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font: inherit; font-size: 13px; }
.bb-admin { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(234,181,77,.08); border: 1px solid rgba(234,181,77,.35); }
.ch-tabs + .ch-tabs { margin-top: 0; }
.ch-levels button.on { background: var(--c, var(--accent)); }
.ch-tabs button small { opacity: .75; font-weight: 600; margin-left: 2px; }
.dc-top .ch-type + .ch-type { margin-left: 6px; }
.dc-top b { margin-right: auto; }
.dc-top .ch-type { color: #fff; align-self: center; }
.anim-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.anim-pick { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 5px; border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line-2); opacity: .7; }
.anim-pick.on { color: #fff; opacity: 1; border-color: var(--c); background: color-mix(in srgb, var(--c) 28%, transparent); }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* ---------- Online ---------- */
.on-name { display: flex; gap: 8px; }
.on-name input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font: inherit; }
.on-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(63,111,176,.14); border: 1px solid rgba(63,111,176,.45); }
.on-wait small { width: 100%; color: var(--muted); }
.on-warn { padding: 10px 12px; border-radius: 10px; background: rgba(217,83,79,.12); border: 1px solid rgba(217,83,79,.4); font-size: 13px; }
.ph-icon svg, .coach-avatar svg, .btn svg { fill: currentColor; }
.mode-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* nickname (one per device) */
.nick-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; margin-left: auto; margin-right: 8px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nick-chip:hover { border-color: rgba(234, 181, 77, .6); }
.nick-chip.empty { color: var(--accent); border-color: rgba(234, 181, 77, .5); }
.nick-chip b { overflow: hidden; text-overflow: ellipsis; }
.nick-ask { text-align: center; }
.nick-ask p { margin: 6px 0 14px; }
.nick-ask input { width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 16px; text-align: center; }
.nick-ask input:focus { outline: none; border-color: var(--accent); }
.nick-err { min-height: 18px; margin: 6px 0 2px; color: #f07a6a; font-size: 13px; }
.on-name.locked { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); }
.muted.small { font-size: 12px; margin-top: 4px; }
/* the 100 extra piece shapes: a scrolling grid */
.st-more { max-height: 320px; overflow-y: auto; padding: 2px 4px 2px 2px; }
.on-name.locked { align-items: center; justify-content: space-between; }
.adm-players { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; margin: 4px 0 8px; }
.adm-player { display: flex; align-items: center; gap: 8px; }
.adm-player input { flex: 1; min-width: 0; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; }
