/* ═══════════════════════════════════════════════
   GEM Escape Room · styles.css
   Clean interactive refresh
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #F5F8FC;
  --card: #FFFFFF;
  --card-2: #ECF3F9;
  --text-1: #0A1F44;
  --text-2: #2D4368;
  --text-3: #5D6B82;
  --accent: #5BA9D8;
  --accent-d: #0E2A5C;
  --accent-l: #DCEBF7;
  --alert: #B91C1C;
  --alert-bg: #FEE7E7;
  --green: #166534;
  --green-bg: #F0FDF4;
  --blue: #1D4ED8;
  --blue-bg: #EFF6FF;
  --border: #DDE6F0;
  --border-strong: #BFCDE0;
  --shadow: 0 18px 48px rgba(14, 42, 92, 0.10);
  --shadow-soft: 0 8px 20px rgba(14, 42, 92, 0.08);
  --r-lg: 28px;
  --r: 20px;
  --r-sm: 14px;

  /* Gradientes metálicos */
  --metal-gold:    linear-gradient(135deg, #FCD34D 0%, #CA8A04 55%, #92400E 100%);
  --metal-silver:  linear-gradient(135deg, #F8FAFC 0%, #CBD5E1 45%, #94A3B8 100%);
  --metal-chrome:  linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 30%, #94A3B8 70%, #CBD5E1 100%);
  --metal-navy:    linear-gradient(135deg, #1E3A8A 0%, #0E2A5C 55%, #061838 100%);
  --metal-celeste: linear-gradient(135deg, #BEE3F8 0%, #5BA9D8 55%, #2C7FB0 100%);
  --metal-brass:   linear-gradient(135deg, #FDE68A 0%, #B45309 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 24%, rgba(91, 169, 216, 0.10), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(14, 42, 92, 0.08), transparent 24%),
    radial-gradient(circle at 62% 78%, rgba(29, 78, 216, 0.05), transparent 28%);
  animation: ambientDrift 16s ease-in-out infinite alternate;
}

button {
  font: inherit;
}

.screen {
  min-height: 100vh;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ─── Brand logos (UEES + GEM) ───────────────── */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 18px 24px 6px;
  flex-wrap: wrap;
}

.brand-logo {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(14, 42, 92, 0.10));
}

.brand-logo--uees { height: 78px; width: auto; }
.brand-logo--gem  { height: 78px; width: auto; border-radius: 8px; }

.brand-bar--results {
  padding: 12px 24px 22px;
  gap: 40px;
}
.brand-bar--results .brand-logo--uees { height: 84px; }
.brand-bar--results .brand-logo--gem  { height: 84px; border-radius: 10px; }

.hm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hm-brand-logo {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}
.hm-brand-logo:last-child { border-radius: 4px; }

.character-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(17, 17, 17, 0.12));
}

.character-float {
  animation: characterFloat 3s ease-in-out infinite;
}

/* ─── Door Transition ─────────────────────────── */

.door-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(91, 169, 216, 0.12), transparent 35%),
    rgba(17, 17, 17, 0.92);
  overflow: hidden;
}

.door-overlay.hidden {
  display: none;
}

.da-scene {
  position: relative;
  width: min(720px, 92vw);
  height: min(420px, 74vh);
}

.da-scene::before {
  content: '';
  position: absolute;
  inset: 10% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 169, 216, 0.16), transparent 60%);
  filter: blur(24px);
  animation: pulseGlow 2.2s ease-in-out infinite;
}

.da-char {
  position: absolute;
  left: 32px;
  bottom: 28px;
  width: 120px;
  z-index: 2;
  will-change: transform, opacity;
}

.da-char.run-to-door {
  transform: translateX(300px);
}

.da-char.at-door {
  animation: doorWait 0.38s ease-in-out infinite;
}

.da-door-wrap {
  position: absolute;
  right: 92px;
  bottom: 18px;
  width: 176px;
  height: 282px;
  border-radius: 88px 88px 10px 10px;
  animation: floatSlow 3.2s ease-in-out infinite;
}

.da-door-frame {
  position: absolute;
  inset: 0;
  border-radius: 88px 88px 10px 10px;
  border: 3px solid #475569;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(91, 169, 216, 0.35),
    0 0 48px rgba(91, 169, 216, 0.4),
    0 8px 24px rgba(14, 42, 92, 0.45);
}

.da-door-panel {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(91, 169, 216, 0.08), transparent 55%),
    linear-gradient(180deg, #1E3A8A 0%, #0A1F44 60%, #061226 100%);
  transform-origin: left center;
  will-change: transform;
  box-shadow:
    inset 0 0 36px rgba(0, 0, 0, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.da-door-hole {
  display: none;
}

.da-door-detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.da-door-knob {
  position: absolute;
  right: 20px;
  top: 52%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #FEF3C7 0%, #FCD34D 28%, #B45309 75%, #5C2A02 100%);
  box-shadow:
    0 0 14px rgba(252, 211, 77, 0.6),
    inset 0 -3px 4px rgba(0, 0, 0, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.55);
  z-index: 2;
}

.da-light-through {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 35% 50%, rgba(245, 248, 252, 0.92), transparent 45%),
    linear-gradient(90deg, rgba(91, 169, 216, 0.26), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: blur(2px);
}

.da-key-card {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  min-width: 220px;
  padding: 16px 22px;
  border-radius: var(--r);
  border: 1px solid rgba(91, 169, 216, 0.4);
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
  opacity: 0;
  box-shadow: var(--shadow);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.da-key-card.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.da-kc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.da-kc-name {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-d);
}

.da-kc-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
}

/* ─── Intro ────────────────────────────────────── */

#screen-intro {
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.intro-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 36px;
  align-items: center;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeUp 0.6s ease both;
}

.intro-gem-tag {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid rgba(14, 42, 92, 0.28);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-d);
  animation: floatTag 4s ease-in-out infinite;
}

