@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #151412;
  --bg-raised: #1d1b18;
  --bg-panel: #211f1c;
  --bg-hover: #2a2723;
  --border: #3a3630;
  --border-strong: #4a443b;
  --text: #eee9df;
  --muted: #aaa298;
  --faint: #756e65;
  --accent: #d69b52;
  --accent-strong: #edb86e;
  --danger: #c76b69;
  --header-height: 52px;
  --board-size: min(82dvh, 78vw, 820px);
  --board-light: #d8c6a7;
  --board-dark: #876c51;
  --board-highlight-light: #ead37c;
  --board-highlight-dark: #b59b4e;
  color-scheme: dark;
}

body[data-theme="light"] {
  --bg: #f1eee8;
  --bg-raised: #faf8f4;
  --bg-panel: #fffdf9;
  --bg-hover: #ebe5dc;
  --border: #d7d0c5;
  --border-strong: #bdb4a7;
  --text: #25221e;
  --muted: #696157;
  --faint: #948a7e;
  --accent: #a96322;
  --accent-strong: #88501b;
  --danger: #a8484c;
  --board-light: #ead9bd;
  --board-dark: #aa8767;
  --board-highlight-light: #e4c560;
  --board-highlight-dark: #bf9f40;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 14px;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.app-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  height: var(--header-height);
  justify-content: space-between;
  padding: 0 clamp(12px, 2vw, 28px);
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 9px;
  text-decoration: none;
}

.brand-group {
  align-items: center;
  display: flex;
  gap: 2px;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  color: #19140e;
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  height: 25px;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 25px;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

.header-actions,
.board-topline,
.game-panel-head,
.record-summary,
.overlay-head,
.board-actions,
.setup-actions,
.setting-toggle-row {
  align-items: center;
  display: flex;
}

.header-actions {
  gap: 12px;
}

.icon-button,
.micro-button,
.compact-button,
.color-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.icon-button {
  color: var(--muted);
  font-size: 18px;
  height: 32px;
  min-width: 32px;
  padding: 0;
}

.about-button {
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
  height: 26px;
  min-width: 26px;
}

.icon-button:hover,
.micro-button:hover,
.compact-button:hover,
.color-button:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-button:disabled,
.micro-button:disabled,
.compact-button:disabled,
.color-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.game-shell {
  align-items: center;
  display: flex;
  height: calc(100dvh - var(--header-height));
  justify-content: center;
  overflow: hidden;
  padding: 12px clamp(12px, 2vw, 28px);
}

.game-layout {
  align-items: center;
  display: grid;
  gap: clamp(16px, 2.4vw, 30px);
  grid-template-columns: minmax(0, 1fr) minmax(245px, 310px);
  height: min(100%, 860px);
  max-width: 1320px;
  width: 100%;
}

.board-column {
  min-width: 0;
}

.board-topline {
  gap: 10px;
  height: 26px;
  justify-content: flex-start;
  margin: 0 auto;
  max-width: var(--board-size);
  overflow: hidden;
}

.board-topline .compact-button {
  min-height: 24px;
  padding: 0 8px;
}

.mode-label,
.panel-kicker,
.setup-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-label {
  color: var(--accent-strong);
  flex: 0 0 auto;
  font-weight: 600;
}

.status-text {
  color: var(--muted);
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row {
  align-items: flex-start;
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr);
}

.board-stack {
  min-width: 0;
  width: min(100%, var(--board-size));
}

.board-frame {
  aspect-ratio: 1;
  background: #0f0e0c;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  margin: 0 auto;
  overflow: hidden;
  width: 100%;
}

#board,
#board .board-b72b1 {
  height: 100%;
  width: 100%;
}

#board .board-b72b1 {
  border: 0;
}

#board .white-1e1d7 {
  background: var(--board-light);
}

#board .black-3c85d {
  background: var(--board-dark);
}

#board .square-55d63 {
  transition: background-color 100ms ease;
}

#board .click-selected {
  background: var(--accent) !important;
}

#board .click-target {
  box-shadow: inset 0 0 0 3px rgba(237, 184, 110, 0.9);
}

#board img {
  max-height: 100%;
  max-width: 100%;
}

#board .notation-322f9 {
  color: rgba(35, 25, 17, 0.68);
  font-size: clamp(8px, 1vw, 12px);
  font-weight: 600;
}

#board .black-3c85d .notation-322f9 {
  color: rgba(250, 241, 222, 0.72);
}

