:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-accent: #142742;
  --panel: rgba(7, 17, 31, 0.72);
  --panel-strong: rgba(12, 23, 41, 0.92);
  --line: rgba(147, 197, 253, 0.18);
  --text: #ecf6ff;
  --muted: #9ab4cd;
  --square-light: linear-gradient(180deg, #f7efdc 0%, #decbab 100%);
  --square-dark: linear-gradient(180deg, #8d5e38 0%, #5f361f 100%);
  --highlight: #7dd3fc;
  --shadow: 0 24px 70px rgba(3, 8, 18, 0.45);
  --radius: 28px;
  --board-rotate-x: 58deg;
  --board-rotate-z: 0deg;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(41, 84, 143, 0.3), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.18), transparent 24%),
    linear-gradient(180deg, #07101d 0%, #040912 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(125, 211, 252, 0.08), transparent 18%),
    radial-gradient(circle at 80% 12%, rgba(245, 158, 11, 0.08), transparent 24%);
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.hero-card,
.card,
.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 26, 45, 0.96), rgba(7, 14, 25, 0.92)),
    linear-gradient(120deg, rgba(125, 211, 252, 0.04), rgba(245, 158, 11, 0.04));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 30px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--highlight);
  font-size: 0.74rem;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.02;
  font-family: Georgia, "Times New Roman", serif;
}

