:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  background: #fff8f5;
  color: #2c1822;
}
* { box-sizing: border-box; }
body { margin: 0; }
header, main { width: min(100% - 2rem, 52rem); margin-inline: auto; }
header { display: flex; justify-content: space-between; padding-block: 1.25rem; border-bottom: 1px solid #e8cdd4; }
header a { color: inherit; font-weight: 800; }
main { padding-block: 2.5rem; }
h1 { font-size: clamp(2.25rem, 7vw, 4.25rem); letter-spacing: -.05em; margin: 0; }
p { line-height: 1.55; }
nav, .choices { display: flex; flex-wrap: wrap; gap: .65rem; }
nav { margin-block: 1.5rem; }
button {
  cursor: pointer;
  font: inherit;
  min-height: 2.75rem;
  border: 1px solid #aa657a;
  border-radius: .65rem;
  padding: .5rem .85rem;
  background: #fff;
  color: #63273e;
}
button[aria-pressed="true"], #start, #next { background: #782a49; color: #fff; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #824500; outline-offset: 3px; }
section { background: #fff; border: 1px solid #e8cdd4; border-radius: 1rem; padding: clamp(1rem, 4vw, 1.75rem); margin-bottom: 1rem; }
section h2 { margin-top: 0; }
#cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .65rem; padding: 0; list-style: none; }
#cards li { background: #fff8f5; border-radius: .75rem; text-align: center; padding: .75rem .25rem; display: grid; gap: .4rem; justify-items: center; }
#cards strong, #question [lang="ja"] { font-size: 1.75rem; }
#audio-status:empty, #feedback:empty { margin: 0; }
.puzzle-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.puzzle-controls select { font: inherit; min-height: 2.75rem; max-width: 100%; color: inherit; }
.puzzle-layout { display: grid; gap: 1rem; }
#puzzle-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; width: min(100%, 26rem); touch-action: none; user-select: none; }
#puzzle-board button { padding: 0; min-width: 0; min-height: 0; aspect-ratio: 1; border-color: #e8cdd4; border-radius: .35rem; font-size: clamp(1rem, 4vw, 1.4rem); }
#puzzle-board .found { color: #15503b; background: #d9f2e5; border-color: #55947c; }
#puzzle-board .selected { color: #fff; background: #782a49; border-color: #782a49; }
#puzzle-progress { font-weight: 700; margin-top: 0; }
#puzzle-words { padding-left: 1.3rem; margin-bottom: 0; }
#puzzle-words li { margin-bottom: .45rem; }
#puzzle-words .found { color: #15503b; }
#puzzle-feedback:empty { margin: 0; }
@media (min-width: 42rem) {
  .puzzle-layout { grid-template-columns: 1.65fr 1fr; }
}
