:root {
  --bg: #151515;
  --panel: #1f1f1f;
  --card: #262626;
  --ink: #f3f0ea;
  --muted: #b6b0a6;
  --accent: #f0b429;
  --wood: #d1a46a;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #2a2a2a 0%, #111 60%, #0e0e0e 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: grid;
  gap: 20px;
}

.header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

.header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

button {
  border: none;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease;
}

button:hover {
  background: #2f2f2f;
  transform: translateY(-1px);
}

.board-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
}

.board-wrap {
  background: var(--panel);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

#board {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
}

.moves {
  background: var(--panel);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-height: 720px;
  overflow-y: auto;
}

.moves h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.moves ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px 32px;
  border: 1px solid var(--line);
  text-align: center;
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .board-section {
    grid-template-columns: 1fr;
  }

  .moves {
    max-height: 260px;
  }
}
