:root {
  --bg: #f6f4ef;
  --ink: #1c2024;
  --muted: #68737d;
  --line: rgba(28, 32, 36, 0.12);
  --accent: #0f766e;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.game-shell {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.game-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
}

.back-link {
  color: var(--accent);
  font-weight: 720;
}

.game-header p {
  margin: 0 0 4px;
  color: #c97a22;
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
}

.game-header h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 760;
}

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

.settings-row {
  margin: 24px 0 0;
}

.difficulty {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 560px);
  margin: 0 auto;
}

.difficulty button {
  border: 1px solid rgba(15, 118, 110, 0.24);
  background: #fff;
  color: var(--accent);
}

.difficulty button.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.score-row div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.score-row span,
.score-row strong {
  display: block;
}

.score-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.score-row strong {
  margin-top: 6px;
  font-size: 1.7rem;
}

canvas {
  display: block;
  width: min(100%, 560px);
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto;
  border: 10px solid #13201e;
  border-radius: 8px;
  background: #f4efe4;
  box-shadow: 0 16px 42px rgba(16, 20, 23, 0.14);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: min(100%, 560px);
  margin: 18px auto 0;
}

.controls button {
  background: #13201e;
  color: #f7c66b;
}

@media (max-width: 620px) {
  .game-header {
    grid-template-columns: 1fr;
  }
}
