:root {
  --ink: #050505;
  --paper: #f5f0e4;
  --white: #ffffff;
  --yellow: #ffea00;
  --green: #57dc26;
  --red: #ff443c;
  --muted: #bdb8ad;
  --line: 3px;
  --radius: 18px;
  color: var(--white);
  background: var(--ink);
  font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, #202020 0, var(--ink) 44rem),
    var(--ink);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 4px solid var(--white);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.landing {
  display: grid;
  min-height: calc(100vh - 72px);
  align-content: center;
  gap: 28px;
  text-align: center;
}

.landing h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: .04em;
}

.route-picker { display: grid; gap: 16px; }

.route-card {
  min-height: 154px;
  padding: 22px;
  border: var(--line) solid currentColor;
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--accent);
  box-shadow: 7px 7px 0 currentColor;
  transition: transform .16s ease, box-shadow .16s ease;
}

.route-card:hover { transform: translate(3px, 3px); box-shadow: 4px 4px 0 currentColor; }
.route-card:active { transform: translate(7px, 7px); box-shadow: none; }
.route-card.masahoshi { --accent: var(--yellow); }
.route-card.onomatope { --accent: var(--green); }

.route-logo {
  display: block;
}

.route-logo-image { display: block; width: min(100%, 440px); height: auto; margin: 0 auto; }

.route-card small { display: block; margin-top: 12px; color: var(--white); font-weight: 700; letter-spacing: .04em; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.brand {
  display: block;
  width: min(100%, 210px);
  height: auto;
}

.outline-button, .primary-button, .share-link, .answer-button {
  min-height: 48px;
  border: var(--line) solid currentColor;
  border-radius: 10px;
  font-weight: 900;
}

.outline-button { padding: 8px 12px; color: var(--white); background: transparent; }
.outline-button:hover { color: var(--ink); background: var(--white); }

.route-page { --accent: var(--yellow); }
.route-page.onomatope { --accent: var(--green); }

.progress {
  display: grid;
  grid-template-columns: repeat(var(--progress-count), 1fr);
  gap: 6px;
  margin: 22px 0;
}

.progress span { height: 8px; border-radius: 99px; background: #343434; }
.progress span.is-active { background: var(--accent); }

.wave-list, .recipe-list { display: grid; gap: 22px; }

.wave, .recipe-card {
  border: var(--line) solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(0, 0, 0, .68);
}

.wave.is-locked { opacity: .42; }
.wave-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wave h2, .recipe-card h2 { margin: 0; color: var(--accent); font-size: 1.75rem; letter-spacing: -.03em; }
.wave-status { margin: 0; font-size: .85rem; font-weight: 900; }

.question-list { display: grid; gap: 10px; }
.question { padding: 12px; border: 2px solid var(--accent); border-radius: 12px; background: #101010; }
.question.is-correct { background: color-mix(in srgb, var(--accent) 14%, #101010); }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.question-number { color: var(--accent); font-size: 1.25rem; font-weight: 1000; }
.question-label { color: var(--muted); font-size: .75rem; font-weight: 700; }
.answer-slot, .share-copy textarea {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--white);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 900;
}

.answer-slot { cursor: pointer; text-align: left; }
.answer-slot.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.answer-slot:disabled { cursor: not-allowed; opacity: .54; }
.answer-slot.is-correct:disabled { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--paper)); opacity: 1; }

.choice-board {
  margin-bottom: 22px;
  border: var(--line) solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(0, 0, 0, .68);
}

.choice-board > summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 1000;
}

.choice-board-hint {
  margin-left: 6px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
}

.choice-board[open] > summary .choice-board-hint { display: none; }

.choice-board[open] > summary { margin-bottom: 10px; }

.choice-board-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-bottom: 9px;
}

.choice-status { margin: 0; color: var(--muted); font-size: .8rem; font-weight: 900; text-align: right; }
.choice-grid-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.choice-grid { display: grid; grid-template-columns: repeat(10, minmax(56px, 1fr)); min-width: 605px; gap: 5px; }

.choice-tile {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 42px;
  padding: 3px 2px;
  border: 2px solid #4b4b4b;
  border-radius: 7px;
  color: var(--white);
  background: #151515;
  text-align: center;
}

