/* Vladuschess — own dark theme, board-centric like the classic chess sites. */

:root {
  --bg: #302e2b;
  --bg-2: #272522;
  --panel: #262522;
  --panel-2: #21201d;
  --panel-3: #3a3936;
  --panel-4: #454440;
  --line: #3d3b38;
  --text: #e9e9e7;
  --muted: #a0a09c;
  --muted-2: #7d7b77;
  --green: #81b64c;
  --green-hi: #a3d160;
  --green-dark: #6a9a3d;
  --sq-light: #eeeed2;
  --sq-dark: #769656;
  --hl: #f6f669;
  --danger: #ca3431;
  --danger-hi: #e04b48;
  --info: #4a90d9;
  --gold: #d8a63c;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: scroll;
}

a { color: var(--green-hi); text-decoration: none; }
button { font: inherit; color: inherit; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  padding: 0 18px;
  background: var(--panel-2);
  border-bottom: 1px solid #1a1918;
}
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand svg { width: 28px; height: 28px; display: block; }
.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: #fff;
}
.brand-name em { color: var(--green); font-style: normal; }

.nav { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--panel-3); color: var(--text); }
.nav a.active { background: var(--panel-3); color: #fff; }

.me {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; font-size: 14px;
}
.me-name { font-weight: 600; color: var(--text); }
.me-rating {
  background: var(--panel-3);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  color: var(--green-hi);
}
.conn {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
}
.conn.on { background: var(--green); box-shadow: 0 0 6px rgba(129,182,76,.8); }
.conn.off { background: var(--danger); }

/* ---------------------------------------------------------------- layout */
main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 20px;
  align-items: start;
}
.cols.wide-right { grid-template-columns: 300px minmax(0, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: -0.1px;
}
.card h2 .count { color: var(--muted-2); font-weight: 600; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--panel-3);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s, transform .06s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  color: #14210a;
  box-shadow: 0 3px 0 var(--green-dark);
}
.btn-primary:hover { background: var(--green-hi); }
.btn-primary:active { box-shadow: 0 1px 0 var(--green-dark); }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 3px 0 #8f2422; }
.btn-danger:hover { background: var(--danger-hi); }

.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--panel-3); }

