* {
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Maru Gothic ProN', 'Rounded Mplus 1c', 'Arial', sans-serif;
  text-align: center;
  background: linear-gradient(180deg, #fff8e1 0%, #ffe0b2 100%);
  color: #333;
  margin: 0;
  min-height: 100vh;
  padding: 3vw 3vw 3vw;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
}

.game-title {
  color: #ef6c00;
  font-size: 8vw;
  margin: 1vh 0 0.2em;
}

.tagline {
  font-size: 4.2vw;
  color: #666;
  margin: 0 0 2.5vh;
}

.name-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 2vh;
}

.name-box label {
  font-size: 3.8vw;
  color: #888;
}

.name-box input {
  width: 60vw;
  max-width: 260px;
  font-size: 5vw;
  padding: 0.4em 0.6em;
  border: 2px solid #ffb74d;
  border-radius: 10px;
  text-align: center;
}

.option-group {
  margin-bottom: 2vh;
}

.option-group h2 {
  font-size: 4vw;
  color: #888;
  margin: 0 0 1vh;
  font-weight: normal;
}

.option-row {
  display: flex;
  justify-content: center;
  gap: 2vw;
  flex-wrap: wrap;
}

.opt-btn {
  font-size: 4.2vw;
  padding: 3vw 4vw;
  border: 2px solid #ffb74d;
  border-radius: 999px;
  background: #fff;
  color: #ef6c00;
  cursor: pointer;
}

.opt-btn.on {
  background: #ef6c00;
  color: #fff;
  border-color: #ef6c00;
}

.btn {
  display: inline-block;
  font-size: 6vw;
  font-weight: bold;
  padding: 3vw 10vw;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  margin: 0.6vh 0;
}

.btn-main {
  background: #ef6c00;
  color: #fff;
  box-shadow: 0 4px 0 #b74d00;
}

.btn-main:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b74d00;
}

.btn-sub {
  background: #fff;
  color: #ef6c00;
  border: 2px solid #ef6c00;
}

.sub-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1vw;
  margin-top: 0.5vh;
}

.btn-mute {
  font-size: 3.6vw;
  padding: 1.5vw 3vw;
  border: none;
  border-radius: 999px;
  background: none;
  color: #999;
  cursor: pointer;
}

.voice-select-mini {
  font-size: 3.6vw;
  padding: 1.5vw 2vw;
  border: none;
  border-radius: 999px;
  background: none;
  color: #999;
  cursor: pointer;
  max-width: 32vw;
}

.gba-back-inline {
  margin-top: 3vh;
  display: inline-block;
}

.footer-note {
  margin-top: 1.5vh;
  text-align: center;
  font-size: 3.2vw;
  color: #aaa;
  line-height: 1.6;
}

.credit-link {
  color: #aaa;
  text-decoration: none;
}

.credit-link:active {
  color: #ef6c00;
}

/* ===== プレイ画面 ===== */

.screen-play {
  max-width: 480px;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 4.5vw;
  margin-bottom: 2vh;
  color: #ef6c00;
  font-weight: bold;
}

.hud-hearts {
  display: inline-flex;
  gap: 0.15em;
  color: #e53935;
}

.hud-hearts i.bi-heart {
  color: #ddd;
}

#hud-time {
  min-width: 2.4em;
  font-variant-numeric: tabular-nums;
}

#hud-time.warn {
  color: #d32f2f;
  animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.question {
  font-size: 12vw;
  margin: 4vh 0 3vh;
  font-weight: bold;
  color: #333;
  min-height: 1.3em;
}

.choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4vw;
}

.choice {
  background: #fff;
  border: 3px solid #ef6c00;
  border-radius: 16px;
  padding: 5vw 0;
  width: 26vw;
  font-size: 8vw;
  font-weight: bold;
  color: #ef6c00;
  cursor: pointer;
  user-select: none;
}

.choice:active,
.choice.correct,
.choice.wrong {
  transform: scale(0.95);
}

.choice.correct {
  background: #c8e6c9;
  border-color: #43a047;
  color: #2e7d32;
}

.choice.wrong {
  background: #ffcdd2;
  border-color: #e53935;
  color: #c62828;
}

.feedback {
  font-size: 5vw;
  margin-top: 3vh;
  min-height: 1.4em;
  font-weight: bold;
}

/* ===== リザルト画面 ===== */

.result-score {
  font-size: 8vw;
  margin: 2vh 0 0.5em;
}

.result-score b {
  font-size: 1.4em;
  color: #ef6c00;
}

.result-sub {
  color: #777;
  font-size: 4vw;
  margin: 0 0 1vh;
}

.result-best {
  color: #ef6c00;
  font-size: 4vw;
  margin: 0 0 3vh;
}

.result-sub i,
.result-best i {
  margin-right: 0.2em;
}

#ranking {
  background: #fff;
  border-radius: 12px;
  padding: 3vw 4vw;
  margin: 0 0 3vh;
  text-align: left;
  font-size: 4vw;
}

#ranking h3 {
  margin: 0 0 1vh;
  font-size: 4.2vw;
  color: #ef6c00;
  text-align: center;
}

#ranking ol {
  margin: 0;
  padding-left: 1.4em;
}

#ranking li {
  padding: 0.4vh 0;
  border-bottom: 1px dashed #eee;
}

#ranking li.mine {
  color: #ef6c00;
  font-weight: bold;
}

#ranking .rank-empty {
  color: #999;
  text-align: center;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 3vw;
  flex-wrap: wrap;
}

@media (min-width: 560px) {
  .game-title { font-size: 44px; }
  .tagline { font-size: 18px; }
  .name-box label { font-size: 15px; }
  .name-box input { font-size: 20px; }
  .option-group h2 { font-size: 16px; }
  .opt-btn { font-size: 17px; padding: 12px 20px; }
  .btn { font-size: 26px; padding: 14px 42px; }
  .btn-mute { font-size: 14px; }
  .voice-select-mini { font-size: 14px; max-width: 140px; }
  .footer-note { font-size: 13px; }
  #hud { font-size: 18px; }
  .question { font-size: 48px; }
  .choice { font-size: 30px; width: 110px; padding: 20px 0; }
  .feedback { font-size: 20px; }
  .result-score { font-size: 30px; }
  #ranking { font-size: 16px; }
  #ranking h3 { font-size: 17px; }
}