.choice-tile:hover { border-color: #4b4b4b; }
.choice-tile span { color: var(--accent); font-size: .5rem; font-weight: 1000; line-height: 1; }
.choice-tile small { overflow-wrap: anywhere; font-size: clamp(.55rem, 2.3vw, .7rem); font-weight: 700; line-height: 1.15; }
.choice-tile.is-selected { border-color: #4b4b4b; background: var(--accent); color: var(--ink); }
.choice-tile.is-selected span { color: var(--ink); }

.primary-button, .answer-button, .share-link {
  width: 100%;
  margin-top: 16px;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--white);
}
.primary-button:hover, .answer-button:hover, .share-link:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--white); }
.primary-button:active, .answer-button:active, .share-link:active { transform: translate(4px, 4px); box-shadow: none; }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; transform: none; }

.feedback {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--white);
  font-weight: 900;
}
.feedback.error { color: var(--red); }
.feedback.success { color: var(--accent); }

.recipe-card { position: relative; }
.recipe-card.is-locked { opacity: .42; }
.recipe-card p { margin: 6px 0 0; color: var(--muted); font-weight: 700; }
.recipe-card.is-solved { display: grid; justify-items: center; gap: 14px; }
.recipe-card.is-solved .food-name { margin: 0; color: var(--white); font-size: 1.4rem; font-weight: 1000; }
.recipe-card.is-solved .food-image { width: min(100%, 260px); height: auto; aspect-ratio: 1; }
.recipe-answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.recipe-answer input { min-width: 0; min-height: 48px; border: 2px solid var(--white); border-radius: 8px; padding: 8px 10px; background: var(--paper); color: var(--ink); font-weight: 900; }
.recipe-answer .answer-button { width: auto; min-width: 82px; margin: 0; }

.onomatope-play { display: grid; gap: 20px; }
.onomatope-board { position: relative; width: 100%; margin: 0 auto; }
.onomatope-board-image { display: block; width: 100%; height: auto; }
.onomatope-board-answers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.onomatope-board-letter {
  fill: var(--ink);
  font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 22px;
  font-weight: 1000;
  text-anchor: middle;
  dominant-baseline: middle;
}
.onomatope-answer {
  border: var(--line) solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(0, 0, 0, .68);
}
.onomatope-answer > label { display: block; color: var(--white); font-weight: 900; }
.onomatope-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.onomatope-answer input { min-width: 0; min-height: 48px; border: 2px solid var(--white); border-radius: 8px; padding: 8px 10px; background: var(--paper); color: var(--ink); font-weight: 900; }
.onomatope-answer .answer-button { width: auto; min-width: 82px; margin: 0; }

.food-reveal { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--accent); }
.food-image, .food-placeholder { width: 118px; height: 88px; border-radius: 10px; background: var(--paper); }
.food-image { object-fit: contain; }
.food-placeholder { display: grid; place-items: center; padding: 8px; color: var(--ink); text-align: center; font-size: .78rem; font-weight: 900; }
.food-reveal p { color: var(--white); }

.final-card, .clear-card, .share-page {
  border: var(--line) solid var(--accent);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(0, 0, 0, .72);
  text-align: center;
}

.final-card h2, .clear-card h1, .share-page h1 { margin: 0; color: var(--accent); font-size: clamp(2.2rem, 11vw, 4rem); letter-spacing: -.07em; }
.clear-card h1 { font-size: clamp(4rem, 24vw, 7rem); }
.final-card p, .clear-card p, .share-page p { font-weight: 700; }
.clear-image, .clear-placeholder { width: min(100%, 420px); margin: 22px auto; border-radius: 12px; background: var(--paper); }
.clear-image { display: block; height: auto; object-fit: contain; }
.clear-placeholder { aspect-ratio: 4 / 3; }
.clear-placeholder { display: grid; place-items: center; color: var(--ink); font-weight: 900; }
.share-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.share-page { text-align: left; }
.share-page h1 { text-align: center; }
.share-copy { margin-top: 20px; }
.share-copy textarea { height: 180px; resize: vertical; line-height: 1.55; font-weight: 700; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 390px) {
  .app-shell { padding-inline: 12px; }
  .wave, .recipe-card { padding: 14px; }
  .choice-board { padding: 11px; }
  .choice-grid { gap: 4px; }
  .onomatope-answer { padding: 14px; }
  .food-reveal { grid-template-columns: 96px minmax(0, 1fr); }
  .food-image, .food-placeholder { width: 96px; height: 72px; }
}