.intro-h1 {
  font-size: clamp(48px, 8vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 900;
  animation: headlineIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.h1-accent {
  display: block;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(180, 83, 9, 0.25));
}

.intro-lead {
  max-width: 560px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-2);
  animation: fadeUpSoft 0.8s ease 0.08s both;
}

.intro-lead strong {
  color: var(--text-1);
}

.btn-start,
.btn-continue,
.btn-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-start,
.btn-continue {
  width: fit-content;
  padding: 15px 26px;
  background: var(--text-1);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(17, 17, 17, 0.18);
  animation: fadeUpSoft 0.78s ease 0.14s both;
}

.btn-start:hover,
.btn-continue:hover {
  background: var(--accent-d);
  transform: translateY(-2px) scale(1.01);
}

.btn-start::before,
.btn-continue::before,
.btn-restart::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.28) 45%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  z-index: -1;
}

.btn-start:hover::before,
.btn-continue:hover::before,
.btn-restart:hover::before {
  transform: translateX(120%);
}

.intro-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  animation: fadeUpSoft 0.8s ease 0.2s both;
}

.intro-visual {
  animation: fadeUp 0.6s ease 0.08s both;
}

.intro-scene-card {
  position: relative;
  min-height: 500px;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(14, 42, 92, 0.18);
  background:
    radial-gradient(circle at 24% 24%, rgba(91, 169, 216, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(220, 235, 247, 0.96) 100%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.intro-scene-card::before {
  content: '';
  position: absolute;
  inset: -20% auto auto -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.78), transparent 60%);
  animation: orbitLight 8s linear infinite;
  pointer-events: none;
}

.intro-scene-glow {
  position: absolute;
  inset: auto 12% 18% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 169, 216, 0.38), transparent 68%);
  filter: blur(4px);
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.intro-scene-door {
  position: absolute;
  right: 92px;
  bottom: 92px;
  width: 150px;
  height: 240px;
  border-radius: 80px 80px 10px 10px;
  border: 4px solid rgba(14, 42, 92, 0.74);
  background: linear-gradient(180deg, #1E3A8A 0%, #0A1F44 60%, #061226 100%);
  box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.34);
  animation: doorBreath 3.6s ease-in-out infinite;
}

.intro-scene-door::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 52%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.intro-scene-path {
  position: absolute;
  left: 62px;
  right: 78px;
  bottom: 58px;
  height: 116px;
  background: linear-gradient(180deg, rgba(14, 42, 92, 0.08), rgba(14, 42, 92, 0.2));
  clip-path: polygon(18% 0%, 52% 0%, 74% 100%, 0% 100%);
  border-radius: 24px;
  overflow: hidden;
}

.intro-scene-path::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.26) 40%, transparent 65%);
  transform: translateX(-120%);
  animation: pathShimmer 4.6s ease-in-out infinite;
}

.intro-scene-character {
  position: absolute;
  left: 48px;
  bottom: 40px;
  width: clamp(260px, 52%, 380px);
  animation: heroEnter 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
}

.intro-scene-chip {
  position: absolute;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(14, 42, 92, 0.18);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-soft);
  animation: floatTag 4.2s ease-in-out infinite;
}

.chip-top {
  top: 28px;
  right: 30px;
  animation-delay: 0.2s;
}

.chip-bottom {
  bottom: 24px;
  right: 28px;
  animation-delay: 1s;
}

/* ─── Game Layout ──────────────────────────────── */

#screen-game {
  min-height: 100vh;
}

.hud-mini {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(245, 248, 252, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(191, 205, 224, 0.52);
}

.hm-sala {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.hm-keys {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hm-key-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(191, 205, 224, 0.72);
  color: var(--text-3);
  transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.hm-key-slot.unlocked {
  background: var(--card-2);
  border-color: rgba(91, 169, 216, 0.36);
  color: var(--text-1);
  box-shadow: 0 0 0 6px rgba(91, 169, 216, 0.10);
  animation: chipPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hm-key-name {
  font-size: 12px;
  font-weight: 600;
}

.hm-key-state {
  font-size: 12px;
}

.hm-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hm-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(191, 205, 224, 0.72);
  background: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.hm-audio-btn:hover {
  background: var(--card-2);
  border-color: rgba(91, 169, 216, 0.45);
  transform: scale(1.06);
  box-shadow: 0 4px 10px rgba(14, 42, 92, 0.15);
}

.hm-audio-btn:active {
  transform: scale(0.96);
}

.hm-audio-btn.muted {
  opacity: 0.55;
}

.hm-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hm-pts {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transform-origin: center;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 1px 2px rgba(180, 83, 9, 0.3));
}

.hm-pts-lbl {
  font-size: 12px;
  color: var(--text-3);
}

.room-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
  padding: 24px;
  transition: background 0.35s ease;
  position: relative;
  overflow: hidden;
}

.room-stage::before {
  content: '';
  position: absolute;
  inset: -10% -5%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.28), transparent 24%),
    radial-gradient(circle at 82% 32%, rgba(91, 169, 216, 0.10), transparent 20%);
  pointer-events: none;
  animation: ambientDrift 14s ease-in-out infinite alternate;
}

.room-stage[data-sala="1"] {
  background: linear-gradient(180deg, #FFF8EC 0%, #FFF1CB 100%);
}

.room-stage[data-sala="2"] {
  background: linear-gradient(180deg, #FFFFFF 0%, #ECF3F9 100%);
}

.room-stage[data-sala="3"] {
  background: linear-gradient(180deg, #FFF7E8 0%, #FFECC1 100%);
}

.room-stage[data-sala="4"] {
  background: linear-gradient(180deg, #FFF8EF 0%, #FFF1D8 100%);
}

.room-stage[data-sala="5"] {
  background: linear-gradient(180deg, #FFF5EA 0%, #FDE7D3 100%);
}

.room-content-col,
.room-visual-col {
  min-width: 0;
}

.level-card,
.room-scene {
  height: 100%;
}

.level-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.level-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sala-tag,
.key-target-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.sala-tag {
  background: var(--card-2);
  color: var(--accent-d);
  border: 1px solid rgba(91, 169, 216, 0.32);
}

.magnetic-chip {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.magnetic-chip:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-soft);
}

.key-target-badge {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-2);
  border: 1px solid rgba(191, 205, 224, 0.7);
}

.level-title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.scenario-card,
.question-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scenario-card {
  padding: 18px 20px 18px;
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(220, 235, 247, 0.55) 100%);
  border: 1px solid rgba(14, 42, 92, 0.16);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 4px 12px rgba(14, 42, 92, 0.04);
}

.scenario-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 72%);
  transform: translateX(-120%);
  animation: pathShimmer 7s ease-in-out infinite;
  pointer-events: none;
}

