:root {
  --bg: #14171d;
  --bg-soft: #1a1f27;
  --bg-mid: #202733;
  --ground: #2b313d;
  --ground-2: #222833;
  --text: #ece6dc;
  --muted: #b7aea1;
  --accent: #c8a56b;
  --accent-2: #8ea4c7;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #14171d 0%, #171b22 100%);
  color: var(--text);
  overflow: hidden;
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(200, 165, 107, 0.08), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(142, 164, 199, 0.08), transparent 28%),
    linear-gradient(180deg, #12151b 0%, #191d25 45%, #151920 100%);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.primary-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: linear-gradient(135deg, rgba(200, 165, 107, 0.95), rgba(182, 143, 85, 0.95));
  color: #181a20;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.18s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}

.secondary-btn:active {
  transform: scale(0.98);
}

.is-hidden-screen {
  display: none !important;
}

/* INTRO / OUTRO */
.intro-screen,
.outro-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro-screen {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 30%),
    linear-gradient(180deg, rgba(10, 12, 16, 0.42), rgba(10, 12, 16, 0.65));
}

.outro-screen {
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.45), rgba(11, 13, 18, 0.88));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-screen.is-hidden,
.outro-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.outro-screen.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intro-screen__inner,
.outro-screen__inner {
  width: min(760px, 100%);
  padding: 34px;
  text-align: center;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.intro-screen h1,
.outro-screen h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.intro-screen h1 {
  font-size: clamp(38px, 8vw, 86px);
}

.outro-screen h2 {
  font-size: clamp(34px, 6vw, 64px);
}

.intro-screen p,
.outro-screen p {
  color: var(--muted);
  line-height: 1.8;
}

.intro-screen__hints {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 26px;
}

.intro-screen__hints span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 14px;
}

.quote {
  margin: 24px auto 0;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.7;
  color: var(--text);
}

.quote-author {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* GAME AREA */
.game-screen {
  position: relative;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  z-index: 12;
  pointer-events: none;
}

.hud__title,
.hud__progress {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 21, 27, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.hud__title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud__progress {
  margin-left: auto;
}

.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 6600px;
  height: 100%;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 20% 8%, rgba(255,255,255,0.32) 0 1px, transparent 2px),
    radial-gradient(circle at 29% 20%, rgba(255,255,255,0.44) 0 1px, transparent 2px),
    radial-gradient(circle at 41% 11%, rgba(255,255,255,0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 53% 17%, rgba(255,255,255,0.36) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 10%, rgba(255,255,255,0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 19%, rgba(255,255,255,0.46) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 13%, rgba(255,255,255,0.38) 0 1px, transparent 2px);
  background-repeat: repeat-x;
  background-size: 1200px 320px;
  opacity: 0.5;
}

.sky-decor {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.8;
}

.sky-decor--1 {
  top: 88px;
  left: 200px;
  width: 220px;
  height: 52px;
  background: rgba(255,255,255,0.06);
}

.sky-decor--2 {
  top: 126px;
  left: 2320px;
  width: 280px;
  height: 68px;
  background: rgba(255,255,255,0.05);
}

.sky-decor--3 {
  top: 96px;
  left: 4760px;
  width: 260px;
  height: 62px;
  background: rgba(255,255,255,0.045);
}

.floating-card {
  position: absolute;
  left: var(--fx);
  top: var(--fy);
  width: 340px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  transition:
    opacity 0.7s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  animation: floatCard 4.4s ease-in-out infinite;
  animation-delay: var(--delay);
}

.floating-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.floating-card img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
  margin-bottom: 14px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.2));
}

.floating-card__text span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.floating-card__text h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.floating-card__text p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1); }
}

