@font-face {
  font-family: "M PLUS Rounded 1c Local";
  src: url("./assets/fonts/m-plus-rounded-1c-japanese-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 1000;
  font-display: swap;
  unicode-range: U+2000-27BF, U+3000-30FF, U+3400-9FFF, U+F900-FAFF, U+FF00-FFEF, U+20000-2FA1F;
}

@font-face {
  font-family: "M PLUS Rounded 1c Local";
  src: url("./assets/fonts/m-plus-rounded-1c-latin-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 1000;
  font-display: swap;
  unicode-range: U+0000-024F;
}

:root {
  color-scheme: light;
  --red: #e60012;
  --red-dark: #b8000e;
  --ink: #171717;
  --paper: #ffffff;
  --canvas: #f2f2f2;
  --muted: #696969;
  --line: #171717;
  --yellow: #ffd426;
  --green: #14834b;
  --radius: 24px;
  font-family: "M PLUS Rounded 1c Local", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  font-synthesis: weight;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-weight: 700;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 680px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--paper);
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 14px;
  border-bottom: 3px solid var(--ink);
}

.brand-kicker,
.official-link {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-kicker {
  color: var(--red);
  font-size: 0.69rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.official-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 3px;
  padding: 7px 8px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  box-shadow: 2px 2px 0 var(--red);
}

.official-link:hover {
  background: var(--red);
  color: var(--paper);
}

.screen {
  width: 100%;
  padding: 24px 0 8px;
}

.screen[hidden] {
  display: none !important;
}

.start-screen {
  display: grid;
  min-height: calc(100svh - 78px);
  align-items: center;
}

.start-card,
.question-card,
.answer-card,
.result-card {
  position: relative;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

.start-card {
  padding: clamp(26px, 7vw, 48px) clamp(20px, 6vw, 42px);
  overflow: hidden;
  text-align: center;
}

.event-label {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 9px 15px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  line-height: 1.03;
}

h1 span {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 5vw, 1.8rem);
  font-weight: 900;
}

h1 strong {
  display: block;
  color: var(--red);
  font-size: clamp(2.15rem, 10vw, 4rem);
  font-weight: 1000;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.host-visual {
  display: grid;
  height: clamp(160px, 46vw, 235px);
  margin: 0 auto 8px;
  place-items: center;
}

.host-visual img {
  width: min(72%, 285px);
  height: 100%;
  object-fit: contain;
}

.prize-shout {
  position: relative;
  z-index: 1;
  margin: 0 auto 18px;
  padding: 11px 14px 10px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--red);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}

.prize-shout span,
.prize-shout strong {
  display: block;
}

.prize-shout span {
  margin-bottom: 2px;
  font-size: 0.86rem;
  font-weight: 900;
}

.prize-shout strong {
  font-size: clamp(1.45rem, 7vw, 2.2rem);
  font-weight: 1000;
  line-height: 1.15;
}

.quiz-rules {
  margin-bottom: 22px;
  padding: 15px 14px 14px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  background: #f2f2f2;
  box-shadow: 3px 3px 0 var(--ink);
}

.quiz-rules p {
  margin-bottom: 11px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.55;
}

.quiz-rules p strong {
  color: var(--red);
  font-size: 1.16em;
  font-weight: 1000;
}

.rule-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rule-badges span {
  padding: 7px 8px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 1000;
}

.quiz-rules .retry-note {
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.98rem;
  font-weight: 1000;
  line-height: 1.45;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: left;
}

.required-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 0.68rem;
  font-weight: 1000;
  vertical-align: 2px;
}

input {
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgb(230 0 18 / 14%);
}

input::placeholder {
  color: #999999;
}

.form-error {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 56px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  font-size: 1.05rem;
  font-weight: 1000;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.primary-button {
  margin-top: 20px;
  background: var(--red);
  color: white;
  box-shadow: 4px 4px 0 var(--ink);
}

.primary-button:disabled {
  transform: none;
  border-color: #777777;
  background: #b9b9b9;
  color: #eeeeee;
  box-shadow: 2px 2px 0 #777777;
  cursor: not-allowed;
}

.primary-button:disabled:hover,
.primary-button:disabled:active {
  transform: none;
  box-shadow: 2px 2px 0 #777777;
}

.secondary-button {
  margin-top: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

#retry-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  text-align: center;
  line-height: 1.25;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.primary-button:active,
.secondary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.choice-button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.status-row,
.answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px 4px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
}

.progress-label,
.answer-meta > span:last-child {
  margin-left: 8px;
  font-size: 0.9rem;
  font-weight: 900;
}

.score-now {
  font-size: 0.9rem;
  font-weight: 900;
}

.score-now span {
  color: var(--red);
  font-size: 1.25rem;
}

.timer {
  margin: 18px 0;
}

.timer-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  font-weight: 1000;
}

.timer-copy span {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.timer-copy strong {
  color: var(--red);
  font-size: 1.65rem;
  line-height: 1;
}

.timer-track {
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.timer-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
  transform-origin: left center;
}

.timer.is-urgent .timer-copy strong {
  animation: timer-pulse 500ms ease-in-out infinite alternate;
}

@keyframes timer-pulse {
  to {
    transform: scale(1.14);
  }
}

.question-card {
  padding: clamp(22px, 6vw, 38px);
}

.question-number,
.answer-status-label {
  margin-bottom: 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.question-card h2 {
  margin-bottom: 26px;
  font-size: clamp(1.35rem, 5.5vw, 2rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.choice-button:hover {
  transform: translateX(3px);
  background: #f7f7f7;
}

.choice-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 1000;
}

.choice-text {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.45;
}

.answer-card,
.result-card {
  padding: clamp(22px, 6vw, 38px);
  text-align: center;
}

.answer-koala {
  display: block;
  width: min(70%, 270px);
  height: 245px;
  margin: 6px auto 2px;
  object-fit: contain;
}

.answer-status-label {
  margin-bottom: 8px;
}

.answer-card h2 {
  margin-bottom: 18px;
  font-size: clamp(1.75rem, 8vw, 2.8rem);
  line-height: 1.25;
}

.answer-card[data-result="correct"] h2 {
  color: var(--red);
}

.answer-card[data-result="incorrect"] h2,
.answer-card[data-result="timeout"] h2 {
  color: var(--ink);
}

.answer-photo-frame {
  margin: 0 0 16px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: white;
}

.answer-photo-frame[hidden] {
  display: none;
}

.answer-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 899;
  object-fit: cover;
}

.explanation {
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #f5f5f5;
  text-align: left;
}

.explanation p {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.75;
}

.explanation p + p {
  margin-top: 8px;
}

.result-card .event-label {
  margin-bottom: 14px;
}

.result-koala {
  display: block;
  width: min(56%, 225px);
  height: 218px;
  margin: -6px auto 2px;
  object-fit: contain;
}

.result-koala[hidden] {
  display: none;
}

.result-card h2 {
  margin-bottom: 8px;
  color: var(--red);
  font-size: clamp(1.8rem, 8vw, 3.2rem);
  line-height: 1.25;
}

.result-name {
  margin-bottom: 18px;
  font-weight: 900;
}

.score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 14px;
}

.score-display strong {
  color: var(--red);
  font-size: clamp(4.5rem, 24vw, 8rem);
  font-weight: 1000;
  line-height: 1;
}

.score-display span {
  font-size: 1.05rem;
  font-weight: 900;
}

.result-message {
  margin-bottom: 22px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.7;
}

.prize-panel {
  padding: 20px 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--yellow);
}

.prize-heading {
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 1000;
}

.prize-code {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 7vw, 2.2rem);
  font-weight: 1000;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.prize-issued,
.prize-note {
  margin-bottom: 0;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.55;
}

.prize-expires {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1.45;
}

.prize-note {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 2px solid var(--ink);
  color: #3b3b3b;
  font-size: 0.76rem;
  letter-spacing: -0.01em;
}

.prize-note .no-break {
  white-space: nowrap;
}

.prize-error { color: var(--red); font-weight: 900; line-height: 1.5; }

.store-proof {
  margin-top: 14px;
  padding: 12px 10px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
}

.store-proof strong,
.store-proof span {
  display: block;
}

.screenshot-ok {
  margin-top: 10px;
  padding: 11px 10px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--red);
  color: var(--paper);
}

.screenshot-ok strong,
.screenshot-ok span {
  display: block;
}

.screenshot-ok strong {
  font-size: 1.02rem;
  font-weight: 1000;
}

.screenshot-ok span {
  margin-top: 3px;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.5;
}

.store-proof strong {
  color: var(--red);
  font-size: 1.08rem;
  font-weight: 1000;
}

.store-proof span {
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: 900;
}

#preload-bin {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.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 (min-width: 681px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100svh - 48px);
    border: 3px solid var(--ink);
    border-radius: 30px;
  }

  .start-screen {
    min-height: calc(100svh - 132px);
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 12px;
  }

  .screen {
    padding-top: 18px;
  }

  .start-card,
  .question-card,
  .answer-card,
  .result-card {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .answer-koala {
    height: 210px;
  }

  .start-card {
    padding: 22px 17px 25px;
  }

  .host-visual {
    height: 165px;
  }

  .prize-shout {
    margin-bottom: 15px;
  }

  .choice-text {
    font-size: 0.96rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
