:root {
  color-scheme: light;
  --ink: #24322f;
  --muted: #70685f;
  --paper: #ffffff;
  --line: #e8e8e3;
  --leaf: #2e6f61;
  --leaf-dark: #19483f;
  --orange: #f1a53b;
  --mint: #edf7f3;
  --blue: #eef6ff;
  --peach: #fff0de;
  --shadow: 0 18px 50px rgba(36, 50, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(46, 111, 97, 0.1), transparent 24%),
    radial-gradient(circle at 86% 20%, rgba(241, 165, 59, 0.1), transparent 22%),
    #f6f6f2;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic",
    "Noto Sans JP", sans-serif;
}

button,
a {
  font: inherit;
}

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

.game-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.game-header,
.score-board,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-header {
  margin-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(36, 50, 47, 0.12);
}

.sound-toggle,
.controls button,
.primary-action {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.sound-toggle {
  padding: 0 14px;
  background: var(--mint);
  color: var(--leaf-dark);
  font-size: 12px;
}

.sound-toggle[aria-pressed="true"] {
  background: var(--leaf);
  color: #fff;
}

.score-board {
  margin-bottom: 12px;
}

.score-board div {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.score-board span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-board strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  line-height: 1;
}

.game-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 50, 47, 0.08);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 14px;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
  box-shadow: 0 18px 50px rgba(36, 50, 47, 0.14);
}

.overlay[hidden] {
  display: none;
}

.overlay img {
  width: 148px;
  height: 148px;
  border: 6px solid #fff;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  margin: 16px 0 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--leaf-dark);
  font-size: 11px;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1,
h2 {
  line-height: 1.22;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 34px;
}

.overlay p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
}

.primary-action {
  width: 100%;
  margin-top: 22px;
  font-size: 16px;
}

.controls {
  margin-top: 12px;
}

.controls button {
  flex: 1;
  background: var(--leaf-dark);
  font-size: 18px;
}

.controls button:nth-child(2) {
  flex: 0.9;
  background: var(--orange);
  font-size: 13px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

@media (min-width: 900px) {
  body::before,
  body::after {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    content: "";
  }

  body::before {
    left: 12vw;
    top: 20vh;
    width: 160px;
    height: 160px;
    background: var(--mint);
  }

  body::after {
    right: 14vw;
    bottom: 16vh;
    width: 130px;
    height: 130px;
    background: var(--peach);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