/* PLAYER PIXEL */
.player {
  position: absolute;
  left: 120px;
  bottom: 92px;
  width: 80px;
  height: 120px;
  z-index: 8;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.player.is-facing-left {
  transform: scaleX(-1);
}

.player__shadow {
  position: absolute;
  left: 16px;
  bottom: 4px;
  width: 46px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  filter: blur(4px);
}

.player__sprite {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 56px;
  height: 84px;
  image-rendering: pixelated;
  transform: scale(1);
  transform-origin: bottom center;
}

.player.is-moving .player__sprite {
  animation: pixelBob 0.22s steps(2) infinite;
}

.px {
  position: absolute;
  width: 8px;
  height: 8px;
  image-rendering: pixelated;
}

.px--hair1 { left: 16px; top: 0; width: 24px; height: 8px; background: #1f2430; }
.px--hair2 { left: 8px; top: 8px; width: 40px; height: 16px; background: #252b39; }
.px--face1 { left: 16px; top: 24px; width: 24px; height: 16px; background: #e6d0b4; }
.px--face2 { left: 24px; top: 40px; width: 8px; height: 8px; background: #d7bb98; }

.px--eye1,
.px--eye2 {
  top: 24px;
  width: 8px;
  height: 8px;
  background: #f7f7f7;
}

.px--eye1 { left: 16px; }
.px--eye2 { left: 32px; }

.px--scarf1 { left: 16px; top: 40px; width: 24px; height: 8px; background: #c8a56b; }
.px--scarf2 { left: 8px; top: 48px; width: 40px; height: 8px; background: #b78d52; }

.px--body1 { left: 16px; top: 56px; width: 24px; height: 16px; background: #2f3f67; }
.px--body2 { left: 8px; top: 64px; width: 40px; height: 8px; background: #3d4f7e; }

.px--arm1 { left: 8px; top: 56px; width: 8px; height: 16px; background: #2b3350; }
.px--arm2 { left: 40px; top: 56px; width: 8px; height: 16px; background: #2b3350; }

.px--leg1,
.px--leg2 {
  top: 72px;
  width: 8px;
  height: 12px;
  background: #e8edf4;
  transform-origin: top center;
}

.px--leg1 { left: 16px; }
.px--leg2 { left: 32px; }

.player.is-moving .px--leg1,
.quiz-player.is-moving .px--leg1 {
  animation: pixelLegLeft 0.28s steps(2) infinite;
}

.player.is-moving .px--leg2,
.quiz-player.is-moving .px--leg2 {
  animation: pixelLegRight 0.28s steps(2) infinite;
}

@keyframes pixelBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes pixelLegLeft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

@keyframes pixelLegRight {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(0); }
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background:
    linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 40px, transparent 40px 80px);
}

.ground-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(200,165,107,0.5), transparent);
}

.controls-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 99990;
  display: none;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.control-btn {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(17, 21, 27, 0.58);
  color: var(--text);
  font-size: 26px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

/* MAIN DOOR */
.door {
  position: absolute;
  left: 6080px;
  bottom: 78px;
  width: 190px;
  height: 260px;
  z-index: 7;
  image-rendering: pixelated;
}

.door__aura {
  position: absolute;
  inset: -34px;
  border-radius: 34px;
  background:
    radial-gradient(circle, rgba(200,165,107,0.20) 0%, rgba(200,165,107,0.10) 38%, transparent 72%);
  filter: blur(12px);
  animation: doorAuraPulse 2.6s ease-in-out infinite;
}

.door__roots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.root {
  position: absolute;
  display: block;
  background: linear-gradient(180deg, #5a6f91, #31425e);
  box-shadow: 0 0 0 1px rgba(200,165,107,0.08);
  transform-origin: top center;
}

.root::before,
.root::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #6e87ad, #354864);
}

.root--1 {
  left: 20px;
  bottom: 38px;
  width: 10px;
  height: 90px;
  transform: rotate(32deg);
}

.root--1::before {
  width: 8px;
  height: 42px;
  left: -10px;
  top: 24px;
  transform: rotate(-38deg);
}

.root--1::after {
  width: 7px;
  height: 28px;
  left: 8px;
  top: 48px;
  transform: rotate(34deg);
}

.root--2 {
  left: 42px;
  bottom: 18px;
  width: 8px;
  height: 72px;
  transform: rotate(18deg);
}

.root--2::before {
  width: 6px;
  height: 32px;
  left: 8px;
  top: 18px;
  transform: rotate(30deg);
}

.root--3 {
  right: 26px;
  bottom: 34px;
  width: 10px;
  height: 96px;
  transform: rotate(-28deg);
}

.root--3::before {
  width: 8px;
  height: 38px;
  right: -8px;
  top: 26px;
  transform: rotate(36deg);
}

.root--3::after {
  width: 6px;
  height: 26px;
  right: 8px;
  top: 54px;
  transform: rotate(-26deg);
}

.root--4 {
  right: 48px;
  bottom: 16px;
  width: 8px;
  height: 68px;
  transform: rotate(-16deg);
}

.root--4::before {
  width: 6px;
  height: 30px;
  right: 8px;
  top: 14px;
  transform: rotate(-34deg);
}

.root--5 {
  left: 68px;
  bottom: -4px;
  width: 8px;
  height: 58px;
  transform: rotate(6deg);
}

.root--5::before {
  width: 6px;
  height: 24px;
  left: -8px;
  top: 18px;
  transform: rotate(-28deg);
}

.root--6 {
  right: 70px;
  bottom: -2px;
  width: 8px;
  height: 54px;
  transform: rotate(-6deg);
}

.root--6::before {
  width: 6px;
  height: 24px;
  right: -8px;
  top: 16px;
  transform: rotate(26deg);
}

.door__pillars {
  position: absolute;
  inset: 16px 0 0;
}

.pillar {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 210px;
  background: linear-gradient(180deg, #88673d 0%, #5c4327 100%);
  box-shadow:
    inset -4px 0 0 rgba(0,0,0,0.14),
    inset 4px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(17, 21, 27, 0.34);
}

.pillar::before,
.pillar::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 32px;
  height: 16px;
  background: linear-gradient(180deg, #a07a49, #6a4d2c);
}

.pillar::before {
  top: -10px;
}

.pillar::after {
  bottom: -6px;
}

.pillar--left {
  left: 18px;
}

.pillar--right {
  right: 18px;
}

.door__portal {
  position: absolute;
  left: 47px;
  bottom: 18px;
  width: 96px;
  height: 196px;
  border: 4px solid rgba(104, 75, 40, 0.95);
  box-shadow:
    0 0 0 4px rgba(28, 22, 16, 0.65),
    0 0 26px rgba(200,165,107,0.12);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.door__pixel-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,0.06) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 2px, transparent 2px 12px);
  opacity: 0.22;
  mix-blend-mode: screen;
}

.door__inner-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,244,220,0.95) 0%, rgba(233,198,132,0.65) 24%, rgba(112,164,255,0.18) 62%, rgba(0,0,0,0) 100%);
  animation: doorLightPulse 2s ease-in-out infinite;
}

.door__core {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 28px;
  height: 126px;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(231,197,135,0.72) 45%, rgba(120,172,255,0.16));
  filter: blur(1px);
  animation: doorCoreShimmer 1.8s ease-in-out infinite;
}

.door__sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.door__sparkles span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff1cc;
  box-shadow: 0 0 10px rgba(255, 241, 204, 0.7);
  animation: sparkleFloat 2.2s ease-in-out infinite;
}

.door__sparkles span:nth-child(1) {
  left: 38px;
  top: 34px;
  animation-delay: 0s;
}

.door__sparkles span:nth-child(2) {
  right: 34px;
  top: 58px;
  animation-delay: 0.45s;
}

.door__sparkles span:nth-child(3) {
  left: 48px;
  bottom: 72px;
  animation-delay: 0.9s;
}

.door__sparkles span:nth-child(4) {
  right: 42px;
  bottom: 50px;
  animation-delay: 1.3s;
}

.door.is-awake .door__aura {
  animation-duration: 1.4s;
}

.door.is-awake .door__inner-light {
  opacity: 1;
}

.door.is-awake .door__core {
  animation-duration: 1.1s;
}

.door.is-awake .root {
  filter: drop-shadow(0 0 8px rgba(142, 164, 199, 0.22));
}

@keyframes doorAuraPulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes doorLightPulse {
  0%, 100% {
    opacity: 0.82;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.04);
  }
}

@keyframes doorCoreShimmer {
  0%, 100% {
    opacity: 0.75;
    transform: translateX(-50%) scaleY(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleY(1.06);
  }
}

@keyframes sparkleFloat {
  0%, 100% {
    opacity: 0.2;
    transform: translateY(0) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateY(-8px) scale(1.1);
  }
}

/* CHOICE SCREEN */
.choice-screen {
  position: absolute;
  inset: 0;
  z-index: 29;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  background:
    radial-gradient(circle at 50% 20%, rgba(200, 165, 107, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(10, 12, 16, 0.52), rgba(10, 12, 16, 0.84));
}

.choice-screen.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.choice-screen__inner {
  width: min(760px, 100%);
  padding: 34px;
  text-align: center;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.choice-screen__inner h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.choice-screen__inner p {
  color: var(--muted);
  line-height: 1.8;
}

.choice-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* QUIZ SCREEN */
.quiz-screen {
  position: absolute;
  inset: 0;
  z-index: 28;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 16px 24px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  background:
    radial-gradient(circle at 50% 20%, rgba(200, 165, 107, 0.08), transparent 22%),
    linear-gradient(180deg, #12161d 0%, #171c24 46%, #13171d 100%);
  overflow: hidden;
}

.quiz-screen.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.quiz-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  z-index: 5;
}

.quiz-lives,
.quiz-counter {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 21, 27, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.quiz-lives {
  color: #efb7aa;
  letter-spacing: 0.12em;
}

.quiz-sky {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
}

.quiz-cloud {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 18px 24px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 60px rgba(0,0,0,0.24);
  text-align: center;
  animation: cloudFloat 4.4s ease-in-out infinite;
}

.quiz-label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.quiz-cloud h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.quiz-doors {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 150px;
  width: min(1120px, calc(100% - 40px));
  height: 260px;
  margin: 0 auto;
  z-index: 3;
  pointer-events: none;
}

.quiz-door {
  position: absolute;
  bottom: 0;
  width: 176px;
  height: 236px;
  image-rendering: pixelated;
  transition: transform 0.2s ease, filter 0.2s ease;
  transform: translateY(44px);
  pointer-events: none;
}

.quiz-door--left {
  left: 36px;
}

.quiz-door--right {
  right: 36px;
}

.quiz-door.is-awake {
  transform: translateY(38px);
}

.quiz-door__label-box {
  position: absolute;
  left: 50%;
  top: -56px; /* naikkan dikit */
  transform: translateX(-46%); /* geser ke kanan dikit */

  width: 120px;
  min-height: 40px;
  padding: 6px 8px;

  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04)),
    rgba(18, 24, 34, 0.82);

  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.24),
    0 0 0 1px rgba(200,165,107,0.06) inset;

  backdrop-filter: blur(8px);

  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-door__label {
  width: 100%;
  color: #f3ede4;
  font-weight: 700;
  line-height: 1.35;
  font-size: 12px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

.quiz-door__aura {
  position: absolute;
  inset: -24px;
  border-radius: 34px;
  background: radial-gradient(circle, rgba(200,165,107,0.2), transparent 70%);
  filter: blur(12px);
  animation: doorAuraPulse 2.6s ease-in-out infinite;
}

.quiz-door__roots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quiz-door__roots .root {
  position: absolute;
  display: block;
  background: linear-gradient(180deg, #5a6f91, #31425e);
  box-shadow: 0 0 0 1px rgba(200,165,107,0.08);
  transform-origin: top center;
}

.quiz-door__roots .root::before,
.quiz-door__roots .root::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #6e87ad, #354864);
}

.quiz-door__roots .root--1 {
  left: 18px;
  bottom: 30px;
  width: 8px;
  height: 58px;
  transform: rotate(28deg);
}

.quiz-door__roots .root--1::before {
  width: 6px;
  height: 24px;
  left: -6px;
  top: 18px;
  transform: rotate(-34deg);
}

.quiz-door__roots .root--2 {
  left: 40px;
  bottom: 12px;
  width: 7px;
  height: 42px;
  transform: rotate(10deg);
}

.quiz-door__roots .root--3 {
  right: 20px;
  bottom: 30px;
  width: 8px;
  height: 64px;
  transform: rotate(-28deg);
}

.quiz-door__roots .root--3::before {
  width: 6px;
  height: 24px;
  right: -6px;
  top: 18px;
  transform: rotate(34deg);
}

.quiz-door__roots .root--4 {
  right: 42px;
  bottom: 12px;
  width: 7px;
  height: 40px;
  transform: rotate(-10deg);
}

.quiz-door__pillars {
  position: absolute;
  inset: 14px 0 0;
}

.quiz-door__pillars .pillar {
  position: absolute;
  bottom: 0;
  width: 21px;
  height: 176px;
  background: linear-gradient(180deg, #88673d 0%, #5c4327 100%);
  box-shadow:
    inset -4px 0 0 rgba(0,0,0,0.14),
    inset 4px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(17, 21, 27, 0.34);
}

.quiz-door__pillars .pillar::before,
.quiz-door__pillars .pillar::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 28px;
  height: 13px;
  background: linear-gradient(180deg, #a07a49, #6a4d2c);
}

.quiz-door__pillars .pillar::before {
  top: -8px;
}

.quiz-door__pillars .pillar::after {
  bottom: -5px;
}

.quiz-door__pillars .pillar--left {
  left: 14px;
}

.quiz-door__pillars .pillar--right {
  right: 14px;
}

.quiz-door__portal {
  position: absolute;
  left: 40px;
  bottom: 6px;
  width: 96px;
  height: 166px;
  border: 4px solid rgba(104, 75, 40, 0.95);
  box-shadow:
    0 0 0 4px rgba(28, 22, 16, 0.65),
    0 0 26px rgba(200,165,107,0.12);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.quiz-door__pixel-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,0.06) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 2px, transparent 2px 12px);
  opacity: 0.22;
  mix-blend-mode: screen;
}

.quiz-door__inner-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,244,220,0.95) 0%, rgba(233,198,132,0.65) 24%, rgba(112,164,255,0.18) 62%, rgba(0,0,0,0) 100%);
  animation: doorLightPulse 2s ease-in-out infinite;
}