.eval-panel {
  height: var(--board-size);
  z-index: 2;
  position: relative;
  width: 24px;
}

.eval-shell {
  background: #000;
  border: 1px solid var(--border-strong);
  height: 100%;
  overflow: hidden;
  position: absolute;
  inset: 0;
  width: 100%;
}

.eval-track {
  height: 100%;
  position: relative;
  width: 100%;
}

.eval-fill {
  background: #fff;
  bottom: 0;
  height: 50%;
  left: 50%;
  position: absolute;
  transition: bottom 240ms cubic-bezier(0.22, 1, 0.36, 1), height 240ms cubic-bezier(0.22, 1, 0.36, 1), left 240ms cubic-bezier(0.22, 1, 0.36, 1), width 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: bottom, height, left, width;
  width: 100%;
}

.eval-marker {
  background: var(--accent);
  bottom: calc(50% - 2px);
  height: 4px;
  left: 0;
  position: absolute;
  transition: bottom 240ms cubic-bezier(0.22, 1, 0.36, 1), left 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: bottom, left;
  width: 100%;
}

.eval-readout {
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 600;
  left: 50%;
  line-height: 1.15;
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.micro-button {
  bottom: -31px;
  color: var(--faint);
  font-size: 15px;
  height: 24px;
  left: 0;
  min-width: 24px;
  padding: 0;
  position: absolute;
  z-index: 2;
}

.board-actions {
  gap: 4px;
  justify-content: center;
  margin-top: 8px;
}

.action-button {
  align-items: center;
  line-height: 1;
  height: 30px;
  min-width: 30px;
}

.action-button > span {
  display: block;
  line-height: 1;
}

.hint-button {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
  font-size: 18px;
  font-variant-emoji: text;
}

.compact-button,
.color-button {
  border-color: var(--border);
  color: var(--muted);
  font-size: 12px;
  min-height: 30px;
  padding: 0 10px;
}

.compact-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b150e;
  font-weight: 600;
}

.compact-button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.compact-button.secondary {
  background: var(--bg-raised);
}

.compact-button.danger {
  color: var(--danger);
}

.game-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: var(--board-size);
  min-height: 0;
  overflow: hidden;
}

.game-panel-head {
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 12px;
}

.game-panel-head > div {
  display: grid;
  gap: 3px;
}

.game-panel-head strong {
  font-size: 15px;
  font-weight: 500;
}

.game-panel-actions {
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  padding: 8px 12px;
}

.game-panel-actions .compact-button {
  flex: 1;
}

.record-summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 12px;
}

.record-badge {
  align-items: center;
  border: 1px solid var(--border);
  display: inline-flex;
  gap: 6px;
  min-height: 24px;
  padding: 2px 7px;
}

.record-badge::before {
  border: 1px solid currentColor;
  content: "";
  display: inline-block;
  height: 8px;
  width: 8px;
}

.record-color.is-white,
.record-turn.is-white {
  background: rgba(240, 237, 228, 0.12);
  color: var(--text);
}

.record-color.is-black,
.record-turn.is-black {
  background: rgba(15, 14, 12, 0.45);
  color: var(--muted);
}

.record-turn {
  border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
  font-weight: 600;
}

.history-table {
  display: grid;
  grid-template-columns: 34px 1fr 1fr;
}

.history-header {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 9px 12px 7px;
  text-transform: uppercase;
}

.move-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px 8px;
  scrollbar-color: var(--border-strong) transparent;
}

.history-row {
  align-items: center;
  border-top: 1px solid rgba(128, 116, 100, 0.14);
  color: var(--text);
  display: grid;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  grid-template-columns: 34px 1fr 1fr;
  min-height: 29px;
  padding: 0 6px;
}

.history-row:last-child {
  background: rgba(214, 155, 82, 0.08);
}

.move-number {
  color: var(--faint);
}

