:root {
  color-scheme: dark;
  --cr-bg: #071012;
  --cr-panel: #101b20;
  --cr-panel-2: #13252b;
  --cr-text: #edf7f4;
  --cr-muted: #9bb5b1;
  --cr-line: #25434a;
  --cr-accent: #d8b75a;
  --cr-accent-2: #8bb7ff;
  --cr-warn: #ffbf69;
  --text: var(--cr-text);
  --muted: var(--cr-muted);
  --line-soft: rgba(255,255,255,.12);
  --line-strong: var(--cr-line);
  --chart-bg: #081326;
  --chart-grid: rgba(155, 181, 177, .22);
  --chart-axis: rgba(216, 183, 90, .68);
  --chart-text: #b8cbc7;
  --chart-line: #d8b75a;
}

* { box-sizing: border-box; }
body.cr-body {
  margin: 0;
  background: var(--cr-bg);
  color: var(--cr-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--cr-accent); }
.cr-subtle-link { font-size: 0.86rem; font-weight: 800; }
.cr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 28px;
  border-bottom: 1px solid var(--cr-line);
  background: rgba(7, 16, 18, 0.95);
}
.cr-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cr-text); text-decoration: none; }
.cr-wordmark {
  font-weight: 900;
  letter-spacing: 0;
  font-size: 1.56rem;
  line-height: 1;
  background: linear-gradient(90deg, #ffe19a 0%, var(--cr-accent) 48%, #f7f0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.cr-logo { height: 50px; width: auto; flex: 0 0 auto; }
.cr-topbar-title {
  margin-right: auto;
  padding-left: 22px;
  color: var(--cr-text);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}
.cr-topbar-title:empty { display: none; }
.cr-nav { display: flex; gap: 18px; font-size: 0.95rem; }
.cr-main { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; padding: 48px 0 72px; }
.cr-hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr); gap: 36px; align-items: start; }
.cr-hero h1 { font-size: clamp(1.85rem, 3vw, 3rem); line-height: 1.08; }
.cr-hero-copy p { font-size: 0.98rem; margin: 0 0 12px; }
h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 4.5rem); line-height: 1.02; letter-spacing: 0; }
h2 { margin: 0 0 8px; font-size: 1.1rem; letter-spacing: 0; }
p { line-height: 1.55; }
.cr-muted { color: var(--cr-muted); }
.cr-choice-grid { display: grid; gap: 14px; }
.cr-choice-title {
  margin: 0 0 2px;
  font-size: 1.15rem;
  color: var(--cr-text);
}
.cr-choice, .cr-panel {
  background: var(--cr-panel);
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 22px;
}
.cr-choice-strict { border-color: #58736f; }
.cr-choice { padding: 18px; }
.cr-choice h2 { font-size: 1rem; }
.cr-choice p { font-size: 0.92rem; margin: 0 0 14px; line-height: 1.42; }
button, .cr-button, .cr-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--cr-accent);
  border-radius: 6px;
  background: var(--cr-accent);
  color: #06110f;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.cr-button-secondary {
  background: transparent;
  color: var(--cr-accent);
}
.cr-auth { max-width: 520px; margin: 0 auto; }
.cr-wide { max-width: 980px; margin: 0 auto; }
.cr-readable { max-width: 760px; margin: 0 auto; }
.cr-readable h2 { margin-top: 22px; }
.cr-back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--cr-accent);
  font-weight: 800;
  text-decoration: none;
}
.cr-back-link::before { content: "< "; }
.cr-form { display: grid; gap: 14px; }
.cr-form label { display: grid; gap: 6px; color: var(--cr-muted); }
.cr-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #081316;
  color: var(--cr-text);
}
.cr-form input:focus {
  outline: 2px solid rgba(216, 183, 90, .4);
  outline-offset: 1px;
}
.cr-form label.is-invalid input,
.cr-form input[aria-invalid="true"] {
  border-color: var(--cr-warn);
  box-shadow: 0 0 0 2px rgba(255, 191, 105, .16);
}
.cr-field-message {
  min-height: 17px;
  color: var(--cr-warn);
  font-size: 0.82rem;
  line-height: 1.25;
}
.cr-field-line {
  min-height: 17px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cr-inline-action {
  color: var(--cr-accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}
.cr-inline-action:hover { text-decoration: underline; }
button:disabled,
.cr-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.cr-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.cr-check input { width: auto; min-height: auto; }
.cr-game-type-row {
  justify-content: flex-start;
}
.cr-game-type-row.is-disabled {
  opacity: .5;
}
.cr-count-badge {
  color: var(--cr-muted);
  font-size: 0.88rem;
  font-weight: 800;
}
.cr-fieldset-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cr-small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.86rem;
}
.cr-count-status {
  font-size: 0.86rem;
}
.cr-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
fieldset { border: 1px solid var(--cr-line); border-radius: 8px; padding: 16px; }
legend { color: var(--cr-text); font-weight: 800; }
.cr-alert { color: var(--cr-warn); }
.cr-progress { display: grid; gap: 10px; color: var(--cr-muted); }
.cr-history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.cr-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-download-button {
  gap: 8px;
  border-color: #2f3a3d;
  background: #050708;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.cr-download-button:hover {
  border-color: var(--cr-accent);
  background: #0b0f10;
}
.cr-download-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.cr-support-link { color: var(--cr-muted); text-decoration: none; }
.cr-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.cr-summary-row > div {
  padding: 14px;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  background: var(--cr-panel-2);
}
.cr-summary-row span { display: block; margin-top: 6px; color: var(--cr-muted); font-size: 0.9rem; }
.card {
  background: var(--cr-panel);
  border: 1px solid var(--cr-line);
  border-radius: 8px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px 8px;
}
.section-title-row h2 { margin: 0; font-size: 1rem; }
.game-selector-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.cr-header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cr-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.cr-header-toggle input { accent-color: var(--cr-accent); }
.cr-game-picker-card { margin-top: 18px; padding-bottom: 14px; }
.column-theme-name,
.column-theme-select,
.elo-scale-select {
  min-height: 32px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 5px 8px;
  background: #081316;
  color: var(--cr-text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
}
.column-theme-name { width: 132px; }
.column-theme-select { width: 220px; }
.elo-scale-select { width: 116px; }
.column-theme-field,
.elo-scale-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cr-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.column-picker-panel {
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.column-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.column-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.column-picker-search {
  width: 180px;
  max-width: 100%;
}
.column-picker-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 9px;
  margin-bottom: 8px;
}
.column-picker-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.column-picker-tab span {
  color: var(--cr-accent);
  font-weight: 900;
}
.column-picker-tab.is-active {
  background: rgba(216, 183, 90, .18);
  border-color: rgba(216, 183, 90, .54);
  color: var(--text);
}
.column-picker-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0,0,0,.15);
}
.column-picker-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}
.column-picker-table th,
.column-picker-table td {
  padding: 8px 9px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.column-picker-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d1a1f;
  color: var(--text);
  text-align: left;
}
.column-picker-table td {
  color: var(--muted);
  line-height: 1.35;
}
.column-picker-table strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}
.column-picker-table code {
  display: block;
  color: var(--cr-accent);
  font-size: 0.72rem;
  white-space: normal;
  word-break: break-word;
}
.column-picker-select-cell {
  width: 42px;
  text-align: center;
}
.column-picker-select-cell input { accent-color: var(--cr-accent); }
.column-calc-status {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(216, 183, 90, .14);
  color: var(--cr-accent);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.column-picker-note { margin: 10px 0 0; font-size: 0.82rem; }
.column-picker-note-inline { color: var(--cr-muted); font-size: 0.76rem; }
.game-selector { display: grid; gap: 7px; padding: 0 14px; }
.game-selector-bottom-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.game-selector-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.game-selector-table-wrap {
  height: var(--cr-game-table-height, 430px);
  max-height: calc(100vh - 190px);
  min-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0d1a1f;
}
body.is-connectedrooks-board-detached .cr-game-picker-card {
  min-height: calc(100vh - 170px);
}
body.is-connectedrooks-board-detached .game-selector-table-wrap {
  max-height: calc(100vh - 210px);
}
.game-selector-resize-bar {
  position: relative;
  display: block;
  width: 100%;
  height: 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: ns-resize;
}
.game-selector-resize-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 72px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(216, 183, 90, .36);
}
.game-selector-resize-bar:hover::before,
.game-selector-resize-bar:focus-visible::before {
  background: rgba(216, 183, 90, .74);
}
body.is-game-table-resizing,
body.is-game-table-resizing * {
  cursor: ns-resize !important;
  user-select: none !important;
}
.game-selector-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 9px;
  line-height: 1.15;
}
.game-selector-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #0d1a1f;
  box-shadow: 0 -1px 0 #0d1a1f, 0 1px 0 var(--line-strong), 0 10px 16px rgba(0,0,0,.24);
}
.game-selector-table th,
.game-selector-table td {
  padding: 3px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.game-selector-table.is-verbose-headers th {
  vertical-align: bottom;
}
.game-selector-table.is-verbose-headers .game-selector-sort {
  min-height: 34px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.12;
}
.game-selector-table th {
  position: relative;
  z-index: 3;
  background: rgba(13, 26, 31, .99);
  user-select: none;
  font-size: 8px;
}
.game-selector-table th.is-dragging { opacity: .58; }
.game-selector-table th.is-drag-over { box-shadow: inset 3px 0 0 var(--cr-accent); }
.game-selector-table thead tr:nth-child(2) th {
  z-index: 2;
  background: rgba(13, 26, 31, .99);
}
.game-selector-sort {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.column-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 3px;
  width: 1px;
  background: rgba(216, 183, 90, .38);
}
body.is-column-resizing,
body.is-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
.game-selector-filter {
  width: 100%;
  min-width: 0;
  height: 20px;
  padding: 1px 3px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  font-size: 8px;
}
.game-selector-filter option {
  color: #172016;
  background: #f8f4e8;
}
.game-date-filter-group {
  display: inline-flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.game-date-filter-field {
  display: grid;
  gap: 3px;
  color: var(--cr-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.game-date-filter-field input {
  min-height: 30px;
  width: 132px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 4px 7px;
  background: #081316;
  color: var(--cr-text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color-scheme: dark;
}
.game-selector-table tbody tr:first-child td { padding-top: 9px; }
.game-selector-row { cursor: pointer; }
.game-selector-row:hover { background: rgba(216, 183, 90, .14); }
.game-selector-row.is-selected,
.game-selector-row.is-selected:hover { background: rgba(123, 95, 28, .9); }
.game-selector-row.is-selected td { color: #fff8df; }
.cr-tool-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.cr-scatter-toggle,
.cr-histogram-toggle,
.cr-outcome-toggle,
.cr-time-series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cr-scatter-toggle.is-active,
.cr-histogram-toggle.is-active,
.cr-outcome-toggle.is-active,
.cr-time-series-toggle.is-active {
  border-color: rgba(216, 183, 90, .74);
  color: var(--cr-accent);
  background: rgba(216, 183, 90, .12);
}
.cr-scatter-panel,
.cr-histogram-panel,
.cr-outcome-panel,
.cr-time-series-panel {
  margin: 12px 14px 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0d1a1f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.cr-scatter-head,
.cr-histogram-head,
.cr-outcome-head,
.cr-time-series-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.cr-scatter-head h3,
.cr-histogram-head h3,
.cr-outcome-head h3,
.cr-time-series-head h3 {
  margin: 0 0 3px;
  font-size: 0.95rem;
}
.cr-scatter-head p,
.cr-histogram-head p,
.cr-outcome-head p,
.cr-time-series-head p {
  margin: 0;
  color: var(--cr-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.cr-scatter-controls,
.cr-histogram-controls,
.cr-outcome-controls,
.cr-time-series-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.cr-scatter-field,
.cr-histogram-field,
.cr-outcome-field,
.cr-time-series-field {
  display: grid;
  gap: 4px;
  color: var(--cr-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cr-scatter-field select,
.cr-histogram-field select,
.cr-histogram-field input,
.cr-outcome-field select,
.cr-outcome-field input,
.cr-time-series-field select {
  min-height: 32px;
  width: 190px;
  max-width: 34vw;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 5px 8px;
  background: #081316;
  color: var(--cr-text);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.cr-histogram-field input#histogram-bins,
.cr-histogram-field select#histogram-mode,
.cr-outcome-field input#outcome-bins,
.cr-outcome-field input#outcome-min-games {
  width: 98px;
}
#outcome-column {
  width: 260px;
  max-width: 44vw;
}
.cr-scatter-body,
.cr-histogram-body,
.cr-outcome-body,
.cr-time-series-body {
  padding: 10px 12px 12px;
}
.cr-scatter-svg,
.cr-histogram-svg,
.cr-outcome-svg,
.cr-time-series-svg {
  display: block;
  width: 100%;
  min-height: 260px;
}
.cr-scatter-bg,
.cr-histogram-bg,
.cr-outcome-bg,
.cr-time-series-bg {
  fill: rgba(2, 7, 9, .42);
  stroke: rgba(255,255,255,.06);
}
.cr-scatter-grid line,
.cr-histogram-grid line,
.cr-outcome-grid line,
.cr-time-series-grid line {
  stroke: rgba(255,255,255,.09);
  stroke-width: 1;
}
.cr-scatter-grid text,
.cr-histogram-grid text,
.cr-outcome-grid text,
.cr-time-series-grid text {
  fill: var(--cr-muted);
  font-size: 11px;
  font-weight: 700;
}
.cr-scatter-axis,
.cr-histogram-axis,
.cr-time-series-axis {
  stroke: rgba(216, 183, 90, .72);
  stroke-width: 1.4;
}
.cr-scatter-axis-label,
.cr-histogram-axis-label,
.cr-outcome-axis-label,
.cr-time-series-axis-label {
  fill: var(--cr-text);
  font-size: 12px;
  font-weight: 900;
}
.cr-histogram-bar {
  fill: rgba(72, 178, 214, .74);
  stroke: rgba(207, 241, 248, .55);
  stroke-width: .7;
}
.cr-histogram-bar:hover {
  fill: #fff8df;
  stroke: var(--cr-accent);
}
.cr-scatter-point {
  fill: rgba(72, 178, 214, .78);
  stroke: rgba(207, 241, 248, .74);
  stroke-width: .7;
  cursor: pointer;
}
.cr-scatter-point:hover {
  fill: #fff8df;
  stroke: var(--cr-accent);
  stroke-width: 1.4;
}
.cr-scatter-point.is-selected {
  fill: #ef4444;
  stroke: #fecaca;
  stroke-width: 1.2;
}
.cr-scatter-current-ring {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2.4;
  pointer-events: none;
}
.cr-histogram-current-line {
  stroke: #ef4444;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  pointer-events: none;
}
.cr-scatter-empty,
.cr-histogram-empty,
.cr-outcome-empty,
.cr-time-series-empty {
  fill: var(--cr-muted);
  font-size: 15px;
  font-weight: 800;
}
.cr-scatter-panel.is-collapsed .cr-scatter-head,
.cr-histogram-panel.is-collapsed .cr-histogram-head,
.cr-outcome-panel.is-collapsed .cr-outcome-head,
.cr-time-series-panel.is-collapsed .cr-time-series-head {
  border-bottom: 0;
}
.cr-time-series-svg {
  min-height: 360px;
}
.cr-time-series-line {
  fill: none;
  stroke: var(--cr-accent);
  stroke-width: 2.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cr-time-series-line-right {
  fill: none;
  stroke: #48b2d6;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cr-time-series-legend text {
  fill: var(--cr-text);
  font-size: 12px;
  font-weight: 900;
}
.cr-time-series-right-tick {
  fill: #9adced;
}
.cr-time-series-point {
  fill: rgba(72, 178, 214, .88);
  stroke: rgba(207, 241, 248, .8);
  stroke-width: .8;
  cursor: pointer;
}
.cr-time-series-point-right {
  fill: rgba(216, 183, 90, .88);
  stroke: rgba(255, 248, 223, .82);
}
.cr-time-series-point:hover {
  fill: #fff8df;
  stroke: var(--cr-accent);
  stroke-width: 1.4;
}
.cr-time-series-point.is-selected {
  fill: #ef4444;
  stroke: #fecaca;
  stroke-width: 1.5;
}
.cr-time-series-plot-capture {
  fill: transparent;
  pointer-events: all;
  cursor: crosshair;
}
.cr-scatter-plot-capture {
  fill: transparent;
  pointer-events: all;
  cursor: crosshair;
}
.cr-scatter-panel.is-detached .cr-scatter-body,
.cr-scatter-panel.is-detached .cr-scatter-field,
.cr-scatter-panel.is-detached #scatterplot-collapse,
.cr-histogram-panel.is-detached .cr-histogram-body,
.cr-histogram-panel.is-detached .cr-histogram-field,
.cr-histogram-panel.is-detached #histogram-collapse,
.cr-outcome-panel.is-detached .cr-outcome-body,
.cr-outcome-panel.is-detached .cr-outcome-field,
.cr-outcome-panel.is-detached #outcome-clear-filter,
.cr-outcome-panel.is-detached #outcome-reset,
.cr-outcome-panel.is-detached #outcome-collapse,
.cr-time-series-panel.is-detached .cr-time-series-body,
.cr-time-series-panel.is-detached .cr-time-series-field,
.cr-time-series-panel.is-detached #time-series-reset-zoom,
.cr-time-series-panel.is-detached #time-series-collapse {
  display: none;
}
.cr-scatter-panel.is-detached .cr-scatter-head,
.cr-histogram-panel.is-detached .cr-histogram-head,
.cr-outcome-panel.is-detached .cr-outcome-head,
.cr-time-series-panel.is-detached .cr-time-series-head {
  align-items: center;
  border-bottom: 0;
}
.cr-outcome-svg {
  min-height: 390px;
}
.cr-outcome-bar,
.cr-outcome-residual-point,
.cr-outcome-box {
  cursor: pointer;
}
.cr-outcome-win { fill: rgba(34, 197, 94, .82); }
.cr-outcome-draw { fill: rgba(216, 183, 90, .86); }
.cr-outcome-loss { fill: rgba(239, 68, 68, .78); }
.cr-outcome-legend text {
  fill: var(--cr-text);
  font-size: 11px;
  font-weight: 900;
}
.cr-outcome-legend rect {
  stroke: rgba(255,255,255,.24);
  stroke-width: .7;
}
.cr-outcome-bar:hover,
.cr-outcome-residual-point:hover,
.cr-outcome-box:hover {
  filter: brightness(1.2);
  stroke: #fff8df;
  stroke-width: 1.2;
}
.cr-outcome-residual-line {
  fill: none;
  stroke: #f8fafc;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cr-outcome-residual-avg-line {
  stroke: #f8fafc;
}
.cr-outcome-residual-median-line {
  stroke: var(--cr-accent);
  stroke-dasharray: 5 4;
}
.cr-outcome-residual-point {
  fill: #f8fafc;
  stroke: #071012;
  stroke-width: 1.1;
}
.cr-outcome-residual-avg {
  fill: #f8fafc;
}
.cr-outcome-residual-median {
  fill: var(--cr-accent);
}
.cr-outcome-box {
  fill: rgba(216, 183, 90, .22);
  stroke: var(--cr-accent);
  stroke-width: 1.2;
}
.cr-outcome-box-whisker,
.cr-outcome-box-median {
  stroke: #f8fafc;
  stroke-width: 1.5;
}
.cr-outcome-x-label,
.cr-outcome-sample-label {
  fill: var(--cr-muted);
  font-size: 10px;
  font-weight: 800;
}
.cr-outcome-x-label {
  font-size: 9.5px;
}
.cr-outcome-box-label {
  fill: var(--cr-text);
  font-size: 10px;
  font-weight: 900;
}
.cr-outcome-summary-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0,0,0,.14);
}
.cr-outcome-summary {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.76rem;
}
.cr-outcome-summary th,
.cr-outcome-summary td {
  padding: 7px 8px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.cr-outcome-summary th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d1a1f;
  color: var(--cr-text);
}
.cr-outcome-summary td {
  color: var(--cr-muted);
}
.cr-outcome-summary tbody tr {
  cursor: pointer;
}
.cr-outcome-summary tbody tr:hover {
  background: rgba(216, 183, 90, .12);
}
.game-selector-country { display: inline-flex; align-items: center; gap: 6px; }
.game-selector-flag,
.game-selector-flag-placeholder {
  width: 16px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
  object-fit: cover;
  background: rgba(255,255,255,.14);
}
.cr-table-wrap {
  overflow: auto;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
}
.cr-table { width: 100%; border-collapse: collapse; min-width: 1120px; font-size: 0.9rem; }
.cr-table th, .cr-table td { padding: 10px 12px; border-bottom: 1px solid var(--cr-line); text-align: left; vertical-align: top; }
.cr-table th { position: sticky; top: 0; background: #0d1a1f; color: #cfe5df; }
.cr-game-row { cursor: pointer; }
.cr-game-row:hover { background: rgba(216, 183, 90, 0.08); }
.cr-game-row.is-selected { background: rgba(216, 183, 90, 0.16); }
.cr-embedded-viewer { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--cr-line); }
.game-viewer-main {
  display: grid;
  grid-template-columns: minmax(360px, 620px) minmax(240px, 320px);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}
.game-viewer-main.is-board-detached {
  display: none;
}
.board-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}
.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.board-meta-primary { display: grid; gap: 4px; }
.board-meta-secondary { display: grid; gap: 8px; justify-items: end; }
.board-detail-list { display: grid; gap: 3px; color: var(--muted); font-size: 0.9rem; }
.viewer-board-stage { display: grid; gap: 12px; }
.viewer-board-wrap { display: grid; gap: 6px; }
.viewer-board-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: stretch;
}
.board-coords {
  display: grid;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.board-coords-top,
.board-coords-bottom {
  grid-template-columns: repeat(8, 1fr);
  padding: 0 32px;
}
.board-coords-left,
.board-coords-right {
  grid-template-rows: repeat(8, 1fr);
  align-items: center;
}
.viewer-board {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 48px rgba(0,0,0,.24);
}
.viewer-square {
  position: relative;
  display: grid;
  place-items: center;
  font-size: clamp(1.6rem, 5vw, 3.4rem);
  color: #101010;
}
.viewer-square.is-light { background: #f1e0c5; }
.viewer-square.is-dark { background: #b8895b; }
.viewer-board.is-wood-grain .viewer-square.is-light {
  background-color: #f1dfbd;
  background-image:
    linear-gradient(rgba(255, 248, 224, .08), rgba(255, 248, 224, .08)),
    url("/static/img/board_textures/american-hard-maple.webp");
}
.viewer-board.is-wood-grain .viewer-square.is-dark {
  background-color: #8e5232;
  background-image:
    linear-gradient(rgba(72, 30, 13, .08), rgba(72, 30, 13, .08)),
    url("/static/img/board_textures/american-cherry-vertical.webp");
}
.viewer-state-bar {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.9rem;
}
.viewer-state-bar strong { color: var(--text); }
.move-animation-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}
.move-animation-range { display: inline-flex; gap: 8px; align-items: center; }
.move-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  align-content: start;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(139,183,255,.04);
  overflow: hidden;
}
.move-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800;
  font-size: 13px;
  color: #eef5ff;
}
.analyze-game-button {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 0.72rem;
}
.engine-analysis-status {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(216, 183, 90, .08);
  color: var(--cr-muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}
.engine-analysis-status.is-error {
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}
.move-list-columns {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  padding: 8px 7px 6px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.02);
}
.move-list-column-label {
  color: var(--cr-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.move-list-body {
  display: grid;
  gap: 2px;
  max-height: 760px;
  overflow: auto;
  padding: 7px 11px 7px 7px;
}
.move-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}
.move-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}
.move-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(255,255,255,.02);
  color: #d9e8ff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.move-cell-san {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.move-list-deep-thought-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.move-list-deep-thought-icon .board-deep-thought-icon {
  width: 13px;
  height: 13px;
  filter: none;
}
.move-engine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  padding: 0 1px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  border: 0;
  background: transparent;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.move-engine-brilliant {
  color: #34d399;
}
.move-engine-inaccuracy {
  color: #7dd3fc;
}
.move-engine-mistake {
  color: #facc15;
}
.move-engine-blunder {
  color: #ef4444;
}
.board-engine-tag {
  font-size: 14px;
  letter-spacing: -0.02em;
  margin-right: 1px;
}
.move-origin-time-overlay.is-white-move .board-engine-tag,
.move-origin-time-overlay.is-black-move .board-engine-tag {
  text-shadow: 0 1px 2px rgba(0,0,0,.72);
}
.move-cell:hover {
  background: rgba(139,183,255,.12);
  border-color: rgba(139,183,255,.22);
}
.move-cell.is-active {
  background: linear-gradient(180deg, rgba(216,183,90,.24), rgba(216,183,90,.14));
  border-color: rgba(216,183,90,.55);
  color: #fff5cf;
}
.move-cell-empty { min-height: 28px; }
.captured-pieces-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  gap: 8px;
  min-height: 19px;
  align-items: center;
}
.captured-pieces-tray {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  max-width: 100%;
  overflow: visible;
  padding: 2px 7px;
  border: 1px solid rgba(106, 62, 28, .28);
  border-radius: 5px;
  background-color: #e6c28c;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0) 18%, rgba(89,48,22,.08) 52%, rgba(255,255,255,.12)),
    repeating-linear-gradient(0deg, rgba(109,68,35,.11) 0 1px, rgba(255,244,211,.08) 1px 3px, rgba(159,101,48,.09) 3px 5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(89,48,22,.14);
}
.captured-pieces-tray-top { justify-content: flex-start; }
.captured-pieces-tray-bottom { justify-content: flex-end; }
.captured-piece-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.28));
  user-select: none;
}
.viewer-piece-img {
  width: min(88%, 52px);
  height: min(88%, 52px);
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  position: relative;
  z-index: 2;
}
.check-board-alert {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(127, 29, 29, .36);
  pointer-events: none;
}
.viewer-piece-img.is-checkmated-king {
  transform: rotate(45deg);
  transform-origin: 50% 50%;
}
.move-origin-time-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.move-origin-time-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(7,18,38,.74);
  color: #fff7d6;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.move-origin-time-overlay.is-white-move .move-origin-time-text {
  background: rgba(255,247,214,.88);
  color: #071226;
}
.move-origin-time-overlay.is-white-move .deep-thought-cog { stroke: #071226; }
.engine-best-move-arrow-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.engine-best-move-arrow-shape {
  fill: rgba(143, 206, 66, .68);
  stroke: rgba(143, 206, 66, .18);
  stroke-width: .35;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
.board-deep-thought-icon {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.32));
}
.deep-thought-cog {
  fill: none;
  stroke: #f6e7b0;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.deep-thought-marker { cursor: pointer; }
.deep-thought-marker:hover .deep-thought-cog { stroke: #ffffff; }
.viewer-square.is-animation-hidden .viewer-piece-img {
  visibility: hidden;
}
.viewer-piece-animation-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  transition-property: transform;
  transition-timing-function: cubic-bezier(.2, .74, .22, 1);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.24));
}
.viewer-captured-piece-animation-overlay {
  z-index: 7;
  transition-property: opacity;
  transition-timing-function: ease-out;
}
.viewer-captured-piece-animation-overlay.is-fading {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .viewer-piece-animation-overlay {
    transition-duration: 0ms !important;
  }
}
.viewer-board.is-wood-grain .viewer-square {
  background-size: 360% 360%;
  background-position: var(--wood-x, 50%) var(--wood-y, 50%);
}
.viewer-square.is-highlight {
  box-shadow: inset 0 0 0 4px rgba(255, 215, 0, .52);
}
.viewer-controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.viewer-nav-btn {
  min-width: 0;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(106, 62, 28, .35);
  background-color: #f1dfbd;
  background-image:
    linear-gradient(rgba(255, 248, 224, .18), rgba(255, 248, 224, .18)),
    url("/static/img/board_textures/american-hard-maple.webp");
  background-size: 260% 260%;
  background-position: 48% 52%;
  color: #17100a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 5px 12px rgba(36, 23, 10, .12);
}
.viewer-nav-btn:hover,
.detach-game-board-btn:hover {
  border-color: rgba(78, 42, 18, .52);
  background-position: 58% 46%;
  color: #120c06;
}
.viewer-nav-icon-btn {
  font-size: 18px;
  font-weight: 800;
}
.viewer-nav-center-btn {
  font-size: 13px;
  font-weight: 900;
}
.move-animation-controls {
  justify-content: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(106, 62, 28, .32);
  border-radius: 8px;
  background-color: #f1dfbd;
  background-image:
    linear-gradient(rgba(255, 248, 224, .16), rgba(255, 248, 224, .16)),
    url("/static/img/board_textures/american-hard-maple.webp");
  background-size: 280% 280%;
  background-position: 42% 54%;
  color: #111;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.36), 0 8px 18px rgba(44, 28, 14, .12);
}
.board-grain-toggle,
.move-animation-label,
.move-animation-range {
  color: #111;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}
.board-grain-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #6f3e22;
}
.move-animation-range input[type="range"] {
  width: min(230px, 34vw);
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.move-animation-range input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 21, 8, .55);
  background-color: #7b4326;
  background-image:
    linear-gradient(rgba(35, 14, 5, .15), rgba(255, 222, 174, .10)),
    url("/static/img/board_textures/american-cherry-vertical.webp");
  background-size: 260% 260%;
  background-position: 50% 45%;
}
.move-animation-range input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -6px;
  border: 1px solid rgba(42, 18, 7, .74);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background-color: #9a5c35;
  background-image:
    radial-gradient(circle at 35% 30%, rgba(255, 222, 166, .36), transparent 34%),
    url("/static/img/board_textures/american-cherry-vertical.webp");
  background-size: 320% 320%;
  background-position: 62% 48%;
  box-shadow: 0 2px 5px rgba(34, 16, 6, .45), inset 0 1px 0 rgba(255,255,255,.22);
}
.move-animation-range input[type="range"]::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 21, 8, .55);
  background-color: #7b4326;
  background-image:
    linear-gradient(rgba(35, 14, 5, .15), rgba(255, 222, 174, .10)),
    url("/static/img/board_textures/american-cherry-vertical.webp");
  background-size: 260% 260%;
  background-position: 50% 45%;
}
.move-animation-range input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(42, 18, 7, .74);
  border-radius: 50%;
  background-color: #9a5c35;
  background-image:
    radial-gradient(circle at 35% 30%, rgba(255, 222, 166, .36), transparent 34%),
    url("/static/img/board_textures/american-cherry-vertical.webp");
  background-size: 320% 320%;
  background-position: 62% 48%;
  box-shadow: 0 2px 5px rgba(34, 16, 6, .45), inset 0 1px 0 rgba(255,255,255,.22);
}
.cr-viewer-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 18px; }
.cr-viewer-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cr-viewer-grid { display: grid; grid-template-columns: minmax(320px, 560px) minmax(260px, 1fr); gap: 20px; align-items: start; }
.cr-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border: 1px solid var(--cr-line); }
.cr-square { min-height: 0; border: 0; border-radius: 0; font-size: clamp(1.6rem, 5vw, 3.4rem); color: #0b1117; }
.cr-square.light { background: #d7e4dc; }
.cr-square.dark { background: #52796f; }
.cr-moves { margin: 0; padding: 14px 14px 14px 34px; max-height: 560px; overflow: auto; border: 1px solid var(--cr-line); border-radius: 8px; background: var(--cr-panel); }
.cr-moves li { padding: 4px 2px; color: var(--cr-muted); cursor: pointer; }
.game-time-management-card {
  margin-top: 20px;
  padding: 22px 24px 18px;
}
.game-time-management-card .section-title-row {
  padding: 0 0 10px;
  justify-content: flex-start;
}
.game-time-management-card #time-management-title { margin: 0; }
.time-management-toggle { margin-left: 2px; }
.game-time-management-panel {
  display: grid;
  gap: 14px;
  padding: 0;
}
.time-curve-copy {
  color: var(--cr-muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 1180px;
}
.time-curve-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.time-curve-mode-toggle {
  display: inline-flex;
  width: max-content;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}
.time-curve-mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--cr-muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.time-curve-mode-btn.is-active {
  background: var(--cr-accent);
  color: #1f2937;
}
.time-curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.time-curve-legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--cr-muted);
  font-size: 12px;
  font-weight: 800;
}
.time-curve-legend-item span {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}
.time-curve-legend-item .time-curve-deep-thought-key {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.time-curve-deep-thought-key .board-deep-thought-icon {
  width: 18px;
  height: 18px;
  filter: none;
}
.time-curve-user-key {
  background: var(--chart-line);
  height: 4px !important;
}
.time-curve-opponent-key {
  background: #ef4444;
  height: 4px !important;
}
.time-curve-material-key {
  background: #f8fafc;
  height: 4px !important;
}
.engine-chart-marker-text {
  font-size: 13px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(7, 16, 18, .86);
  stroke-width: 2.6px;
  stroke-linejoin: round;
}
.time-curve-grid {
  display: grid;
  gap: 16px;
}
.time-curve-panel { min-width: 0; }
.game-time-curve-svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-empty {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  color: var(--cr-muted);
  padding: 18px;
}
.material-change-dot circle {
  fill: #f8fafc;
  stroke: #111827;
  stroke-width: 1.4;
  cursor: pointer;
}
.material-change-dot:hover circle {
  fill: #ffffff;
  stroke: #67b3ff;
  stroke-width: 2;
}
.material-metric-callout { cursor: pointer; }
.material-metric-callout:hover rect {
  fill: rgba(30, 41, 59, .96);
  stroke: #fbbf24;
}

.cr-docs-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.cr-docs-head h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
}
.cr-docs-head p {
  margin: 0;
  max-width: 980px;
}
.cr-docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.cr-docs-sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
}
.cr-docs-search {
  display: grid;
  gap: 6px;
  color: var(--cr-muted);
  font-size: 12px;
  font-weight: 800;
}
.cr-docs-search input {
  width: 100%;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255,255,255,.05);
  color: var(--cr-text);
}
.cr-docs-tabs {
  display: grid;
  gap: 6px;
}
.cr-docs-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255,255,255,.04);
  color: var(--cr-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.cr-docs-tab strong {
  color: var(--cr-accent);
  font-size: 12px;
}
.cr-docs-tab.is-active {
  border-color: rgba(245, 197, 92, .72);
  background: rgba(245, 197, 92, .12);
  color: var(--cr-text);
}
.cr-docs-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.cr-docs-themes,
.cr-docs-panel {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.cr-docs-themes {
  padding: 16px;
}
.cr-docs-themes h2,
.cr-docs-panel h2 {
  margin: 0;
  font-size: 1rem;
}
.cr-docs-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.cr-docs-theme {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0,0,0,.15);
}
.cr-docs-theme div {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.cr-docs-theme strong {
  color: var(--cr-text);
}
.cr-docs-theme span,
.cr-docs-flags span,
.cr-docs-status {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(245, 197, 92, .14);
  color: var(--cr-accent);
  font-size: 11px;
  font-weight: 900;
}
.cr-docs-theme p {
  margin: 8px 0;
  color: var(--cr-muted);
  font-size: 13px;
  line-height: 1.45;
}
.cr-docs-theme small {
  color: var(--cr-muted);
}
.cr-docs-panel {
  display: none;
}
.cr-docs-panel.is-active {
  display: block;
}
.cr-docs-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cr-line);
}
.cr-docs-panel-title span {
  color: var(--cr-muted);
  font-size: 12px;
  font-weight: 800;
}
.cr-docs-table-wrap {
  overflow: auto;
}
.cr-docs-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}
.cr-docs-table th,
.cr-docs-table td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.42;
}
.cr-docs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111827;
  color: var(--cr-muted);
  font-size: 11px;
  text-transform: uppercase;
}
.cr-docs-table td {
  color: var(--cr-text);
}
.cr-docs-table td:nth-child(1) {
  width: 210px;
}
.cr-docs-table td:nth-child(3) {
  width: 34%;
}
.cr-docs-table code {
  display: block;
  margin-top: 4px;
  color: var(--cr-accent);
  white-space: normal;
}
.cr-docs-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}
.cr-docs-status {
  display: inline-block;
  margin: 0 6px 4px 0;
}

@media (max-width: 840px) {
  .cr-main { padding-top: 24px; }
  .cr-hero, .cr-section-grid, .cr-history-head, .cr-summary-row, .cr-viewer-grid, .game-viewer-main, .cr-docs-layout { grid-template-columns: 1fr; }
  .cr-hero { gap: 18px; }
  .cr-hero h1 { font-size: 1.9rem; }
  .cr-hero-copy p, .cr-choice p { font-size: 0.9rem; }
  .cr-history-head, .cr-viewer-head { display: grid; align-items: start; }
  .cr-docs-sidebar { position: static; }
  h1 { font-size: 2.25rem; }
}