.sc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.sc-icon {
  font-size: 28px;
  line-height: 0.9;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(180, 83, 9, 0.22));
}

.sc-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.scenario-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  position: relative;
  z-index: 1;
}

.scenario-text strong,
.scenario-text em {
  color: var(--text-1);
}

.q-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.ql-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--metal-gold);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.55);
  animation: qLabelPulse 2.2s ease-in-out infinite;
}

@keyframes qLabelPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(252, 211, 77, 0); }
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt-card {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid rgba(191, 205, 224, 0.72);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(17, 17, 17, 0.02);
  transition: transform 0.22s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  position: relative;
  overflow: hidden;
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)) scale(var(--sc, 1));
  will-change: transform;
}

.opt-card:hover {
  --lift: -3px;
  --sc: 1.008;
  border-color: rgba(14, 42, 92, 0.42);
  box-shadow: var(--shadow-soft);
}

.opt-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(180deg, rgba(91, 169, 216, 0.14), rgba(91, 169, 216, 0.02));
  transition: width 0.28s ease;
  z-index: 0;
}

.opt-card:hover::before,
.opt-card.selected::before {
  width: 100%;
}

.opt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.2), transparent 55%);
  opacity: var(--glow, 0);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.12s ease;
}

.opt-main {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.opt-icon-badge {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
  background: linear-gradient(135deg, #ECF3F9 0%, #FFFFFF 100%);
  border: 1px solid rgba(191, 205, 224, 0.7);
  box-shadow:
    0 3px 8px rgba(14, 42, 92, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              background 0.22s ease,
              border-color 0.22s ease;
}

.opt-card:hover .opt-icon-badge {
  transform: scale(1.08) rotate(-4deg);
  box-shadow:
    0 6px 14px rgba(14, 42, 92, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.opt-card.selected .opt-icon-badge {
  background: linear-gradient(135deg, #DCEBF7 0%, #BEE3F8 100%);
  border-color: rgba(91, 169, 216, 0.8);
}

.opt-card.tier-best .opt-icon-badge {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: rgba(22, 101, 52, 0.5);
}
.opt-card.tier-zero .opt-icon-badge {
  background: linear-gradient(135deg, #FEE7E7 0%, #FECACA 100%);
  border-color: rgba(185, 28, 28, 0.5);
}

.opt-content {
  flex: 1;
  min-width: 0;
}

.opt-chevron {
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.24s ease, transform 0.24s ease, color 0.18s ease;
}

.opt-card:hover .opt-chevron {
  opacity: 1;
  transform: translateX(0);
}

.opt-card.selected .opt-chevron {
  opacity: 0.6;
  transform: translateX(2px);
}

.opt-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opt-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.opt-text {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

.opt-card.selected {
  box-shadow: var(--shadow-soft);
  animation: chipPop 0.34s ease both;
}

.opt-card.faded {
  opacity: 0.38;
  pointer-events: none;
  transform: scale(0.985);
}

.tier-best {
  border-color: rgba(22, 101, 52, 0.32);
  background: var(--green-bg);
}

.tier-mid {
  border-color: rgba(29, 78, 216, 0.24);
  background: var(--blue-bg);
}

.tier-low {
  border-color: rgba(91, 169, 216, 0.36);
  background: #F0F7FD;
}

.tier-zero {
  border-color: rgba(194, 65, 12, 0.24);
  background: var(--alert-bg);
}

.feedback-stack {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  animation: fadeUp 0.28s ease both;
}

.unlock-card,
.gem-mini {
  padding: 16px 18px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid rgba(191, 205, 224, 0.72);
  box-shadow: var(--shadow-soft);
}

.unlock-kicker,
.gem-mini-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.unlock-title {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
}

.unlock-text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.unlock-points {
  display: inline-flex;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  animation: pulseText 1.8s ease-in-out infinite;
}

.unlock-card.tier-best .unlock-title,
.unlock-card.tier-best .unlock-points {
  color: var(--green);
}

.unlock-card.tier-mid .unlock-title,
.unlock-card.tier-mid .unlock-points {
  color: var(--blue);
}

.unlock-card.tier-low .unlock-title,
.unlock-card.tier-low .unlock-points {
  color: var(--accent-d);
}

.unlock-card.tier-zero .unlock-title,
.unlock-card.tier-zero .unlock-points {
  color: var(--alert);
}

.gem-mini {
  background: rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.gem-mini::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(91, 169, 216, 0.08) 45%, transparent 62%);
  transform: translateX(-120%);
  animation: pathShimmer 5.2s ease-in-out infinite;
}

.gem-mini-stat {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: var(--accent-d);
}

.gem-mini-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gem-mini-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ─── Room Scene ───────────────────────────────── */

.room-scene {
  display: flex;
}

.scene-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid rgba(191, 205, 224, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(220, 235, 247, 0.94) 100%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.scene-atmosphere,
.scene-grid {
  position: absolute;
  inset: 0;
}

.scene-atmosphere {
  animation: ambientDrift 12s ease-in-out infinite alternate;
}

.scene-atmosphere::before,
.scene-atmosphere::after,
.scene-grid::before,
.scene-grid::after {
  content: '';
  position: absolute;
}

.scene-grid {
  background-image:
    linear-gradient(rgba(14, 42, 92, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 42, 92, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 72%);
}

.scene-floor {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -20px;
  height: 150px;
  background: linear-gradient(180deg, rgba(14, 42, 92, 0.16), rgba(14, 42, 92, 0.34));
  border-radius: 50% 50% 0 0;
  animation: floorBreath 4s ease-in-out infinite;
}

.scene-path {
  position: absolute;
  left: 14%;
  right: 18%;
  bottom: 82px;
  height: 154px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06));
  clip-path: polygon(18% 0%, 58% 0%, 76% 100%, 0% 100%);
  border-radius: 20px;
  overflow: hidden;
}

.scene-path::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.24) 46%, transparent 64%);
  transform: translateX(-120%);
  animation: pathShimmer 5s ease-in-out infinite;
}

.scene-door-wrap {
  position: absolute;
  right: 13%;
  bottom: 88px;
  width: 158px;
  height: 244px;
  border-radius: 82px 82px 10px 10px;
}

.scene-door-light {
  position: absolute;
  inset: -12px;
  border-radius: 82px 82px 16px 16px;
  background: radial-gradient(circle at center, rgba(91, 169, 216, 0.24), transparent 66%);
  animation: pulseGlow 2.6s ease-in-out infinite;
}

.scene-door-frame {
  position: absolute;
  inset: 0;
  border-radius: 82px 82px 10px 10px;
  border: 3px solid rgba(14, 42, 92, 0.72);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.26);
  animation: doorBreath 3.8s ease-in-out infinite;
}

.scene-door-panel {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #1E3A8A 0%, #0A1F44 60%, #061226 100%);
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.16);
}

.scene-door-knob {
  position: absolute;
  right: 18px;
  top: 52%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #FEF3C7 0%, #FCD34D 28%, #B45309 75%, #5C2A02 100%);
  box-shadow:
    0 0 14px rgba(252, 211, 77, 0.55),
    inset 0 -3px 4px rgba(0, 0, 0, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.55);
  z-index: 2;
}

.scene-character-wrap {
  position: absolute;
  left: 8%;
  bottom: 40px;
  width: clamp(260px, 56%, 380px);
  animation: heroEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  z-index: 3;
}

.scene-character-wrap .character-image {
  filter: drop-shadow(0 16px 18px rgba(17, 17, 17, 0.32))
          drop-shadow(0 4px 6px rgba(17, 17, 17, 0.18));
}

.scene-figures {
  position: absolute;
  left: 42%;
  top: 18%;
  width: 108px;
  height: 108px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 8px 14px rgba(17, 17, 17, 0.12));
  animation: figureBob 6.5s ease-in-out infinite;
}

.scene-figures .rf-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes figureBob {
  0%, 100% { transform: translateY(0) rotate(-1.4deg); }
  50%      { transform: translateY(-8px) rotate(1.4deg); }
}

.scene-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.scene-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(91, 169, 216, 0.62);
  top: calc(14% + (var(--i) * 8.5%));
  left: calc(16% + (var(--i) * 8%));
  animation: particleFloat 5.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.28s);
  opacity: 0;
}

