/* 正午のクイズハンター — ベース + ワクワク演出 */

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

::selection {
  background: transparent;
  color: inherit;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  background: #38bdf8;
  color: #111;
  font-family: 'DotGothic16', 'Hiragino Kaku Gothic ProN', sans-serif;
  touch-action: none;
}

.game-container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 42%, #fde047 100%);
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  view-transition-name: game-root;
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes attack {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); text-shadow: 0 0 20px yellow; }
  100% { transform: scale(1); }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes damageText {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

@keyframes gaugePulse {
  0%, 100% { box-shadow: 0 0 6px #facc15; }
  50% { box-shadow: 0 0 18px #f97316, 0 0 28px #facc15; }
}

@keyframes rageGlow {
  0%, 100% { filter: drop-shadow(0 0 12px #ef4444) hue-rotate(0deg); }
  50% { filter: drop-shadow(0 0 28px #f97316) hue-rotate(-20deg); }
}

.shake-anim { animation: shake 0.5s; }
.attack-anim { animation: attack 0.2s; }

.hp-bar-bg {
  background-color: #fff;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid #111;
  box-shadow: 2px 2px 0 #111;
}
.hp-bar-fill { height: 100%; transition: width 0.3s ease-out; }
.timer-bar {
  height: 6px;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  transition: width 0.1s linear;
}

.game-btn,
.btn-answer {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.08s ease, filter 0.08s ease;
  will-change: transform;
  touch-action: none;
  min-height: 56px;
}

.game-btn:active,
.game-btn.is-pressed,
.btn-answer:active:not(:disabled),
.btn-answer.is-pressed:not(:disabled) {
  transform: translateY(7px) scale(0.98);
  filter: brightness(0.97);
}

.btn-answer {
  background: linear-gradient(to bottom, #bae6fd 0%, #0ea5e9 58%, #0284c7 100%);
  border: 4px solid #111;
  border-radius: 18px;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12),
    0 7px 0 #111,
    0 11px 0 rgba(0, 0, 0, 0.18);
  color: #111;
  font-weight: bold;
  font-size: 1.125rem;
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
}

.btn-answer:active:not(:disabled),
.btn-answer.is-pressed:not(:disabled) {
  box-shadow:
    inset 0 4px 0 rgba(0, 0, 0, 0.2),
    0 1px 0 #111;
}

.btn-wrong {
  background: linear-gradient(to bottom, #fb7185, #e11d48) !important;
  border-color: #111 !important;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    0 7px 0 #111 !important;
  color: #fff !important;
}
.btn-correct {
  background: linear-gradient(to bottom, #bef264, #65a30d) !important;
  border-color: #111 !important;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    0 7px 0 #111 !important;
  color: #111 !important;
}

.character-sprite {
  font-size: 5rem;
  transform-origin: 50% 88%;
  filter: drop-shadow(8px 12px 0 rgba(17, 17, 17, 0.22));
  animation: enemyIdle 1.25s ease-in-out infinite;
}
.boss-sprite {
  font-size: 7.5rem;
  transform-origin: 50% 88%;
  filter: drop-shadow(10px 14px 0 rgba(17, 17, 17, 0.28)) drop-shadow(0 0 15px rgba(255, 0, 0, 0.55));
}
.boss-sprite.mid-boss {
  font-size: 7.2rem;
  filter: drop-shadow(0 0 22px #f97316) drop-shadow(0 0 8px #facc15);
  animation: midBossIdle 1.1s ease-in-out infinite;
}
.boss-sprite.final-boss {
  font-size: 8.6rem;
  filter: drop-shadow(0 0 28px #c084fc) drop-shadow(0 0 16px #ef4444);
  animation: finalBossIdle 0.7s ease-in-out infinite;
}
.boss-sprite.is-rage { animation: rageGlow 0.45s infinite; }
.character-sprite.is-spawn,
.boss-sprite.is-spawn {
  animation: enemySpawn 0.42s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}
.character-sprite.is-hit,
.boss-sprite.is-hit {
  animation: enemyHit 0.38s ease-out;
}

@keyframes enemyIdle {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  50% { transform: translateY(-12px) rotate(4deg) scale(1.06); }
}
@keyframes enemySpawn {
  0% { transform: translateY(36px) scale(0.2) rotate(-12deg); }
  70% { transform: translateY(-10px) scale(1.18) rotate(6deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
@keyframes enemyHit {
  0% { transform: scale(1.28) translateY(-14px) rotate(-16deg); }
  45% { transform: scale(0.88) translateX(12px) rotate(10deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}

@keyframes midBossIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.06); }
}
@keyframes finalBossIdle {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  50% { transform: translateY(-14px) rotate(4deg) scale(1.12); }
}

#damage-overlay,
#flash-overlay {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none; z-index: 25; transition: opacity 0.1s;
}
#damage-overlay { background: red; }
#flash-overlay { background: white; }

.damage-number {
  position: absolute; font-size: 2rem; font-weight: bold; color: #ff0000;
  text-shadow: 2px 2px 0 #000; animation: damageText 0.8s forwards; z-index: 40;
  pointer-events: none;
}

#fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.hud-special {
  margin-top: 4px;
}
.special-label {
  font-size: 10px;
  color: #c2410c;
  letter-spacing: 0.08em;
  font-weight: bold;
}
.special-gauge-bg {
  height: 10px;
  border: 3px solid #111;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.special-gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #f97316, #ef4444);
  transition: width 0.2s ease-out;
}
.special-gauge-bg.is-ready {
  animation: gaugePulse 0.7s infinite;
}

#special-btn {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  font-size: 1.15rem;
  font-weight: bold;
  font-family: inherit;
  color: #111;
  background: linear-gradient(to bottom, #fde047 0%, #f97316 70%, #c2410c 100%);
  border: 4px solid #111;
  border-radius: 18px;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    0 7px 0 #111,
    0 11px 0 rgba(0, 0, 0, 0.18);
  animation: gaugePulse 0.8s infinite;
}
#special-btn.is-ready { display: block; }
#special-btn.is-pressed,
#special-btn:active {
  box-shadow:
    inset 0 4px 0 rgba(0, 0, 0, 0.18),
    0 1px 0 #111;
}

.cutin {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.25), transparent);
}
.cutin.is-on { display: flex; }
.cutin-text {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: bold;
  color: #fde047;
  text-shadow: 0 0 18px #f97316, 4px 4px 0 #000;
  transform: rotate(-8deg);
}

.hud-tools {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(8px + env(safe-area-inset-right));
  z-index: 120;
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  border: 3px solid #111;
  background: linear-gradient(to bottom, #fde047, #facc15);
  color: #111;
  font-size: 1.1rem;
  font-family: inherit;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 4px 0 #111;
}
.icon-btn:active,
.icon-btn.is-pressed {
  transform: translateY(4px) scale(0.94);
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, 0.18),
    0 0 0 #111;
}

#pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.88);
  flex-direction: column;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom));
}
#pause-overlay.is-on { display: flex; }

#title-book {
  width: min(92vw, 360px);
  max-height: min(80dvh, 560px);
  overflow: hidden;
  overscroll-behavior: none;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  border: 4px solid #111;
  border-radius: 24px;
  background: #fff7ed;
  color: #111;
  box-shadow: 6px 6px 0 #111;
}
#title-book::backdrop {
  background: rgba(56, 189, 248, 0.45);
}
#title-book:not(:popover-open).fallback-open {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 80;
  display: block;
}
#title-book:not(:popover-open) { display: none; }
#title-book:not(:popover-open).fallback-open { display: block; }

.title-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 2px dashed #fb923c;
  font-size: 0.9rem;
}
.title-item.locked { opacity: 0.4; }
.title-item .mark { color: #ea580c; min-width: 1.5rem; font-weight: bold; }

.mission-extra {
  margin-top: 8px;
  color: #9a3412;
  font-size: 0.8rem;
  line-height: 1.5;
}

#q-text.is-gag,
.pop-q.is-gag {
  color: #9d174d;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.hidden { display: none !important; }

#start-screen {
  z-index: 100;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
}

#start-btn {
  position: relative;
  z-index: 101;
}

.title-logo {
  margin: 4px 0 12px;
  text-align: center;
}
.title-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 16px;
  font-size: 1.15rem;
  font-weight: bold;
  color: #7c2d12;
  background: linear-gradient(90deg, #fde047, #fb923c);
  border: 3px solid #111;
  border-radius: 999px;
  box-shadow: 0 4px 0 #111;
  animation: titleBadgePop 1.1s ease-in-out infinite;
}
.title-main {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0.04em;
}
.title-quiz,
.title-hunter {
  display: inline-block;
  font-size: clamp(2.1rem, 9vw, 3.1rem);
  font-weight: bold;
  -webkit-text-stroke: 5px #7c2d12;
  paint-order: stroke fill;
}
.title-quiz {
  color: #38bdf8;
  text-shadow: 0 4px 0 #0369a1, 0 0 18px #7dd3fc;
  transform: rotate(-6deg);
}
.title-hunter {
  color: #facc15;
  text-shadow: 0 4px 0 #b45309, 0 0 20px #fde047;
  transform: rotate(4deg);
  animation: titleHunterBounce 0.9s ease-in-out infinite;
}
.title-sub {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #7c2d12;
  font-weight: bold;
  text-shadow: 1px 1px 0 #fff;
}
@keyframes titleBadgePop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes titleHunterBounce {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-6px); }
}

