:root {
  --bg-deep: #15182b;
  --bg-hall: #1f2440;
  --cream: #fff8e7;
  --cream-soft: #f5ebd1;
  --ink: #1e1b2e;
  --ink-muted: #5b5570;
  --gold: #ffca3a;
  --gold-dark: #d99b00;
  --coral: #ff595e;
  --coral-dark: #c93439;
  --teal: #2ec4b6;
  --teal-dark: #198d82;
  --sky: #3a86ff;
  --violet: #8338ec;
  --emerald: #38b000;
  --emerald-dark: #257300;
  --border-w: 3px;
  --shadow-arcade: 0 6px 0 var(--ink);
  --shadow-arcade-sm: 0 4px 0 var(--ink);
  --radius-lg: 22px;
  --font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --room-width: 780px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* ==================== FULLSCREEN PANORAMIC CARTOON MUSEUM ==================== */
.museum-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  background: #141625;
}

.museum-corridor {
  position: absolute;
  top: 56px;
  bottom: 112px;
  left: 0;
  display: flex;
  width: calc(var(--room-width) * 7);
  transition: transform 1.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.museum-room {
  position: relative;
  width: var(--room-width);
  height: 100%;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--wall-bg) 0%, var(--wall-accent) 100%);
  border-right: 6px solid #1e1b2e;
  display: flex;
  flex-direction: column;
  transition: filter 0.6s ease, opacity 0.6s ease;
}

.museum-room.hall-dim {
  filter: brightness(0.55) saturate(0.75);
}

.museum-room.hall-lit {
  filter: brightness(1) saturate(1.06);
}

.room-ceiling {
  height: 46px;
  background: #1a1c2c;
  border-bottom: 4px solid var(--trim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: relative;
}

.room-spotlight {
  width: 34px;
  height: 14px;
  background: var(--gold);
  border: 2.5px solid var(--ink);
  border-radius: 0 0 14px 14px;
  position: relative;
}

.museum-room.hall-lit .room-spotlight::after {
  content: '';
  position: absolute;
  top: 12px;
  left: -46px;
  width: 126px;
  height: 240px;
  background: linear-gradient(180deg, rgba(255, 232, 150, 0.24) 0%, rgba(255, 232, 150, 0) 100%);
  clip-path: polygon(35% 0%, 65% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
}

.room-sign {
  background: var(--cream);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 3px 0 var(--ink);
}

.room-wall {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 46px 10px;
  background-image: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.08), transparent 65%);
}

.room-column {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  background: repeating-linear-gradient(90deg, #ede2c9 0 6px, #cbb993 6px 10px);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
}

.room-column:first-of-type {
  left: 10px;
}

.room-column:last-of-type {
  right: 10px;
}

/* Wall Paintings / Frames */
.wall-gallery-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 24px;
  z-index: 1;
}

.wall-frame {
  margin: 0;
  background: #b97d32;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 7px 7px 5px;
  box-shadow: 0 5px 0 rgba(20, 18, 32, 0.45);
  width: 158px;
  text-align: center;
}

.frame-art {
  background: #fff8e7;
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  line-height: 0;
}

.frame-art svg {
  width: 100%;
  height: auto;
}

.frame-caption {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff8e7;
  text-shadow: 0 1px 0 var(--ink);
}

/* Pedestal Glass Vitrines on Floor Edge */
.vitrine-floor-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 24px;
  z-index: 2;
  margin-top: auto;
}

.pedestal-vitrine {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 146px;
}

.vitrine-glass {
  width: 96px;
  height: 82px;
  background: linear-gradient(135deg, rgba(215, 244, 255, 0.34), rgba(255, 255, 255, 0.12));
  border: 3px solid var(--ink);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
}

.vitrine-glass::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 9px;
  width: 10px;
  height: 50px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  transform: rotate(10deg);
}

.vitrine-item {
  width: 60px;
  height: 60px;
}

.vitrine-item svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 0 rgba(30, 27, 46, 0.35));
}

.museum-room.hall-current .vitrine-item {
  animation: floatArtifact 2.4s ease-in-out infinite;
}

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

.vitrine-plinth {
  width: 126px;
  background: linear-gradient(180deg, #e7d8b5 0%, #c8b386 100%);
  border: 3px solid var(--ink);
  border-radius: 6px 6px 2px 2px;
  padding: 6px 6px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(20, 18, 32, 0.45);
}

/* Museum Floor & Red Carpet Runner */
.museum-floor {
  position: relative;
  height: 112px;
  width: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      #d8c7a3 0 64px,
      #cbb78e 64px 128px
    );
  border-top: 4px solid var(--ink);
}