.quiz-door__core {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 24px;
  height: 104px;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(231,197,135,0.72) 45%, rgba(120,172,255,0.16));
  filter: blur(1px);
  animation: doorCoreShimmer 1.8s ease-in-out infinite;
}

.quiz-door.is-awake .quiz-door__label-box {
  border-color: rgba(200,165,107,0.28);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.26),
    0 0 18px rgba(200,165,107,0.12);
}

.quiz-door.is-correct .quiz-door__aura {
  background: radial-gradient(circle, rgba(130, 218, 155, 0.28), transparent 68%);
}

.quiz-door.is-wrong .quiz-door__aura {
  background: radial-gradient(circle, rgba(231, 120, 120, 0.28), transparent 68%);
}
.quiz-door.is-correct .quiz-door__label-box {
  border-color: rgba(130, 218, 155, 0.45);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.26),
    0 0 18px rgba(130, 218, 155, 0.16);
}

.quiz-door.is-wrong .quiz-door__label-box {
  border-color: rgba(231, 120, 120, 0.45);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.26),
    0 0 18px rgba(231, 120, 120, 0.14);
}

.quiz-player-lane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 94px;
  width: min(1180px, calc(100% - 20px));
  height: 72px;
  margin: 0 auto;
  z-index: 5;
}

.quiz-player {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 50px;
  height: 74px;
  transform: translateX(-50%);
  z-index: 6;
}