@keyframes particleFloat {
  0%   { transform: translate(0, 8px) scale(0.6); opacity: 0; }
  20%  { opacity: 0.85; }
  50%  { transform: translate(10px, -16px) scale(1); opacity: 0.7; }
  80%  { opacity: 0.4; }
  100% { transform: translate(20px, -32px) scale(0.5); opacity: 0; }
}

.room-stage[data-sala="2"] .scene-particles span {
  background: rgba(191, 205, 224, 0.85);
  width: 4px;
  height: 5px;
  border-radius: 1px;
}

.room-stage[data-sala="3"] .scene-particles span {
  background: rgba(91, 169, 216, 0.85);
  box-shadow: 0 0 6px rgba(91, 169, 216, 0.5);
}

.room-stage[data-sala="4"] .scene-particles span {
  background: rgba(29, 78, 216, 0.65);
  width: 4px;
  height: 4px;
  box-shadow: 0 0 5px rgba(29, 78, 216, 0.55);
}

.room-stage[data-sala="5"] .scene-particles span {
  background: rgba(153, 27, 27, 0.42);
  width: 5px;
  height: 2px;
  border-radius: 1px;
  animation-duration: 3.2s;
}

.scene-door-detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  animation: doorDetailGlow 4s ease-in-out infinite;
}

@keyframes doorDetailGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(91, 169, 216, 0.18)) drop-shadow(0 0 1px rgba(252, 211, 77, 0.18)); }
  50%      { filter: drop-shadow(0 0 7px rgba(91, 169, 216, 0.42)) drop-shadow(0 0 3px rgba(252, 211, 77, 0.30)); }
}

.scene-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.scene-chip {
  position: absolute;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(191, 205, 224, 0.72);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-soft);
  animation: floatTag 4.8s ease-in-out infinite;
}

.scene-chip-a {
  top: 20px;
  left: 20px;
  animation-delay: 0.1s;
}

.scene-chip-b {
  top: 74px;
  right: 22px;
  animation-delay: 0.9s;
}

.scene-chip-c {
  left: 40px;
  bottom: 164px;
  animation-delay: 1.6s;
}

.room-stage[data-sala="1"] .scene-atmosphere::before {
  top: 28px;
  right: 70px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 169, 216, 0.42), rgba(91, 169, 216, 0.08) 62%, transparent 64%);
}

.room-stage[data-sala="1"] .scene-atmosphere::after {
  left: 36px;
  right: 36px;
  bottom: 238px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(14, 42, 92, 0.6), transparent);
}

.room-stage[data-sala="2"] .scene-atmosphere::before {
  top: 34px;
  right: 62px;
  width: 118px;
  height: 148px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(220, 235, 247, 0.88));
  border: 1px solid rgba(191, 205, 224, 0.86);
  transform: rotate(-6deg);
}

.room-stage[data-sala="2"] .scene-atmosphere::after {
  top: 66px;
  right: 102px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 10px solid rgba(194, 65, 12, 0.16);
}