.judge-banner {
  position: absolute;
  inset: 0;
  z-index: 62;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.28);
}
.judge-banner.is-on { display: flex; }
.judge-prefix {
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: #fde047;
  margin: 0 0 6px;
  text-shadow: 0 0 10px #facc15;
}
.judge-text {
  font-size: clamp(1.4rem, 6.5vw, 2.2rem);
  font-weight: bold;
  color: #fde047;
  text-shadow: 3px 3px 0 #000, 0 0 16px #facc15;
  margin: 0;
  max-width: 92%;
}
.judge-banner.is-ng .judge-prefix { color: #67e8f9; text-shadow: 0 0 10px #22d3ee; }
.judge-banner.is-ng .judge-text {
  color: #a5f3fc;
  text-shadow: 3px 3px 0 #000, 0 0 16px #22d3ee;
}

.boss-intro {
  position: absolute;
  inset: 0;
  z-index: 66;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.78);
  text-align: center;
  gap: 8px;
}
.boss-intro.is-on { display: flex; }
.boss-intro.is-final {
  background: radial-gradient(circle at 50% 40%, rgba(168, 85, 247, 0.45), rgba(0, 0, 0, 0.88));
}
.boss-intro-tag {
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  letter-spacing: 0.28em;
  color: #facc15;
  text-shadow: 0 0 16px #f97316;
  animation: warnBlink 0.28s steps(2) infinite;
}
.boss-intro.is-final .boss-intro-tag { color: #f0abfc; text-shadow: 0 0 18px #c026d3; }
.boss-intro-kind {
  font-size: 1.1rem;
  color: #fdba74;
}
.boss-intro-name {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  font-weight: bold;
  color: #fff;
  text-shadow: 4px 4px 0 #000, 0 0 20px #f97316;
}
.boss-intro.is-final .boss-intro-name {
  color: #fde68a;
  text-shadow: 4px 4px 0 #000, 0 0 24px #a855f7;
}

@keyframes warnBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.ending-screen {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(56px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: none;
  text-align: center;
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 42%, #fde047 100%);
  animation: endingBg 4s ease-in-out infinite alternate;
}
.ending-screen.hidden { display: none !important; }
.game-container.is-finale #fx-canvas { z-index: 95; }

@keyframes endingBg {
  from { filter: saturate(1); }
  to { filter: saturate(1.4) brightness(1.08); }
}

.ending-ko {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: #f97316;
  text-shadow: 0 0 18px #facc15, 3px 3px 0 #000;
  margin: 8px 0 4px;
  animation: popIn 0.45s both;
}
.ending-title {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  color: #fde047;
  font-weight: bold;
  text-shadow: 0 0 18px #facc15, 0 0 40px #eab308;
  margin: 0 0 12px;
  animation: endingTitleIn 0.8s 0.3s both;
}
@keyframes endingTitleIn {
  from { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(2deg); opacity: 1; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.ending-hero {
  position: relative;
  display: inline-block;
  font-size: 5.5rem;
  line-height: 1;
  margin: 8px 0 16px;
  animation: endingHero 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px #facc15);
}
.ending-hero-body {
  display: block;
}
.ending-crown {
  position: absolute;
  top: -0.12em;
  left: 50%;
  font-size: 0.42em;
  line-height: 1;
  pointer-events: none;
  animation: crownSpin 1.6s ease-in-out infinite;
}
@keyframes endingHero {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.08); }
}
@keyframes crownSpin {
  0%, 100% { transform: translate(-58%, 0) rotate(-8deg); }
  50% { transform: translate(-58%, -8px) rotate(8deg); }
}
.ending-story {
  width: 100%;
  max-width: 420px;
  background: #fff7ed;
  border: 4px solid #111;
  border-radius: 20px;
  box-shadow: 6px 6px 0 #111;
  padding: 14px;
  margin-bottom: 16px;
}
.ending-story p {
  color: #111;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 6px 0;
  opacity: 0;
  transform: translateY(12px);
}
.ending-story p.is-in {
  animation: storyIn 0.55s forwards;
}
@keyframes storyIn {
  to { opacity: 1; transform: translateY(0); }
}
.ending-score {
  color: #7c2d12;
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 #fff;
}

/* --- 正午ポップUI --- */
.pop-screen {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 48%, #fde047 100%);
  color: #111;
}
.pop-card {
  background: #fff7ed;
  border: 4px solid #111;
  border-radius: 20px;
  box-shadow: 6px 8px 0 #111, 10px 12px 0 rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  color: #111;
}
.pop-card-label {
  color: #c2410c;
  font-weight: bold;
  letter-spacing: 0.06em;
}
.pop-em {
  color: #ea580c;
  font-weight: bold;
}
.pop-note {
  color: #7c2d12;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}
.pop-btn-main,
.pop-btn-alt {
  width: min(100%, 280px);
  margin: 6px 0;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: bold;
  border-radius: 18px;
  border: 4px solid #111;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    0 7px 0 #111,
    0 11px 0 rgba(0, 0, 0, 0.16);
  color: #111;
}
.pop-btn-main {
  background: linear-gradient(to bottom, #fde047 0%, #fb923c 70%, #ea580c 100%);
}
.pop-btn-alt {
  background: linear-gradient(to bottom, #fff 0%, #fed7aa 70%, #fdba74 100%);
}
.pop-btn-main:active,
.pop-btn-main.is-pressed,
.pop-btn-alt:active,
.pop-btn-alt.is-pressed {
  box-shadow:
    inset 0 4px 0 rgba(0, 0, 0, 0.16),
    0 1px 0 #111;
}
.pop-result-title {
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: bold;
  color: #e11d48;
  margin: 0 0 12px;
  -webkit-text-stroke: 4px #111;
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 #fff;
}
.pop-result-title.is-record {
  color: #facc15;
  animation: titleHunterBounce 0.9s ease-in-out infinite;
}
.pop-pause-title {
  font-size: clamp(2rem, 10vw, 3.2rem);
  font-weight: bold;
  color: #fde047;
  margin: 0;
  -webkit-text-stroke: 5px #111;
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 #fff;
}
.pop-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-right: calc(7.25rem + env(safe-area-inset-right));
  background: #fff7ed;
  border-bottom: 4px solid #111;
  color: #111;
  box-shadow: 0 4px 0 #111;
}
.pop-hud-label {
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  color: #9a3412;
  margin-bottom: 2px;
}
.pop-lv {
  font-size: 1.15rem;
  font-weight: bold;
  color: #111;
  background: #fde047;
  border: 3px solid #111;
  border-radius: 999px;
  padding: 2px 10px;
  box-shadow: 2px 2px 0 #111;
}
.pop-field {
  background:
    radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.55) 0 16px, transparent 17px),
    radial-gradient(circle at 84% 18%, rgba(253, 224, 71, 0.7) 0 20px, transparent 21px),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.4) 0 14px, transparent 15px),
    linear-gradient(180deg, #7dd3fc 0%, #bae6fd 55%, #86efac 100%);
}
.pop-field::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 10%;
  height: 22px;
  background: rgba(17, 17, 17, 0.16);
  border-radius: 50%;
  filter: blur(3px);
  pointer-events: none;
}
#enemy-container {
  position: relative;
  z-index: 1;
}
.pop-enemy-name {
  margin-top: 6px;
  padding: 4px 14px;
  background: #fff;
  border: 3px solid #111;
  border-radius: 999px;
  font-weight: bold;
  color: #111;
  box-shadow: 3px 3px 0 #111;
}
.pop-combo {
  font-size: 1.35rem;
  font-weight: bold;
  color: #ea580c;
  -webkit-text-stroke: 3px #111;
  paint-order: stroke fill;
}
.pop-combo-sub {
  font-size: 0.75rem;
  font-weight: bold;
  color: #111;
  background: #fde047;
  border: 2px solid #111;
  border-radius: 999px;
  padding: 1px 8px;
  display: inline-block;
}
.pop-quiz {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fffbeb;
  border-top: 4px solid #111;
  box-shadow: 0 -4px 0 #111;
  color: #111;
}
.pop-timer-track {
  height: 10px;
  margin: 0 0 10px;
  background: #fff;
  border: 3px solid #111;
  border-radius: 999px;
  overflow: hidden;
}
.pop-cat {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  border: 2px solid #111;
  margin-bottom: 6px;
  font-weight: bold;
  box-shadow: 2px 2px 0 #111;
}
.pop-q {
  margin: 6px 0 0;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #111;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.pop-book-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: bold;
  color: #c2410c;
}