.hero-text {
  margin: 12px 0 0;
  max-width: 660px;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.board-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scene-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(125, 211, 252, 0.14);
  background:
    radial-gradient(circle at top, rgba(125, 211, 252, 0.15), transparent 38%),
    radial-gradient(circle at bottom, rgba(245, 158, 11, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(7, 16, 29, 0.86), rgba(5, 12, 21, 0.96));
  min-height: 500px;
  box-shadow: var(--shadow);
}

.board-scene {
  display: grid;
  place-items: center;
  perspective: 1500px;
  min-height: 100%;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.board-scene.is-dragging {
  cursor: grabbing;
}

.board {
  width: min(100%, 720px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(4px, 0.6vw, 6px);
  padding: clamp(12px, 2vw, 22px);
  border-radius: 30px;
  transform-style: preserve-3d;
  transform:
    rotateX(var(--board-rotate-x))
    rotateZ(var(--board-rotate-z));
  background:
    linear-gradient(180deg, #d0b48a 0%, #7f5932 100%);
  box-shadow:
    0 48px 65px rgba(3, 8, 18, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    inset 0 -16px 24px rgba(57, 28, 11, 0.55);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.board.two-d {
  box-shadow:
    0 24px 48px rgba(3, 8, 18, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -8px 14px rgba(57, 28, 11, 0.28);
}

.square {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  transform-style: preserve-3d;
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

.square::before,
.square::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.square::before {
  transform: translateZ(8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 12px 10px rgba(6, 14, 24, 0.2);
}

.square::after {
  inset: auto 6px -13px;
  height: 16px;
  filter: blur(8px);
  background: rgba(3, 8, 18, 0.45);
  transform: translateZ(-10px);
}

.square.light::before {
  background: var(--square-light);
}

.square.dark::before {
  background: var(--square-dark);
}

.square:hover {
  transform: translateZ(10px) translateY(-1px);
}

.square.selectable:hover::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 0 0 2px rgba(125, 211, 252, 0.5),
    0 12px 10px rgba(6, 14, 24, 0.2);
}

.square.selected::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 0 0 3px rgba(245, 158, 11, 0.92),
    0 14px 14px rgba(245, 158, 11, 0.16);
}

.square.legal::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 0 0 3px rgba(125, 211, 252, 0.95),
    0 0 18px rgba(125, 211, 252, 0.22);
}

.square.last-move::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 0 0 3px rgba(52, 211, 153, 0.88),
    0 12px 14px rgba(52, 211, 153, 0.14);
}

.square.check::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 14px rgba(58, 33, 18, 0.22),
    0 0 0 3px rgba(249, 115, 115, 0.94),
    0 0 24px rgba(249, 115, 115, 0.3);
}

.piece {
  --piece-gloss: #fffdf7;
  --piece-mid: #e8dcca;
  --piece-dark: #b69d7b;
  --piece-deep: #725842;
  --piece-shadow: rgba(0, 0, 0, 0.5);
  --piece-shadow-long: rgba(0, 0, 0, 0.34);
  --piece-lift: 36px;
  --piece-size-scale: 1;
  --piece-height-scale: 1.34;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  height: 138%;
  transform:
    translate(-50%, -84%)
    translateZ(var(--piece-lift))
    scale(var(--piece-size-scale));
  transform-style: preserve-3d;
  transition:
    transform 180ms ease,
    filter 180ms ease;
  pointer-events: none;
}

.piece.white {
  --piece-gloss: #fffef8;
  --piece-mid: #f1e6d4;
  --piece-dark: #cfb799;
  --piece-deep: #8c7358;
  --piece-shadow: rgba(0, 0, 0, 0.46);
  --piece-shadow-long: rgba(0, 0, 0, 0.3);
}

.piece.black {
  --piece-gloss: #8ca0bc;
  --piece-mid: #334c6d;
  --piece-dark: #1d2d47;
  --piece-deep: #060d18;
  --piece-shadow: rgba(0, 0, 0, 0.62);
  --piece-shadow-long: rgba(0, 0, 0, 0.4);
}

.piece-shadow {
  position: absolute;
  left: 50%;
  bottom: -1%;
  width: 82%;
  height: 16%;
  border-radius: 999px;
  background: var(--piece-shadow);
  filter: blur(7px);
  transform:
    translateX(-50%)
    translateZ(-10px)
    rotateZ(-10deg)
    scaleX(1.12);
}

.piece-shadow::after {
  content: "";
  position: absolute;
  left: 38%;
  bottom: 8%;
  width: 170%;
  height: 88%;
  border-radius: 999px;
  background: var(--piece-shadow-long);
  filter: blur(9px);
  transform:
    rotate(12deg)
    skewX(-28deg)
    scaleX(1.1);
}

.piece-core {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  transform:
    rotateX(calc(-1 * var(--board-rotate-x)))
    scaleY(var(--piece-height-scale));
}

.piece-core > span {
  position: absolute;
  left: 50%;
  transform-style: preserve-3d;
  transform: translateX(-50%);
}

.piece-base,
.piece-body,
.piece-top,
.piece-detail {
  background:
    linear-gradient(180deg, var(--piece-gloss) 0%, var(--piece-mid) 34%, var(--piece-dark) 72%, var(--piece-deep) 100%);
  box-shadow:
    inset -6px 0 10px rgba(0, 0, 0, 0.12),
    inset 6px 0 10px rgba(255, 255, 255, 0.1),
    0 10px 14px rgba(5, 10, 17, 0.16);
}

.piece-base {
  bottom: 5%;
  width: 74%;
  height: 16%;
  border-radius: 999px;
  transform:
    translateX(-50%)
    translateZ(12px);
}

.piece-base::after {
  content: "";
  position: absolute;
  inset: 14% 10%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(3, 8, 18, 0.16));
}

.piece-body {
  bottom: 16%;
  width: 50%;
  height: 50%;
  border-radius: 28% 28% 18% 18% / 16% 16% 12% 12%;
  clip-path: polygon(18% 100%, 28% 16%, 72% 16%, 82% 100%);
  transform:
    translateX(-50%)
    translateZ(20px);
}

.piece-top {
  bottom: 58%;
  width: 30%;
  height: 22%;
  border-radius: 50%;
  transform:
    translateX(-50%)
    translateZ(28px);
}

.piece-detail {
  bottom: 36%;
  width: 54%;
  height: 8%;
  border-radius: 999px;
  transform:
    translateX(-50%)
    translateZ(26px);
}

.piece.glimmer {
  filter: drop-shadow(0 0 18px rgba(125, 211, 252, 0.26));
}

.piece.piece-p .piece-body {
  width: 42%;
  height: 28%;
  clip-path: polygon(20% 100%, 32% 14%, 68% 14%, 80% 100%);
}

.piece.piece-p .piece-top {
  bottom: 38%;
  width: 42%;
  height: 28%;
}

.piece.piece-p .piece-detail {
  bottom: 32%;
  width: 52%;
}

.piece.piece-r .piece-body {
  width: 48%;
  height: 50%;
  clip-path: polygon(18% 100%, 18% 10%, 82% 10%, 82% 100%);
  border-radius: 10% 10% 18% 18% / 8% 8% 10% 10%;
}

.piece.piece-r .piece-top {
  bottom: 56%;
  width: 58%;
  height: 18%;
  border-radius: 14% 14% 8% 8%;
}

.piece.piece-r .piece-top::after {
  content: "";
  position: absolute;
  inset: -10% 16% auto;
  height: 42%;
  border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 10%,
    rgba(255, 255, 255, 0.26) 10% 19%,
    transparent 19% 32%
  );
}

.piece.piece-r .piece-detail {
  bottom: 26%;
  width: 60%;
}

.piece.piece-n {
  --knight-direction: -1;
}

.piece.piece-n.piece-right-facing {
  --knight-direction: 1;
}

.piece.piece-n .piece-body {
  width: 52%;
  height: 40%;
  clip-path: polygon(14% 100%, 24% 12%, 76% 12%, 86% 100%);
  border-radius: 18% 18% 16% 16% / 12% 12% 10% 10%;
}

.piece.piece-n .piece-top {
  left: calc(50% + 3% * var(--knight-direction));
  bottom: 38%;
  width: 58%;
  height: 42%;
  clip-path: polygon(18% 100%, 8% 74%, 14% 30%, 40% 4%, 74% 10%, 90% 42%, 82% 100%, 58% 88%, 38% 92%);
  border-radius: 20% 32% 22% 24%;
  transform:
    translateX(-50%)
    translateZ(36px)
    rotateY(calc(18deg * var(--knight-direction)))
    rotateZ(calc(5deg * var(--knight-direction)));
}

.piece.piece-n .piece-top::before {
  content: "";
  position: absolute;
  inset: auto 8% 14% 40%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--piece-gloss) 0%, var(--piece-mid) 34%, var(--piece-dark) 72%, var(--piece-deep) 100%);
  transform: translateZ(8px) rotate(6deg);
}