.room-stage[data-sala="3"] .scene-atmosphere::before {
  top: 36px;
  right: 72px;
  width: 136px;
  height: 94px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.08), rgba(17, 17, 17, 0.18));
  border: 1px solid rgba(191, 205, 224, 0.52);
}

.room-stage[data-sala="3"] .scene-atmosphere::after {
  bottom: 172px;
  right: 62px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(91, 169, 216, 0.72);
  box-shadow:
    -28px 18px 0 0 rgba(91, 169, 216, 0.46),
    -60px 2px 0 0 rgba(91, 169, 216, 0.34);
}

.room-stage[data-sala="4"] .scene-atmosphere::before {
  top: 28px;
  right: 50px;
  width: 150px;
  height: 150px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(220, 235, 247, 0.54)),
    linear-gradient(90deg, transparent 46%, rgba(14, 42, 92, 0.16) 46%, rgba(14, 42, 92, 0.16) 54%, transparent 54%);
  border: 1px solid rgba(191, 205, 224, 0.78);
}

.room-stage[data-sala="4"] .scene-atmosphere::after {
  top: 74px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 42, 92, 0.42), transparent 68%);
}

.room-stage[data-sala="5"] .scene-atmosphere::before {
  top: 30px;
  left: 20px;
  width: 170px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(194, 65, 12, 0.12), rgba(17, 17, 17, 0.08), rgba(194, 65, 12, 0.12));
}

.room-stage[data-sala="5"] .scene-atmosphere::after {
  top: 78px;
  left: 40px;
  width: 128px;
  height: 76px;
  clip-path: polygon(8% 0%, 46% 0%, 28% 56%, 68% 56%, 0% 100%, 20% 62%, 0% 62%);
  background: rgba(194, 65, 12, 0.16);
}

/* ─── Progress Bar ─────────────────────────────── */

.corridor {
  padding: 16px 24px 20px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(191, 205, 224, 0.62);
}

.cor-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(191, 205, 224, 0.7);
  overflow: hidden;
}

.cor-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-d) 100%);
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.cor-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.34) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: pathShimmer 3.6s ease-in-out infinite;
}

.cor-doors {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cor-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 16px;
  background: rgba(245, 248, 252, 0.52);
  border: 1px solid rgba(191, 205, 224, 0.56);
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.cor-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.cor-step-state {
  font-size: 15px;
}

.cor-step.is-complete {
  background: rgba(220, 235, 247, 0.86);
  border-color: rgba(91, 169, 216, 0.34);
  animation: chipPop 0.45s ease both;
}

.cor-step.is-current {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(14, 42, 92, 0.42);
  box-shadow: 0 0 0 4px rgba(91, 169, 216, 0.12);
  animation: stepPulse 1.6s ease-in-out infinite;
}

.cor-step.is-locked {
  opacity: 0.72;
}

.cor-step-final {
  background: rgba(17, 17, 17, 0.04);
}

/* ─── Results ──────────────────────────────────── */

#screen-results {
  background: var(--bg);
  overflow-y: auto;
}

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

.res-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 44px 24px 72px;
}

.res-content {
  width: min(760px, 100%);
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.res-hero,
.res-score-bar,
.res-stats,
.res-keys-row,
.res-gem-card,
.res-details {
  animation: fadeUp 0.42s ease both;
}

.res-hero {
  text-align: center;
  margin-bottom: 6px;
}

.res-scene {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 18px;
  animation: heroEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.res-door {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 84px;
  height: 138px;
  border-radius: 44px 44px 8px 8px;
  border: 3px solid rgba(14, 42, 92, 0.72);
  background: linear-gradient(180deg, #1E3A8A 0%, #0A1F44 60%, #061226 100%);
  animation: doorBreath 4s ease-in-out infinite;
}

.res-door.open::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(91, 169, 216, 0.28), transparent 70%);
  animation: pulseGlow 2.2s ease-in-out infinite;
}

.res-character {
  position: absolute;
  left: 12px;
  bottom: 0;
  width: 128px;
}

.res-status {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.res-title {
  margin-top: 10px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.res-score-bar,
.res-gem-card,
.res-details {
  padding: 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
}

.rsb-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.rsb-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rsb-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.rsb-track {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(191, 205, 224, 0.72);
  overflow: hidden;
}

.rsb-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.res-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rs-item {
  padding: 16px 14px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(191, 205, 224, 0.58);
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.rs-item:hover,
.rk-item:hover,
.analysis-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.rs-val {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.rs-lbl {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.res-keys-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.rk-item {
  padding: 14px 10px;
  border-radius: var(--r);
  border: 1px solid rgba(191, 205, 224, 0.64);
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.rk-item.earned {
  background: rgba(220, 235, 247, 0.88);
  border-color: rgba(91, 169, 216, 0.36);
}

.rk-item.missed {
  opacity: 0.5;
}

.rk-state {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-d);
}

.rk-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.rgc-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rgc-stat {
  margin-top: 10px;
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  color: var(--alert);
}

.rgc-copy {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

.btn-restart {
  width: fit-content;
  padding: 14px 22px;
  background: var(--text-1);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(17, 17, 17, 0.16);
}

.btn-restart:hover {
  background: var(--accent-d);
  transform: translateY(-2px) scale(1.01);
}

.res-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.res-details summary::-webkit-details-marker {
  display: none;
}

.res-details summary::after {
  content: '+';
  float: right;
  color: var(--accent-d);
}

.res-details[open] summary::after {
  content: '−';
}

.res-details-body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.analysis-card {
  padding: 16px;
  border-radius: var(--r);
  background: rgba(245, 248, 252, 0.7);
  border: 1px solid rgba(191, 205, 224, 0.58);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.analysis-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.analysis-text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.reveal-stagger {
  opacity: 0;
  animation: revealCascade 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay, 0s);
}

/* ─── Motion ───────────────────────────────────── */

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

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

@keyframes revealCascade {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes headlineIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    letter-spacing: -0.02em;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    letter-spacing: -0.06em;
  }
}

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

@keyframes heroEnter {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatTag {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.55;
  }
}

@keyframes pathShimmer {
  0%,
  16% {
    transform: translateX(-120%);
  }
  40%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes doorBreath {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.24);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.3);
  }
}

@keyframes floorBreath {
  0%,
  100% {
    transform: scaleX(1) translateY(0);
  }
  50% {
    transform: scaleX(1.02) translateY(-3px);
  }
}

@keyframes ambientDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, -1.5%, 0) scale(1.04);
  }
}

@keyframes orbitLight {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(46px, 26px, 0) scale(1.05);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes chipPop {
  0% {
    transform: scale(0.88);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes stepPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 4px rgba(91, 169, 216, 0.12);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 8px rgba(91, 169, 216, 0.08);
  }
}

@keyframes pulseText {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes doorWait {
  0%,
  100% {
    transform: translateX(300px) translateY(0);
  }
  50% {
    transform: translateX(300px) translateY(-6px);
  }
}

@keyframes scoreBump {
  0% {
    transform: scale(1.2);
    color: var(--accent-d);
  }
  100% {
    transform: scale(1);
  }
}

.score-bump-anim {
  animation: scoreBump 0.32s ease both;
}

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

/* ─── Word-split animation ─────────────────────── */

.tw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
}

.twi {
  display: inline-block;
}

/* ─── Accessibility ────────────────────────────── */

/* ─── Onboarding ─────────────────────────────── */

#screen-onboarding {
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.ob-wrap {
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeUp 0.5s ease both;
}

.ob-gem-tag {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid rgba(14, 42, 92, 0.28);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-d);
}

.ob-title {
  margin-top: 12px;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.ob-lead {
  margin-top: 10px;
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.55;
}

.ob-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ob-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.ob-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ob-input:focus {
  border-color: var(--accent-d);
  box-shadow: 0 0 0 4px rgba(14, 42, 92, 0.12);
}

.ob-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

.ob-biz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ob-biz-btn {
  padding: 13px 8px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  line-height: 1.4;
}

.ob-biz-btn:hover {
  border-color: rgba(14, 42, 92, 0.42);
  background: var(--card-2);
  transform: translateY(-2px);
}

.ob-biz-btn.selected {
  border-color: var(--accent-d);
  background: var(--accent-l);
  color: var(--accent-d);
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(14, 42, 92, 0.14);
}

.btn-ob-go {
  width: 100%;
  padding: 16px 24px;
  border-radius: 999px;
  border: none;
  background: var(--text-1);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 12px 26px rgba(17, 17, 17, 0.18);
}

.btn-ob-go:hover:not(:disabled) {
  background: var(--accent-d);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(17, 17, 17, 0.22);
}

.btn-ob-go:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── Level context tag ─────────────────────────── */

.level-context-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-l);
  border: 1px solid rgba(14, 42, 92, 0.22);
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-d);
}

