:root {
  color-scheme: light;
  --bg: #f5efe2;
  --panel: rgba(255, 251, 244, 0.9);
  --ink: #1d1b19;
  --muted: #6c655b;
  --accent: #cb5f2d;
  --accent-2: #2f6c5b;
  --line: #cbbda7;
  --shadow: 0 22px 60px rgba(66, 45, 15, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.75), transparent 36%),
    linear-gradient(145deg, #f8f2e7 0%, #ead9bc 100%);
}

.app {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 28px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow,
.label,
.legend {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.95;
}

.subtitle {
  margin: 12px 0 0;
  font-size: 1.08rem;
  max-width: 38rem;
  color: #3d382f;
}

.panel {
  padding: 22px;
  border: 1px solid rgba(112, 89, 56, 0.12);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.status {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.restart {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  color: #fffaf3;
  background: linear-gradient(135deg, var(--accent), #df8546);
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(203, 95, 45, 0.28);
}

.restart:hover {
  filter: brightness(1.04);
}

.legend {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}

.legend strong {
  color: var(--ink);
}

.board-shell {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(112, 89, 56, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent),
    #f4ead7;
}

canvas {
  display: block;
  width: min(900px, calc(100vw - 80px));
  height: min(900px, calc(100vw - 80px));
  touch-action: manipulation;
}

@media (max-width: 720px) {
  .app {
    width: min(100vw - 16px, 1120px);
    padding-top: 20px;
  }

  .panel {
    padding: 16px;
  }

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

  canvas {
    width: max(720px, calc(100vw - 48px));
    height: max(720px, calc(100vw - 48px));
  }
}