.piece.piece-n .piece-top::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 24%;
  width: 18%;
  height: 24%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(180deg, var(--piece-gloss) 0%, var(--piece-mid) 34%, var(--piece-dark) 72%, var(--piece-deep) 100%);
  transform:
    translateZ(10px)
    rotate(calc(-14deg * var(--knight-direction)));
}

.piece.piece-n .piece-detail {
  left: calc(50% - 7% * var(--knight-direction));
  bottom: 43%;
  width: 24%;
  height: 34%;
  clip-path: polygon(30% 100%, 0 38%, 34% 0, 100% 100%);
  transform:
    translateX(-50%)
    translateZ(34px)
    rotateY(calc(12deg * var(--knight-direction)))
    rotateZ(calc(-10deg * var(--knight-direction)));
}

.piece.piece-n .piece-detail::before {
  content: "";
  position: absolute;
  inset: 18% 18% auto 18%;
  height: 12%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.piece.piece-b .piece-body {
  width: 42%;
  height: 46%;
  clip-path: polygon(50% 0, 78% 18%, 72% 100%, 28% 100%, 22% 18%);
  border-radius: 24% 24% 18% 18%;
}

.piece.piece-b .piece-top {
  bottom: 52%;
  width: 28%;
  height: 30%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 10% 10% 30% 30%;
}

.piece.piece-b .piece-top::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  width: 12%;
  height: 58%;
  border-radius: 999px;
  background: rgba(9, 16, 29, 0.34);
  transform: translateX(-50%) rotate(18deg);
}

.piece.piece-b .piece-detail {
  bottom: 28%;
  width: 54%;
}

.piece.piece-q .piece-body {
  width: 50%;
  height: 60%;
  clip-path: polygon(24% 100%, 14% 16%, 86% 16%, 76% 100%);
}

.piece.piece-q .piece-top {
  bottom: 66%;
  width: 48%;
  height: 16%;
  clip-path: polygon(0 100%, 16% 42%, 32% 78%, 50% 0, 68% 78%, 84% 42%, 100% 100%);
  border-radius: 12% 12% 28% 28%;
}

.piece.piece-q .piece-detail {
  bottom: 80%;
  width: 18%;
  height: 12%;
  border-radius: 50%;
}

.piece.piece-k .piece-body {
  width: 52%;
  height: 64%;
  clip-path: polygon(26% 100%, 16% 14%, 84% 14%, 74% 100%);
}

.piece.piece-k .piece-top {
  bottom: 72%;
  width: 42%;
  height: 12%;
  border-radius: 999px;
}

.piece.piece-k .piece-detail {
  bottom: 80%;
  width: 12%;
  height: 18%;
  border-radius: 4px;
}

.piece.piece-k .piece-detail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  width: 230%;
  height: 22%;
  border-radius: 4px;
  background: inherit;
  transform: translateX(-50%);
}