.lct-sep {
  opacity: 0.5;
}

/* ─── GEM Diagnosis Chart ───────────────────────── */

.gem-chart {
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid rgba(191, 205, 224, 0.72);
  box-shadow: var(--shadow-soft);
}

.gc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.gc-stat-big {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-d);
  line-height: 1;
}

.gc-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.gc-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(191, 205, 224, 0.5);
  overflow: hidden;
}

.gc-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  will-change: width;
}

.gem-chart.tier-best .gc-bar-fill { background: var(--green); }
.gem-chart.tier-best .gc-stat-big  { color: var(--green); }
.gem-chart.tier-mid  .gc-bar-fill  { background: var(--blue); }
.gem-chart.tier-mid  .gc-stat-big  { color: var(--blue); }
.gem-chart.tier-zero .gc-bar-fill  { background: var(--alert); }
.gem-chart.tier-zero .gc-stat-big  { color: var(--alert); }

.gc-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
}

/* ─── Decision Map ──────────────────────────────── */

.decision-map {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
}

.dm-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}

.dm-track {
  display: flex;
  align-items: flex-start;
  position: relative;
}

.dm-track::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(191, 205, 224, 0.6);
  z-index: 0;
}

.dm-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.dm-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(191, 205, 224, 0.8);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-3);
}

.dm-step-best .dm-dot { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.dm-step-mid  .dm-dot { background: var(--blue-bg);  border-color: var(--blue);  color: var(--blue); }
.dm-step-low  .dm-dot { background: #F0F7FD;          border-color: var(--accent-d); color: var(--accent-d); }
.dm-step-zero .dm-dot { background: var(--alert-bg);  border-color: var(--alert);  color: var(--alert); }

.dm-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
}

.dm-pts {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
}

.dm-step-best .dm-pts { color: var(--green); }
.dm-step-mid  .dm-pts { color: var(--blue); }
.dm-step-low  .dm-pts { color: var(--accent-d); }
.dm-step-zero .dm-pts { color: var(--alert); }

.dm-tier-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* ─── Results actions ────────────────────────────── */

.res-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-share-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--card);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-share-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent-d);
}

/* ─── PDF link button ────────────────────────────── */

.btn-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(14, 42, 92, 0.3);
  background: var(--card-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-d);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  width: fit-content;
}

.btn-pdf-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* ─── Feedback modal ────────────────────────────── */

.fb-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fb-modal.hidden {
  display: none;
}

.fb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 42, 92, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fbBackdropIn 0.28s ease both;
}