.btn-lg { padding: 14px 20px; font-size: 16px; width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 13px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- pickers */
.tc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.tc {
  padding: 11px 6px;
  border-radius: var(--radius);
  background: var(--panel-3);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background .12s, border-color .12s;
}
.tc:hover { background: var(--panel-4); }
.tc.sel { border-color: var(--green); background: #33421f; }
.tc .t { font-weight: 700; font-size: 15px; }
.tc .d { font-size: 11px; color: var(--muted); margin-top: 1px; }

.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--panel-3);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.seg button.sel { border-color: var(--green); background: #33421f; }
.seg button:hover { background: var(--panel-4); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.input:focus { outline: none; border-color: var(--green); }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.row-item .grow { flex: 1 1 auto; min-width: 0; }
.row-item .nm {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-item .sub { font-size: 12px; color: var(--muted); }
.empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
  background: var(--panel-2);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-3);
  color: var(--muted);
}
.pill.live { background: #3f2a26; color: #f0a08a; }
.pill.open { background: #2a3520; color: var(--green-hi); }
.pill.done { background: var(--panel-3); color: var(--muted-2); }

/* ---------------------------------------------------------------- board */
.board-area { display: flex; flex-direction: column; gap: 10px; }

.player {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 4px;
}
.avatar {
  width: 38px; height: 38px;
  border-radius: 6px;
  background: var(--panel-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  flex: 0 0 auto;
}
.player .pname { font-weight: 700; font-size: 15px; }
.player .prating { color: var(--muted); font-size: 13px; }
.player .grow { flex: 1 1 auto; min-width: 0; }
.player.active .pname { color: var(--green-hi); }

.clock {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius);
  background: var(--panel-2);
  font-weight: 700;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  color: var(--muted);
  min-width: 108px;
  justify-content: center;
  transition: background .15s, color .15s;
}
.clock.active { background: #4a4a45; color: #fff; }
.clock.low { color: var(--danger-hi); }
.clock.active.low { color: #ff8b88; }
.clock .inc { font-size: 11px; color: var(--muted-2); font-weight: 600; }

.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
  user-select: none;
  touch-action: none;
}
.board-squares {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}
.sq { position: relative; }
.sq.light { background: var(--sq-light); }
.sq.dark { background: var(--sq-dark); }

.sq .coord {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  opacity: .85;
  pointer-events: none;
}
.sq .coord.f { right: 3px; bottom: 1px; }
.sq .coord.r { left: 3px; top: 1px; }
.sq.light .coord { color: var(--sq-dark); }
.sq.dark .coord { color: var(--sq-light); }

.sq .marker {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sq .marker.last { background: rgba(246,246,105,.42); }
.sq .marker.sel { background: rgba(246,246,105,.55); }
.sq .marker.check {
  background: radial-gradient(circle, rgba(255,60,50,.95) 12%, rgba(255,60,50,.55) 42%, rgba(255,60,50,0) 72%);
}
.sq .hint {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.sq .hint i {
  width: 30%; height: 30%;
  border-radius: 50%;
  background: rgba(20,20,20,.22);
  display: block;
}
.sq .hint.cap i {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: none;
  box-shadow: inset 0 0 0 6px rgba(20,20,20,.18);
}

.pieces { position: absolute; inset: 0; pointer-events: none; }
.piece-wrap {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  top: 0; left: 0;
  transition: transform .16s ease-out;
  will-change: transform;
  z-index: 2;
}
.piece-wrap.dragging { transition: none; z-index: 9; }
.piece-wrap.gone { opacity: 0; transition: opacity .14s; }
.piece-wrap svg { width: 100%; height: 100%; display: block; }

/* Pieces never take the pointer: the board handles every event and works out the
   square from coordinates. That keeps hovering and dragging consistent on squares
   that do and do not contain a piece. */
.board-wrap.draggable .sq.has-piece { cursor: grab; }
.board-wrap.draggable .piece-wrap.dragging { cursor: grabbing; }

.board-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.board-actions .spacer { flex: 1 1 auto; }

.evalbar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: #3a3936;
  overflow: hidden;
}
.evalbar .white-part {
  position: absolute;
  inset: 0 auto 0 0;
  background: #eeeed2;
  transition: width .25s;
}
.evalbar .label {
  position: absolute;
  right: 6px; top: -1px;
  font-size: 10px; font-weight: 700; color: #111;
}

/* ---------------------------------------------------------------- moves */
.movelist {
  max-height: 380px;
  overflow-y: auto;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.movelist table { width: 100%; border-collapse: collapse; }
.movelist td { padding: 3px 6px; }
.movelist td.num { color: var(--muted-2); width: 34px; font-size: 13px; }
.movelist td.mv {
  cursor: pointer;
  border-radius: 5px;
  font-weight: 600;
  width: 50%;
}
.movelist td.mv:hover { background: var(--panel-3); }
.movelist td.mv.cur { background: var(--panel-4); }
.movelist td.mv .badge { font-weight: 800; margin-left: 3px; }
.badge.blunder { color: #e0665c; }
.badge.mistake { color: #e8a33d; }
.badge.inaccuracy { color: #d9d24a; }
.badge.best { color: var(--green-hi); }

/* ---------------------------------------------------------------- chat */
.chat {
  display: flex;
  flex-direction: column;
  height: 210px;
}
.chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
  font-size: 13px;
}
.chat-msg { line-height: 1.35; }
.chat-msg .who { font-weight: 700; color: var(--green-hi); }
.chat-msg.sys { color: var(--muted-2); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form .input { flex: 1 1 auto; }

/* ---------------------------------------------------------------- puzzles */
.puzzle-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.puzzle-head .theme {
  padding: 4px 11px; border-radius: 20px;
  background: var(--panel-3); font-size: 12px; font-weight: 700;
}
.puzzle-feedback {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--panel-2);
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.puzzle-feedback.ok { background: #2c3a1c; color: var(--green-hi); }
.puzzle-feedback.bad { background: #3d2320; color: #f0a08a; }

.dots { display: flex; gap: 5px; }
.dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--panel-3); display: block;
}
.dots i.on { background: var(--green); }
.dots i.done { background: var(--green-dark); }

/* ---------------------------------------------------------------- review */
.review-nav { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.review-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.summary-box {
  flex: 1 1 90px;
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.summary-box .n { font-size: 20px; font-weight: 800; }
.summary-box .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.summary-box.w .n { color: #eeeed2; }
.summary-box.b .n { color: #e0665c; }
.summary-box.d .n { color: #d9d24a; }

.graph { width: 100%; height: 70px; display: block; border-radius: 6px; background: var(--panel-2); }

.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
}
.progress i { display: block; height: 100%; background: var(--green); width: 0; transition: width .2s; }

/* ---------------------------------------------------------------- misc */
.toasts {
  position: fixed;
  right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  max-width: 340px;
}
.toast {
  background: var(--panel-3);
  border: 1px solid var(--panel-4);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .18s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  padding: 20px;
}
.modal-box {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.modal-box h3 { margin: 0 0 14px; font-size: 17px; }

.promo {
  display: flex; gap: 8px; justify-content: center;
}
.promo button {
  width: 68px; height: 68px;
  border-radius: var(--radius);
  background: var(--panel-3);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 6px;
}
.promo button:hover { background: var(--panel-4); border-color: var(--green); }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--muted);
}

.result-banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border-left: 3px solid var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}
.result-banner.loss { border-left-color: var(--danger); }
.result-banner.draw { border-left-color: var(--muted); }

.hintline { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted-2); word-break: break-all; }

@media (max-width: 900px) {
  .cols, .cols.wide-right { grid-template-columns: minmax(0, 1fr); }
  .tc-grid { grid-template-columns: repeat(3, 1fr); }
  main { padding: 16px 12px 50px; }
  .brand-name { font-size: 16px; }
  .me-name { display: none; }
}

/* ---------------------------------------------------------------- board themes */
html[data-board="green"] { --sq-light: #eeeed2; --sq-dark: #769656; }
html[data-board="blue"]  { --sq-light: #dee3e6; --sq-dark: #8ca2ad; }
html[data-board="brown"] { --sq-light: #f0d9b5; --sq-dark: #b58863; }
html[data-board="wood"]  { --sq-light: #e6d3b3; --sq-dark: #a97a4b; }
html[data-board="gray"]  { --sq-light: #e9e9e6; --sq-dark: #9a9a94; }
html[data-board="night"] { --sq-light: #8b8987; --sq-dark: #5a5856; }

/* ---------------------------------------------------------------- piece sets */
.piece-wrap img { width: 100%; height: 100%; display: block; object-fit: contain; }

.setgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 10px;
}
.setcard {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.setcard:hover { background: var(--panel-3); }
.setcard.sel { border-color: var(--green); background: #33421f; }
.setcard .preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  margin-bottom: 7px;
}
.setcard .preview img,
.setcard .preview svg { width: 32px; height: 32px; display: block; }
.setcard .nm { font-weight: 700; font-size: 14px; }
.setcard .lic { font-size: 11px; color: var(--green-hi); font-weight: 600; }
.setcard .note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.setcard .by { font-size: 11px; color: var(--muted-2); }

.themegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}
.themecard {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--panel-2);
}
.themecard.sel { border-color: var(--green); }
.themecard .swatch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 44px;
}
.themecard .lbl { font-size: 12px; text-align: center; padding: 5px; color: var(--muted); }
.themecard.sel .lbl { color: var(--text); font-weight: 600; }

.credit-note {
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.5;
  margin-top: 10px;
}
.credit-note code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
/* best-move arrow (review, hints) */
.arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
/* public tunnel link in the lobby */
.friend-link { margin-top: 12px; }
.linkrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.linkcode {
  flex: 1 1 220px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--green-hi);
  word-break: break-all;
}
/* square under the cursor darkens slightly (only when you can actually move) */
.board-wrap.draggable .sq::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .1s ease-out;
  pointer-events: none;
}
.board-wrap.draggable .sq:hover::after { background: rgba(0, 0, 0, 0.09); }
.board-wrap.draggable.dragging .sq:hover::after { background: rgba(0, 0, 0, 0); }
/* ---------------------------------------------------------------- review extras */
.review-comment {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--panel-2);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
}
.review-comment:empty { display: none; }
.arrow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.arrow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.arrow-legend .sw {
  width: 18px;
  height: 5px;
  border-radius: 3px;
  display: inline-block;
}
.arrow-legend .sw-played { background: #8a8a86; }
.arrow-legend .sw-best { background: var(--green); }
/* ---------------------------------------------------------------- openings */
.opening-eco {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--green-hi);
  vertical-align: middle;
}
.opening-line {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  background: var(--panel-2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}
.opening-moves { display: flex; flex-wrap: wrap; gap: 6px; }
.opening-moves .btn { display: inline-flex; align-items: center; gap: 6px; }
.opening-moves .cnt {
  font-size: 11px;
  color: var(--muted);
  background: rgba(0,0,0,.22);
  border-radius: 10px;
  padding: 0 6px;
}
.opening-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.opening-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.opening-row:hover { background: var(--panel-3); }
.opening-row-eco {
  font-weight: 700;
  font-size: 11px;
  color: var(--green-hi);
  min-width: 34px;
}
.opening-row-name { font-size: 13px; font-weight: 600; }
.opening-row-moves { font-size: 11px; color: var(--muted-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.opening-en {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted-2);
}
.opening-row-en { font-size: 11px; color: var(--muted-2); }
/* time control picker while waiting for an opponent */
.tc-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tc-row .btn { padding: 5px 10px; font-size: 12px; }
/* ---------------------------------------------------------------- who is online */
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  transition: background .12s;
}
.person:hover { background: var(--panel-3); }
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex: 0 0 auto;
}
.person .nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.person .sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.person .sub .dot { color: var(--muted-2); }
.you {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--panel-3);
  color: var(--muted);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ---------------------------------------------------------------- captured material */
.captured { display: inline-flex; align-items: center; margin-left: 8px; vertical-align: middle; }
.cap-piece { display: inline-block; width: 15px; height: 15px; margin-left: -4px; }
.cap-piece svg, .cap-piece img { width: 15px; height: 15px; display: block; }
.cap-lead { margin-left: 5px; font-size: 12px; font-weight: 700; color: var(--green-hi); }

/* ---------------------------------------------------------------- rating change */
.rating-delta { margin-left: 10px; font-weight: 800; font-size: 14px; }
.rating-delta.up { color: var(--green-hi); }
.rating-delta.down { color: #e0665c; }

/* ---------------------------------------------------------------- challenge dialog */
.challenge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px;
}
.challenge-card .nm { font-weight: 700; font-size: 15px; }
.challenge-card .sub { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- opening name in a game */
.opening-inline { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chat-time { margin-left: 6px; font-size: 10px; color: var(--muted-2); }