.square.legal .piece,
.square.selected .piece {
  transform:
    translate(-50%, -88%)
    translateZ(calc(var(--piece-lift) + 6px))
    scale(calc(var(--piece-size-scale) * 1.01));
}

.board.two-d .square::before {
  transform: translateZ(2px);
}

.board.two-d .square::after {
  opacity: 0;
}

.board.two-d .square:hover {
  transform: translateY(-1px);
}

.board.two-d .piece {
  height: 120%;
  transform:
    translate(-50%, -72%)
    translateZ(calc(var(--piece-lift) * 0.38))
    scale(calc(var(--piece-size-scale) * 0.94));
}

.board.two-d .piece-shadow {
  opacity: 0.65;
  transform:
    translateX(-50%)
    translateZ(-2px)
    rotateZ(-8deg)
    scaleX(1.04);
}

.board.two-d .piece-base,
.board.two-d .piece-body,
.board.two-d .piece-top,
.board.two-d .piece-detail {
  box-shadow:
    inset -4px 0 8px rgba(0, 0, 0, 0.1),
    inset 4px 0 8px rgba(255, 255, 255, 0.08),
    0 6px 8px rgba(5, 10, 17, 0.12);
}

.board.two-d .square.legal .piece,
.board.two-d .square.selected .piece {
  transform:
    translate(-50%, -74%)
    translateZ(calc(var(--piece-lift) * 0.44))
    scale(calc(var(--piece-size-scale) * 0.95));
}

.board.two-d .coord {
  transform: translateZ(6px);
}

.coord {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(8, 17, 31, 0.55);
  transform: translateZ(18px);
  pointer-events: none;
}

.coord.file {
  bottom: 8px;
  right: 9px;
}

.coord.rank {
  top: 8px;
  left: 10px;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.view-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 11px 16px;
  transition:
    transform 140ms ease,
    filter 140ms ease,
    background-color 140ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #f59e0b, #fb7185);
  color: #1f1207;
  font-weight: 800;
}

.secondary-button {
  background: rgba(148, 163, 184, 0.13);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.ghost-button {
  background: transparent;
  color: var(--highlight);
  border: 1px solid rgba(125, 211, 252, 0.24);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.slot-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.status-card {
  padding: 18px 22px;
}

.status-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.install-hint {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.control-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.06rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.field span {
  font-size: 0.92rem;
}

select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
}

.range-input {
  width: 100%;
  height: 12px;
  margin: 2px 0 0;
  accent-color: #7dd3fc;
}

.range-input:disabled {
  opacity: 0.45;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.legend-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(8, 15, 27, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.info-tile span {
  font-size: 0.8rem;
  color: var(--muted);
}

.info-tile strong {
  font-size: 1rem;
}

.save-slots {
  display: grid;
  gap: 12px;
}

.save-slot {
  padding: 14px;
  border-radius: 20px;
  background: rgba(8, 15, 27, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.save-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.save-slot h3 {
  margin: 0;
  font-size: 1rem;
}

.save-slot time,
.slot-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.slot-actions button {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.slot-actions .delete-button {
  color: #fecaca;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.history-row {
  display: grid;
  grid-template-columns: 52px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.history-number {
  font-size: 0.9rem;
  color: var(--muted);
}

.move-button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.move-button.active {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.44);
}

.move-button:disabled {
  visibility: hidden;
}

@media (max-width: 1160px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  :root {
    --board-rotate-x: 52deg;
    --board-rotate-z: 0deg;
  }

  .app-shell {
    width: min(100% - 10px, 980px);
    padding-top: 8px;
  }

  .hero-card,
  .card,
  .status-card {
    border-radius: 24px;
  }

  .hero-card {
    padding: 22px 18px;
  }

  .scene-wrap {
    min-height: auto;
    padding: 8px;
    border-radius: 24px;
  }

  .board {
    width: min(100vw - 20px, 760px);
    padding: 6px;
    gap: 2px;
    border-radius: 24px;
  }

  .square {
    border-radius: 9px;
  }

  .piece {
    --piece-lift: 38px;
    --piece-size-scale: 1.12;
    --piece-height-scale: 1.4;
    width: 88%;
    height: 144%;
  }

  .board-toolbar {
    gap: 8px;
  }

  .view-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .slot-actions button {
    width: 100%;
  }

  .history-row {
    grid-template-columns: 42px 1fr 1fr;
  }
}