@keyframes fbBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fb-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 30px 80px rgba(14, 42, 92, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  animation: fbCardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fbCardIn {
  from { transform: translateY(28px) scale(0.94); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.fb-tier-strip {
  height: 5px;
  background: var(--metal-gold);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.fb-tier-strip.tier-best { background: linear-gradient(90deg, #22C55E 0%, #166534 100%); }
.fb-tier-strip.tier-mid  { background: linear-gradient(90deg, #5BA9D8 0%, #1D4ED8 100%); }
.fb-tier-strip.tier-low  { background: linear-gradient(90deg, #FCD34D 0%, #CA8A04 100%); }
.fb-tier-strip.tier-zero { background: linear-gradient(90deg, #F97316 0%, #991B1B 100%); }

.fb-body {
  padding: 22px 24px 24px;
}

.fb-body .feedback-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-body .btn-continue {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 520px) {
  .fb-modal { padding: 16px; }
  .fb-body { padding: 18px 18px 20px; }
}

/* ─── Timeskip overlay ──────────────────────────── */

.ts-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(6px);
}

.ts-overlay.hidden {
  display: none;
}

.ts-inner {
  text-align: center;
  color: #fff;
  padding: 0 32px;
}

.ts-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 32px;
}

.ts-months-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.ts-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ts-month-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.ts-month-num {
  font-size: clamp(52px, 10vw, 88px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22);
  font-variant-numeric: tabular-nums;
}

.ts-month-hi {
  color: var(--accent);
}

.ts-arrow-wrap {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 28px;
  flex-shrink: 0;
}

.ts-sala-name {
  margin-top: 30px;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: -0.02em;
}

.ts-bar-track {
  margin: 28px auto 0;
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.ts-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── HUD Month Counter (Orden A) ──────────────── */

.hm-month {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-d);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(91, 169, 216, 0.12);
  border: 1px solid rgba(91, 169, 216, 0.28);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hm-month-bump {
  animation: chipPop 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ─── GEM Room Badge (Orden C) ──────────────────── */

.gem-room-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(91, 169, 216, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  text-align: right;
  max-width: 148px;
  animation: fadeUp 0.42s ease 0.28s both;
}

.grb-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.grb-value {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: var(--accent-d);
  line-height: 1.1;
  margin-top: 3px;
}

.grb-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.3;
}

/* ─── Consequence Block (Orden B) ───────────────── */

.consequence-block {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid rgba(191, 205, 224, 0.72);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.cb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cb-impact-label {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.cb-months {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.consequence-block.tier-best .cb-months { color: var(--green); }
.consequence-block.tier-mid  .cb-months { color: var(--blue); }
.consequence-block.tier-low  .cb-months { color: var(--accent-d); }
.consequence-block.tier-zero .cb-months { color: var(--alert); }

.cb-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(191, 205, 224, 0.5);
  overflow: hidden;
  margin-bottom: 9px;
}

.cb-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.consequence-block.tier-best .cb-bar-fill { background: linear-gradient(90deg, #16a34a, #22c55e); }
.consequence-block.tier-mid  .cb-bar-fill { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.consequence-block.tier-low  .cb-bar-fill { background: linear-gradient(90deg, #0e2a5c, #5ba9d8); }
.consequence-block.tier-zero .cb-bar-fill { background: linear-gradient(90deg, #991b1b, #ef4444); }

.cb-consequence-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

/* ─── Results enhanced (Orden D) ────────────────── */

.res-hero-banner {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: 32px 28px;
  background: linear-gradient(135deg, #0A1F44 0%, #1E3A8A 60%, #0E2A5C 100%);
  border: 1px solid rgba(91, 169, 216, 0.22);
  box-shadow: 0 24px 56px rgba(14, 42, 92, 0.38);
  display: flex;
  align-items: center;
  gap: 24px;
  animation: fadeUp 0.5s ease both;
}

.rhb-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 40%, rgba(91, 169, 216, 0.24), transparent 46%),
    radial-gradient(circle at 10% 80%, rgba(252, 211, 77, 0.08), transparent 40%);
  pointer-events: none;
}

.rhb-scene {
  flex: 0 0 auto;
  position: relative;
  width: 130px;
  height: 170px;
}

.rhb-door {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 64px;
  height: 106px;
  border-radius: 34px 34px 6px 6px;
  border: 2.5px solid rgba(91, 169, 216, 0.62);
  background: linear-gradient(180deg, rgba(91,169,216,0.28) 0%, rgba(14,42,92,0.48) 100%);
  animation: doorBreath 4s ease-in-out infinite;
}

.rhb-door.open {
  border-color: #5BA9D8;
  box-shadow: 0 0 28px rgba(91, 169, 216, 0.55);
}

.rhb-character {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 140px;
  z-index: 2;
  animation: characterFloat 3s ease-in-out infinite;
}

.rhb-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.rhb-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(91, 169, 216, 0.8);
  margin-bottom: 10px;
}

.rhb-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #F5F8FC;
  margin-bottom: 14px;
}

.rhb-month-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.rhb-months {
  font-size: clamp(40px, 8vw, 58px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #5BA9D8;
  font-variant-numeric: tabular-nums;
}

.rhb-months-lbl {
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 248, 252, 0.55);
}

.rhb-status {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 6px;
}

.res-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.res-profile-card {
  padding: 20px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
  animation: fadeUp 0.42s ease both;
}

.rpc-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rpc-type {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.15;
}

.rpc-rows {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpc-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rpc-row-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.rpc-row-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.res-radar-card {
  padding: 20px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.42s ease 0.08s both;
}

.rrc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
  align-self: flex-start;
}

#radar-canvas {
  width: 100%;
  max-width: 200px;
  height: auto;
}

.res-compare {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 205, 224, 0.62);
  box-shadow: var(--shadow);
  animation: fadeUp 0.42s ease both;
}

.rc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

.rc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rc-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  width: 130px;
  flex-shrink: 0;
}

.rc-bar-wrap {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(191, 205, 224, 0.5);
  overflow: hidden;
}

.rc-bar {
  height: 100%;
  border-radius: inherit;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-1);
  width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.rc-insight {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  padding-top: 12px;
  border-top: 1px solid rgba(191, 205, 224, 0.55);
}

/* Enhanced decision map */

.dm-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.dm-list-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  background: rgba(245, 248, 252, 0.7);
  border: 1px solid rgba(191, 205, 224, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dm-list-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-soft);
}

.dm-list-item.dm-li-best { border-left: 3px solid var(--green); }
.dm-list-item.dm-li-mid  { border-left: 3px solid var(--blue); }
.dm-list-item.dm-li-low  { border-left: 3px solid var(--accent); }
.dm-list-item.dm-li-zero { border-left: 3px solid var(--alert); }

.dm-li-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.dm-li-best .dm-li-dot { background: var(--green-bg);  color: var(--green); }
.dm-li-mid  .dm-li-dot { background: var(--blue-bg);   color: var(--blue); }
.dm-li-low  .dm-li-dot { background: #EFF6FF;          color: var(--accent-d); }
.dm-li-zero .dm-li-dot { background: var(--alert-bg);  color: var(--alert); }

.dm-li-body {
  flex: 1;
  min-width: 0;
}

.dm-li-room {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.dm-li-decision {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 2px;
}

.dm-li-consequence {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  margin-top: 4px;
}

.dm-li-pts {
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  align-self: center;
}

.dm-li-best .dm-li-pts { color: var(--green); }
.dm-li-mid  .dm-li-pts { color: var(--blue); }
.dm-li-low  .dm-li-pts { color: var(--accent-d); }
.dm-li-zero .dm-li-pts { color: var(--alert); }

.res-recommendation {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(220, 235, 247, 0.6) 0%, rgba(255, 255, 255, 0.92) 100%);
  border: 1px solid rgba(91, 169, 216, 0.28);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.42s ease both;
}

.rr-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-d);
  margin-bottom: 8px;
}

.rr-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}

.rr-text strong {
  color: var(--text-1);
}

/* ─── Accessibility ────────────────────────────── */

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

  .opt-card {
    transform: none !important;
  }
}

/* ─── Responsive ───────────────────────────────── */

@media (max-width: 980px) {
  .intro-layout,
  .room-stage {
    grid-template-columns: 1fr;
  }

  .intro-visual {
    order: -1;
  }

  .room-visual-col {
    min-height: 420px;
  }

  .cor-doors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .res-stats,
  .res-keys-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .res-analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #screen-intro,
  .room-stage,
  .corridor,
  .res-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hud-mini {
    padding: 12px 16px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .hm-keys {
    width: 100%;
    justify-content: flex-start;
  }

  .hm-key-name {
    display: none;
  }

  .intro-scene-card {
    min-height: 360px;
  }

  .intro-scene-door {
    right: 48px;
    bottom: 68px;
    width: 118px;
    height: 190px;
  }

  .intro-scene-character {
    left: 34px;
    bottom: 46px;
    width: 180px;
  }

  .level-card,
  .res-score-bar,
  .res-gem-card,
  .res-details {
    padding: 18px;
  }

  .scene-character-wrap {
    left: 8%;
    width: 180px;
  }

  .scene-door-wrap {
    right: 8%;
    width: 136px;
    height: 214px;
  }

  .res-stats,
  .res-keys-row {
    grid-template-columns: 1fr;
  }

  .decision-map {
    padding: 16px 14px;
  }

  .dm-dot {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border-width: 2px;
  }

  .dm-key {
    font-size: 10px;
  }

  .dm-pts {
    font-size: 11px;
  }

  .dm-tier-label {
    font-size: 8px;
  }

  .res-actions {
    width: 100%;
  }

  .res-actions .btn-restart,
  .res-actions .btn-share-card,
  .res-actions .btn-pdf-link {
    flex: 1 1 auto;
    min-width: 160px;
    justify-content: center;
  }

  .gem-chart {
    padding: 12px 14px;
  }
}

@media (max-width: 520px) {
  .intro-h1 {
    font-size: 48px;
  }

  .intro-lead {
    font-size: 16px;
  }

  .intro-scene-chip {
    font-size: 11px;
  }

  .room-stage {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .level-card {
    gap: 18px;
    padding: 16px;
  }

  .level-title {
    font-size: 30px;
  }

  .scene-shell {
    min-height: 360px;
  }

  .scene-chip-a,
  .scene-chip-b,
  .scene-chip-c {
    transform: scale(0.94);
    transform-origin: left top;
  }

  .scene-chip-c {
    left: 20px;
    bottom: 150px;
  }

  .cor-doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .da-scene {
    height: 320px;
  }

  .da-char {
    left: 12px;
    width: 96px;
  }

  .da-char.run-to-door {
    transform: translateX(170px);
  }

  @keyframes doorWait {
    0%,
    100% {
      transform: translateX(170px) translateY(0);
    }
    50% {
      transform: translateX(170px) translateY(-5px);
    }
  }

  .da-door-wrap {
    right: 34px;
    width: 132px;
    height: 218px;
  }

  .da-key-card {
    min-width: 0;
    width: calc(100% - 24px);
  }

  .decision-map {
    padding: 14px 10px;
  }

  .dm-track {
    flex-wrap: wrap;
    gap: 18px 4px;
  }

  .dm-track::before {
    display: none;
  }

  .dm-step {
    flex: 0 0 33.333%;
    min-width: 0;
  }

  .res-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .res-actions .btn-restart,
  .res-actions .btn-share-card,
  .res-actions .btn-pdf-link {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    min-width: 0;
    flex: 0 0 auto;
  }

  .gc-stat-big {
    font-size: 19px;
  }

  .gc-stat-label {
    font-size: 9px;
  }

  .ob-biz-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ob-biz-btn {
    min-height: 56px;
    padding: 14px 10px;
    font-size: 14px;
  }

  .hm-key-slot {
    padding: 8px 12px;
    min-height: 36px;
  }

  .cor-step {
    min-height: 58px;
    padding: 10px 6px;
  }

  .cor-step-label {
    font-size: 11px;
  }

  .cor-step-state {
    font-size: 16px;
  }
}

/* ─── Touch / no-hover devices ──────────────────── */

@media (hover: none) {
  .btn-share-card:hover,
  .btn-pdf-link:hover,
  .btn-restart:hover,
  .btn-start:hover,
  .btn-continue:hover,
  .ob-biz-btn:hover {
    transform: none;
    box-shadow: none;
  }

  .opt-card {
    --rx: 0deg;
    --ry: 0deg;
    --glow: 0;
  }
}