.hud-tools .icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
}

.ios-start .title-logo { order: 0; flex-shrink: 0; }
.ios-start .pop-card {
  order: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  margin-top: 12px;
}
.ios-start #start-btn,
.ios-start #titles-btn {
  order: 2;
  flex-shrink: 0;
  width: min(100%, 320px);
}
.ios-start .pop-note {
  order: 3;
  flex-shrink: 0;
  margin-top: 8px;
}

.title-run {
  position: absolute;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  height: 80px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.title-run::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 10px;
  height: 16px;
  background: rgba(17, 17, 17, 0.14);
  border-radius: 50%;
  filter: blur(2px);
}
.title-runner {
  position: absolute;
  bottom: 14px;
  left: -4.5rem;
  font-size: 2.7rem;
  line-height: 1;
  display: block;
  filter: drop-shadow(6px 8px 0 rgba(17, 17, 17, 0.22));
  animation: titleRunX 3.2s linear infinite, titleRunBob 0.28s ease-in-out infinite;
}
.title-run-dust {
  position: absolute;
  bottom: 22px;
  left: -4.5rem;
  width: 22px;
  height: 8px;
  margin-left: -18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  filter: blur(1px);
  animation: titleRunX 3.2s linear infinite;
}
@keyframes titleRunX {
  from { left: -4.5rem; }
  to { left: calc(100% + 1.5rem); }
}
@keyframes titleRunBob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}

.ios-overlay {
  justify-content: flex-start;
  overflow: hidden;
  overscroll-behavior: none;
  padding: calc(56px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
}
#share-result-btn,
#share-ending-btn {
  margin-top: auto;
}

#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #38bdf8;
  color: #111;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.35rem;
  font-weight: bold;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.rotate-emoji {
  font-size: 3rem;
  margin: 0 0 12px;
}
@media (orientation: landscape) and (max-height: 500px) {
  #rotate-overlay { display: flex; }
}

@media (max-height: 700px) {
  .character-sprite { font-size: 3.6rem; }
  .boss-sprite { font-size: 5.2rem; }
  .boss-sprite.mid-boss { font-size: 5.4rem; }
  .boss-sprite.final-boss { font-size: 6rem; }
  .title-quiz,
  .title-hunter { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .pop-q { font-size: 0.95rem; }
  .ios-start { padding-top: calc(56px + env(safe-area-inset-top)); }
  .title-run { height: 64px; }
  .title-runner { font-size: 2.2rem; }
  .pop-quiz { padding-top: 8px; }
  .ending-hero { font-size: 4.2rem; }
}