.quiz-player.is-facing-left {
  transform: translateX(-50%) scaleX(-1);
}

.quiz-player .player__sprite {
  transform: scale(0.68);
  transform-origin: bottom center;
}

.quiz-player.is-moving .player__sprite {
  animation: quizPixelBob 0.22s steps(2) infinite;
}

.quiz-ground-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  width: min(1180px, calc(100% - 20px));
  height: 108px;
  margin: 0 auto;
  z-index: 1;
}

.quiz-ground-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(200, 165, 107, 0.55),
    transparent
  );
}

.quiz-ground {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  bottom: 0;
  background:
    linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.03) 0 40px,
      transparent 40px 80px
    );
  border-radius: 0 0 18px 18px;
}

.quiz-feedback {
  min-height: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  position: relative;
  z-index: 6;
}

@keyframes cloudFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* MUSIC BUTTON */
.music-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(200, 165, 107, 0.62);
  border-radius: 999px;
  background: rgba(200, 165, 107, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(200, 165, 107, 0.08) inset;
  transition:
    transform 0.18s ease,
    background 0.2s ease,
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.music-toggle:hover {
  background: rgba(200, 165, 107, 0.28);
  border-color: rgba(200, 165, 107, 0.78);
}

.music-toggle:active {
  transform: scale(0.95);
}

.music-toggle img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .floating-card {
    width: 280px;
    padding: 16px;
  }

  .floating-card__text h2 {
    font-size: 28px;
  }

  .floating-card img {
    max-height: 120px;
  }

  .quiz-door {
    width: 158px;
    height: 220px;
  }

  .quiz-door__portal {
    left: 36px;
    width: 86px;
    height: 154px;
  }
}

