:root {
  color-scheme: light;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f4efe4;
  color: #20302c;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, #fff8df 0, transparent 38%),
    #f4efe4;
}

button {
  font: inherit;
}

.game {
  width: min(100%, 520px);
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: #ba4b2f;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1;
}

.rule {
  margin: 0 auto 28px;
  color: #5e6a66;
  font-size: 0.95rem;
}

.panel,
.status-panel {
  border: 2px solid #20302c;
  border-radius: 16px;
  background: #fffdf7;
  box-shadow: 6px 6px 0 #20302c;
}

.panel {
  padding: 28px 20px;
}

.panel h2 {
  margin: 0 0 20px;
  font-size: 1.2rem;
}

.choice-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-buttons button,
.restart {
  min-height: 48px;
  border: 2px solid #20302c;
  border-radius: 10px;
  background: #f3b843;
  color: #20302c;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 3px 3px 0 #20302c;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.choice-buttons button:hover,
.restart:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #20302c;
}

.play-area {
  display: grid;
  gap: 20px;
}

.status-panel {
  min-height: 78px;
  display: grid;
  place-content: center;
  padding: 12px;
}

.status {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.detail {
  min-height: 1.2em;
  margin: 4px 0 0;
  color: #6a746f;
  font-size: 0.85rem;
}

.board {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 3px solid #20302c;
  border-radius: 16px;
  background: #20302c;
  box-shadow: 7px 7px 0 #ba4b2f;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #fffdf7;
  color: #20302c;
  cursor: pointer;
}

.cell:not(:disabled):hover {
  background: #fff0bd;
}

.cell:disabled {
  cursor: default;
}

.number {
  position: absolute;
  top: 8px;
  left: 10px;
  color: #7b8581;
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 800;
}

.mark {
  font-family: Arial, sans-serif;
  font-size: clamp(3rem, 17vw, 6rem);
  font-weight: 700;
  line-height: 1;
}

.mark.player {
  color: #167c80;
}

.mark.cpu {
  color: #ba4b2f;
}

.restart {
  justify-self: center;
  padding: 10px 18px;
  background: #fffdf7;
}

.site-footer {
  margin-top: 28px;
  font-size: 0.85rem;
}

.site-footer a {
  color: #5e6a66;
}

.site-footer a:hover {
  color: #ba4b2f;
}

@media (max-width: 420px) {
  body {
    padding: 16px;
  }

  .choice-buttons {
    grid-template-columns: 1fr;
  }
}