.museum-carpet {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  height: 52px;
  background: #b52a37;
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.18);
}

/* Animated Cartoon Museum Visitor */
.museum-walker {
  position: fixed;
  bottom: 24px;
  left: 16%;
  width: 96px;
  height: 128px;
  z-index: 2;
  transition: left 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.walker-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 0 rgba(15, 17, 32, 0.35));
}

.museum-walker.is-walking .walker-svg {
  animation: walkerBounce 0.32s ease-in-out infinite alternate;
}

.museum-walker.is-walking .walker-leg-left {
  transform-origin: 34px 72px;
  animation: legSwingA 0.32s ease-in-out infinite alternate;
}

.museum-walker.is-walking .walker-leg-right {
  transform-origin: 46px 72px;
  animation: legSwingB 0.32s ease-in-out infinite alternate;
}

.museum-walker.is-walking .walker-arm-front {
  transform-origin: 22px 46px;
  animation: legSwingB 0.32s ease-in-out infinite alternate;
}

.museum-walker.is-walking .walker-arm-back {
  transform-origin: 56px 46px;
  animation: legSwingA 0.32s ease-in-out infinite alternate;
}

@keyframes walkerBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

@keyframes legSwingA {
  from { transform: rotate(-18deg); }
  to { transform: rotate(18deg); }
}