@media (max-width: 768px) {
  .intro-screen__inner,
  .outro-screen__inner,
  .choice-screen__inner {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .intro-screen__hints {
    flex-direction: column;
    gap: 10px;
  }

  .hud {
    top: 12px;
    left: 12px;
    right: 72px;
    gap: 10px;
  }

  .hud__title,
  .hud__progress {
    font-size: 11px;
    padding: 8px 10px;
  }

  .controls-mobile {
    display: flex;
  }

  .world {
    width: 6400px;
  }

  .player {
    width: 72px;
    height: 108px;
    bottom: 98px;
  }

  .player__sprite {
    transform: scale(0.92);
    transform-origin: bottom center;
  }

  .floating-card {
    width: 250px;
  }

  .floating-card__text h2 {
    font-size: 24px;
  }

  .floating-card__text p {
    font-size: 13px;
    line-height: 1.6;
  }

  .choice-screen {
    padding: 18px;
  }

  .choice-actions {
    flex-direction: column;
    gap: 12px;
  }

  .choice-actions .primary-btn,
  .choice-actions .secondary-btn {
    width: 100%;
  }

  .quote {
    font-size: 17px;
    line-height: 1.65;
  }

  .quiz-screen {
    padding: 12px 12px 0;
  }

  .quiz-hud {
    gap: 10px;
    margin-bottom: 6px;
  }

  .quiz-lives,
  .quiz-counter {
    font-size: 12px;
    padding: 8px 10px;
  }

  .quiz-sky {
    gap: 12px;
  }

  .quiz-screen {
    padding: 12px 12px 86px;
  }

  .quiz-cloud {
    width: calc(100% - 8px);
    padding: 16px 14px;
    border-radius: 24px;
  }

  .quiz-cloud h2 {
    font-size: clamp(18px, 5.8vw, 28px);
    line-height: 1.14;
  }

  .quiz-doors {
    bottom: 168px;
    width: calc(100% - 16px);
    height: 190px;
  }

  .quiz-door {
    width: 112px;
    height: 170px;
    transform: translateY(32px);
  }

  .quiz-door--left {
    left: 0;
  }

  .quiz-door--right {
    right: 0;
  }

  .quiz-door.is-awake {
    transform: translateY(26px);
  }

  .quiz-door__label-box {
    width: 110px;
    min-height: 36px;
    padding: 6px 6px;

    top: -50px; /* naik sedikit */
    transform: translateX(-20%); /* geser kanan lebih terasa */
  }

  .quiz-door__label {
    font-size: 10px;
    line-height: 1.25;
  }

  .quiz-door__pillars .pillar {
    height: 126px;
    width: 16px;
  }

  .quiz-door__pillars .pillar--left {
    left: 10px;
  }

  .quiz-door__pillars .pillar--right {
    right: 10px;
  }

  .quiz-door__portal {
    left: 26px;
    bottom: 2px;
    width: 60px;
    height: 118px;
  }

  .quiz-door__portal {
    bottom: -6px;
  }

  .quiz-player-lane {
    bottom: 110px;
    width: calc(100% - 16px);
    height: 56px;
  }

  .quiz-player {
    width: 46px;
    height: 70px;
    bottom: -4px;
  }

  .quiz-player .player__sprite {
    transform: scale(0.62);
    transform-origin: bottom center;
  }

  .quiz-player.is-moving .player__sprite {
    animation: quizPixelBobMobile 0.22s steps(2) infinite;
  }

  .quiz-ground-wrap {
    bottom: 74px;
    width: calc(100% - 16px);
    height: 70px;
  }

  .quiz-ground-wrap {
    bottom: 165px;
  }

  .quiz-door__core {
    width: 18px;
    height: 82px;
  }

  .quiz-feedback {
    font-size: 13px;
    min-height: 18px;
  }

  .music-toggle {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .music-toggle img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 520px) {
  .hud__title {
    display: none;
  }

  .player {
    left: 90px;
    width: 58px;
    height: 114px;
  }

  .floating-card {
    width: 220px;
    padding: 14px;
  }

  .floating-card img {
    max-height: 96px;
  }

  .quiz-cloud h2 {
    font-size: clamp(18px, 6vw, 26px);
  }

  .quiz-door {
    width: 112px;
    height: 170px;
  }

  .quiz-door__portal {
    left: 26px;
    width: 60px;
    height: 118px;
  }

  .quiz-player {
    width: 50px;
    height: 76px;
  }
}

@media (max-width: 768px) {
  .controls-mobile {
    display: flex;
  }

  .control-btn {
    width: 58px;
    height: 58px;
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .quiz-screen {
    padding: 12px 12px 86px;
  }
}

@media (max-width: 420px) {
  .quiz-cloud h2 {
    font-size: 17px;
  }

  .quiz-doors {
    width: calc(100% - 12px);
  }

  .quiz-door {
    width: 104px;
    height: 162px;
  }

  .quiz-door__portal {
    left: 24px;
    width: 56px;
    height: 112px;
  }

  .quiz-player {
    width: 48px;
    height: 74px;
  }
}

@keyframes quizPixelBob {
  0%, 100% {
    transform: scale(0.68) translateY(0);
  }
  50% {
    transform: scale(0.74) translateY(-2px);
  }
}

@keyframes quizPixelBobMobile {
  0%, 100% {
    transform: scale(0.62) translateY(0);
  }
  50% {
    transform: scale(0.67) translateY(-2px);
  }
}

.ambient-words {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ambient-word {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: rgba(236, 230, 220, 0.34);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  text-shadow:
    0 0 10px rgba(200, 165, 107, 0.08),
    0 0 24px rgba(142, 164, 199, 0.06);
  animation:
    ambientFloat 8s ease-in-out infinite,
    ambientFade 4.8s ease-in-out infinite;
  animation-delay: var(--d), var(--d);
}

.ambient-word--small {
  font-size: 11px;
  opacity: 0.28;
  letter-spacing: 0.12em;
}

.ambient-word--large {
  font-size: 17px;
  opacity: 0.4;
  letter-spacing: 0.16em;
}

.ambient-word--gold {
  color: rgba(200, 165, 107, 0.42);
}

.ambient-word--blue {
  color: rgba(142, 164, 199, 0.36);
}

.ambient-word--soft {
  color: rgba(236, 230, 220, 0.22);
}

@keyframes ambientFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

@keyframes ambientFade {
  0%, 100% {
    opacity: 0.14;
  }
  25% {
    opacity: 0.34;
  }
  50% {
    opacity: 0.56;
  }
  75% {
    opacity: 0.26;
  }
}

@keyframes ambientFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes ambientFade {
  0%, 100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.42;
  }
}

.floating-card {
  z-index: 3;
}

.player {
  z-index: 8;
}

.ambient-words--back {
  z-index: 1;
  filter: blur(0.2px);
}

.ambient-words--back .ambient-word {
  opacity: 0.18;
  font-size: 12px;
}

.ambient-word {
  color: rgba(236, 230, 220, 0.28);
}

.npc {
  position: absolute;
  bottom: 110px; /* sesuaikan dengan ground */
  transform: translateX(-50%);
  z-index: 6;
}

.npc-character {
  width: 40px;
  height: 52px;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
}

/* contoh sprite */
.npc--babbage {
  background-image: url("img/npc1.png");
}

.npc--engineer {
  background-image: url("img/npc2.png");
}

.npc--scientist {
  background-image: url("img/npc3.png");
}

.npc--modern {
  background-image: url("img/npc4.png");
}

/* speech bubble */
.npc-bubble {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 160px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: #e8e2d9;

  background: rgba(20, 26, 36, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(200,165,107,0.25);

  opacity: 0;
  pointer-events: none;

  transition: all 0.4s ease;
}

/* efek muncul */
.npc.is-active .npc-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* sedikit floating */
.npc-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(20,26,36,0.7) transparent transparent transparent;
}

.npc-character {
  animation: npcIdle 2s ease-in-out infinite;
}

@keyframes npcIdle {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.npc.is-active .npc-character {
  filter: drop-shadow(0 0 8px rgba(200,165,107,0.4));
}

.npc {
  position: absolute;
  bottom: 112px;
  transform: translateX(-50%);
  z-index: 6;
}

.npc-character {
  position: relative;
  width: 42px;
  height: 54px;
  image-rendering: pixelated;
  animation: npcIdle 2s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.22));
}

.npc .px {
  position: absolute;
  width: 6px;
  height: 6px;
  image-rendering: pixelated;
}

.npc .px--hat {
  left: 9px;
  top: 0;
  width: 24px;
  height: 6px;
  background: var(--npc-hat, #2c3140);
}

.npc .px--hair {
  left: 6px;
  top: 6px;
  width: 30px;
  height: 12px;
  background: var(--npc-hair, #3a2b22);
}

.npc .px--face {
  left: 12px;
  top: 18px;
  width: 18px;
  height: 12px;
  background: var(--npc-face, #e1c7aa);
}

.npc .px--eye1,
.npc .px--eye2 {
  top: 18px;
  width: 6px;
  height: 6px;
  background: #f7f7f7;
}

.npc .px--eye1 {
  left: 12px;
}

.npc .px--eye2 {
  left: 24px;
}

.npc .px--body {
  left: 9px;
  top: 30px;
  width: 24px;
  height: 12px;
  background: var(--npc-body, #4d607f);
}

.npc .px--arm1 {
  left: 3px;
  top: 30px;
  width: 6px;
  height: 12px;
  background: var(--npc-arm, #32415c);
}

.npc .px--arm2 {
  left: 33px;
  top: 30px;
  width: 6px;
  height: 12px;
  background: var(--npc-arm, #32415c);
}

.npc .px--leg1,
.npc .px--leg2 {
  top: 42px;
  width: 6px;
  height: 12px;
  background: var(--npc-leg, #eef2f7);
}

.npc .px--leg1 {
  left: 12px;
}

.npc .px--leg2 {
  left: 24px;
}

.npc-bubble {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(18, 24, 34, 0.82);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.24),
    0 0 0 1px rgba(200,165,107,0.06) inset;
  backdrop-filter: blur(8px);
  color: #efe7dc;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.npc-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(18, 24, 34, 0.82) transparent transparent transparent;
}

.npc.is-active .npc-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.npc.is-active .npc-character {
  filter:
    drop-shadow(0 0 8px rgba(200,165,107,0.18))
    drop-shadow(0 8px 10px rgba(0,0,0,0.22));
}

@keyframes npcIdle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.npc--babbage {
  --npc-hat: #3e3329;
  --npc-hair: #5a4534;
  --npc-face: #dfc3a2;
  --npc-body: #6a4f3f;
  --npc-arm: #593f31;
  --npc-leg: #eee7dd;
}

.npc--engineer {
  --npc-hat: #3b465d;
  --npc-hair: #2b3343;
  --npc-face: #e2c8ac;
  --npc-body: #506785;
  --npc-arm: #40536d;
  --npc-leg: #eef3f8;
}

.npc--scientist {
  --npc-hat: #4a4a4a;
  --npc-hair: #d9d9d9;
  --npc-face: #e7ccb0;
  --npc-body: #6c7b92;
  --npc-arm: #57657b;
  --npc-leg: #f3f5f8;
}

.npc--modern {
  --npc-hat: #202536;
  --npc-hair: #1a2130;
  --npc-face: #e6cab0;
  --npc-body: #3b4f8c;
  --npc-arm: #2e3f73;
  --npc-leg: #f2f5fa;
}

@media (max-width: 768px) {
  .npc {
    bottom: 106px;
  }

  .npc-character {
    transform: scale(0.9);
    transform-origin: bottom center;
  }

  .npc-bubble {
    width: 150px;
    font-size: 11px;
    padding: 8px 10px;
  }
}