.move-cell {
  align-items: center;
  display: flex;
  gap: 4px;
  overflow: hidden;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-piece-icon {
  flex: 0 0 20px;
  height: 20px;
  object-fit: contain;
  width: 20px;
}

.history-empty {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 6px;
}

.overlay {
  align-items: flex-start;
  background: rgba(8, 7, 6, 0.7);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 70px 16px 16px;
  position: fixed;
  z-index: 20;
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.overlay-surface {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  max-width: 440px;
  padding: 16px;
  width: 100%;
}

.about-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.about-copy p {
  margin: 0 0 12px;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.promotion-overlay {
  background: rgba(8, 7, 6, 0.68);
  display: block;
  inset: 0;
  position: fixed;
  z-index: 25;
}

.promotion-overlay.hidden {
  display: none !important;
}

.promotion-surface {
  left: var(--promotion-left, 8px);
  padding: 0;
  position: fixed;
  top: var(--promotion-top, 8px);
  width: var(--promotion-size, 64px);
  z-index: 26;
}

.promotion-options {
  display: grid;
  gap: var(--promotion-gap, 4px);
  grid-template-columns: 1fr;
}

.promotion-button {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(238, 235, 227, 0.94);
  border: 1px solid rgba(20, 18, 15, 0.35);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 5px;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.promotion-button:hover,
.promotion-button:focus-visible {
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.46);
  outline: none;
  transform: scale(1.06);
}

.promotion-button img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.overlay-head {
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.overlay-head > div {
  display: grid;
  gap: 4px;
}

.overlay-head h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.setting-list {
  display: grid;
  gap: 2px;
}

.setting-field {
  align-items: center;
  border-bottom: 1px solid rgba(128, 116, 100, 0.2);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 0;
}

.setting-field > span:first-child {
  display: grid;
  gap: 3px;
}

.setting-field strong {
  font-size: 13px;
  font-weight: 500;
}

.setting-field small {
  color: var(--faint);
  font-size: 11px;
}

.setting-field select {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  min-width: 70px;
  padding: 6px 8px;
}

.edit-record-button {
  flex: 0 0 28px;
  font-size: 16px;
  height: 28px;
  min-width: 28px;
}

.setting-toggle-row {
  gap: 10px;
}

.overlay-footnote {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
  margin: 14px 0 0;
}

.setup-section {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.color-picker {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 1fr);
}

.color-button {
  min-height: 36px;
}

.color-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b150e;
  font-weight: 600;
}

.setup-level {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
}

.setup-value {
  color: var(--text);
  font-size: 13px;
}

.setup-actions {
  gap: 7px;
  justify-content: flex-end;
}

.setup-actions .compact-button {
  min-height: 34px;
}

.toast {
  background: var(--text);
  bottom: 18px;
  color: var(--bg);
  font-size: 12px;
  left: 50%;
  max-width: calc(100% - 24px);
  opacity: 0;
  padding: 9px 12px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 8px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 30;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-only {
  display: none;
}

body.eval-hidden .eval-panel {
  height: 0;
  width: 0;
}

body.eval-hidden .eval-shell,
body.eval-hidden .eval-readout {
  display: none;
}

body.eval-hidden .micro-button {
  left: 0;
}

body.eval-hidden .board-row {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1120px) {
  :root {
    --board-size: min(82dvh, 73vw, 720px);
  }

  .game-layout {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  }

}

@media (max-width: 900px) {
  :root {
    --board-size: min(88vw, calc(100dvh - 164px), 720px);
  }

  .game-shell {
    align-items: flex-start;
    padding-top: 8px;
  }

  .game-layout {
    display: block;
    height: 100%;
  }

  .board-topline {
    max-width: var(--board-size);
  }

  .board-row,
  body.eval-hidden .board-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .eval-panel {
    height: 16px;
    margin: 0 auto;
    width: var(--board-size);
  }

  body.eval-hidden .eval-panel {
    height: 0;
    margin: 0;
    width: 0;
  }

  body.eval-hidden .micro-button {
    left: 0;
    top: 0;
  }

  .eval-shell {
    height: 100%;
    width: 100%;
  }

  .eval-fill {
    bottom: auto;
    height: 100%;
    left: 0;
    width: 50%;
  }

  .eval-marker {
    bottom: auto;
    height: 100%;
    left: calc(50% - 2px);
    width: 4px;
  }

  .eval-readout {
    left: 50%;
    top: -25px;
    transform: translateX(-50%);
  }

  .micro-button {
    bottom: auto;
    left: -28px;
    top: -5px;
  }

  .game-panel {
    display: none;
  }

  body.history-open .game-panel {
    display: flex;
    height: min(70dvh, 520px);
    inset: auto 8px 8px;
    position: fixed;
    width: auto;
    z-index: 10;
  }

  .mobile-only {
    display: inline-flex;
  }

  .board-actions {
    flex-wrap: wrap;
  }

  .board-actions .compact-button.danger,
  .board-actions #toggle-mode {
    display: none;
  }
}

@media (max-width: 520px) {
  :root {
    --header-height: 48px;
    --board-size: min(90vw, calc(100dvh - 150px), 520px);
  }

  body {
    font-size: 13px;
  }

  .app-header {
    padding: 0 10px;
  }

  .brand-name {
    font-size: 15px;
  }

  .game-shell {
    padding: 6px 8px 8px;
  }

  .board-topline {
    height: 24px;
  }

  .status-text {
    font-size: 11px;
  }

  .board-actions {
    margin-top: 6px;
  }

  .board-actions .compact-button.primary {
    flex: 1;
  }

  .overlay {
    align-items: end;
    padding: 0;
  }

  .overlay-surface {
    border-bottom: 0;
    max-width: none;
    padding: 14px 14px 18px;
  }

  .overlay-head h2 {
    font-size: 18px;
  }

  .setup-actions {
    justify-content: stretch;
  }

  .setup-actions .compact-button {
    flex: 1;
  }

  .record-summary {
    font-size: 10px;
  }
}

@media (max-height: 460px) and (orientation: landscape) {
  :root {
    --board-size: min(82vw, calc(100dvh - 150px), 480px);
  }

  .game-shell {
    padding-top: 4px;
  }

  .board-topline {
    height: 20px;
  }

  .board-actions {
    margin-top: 3px;
    flex-wrap: nowrap;
  }

  .board-actions #share-position {
    display: none;
  }
}

.menu-surface,
.wide-surface {
  max-width: 620px;
}

.menu-grid {
  display: grid;
  gap: 6px;
}

.menu-item {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.menu-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.menu-item strong {
  font-size: 13px;
  font-weight: 500;
}

.menu-item small,
.overlay-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-row label {
  color: var(--muted);
  display: grid;
  flex: 1;
  font-size: 11px;
  gap: 5px;
}

.filter-row select {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  min-height: 32px;
  padding: 5px 7px;
}

.record-list {
  display: grid;
  gap: 6px;
  max-height: min(60dvh, 480px);
  overflow-y: auto;
}

.record-item {
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.record-item-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-item-title-row {
  align-items: center;
  display: flex;
  gap: 2px;
  min-width: 0;
}

.record-item-title {
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-title-action {
  flex: 0 0 26px;
  font-size: 15px;
  height: 26px;
  min-width: 26px;
}

.record-item-detail,
.record-item-meta,
.empty-state {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.record-item-meta {
  color: var(--faint);
}

.record-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.record-item-actions .compact-button {
  min-height: 28px;
  padding: 0 8px;
}

.favorite-button {
  color: var(--accent-strong);
}

.storage-summary,
.statistics-content {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.statistics-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 14px;
}

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: grid;
  gap: 3px;
  padding: 10px;
}

.stat-card strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
}

.stat-card span {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.level-table {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding-top: 8px;
}

.level-table span {
  padding: 5px 3px;
}

.level-table span:nth-child(-n + 6) {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.data-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
}

.replay-surface {
  max-width: 760px;
}

.replay-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 190px;
}

.replay-board-frame {
  aspect-ratio: 1;
  background: #0f0e0c;
  border: 1px solid var(--border-strong);
  max-width: 520px;
  overflow: hidden;
  width: 100%;
}

#replay-board,
#replay-board .board-b72b1 {
  height: 100%;
  width: 100%;
}

#replay-board .board-b72b1 {
  border: 0;
}

#replay-board .white-1e1d7 {
  background: var(--board-light);
}

#replay-board .black-3c85d {
  background: var(--board-dark);
}

.replay-moves {
  border: 1px solid var(--border);
  max-height: 520px;
  min-height: 150px;
  overflow-y: auto;
  padding: 5px;
}

.replay-move {
  color: var(--muted);
  cursor: pointer;
  display: block;
  padding: 6px;
  width: 100%;
}

.replay-move:hover,
.replay-move.active {
  background: var(--bg-hover);
  color: var(--text);
}

.replay-controls {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}

.replay-position {
  color: var(--muted);
  font-size: 11px;
  min-width: 62px;
  text-align: center;
}

@media (max-width: 640px) {
  .record-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .record-item-actions {
    justify-content: start;
  }

  .data-actions,
  .statistics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .replay-layout {
    grid-template-columns: 1fr;
  }

  .replay-moves {
    max-height: 150px;
  }
}