@keyframes legSwingB {
  from { transform: rotate(18deg); }
  to { transform: rotate(-18deg); }
}

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  background: rgba(21, 24, 43, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid rgba(255, 202, 58, 0.3);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow-arcade-sm);
  border-radius: 999px;
  padding: 5px 15px 5px 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.brand-crest img {
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  background: var(--bg-hall);
  color: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.streak-pill {
  background: #3a1d12;
  color: #ffd166;
  border-color: #ff9f1c;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ==================== LAYOUT & PANELS ==================== */
.app-shell {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 14px 16px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  animation: fadeSlideUp 0.25s ease-out;
}

.screen.active {
  display: block;
}

.screen-game-stage.active {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: calc(100vh - 150px);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.arcade-panel {
  background: rgba(255, 248, 231, 0.95);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-arcade);
}

/* ==================== BUTTONS ==================== */
.arcade-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 12px 24px;
  border-radius: 16px;
  border: var(--border-w) solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.arcade-btn:hover { filter: brightness(1.04); }
.arcade-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.arcade-btn-primary { background: var(--teal); color: var(--ink); }
.arcade-btn-gold { background: var(--gold); color: var(--ink); }
.arcade-btn-secondary { background: var(--cream-soft); color: var(--ink); }

/* ==================== SCREEN 1: ENTRANCE ==================== */
.entrance-card {
  padding: 0 24px 24px;
  overflow: hidden;
  text-align: center;
  max-width: 780px;
  margin: 10px auto 0;
}

.museum-pediment {
  margin: 0 -24px 16px;
  background: linear-gradient(180deg, #e7d8b5 0%, #f5ebd1 100%);
  border-bottom: var(--border-w) solid var(--ink);
  padding: 12px 16px 0;
}

.pediment-roof {
  display: inline-block;
  background: var(--gold);
  border: var(--border-w) solid var(--ink);
  border-radius: 999px;
  padding: 4px 16px;
  margin-bottom: 8px;
}

.pediment-inscription {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.pediment-columns {
  display: flex;
  justify-content: space-around;
  max-width: 520px;
  margin: 0 auto;
  height: 16px;
}

.pillar {
  width: 26px;
  height: 16px;
  background: repeating-linear-gradient(90deg, #fff8e7 0 5px, #d6c59c 5px 8px);
  border-left: 2.5px solid var(--ink);
  border-right: 2.5px solid var(--ink);
  border-top: 2.5px solid var(--ink);
  border-radius: 4px 4px 0 0;
}

.badge-ribbon {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  margin-bottom: 8px;
}

.hero-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 4px 4px 0 var(--gold);
}

.hero-subtitle {
  max-width: 560px;
  margin: 10px auto 16px;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.entrance-era-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 0 auto 16px;
}

.mini-vitrine {
  background: var(--cream-soft);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 3px 0 var(--ink);
}

.mini-vitrine svg {
  width: 30px;
  height: 30px;
}

.mini-vitrine span {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
}

.entrance-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 auto 16px;
  text-align: left;
}

.step-pill {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  line-height: 1.3;
}

.step-pill-gold { background: #fff3c4; }

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

.tier-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.tier-chip {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
}

.tier-tourist { background: #b7e4c7; }
.tier-explorer { background: #90dbf4; }
.tier-scholar { background: #cdb4db; }
.tier-archivist { background: #ffafcc; }
.tier-maxima { background: var(--gold); box-shadow: 0 2px 0 var(--ink); }
.tier-arrow { color: var(--ink-muted); font-weight: 700; }

.entrance-cta-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.entrance-record-bar,
.summary-records-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 14px;
}

.record-pill {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 0 2px 0 var(--ink);
}

.record-pill-first {
  background: #f1f5f9;
}

.record-pill-best {
  background: #fff3c4;
}

.record-pill-streak {
  background: #ffedd5;
  color: #9a3412;
  border-color: #c2410c;
}

.record-pill-new {
  background: var(--gold);
  animation: vitrinePop 0.45s ease;
}

.challenge-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 14px;
  padding: 10px 16px;
  max-width: 560px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: linear-gradient(135deg, #fff3b0 0%, #ffe08a 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  box-shadow: 0 3px 0 var(--ink);
  text-align: center;
}

.challenge-banner.challenge-won {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.challenge-banner.challenge-lost {
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
}

.challenge-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.game-challenge-pill {
  align-self: center;
  margin: 6px auto 0;
  padding: 5px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--ink);
}

.bd-question-records {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.archive-switcher {
  padding-top: 12px;
  border-top: 2px dashed #d6c59c;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.archive-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.pack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pack-pill {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}

.pack-pill.active {
  background: var(--ink);
  color: var(--gold);
}

/* ==================== SCREEN 2: COMPACT HUD + FLOATING EXHIBIT CARD ==================== */
.museum-hud-strip {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-badge {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.hud-era-pill {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
}

.hud-era-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.era-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #e6dbc1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0.55;
  transition: all 0.35s ease;
}

.era-dot.unlocked {
  opacity: 1;
  background: #fff;
}

.era-dot.current {
  background: var(--gold);
  transform: scale(1.16);
  box-shadow: 0 2px 0 var(--ink);
}

.hud-score-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.hud-score-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 2px 10px;
  box-shadow: 0 3px 0 var(--ink);
}

/* Floating Question Plaque positioned cleanly above the museum carpet & walker */
.exhibit-card {
  width: 100%;
  max-width: 640px;
  margin: auto auto 92px;
  padding: 18px 22px 20px;
  background: rgba(255, 248, 231, 0.94);
  backdrop-filter: blur(4px);
}

.exhibit-card.is-reveal-compact {
  max-width: 560px;
  margin-bottom: 106px;
}

.exhibit-card.shake {
  animation: cardShake 0.38s ease;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.exhibit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.category-plaque {
  background: var(--gold);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 0 var(--ink);
}

.timer-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  flex: 1;
  max-width: 280px;
}

.timer-bar-shell {
  flex: 1;
  height: 14px;
  background: #e3d6b8;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  background: var(--emerald);
  transition: width 0.2s linear, background-color 0.25s ease;
}

.timer-bar-fill.warn { background: var(--gold); }
.timer-bar-fill.danger { background: var(--coral); animation: pulseTimer 0.55s infinite alternate; }

@keyframes pulseTimer {
  from { filter: brightness(1); }
  to { filter: brightness(1.25); }
}

.timer-seconds {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 34px;
  text-align: right;
}

.prompt-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  line-height: 1.18;
  text-align: center;
}

.prompt-subtext {
  margin: 0 0 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.answer-form {
  max-width: 580px;
  margin: 0 auto;
}

.input-row {
  display: flex;
  gap: 10px;
}

.arcade-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  border: var(--border-w) solid var(--ink);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.arcade-input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.22);
}

.feedback-banner {
  margin: 12px auto 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  background: #ffe1e2;
  color: #7d1115;
}

.feedback-banner.consulting {
  background: #e0f2fe;
  color: #0c4a6e;
}

.confirm-box {
  margin: 14px auto 0;
  padding: 13px 14px;
  border-radius: 16px;
  border: var(--border-w) solid var(--ink);
  background: #fff3c4;
  box-shadow: 0 4px 0 var(--ink);
  text-align: center;
}

.confirm-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
}

.confirm-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.confirm-choice-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 8px 16px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: var(--teal);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.confirm-choice-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.confirm-reject-btn {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.skip-row {
  margin-top: 14px;
  text-align: center;
}

.skip-btn {
  background: transparent;
  border: 2px dashed var(--ink-muted);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.skip-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(30, 27, 46, 0.06);
}

/* ==================== REVEAL STATE ==================== */
.exhibit-reveal {
  text-align: center;
}

.tier-stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 7px 20px;
  border-radius: 14px;
  border: var(--border-w) solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  margin-bottom: 10px;
  animation: stampSlam 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stampSlam {
  0% { transform: scale(1.6) rotate(-6deg); opacity: 0; }
  100% { transform: scale(1) rotate(-1.5deg); opacity: 1; }
}

.stamp-tourist { background: #b7e4c7; }
.stamp-explorer { background: #90dbf4; }
.stamp-scholar { background: #cdb4db; }
.stamp-archivist { background: #ffafcc; }
.stamp-maxima {
  background: linear-gradient(135deg, #ffe066, #ffca3a);
  box-shadow: 0 5px 0 var(--ink), 0 0 22px rgba(255, 202, 58, 0.85);
}
.stamp-zero { background: #e2e8f0; color: #475569; }

.reveal-answer-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.reveal-answer-word {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
}

.reveal-points-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--gold);
  padding: 4px 11px;
  border-radius: 999px;
}

.judge-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.museum-plaque {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  text-align: left;
  box-shadow: 0 3px 0 #d6c59c;
  margin-bottom: 14px;
}

.plaque-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 3px;
}

.plaque-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ==================== CROWD DISTRIBUTION BAR ==================== */
.crowd-box {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 13px 9px;
  margin-bottom: 14px;
  text-align: left;
  box-shadow: 0 3px 0 #d6c59c;
}

.crowd-box.crowd-compact {
  margin-top: 9px;
  margin-bottom: 0;
  padding: 8px 10px 7px;
  background: var(--cream);
  box-shadow: none;
  border-width: 2px;
}

.crowd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.crowd-compact .crowd-header {
  margin-bottom: 15px;
}

.crowd-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.crowd-rank-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  background: #fff3c4;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
}

.crowd-rank-badge.is-zero {
  background: #e2e8f0;
  color: #475569;
}

.crowd-bar-wrap {
  position: relative;
}

.crowd-you-pin {
  position: absolute;
  top: -19px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.crowd-you-tag {
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.crowd-you-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink);
}

.crowd-bar-track {
  display: flex;
  width: 100%;
  height: 15px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  overflow: hidden;
  background: #e2e8f0;
}

.crowd-compact .crowd-bar-track {
  height: 12px;
  border-width: 2px;
}

.crowd-seg {
  height: 100%;
  border-right: 1.5px solid var(--ink);
}

.crowd-seg:last-child {
  border-right: none;
}

.crowd-seg-tourist { background: #b7e4c7; }
.crowd-seg-explorer { background: #90dbf4; }
.crowd-seg-scholar { background: #cdb4db; }
.crowd-seg-archivist { background: #ffafcc; }
.crowd-seg-maxima { background: var(--gold); }

.crowd-legend {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.summary-crowd-pill {
  display: inline-block;
  margin: 0 auto 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  background: #e0f2fe;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 16px;
  box-shadow: 0 3px 0 var(--ink);
}

/* ==================== TOTAL BREAKDOWN COMPARISON ==================== */
.total-comparison-card {
  margin-top: 16px;
  background: linear-gradient(180deg, #fffdf6 0%, #fff3c4 100%);
  border: var(--border-w) solid var(--ink);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 4px 0 var(--ink);
}

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

.tc-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.tc-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
}

.tc-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.tc-stat {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 9px 11px;
}

.tc-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.tc-stat-val {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
}

.tc-stat-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.tc-tally-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 26px;
}

.tc-tally-pill {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
}

.tc-bar-wrap {
  position: relative;
  margin-bottom: 6px;
}

.tc-pin {
  position: absolute;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.tc-pin-you {
  top: -22px;
  z-index: 4;
}

.tc-pin-avg {
  bottom: -22px;
  z-index: 3;
}

.tc-pin-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.tc-pin-you .tc-pin-tag {
  background: var(--ink);
  color: var(--gold);
}

.tc-pin-avg .tc-pin-tag {
  background: #e2e8f0;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.tc-pin-arrow-down {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink);
}

.tc-pin-arrow-up {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--ink);
}

.tc-bar-track {
  height: 16px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: linear-gradient(90deg, #b7e4c7 0%, #90dbf4 35%, #cdb4db 65%, #ffafcc 85%, #ffca3a 100%);
  position: relative;
  overflow: hidden;
}

.tc-bar-fill-dim {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.58);
}

.tc-bar-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-muted);
  margin-top: 22px;
}

@media (max-width: 760px) {
  .tc-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== SCREEN 3: SUMMARY ==================== */
.summary-hero {
  padding: 22px 22px;
  text-align: center;
  margin-bottom: 16px;
}

.summary-top-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--gold);
  padding: 4px 13px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.summary-era-heading {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.8vw, 2.1rem);
}

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

.summary-total-score {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 3px 3px 0 var(--gold);
}

.summary-max-score {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  color: var(--ink-muted);
}

.summary-era-showcase {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  background: #fff3b0;
  border: var(--border-w) solid var(--ink);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 var(--ink);
  padding: 10px;
}

.summary-era-showcase svg { width: 100%; height: 100%; }

.summary-timeline-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 780px;
  margin: 0 auto 18px;
}

.era-vitrine {
  background: #e9dec4;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 7px 4px;
  text-align: center;
  opacity: 0.55;
  filter: grayscale(0.75);
}

.era-vitrine.unlocked { opacity: 1; filter: none; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.era-vitrine.current { background: #fff3b0; box-shadow: 0 4px 0 var(--ink); }
.era-vitrine-art { width: 32px; height: 32px; margin: 0 auto 3px; }
.era-vitrine-name { display: block; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; }

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-toast { margin: 10px 0 0; font-weight: 700; color: var(--emerald-dark); font-size: 0.88rem; }
.countdown-text { margin: 10px 0 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-muted); }

.breakdown-panel { padding: 20px 22px; }
.breakdown-header { margin-bottom: 14px; }
.breakdown-header h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.3rem; }
.breakdown-sub { font-size: 0.86rem; color: var(--ink-muted); }
.breakdown-list { display: grid; gap: 12px; }

.breakdown-item {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: 0 3px 0 #d6c59c;
}

.breakdown-q-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.breakdown-q-title { font-family: var(--font-display); font-size: 1.04rem; font-weight: 700; }
.breakdown-tier-pill { font-family: var(--font-display); font-size: 0.76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); }

.breakdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 0.84rem; }
.bd-cell { background: var(--cream); border: 2px solid #e1d4b7; border-radius: 10px; padding: 7px 9px; }
.bd-cell-maxima { background: #fff6cc; border-color: var(--gold-dark); }
.bd-label { display: block; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; color: var(--ink-muted); margin-bottom: 2px; }
.bd-val { font-weight: 700; }
.bd-fact { margin: 8px 0 0; font-size: 0.82rem; color: var(--ink-muted); }

/* ==================== FOOTER & MODALS ==================== */
.site-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: 8px auto 14px;
  padding: 8px 16px;
  background: rgba(255, 248, 231, 0.95);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
}

.footer-link {
  background: none;
  border: none;
  color: #1d4ed8;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.footer-link:hover {
  color: #1e3a8a;
  background: rgba(29, 78, 216, 0.1);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 17, 32, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box { width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; padding: 20px 22px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { margin: 0; font-family: var(--font-display); font-size: 1.35rem; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--coral); color: #fff; font-weight: 700; cursor: pointer; }
.modal-body { font-size: 0.93rem; line-height: 1.55; }
.modal-body ul { padding-left: 20px; }

.legal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #d6c59c;
}

.legal-lang-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 5px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.legal-lang-btn.active {
  background: var(--gold);
  box-shadow: 0 2px 0 var(--ink);
}

.legal-section h4 {
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}

.legal-section p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.legal-section a {
  color: #1d4ed8;
  font-weight: 600;
}

.legal-section a:hover {
  color: #1e3a8a;
}

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 760px) {
  :root {
    --room-width: 520px;
  }

  .wall-frame {
    width: 126px;
  }

  .pedestal-vitrine {
    width: 112px;
  }

  .vitrine-glass {
    width: 78px;
    height: 68px;
  }

  .vitrine-item {
    width: 48px;
    height: 48px;
  }

  .museum-walker {
    width: 76px;
    height: 102px;
    bottom: 20px;
  }

  .entrance-era-strip,
  .summary-timeline-mini {
    grid-template-columns: repeat(4, 1fr);
  }

  .entrance-steps,
  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .btn-label-sm {
    display: none;
  }

  .hud-era-dots {
    display: none;
  }
}
