/* ============================================================
   Autostima da Regina — royal design system
   ============================================================ */

@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("assets/fonts/cormorant-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("assets/fonts/cormorant-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pinyon Script";
  src: url("assets/fonts/pinyon-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* palette */
  --ink: #140507;
  --ink-2: #1e080c;
  --maroon: #4a0e1c;
  --maroon-deep: #2a0810;
  --wine: #6b1226;
  --rose: #8c2b3f;
  --gold: #c9a24b;
  --gold-light: #e8c874;
  --gold-deep: #9a7526;
  --cream: #f1e4c6;
  --cream-dim: #cdbfa0;

  /* type */
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Cormorant", Georgia, serif;
  --font-script: "Pinyon Script", "Cormorant", cursive;

  /* rhythm */
  --pad: clamp(20px, 6vw, 34px);
  --radius: 16px;
  --radius-lg: 22px;

  /* effects */
  --gold-grad: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  --glow-gold: 0 0 22px rgba(201, 162, 75, .45);
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* safe areas — max of device inset and Telegram's fullscreen insets */
  --tg-top: 0px;
  --tg-bottom: 0px;
  --safe-t: max(env(safe-area-inset-top, 0px), var(--tg-top));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom));

  --tabbar-h: calc(64px + var(--safe-b));
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---- stage & screens ---- */
#stage {
  position: fixed;
  inset: 0;
  perspective: 1400px;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform: translateY(14px) scale(.992);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  will-change: opacity, transform;
}
.screen.mounted { display: block; }
.screen.active {
  opacity: 1;
  transform: none;
  z-index: 2;
}
.screen.leaving {
  opacity: 0;
  transform: translateY(-10px) scale(.995);
  z-index: 1;
}

/* Cinematic "walk into the room" zoom transition (opts.zoom in go()). */
.screen.zoom { transition-duration: .74s; }
.screen.zoom.mounted:not(.active) { transform: scale(1.16); opacity: 0; } /* arriving room rushes in */
.screen.zoom.active { transform: none; opacity: 1; }
.screen.zoom.leaving { transform: scale(1.34); opacity: 0; }              /* we push through the old one */

/* screens that carry the bottom tabbar leave room for it */
.screen.has-tabbar { padding-bottom: var(--tabbar-h); }

/* ---- ambient vignette above backgrounds ---- */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(120% 80% at 50% 8%, transparent 55%, rgba(10, 2, 4, .55) 100%),
    radial-gradient(90% 60% at 50% 120%, rgba(107, 18, 38, .18), transparent 60%);
  mix-blend-mode: normal;
}

/* ---- shared screen scaffolding ---- */
.screen-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.screen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 4, 6, .35) 0%, rgba(15, 4, 6, .1) 40%, rgba(15, 4, 6, .8) 100%);
}
.screen-inner {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
}

/* ---- typographic helpers ---- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.1;
  color: var(--cream);
}
.serif {
  font-family: var(--font-body);
  font-weight: 400;
}
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ornamental gold divider with a central crown dot */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  color: var(--gold);
  opacity: .8;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  width: min(80px, 22vw);
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}
.divider span { font-size: 10px; letter-spacing: .3em; }

/* ---- primary royal button ---- */
.btn-royal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 13px;
  color: #2a0810;
  background: var(--gold-grad);
  border-radius: 999px;
  box-shadow: var(--glow-gold), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease);
}
.btn-royal:active { transform: scale(.96); }
.btn-royal:hover { filter: brightness(1.05); box-shadow: 0 0 34px rgba(201, 162, 75, .6), inset 0 1px 0 rgba(255, 255, 255, .5); }

.btn-ghost {
  padding: 12px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 75, .5);
  border-radius: 999px;
  background: rgba(20, 5, 7, .35);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.btn-ghost:active { transform: scale(.96); }
.btn-ghost:hover { border-color: var(--gold); }

/* ---- bottom tabbar ---- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: var(--tabbar-h);
  padding-bottom: var(--safe-b);
  background: linear-gradient(180deg, rgba(20, 5, 7, .82), rgba(10, 3, 4, .96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(201, 162, 75, .28);
}
.tabbar[hidden] { display: none; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--cream-dim);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .08em;
  font-size: 9px;
  text-transform: uppercase;
  opacity: .7;
  transition: color .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab:active { transform: scale(.9); }
.tab.active { color: var(--gold); opacity: 1; }

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px);
  transform: translate(-50%, 20px);
  z-index: 40;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(42, 8, 16, .95);
  border: 1px solid rgba(201, 162, 75, .5);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: .01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- utilities ---- */
.spacer { flex: 1 1 auto; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }

/* ============================================================
   CHUNK 2 — Intro splash + Welcome gate
   ============================================================ */

/* ---- Intro video splash ---- */
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #0a0203;
}
.intro-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(10, 2, 4, .55) 100%),
    linear-gradient(180deg, rgba(10, 2, 4, .5) 0%, transparent 30%, transparent 60%, rgba(10, 2, 4, .85) 100%);
}
.intro-content {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  text-align: center;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(46px + var(--safe-b));
}
.intro-crown { color: var(--gold); opacity: 0; animation: fadeUp .9s var(--ease) .2s forwards; }
.intro-crown svg { width: 42px; height: 42px; filter: drop-shadow(0 0 10px rgba(201,162,75,.5)); }
.intro-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 8.2vw, 38px);
  letter-spacing: .14em;
  line-height: 1.15;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 30px rgba(201, 162, 75, .25);
  opacity: 0;
  animation: fadeUp 1.1s var(--ease) .45s forwards;
}
.intro-sub {
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: .04em;
  color: var(--cream-dim);
  opacity: 0;
  animation: fadeUp 1.1s var(--ease) .85s forwards;
}
.intro-loading {
  margin-top: 6px;
  width: 132px; height: 2px;
  border-radius: 2px;
  background: rgba(201, 162, 75, .18);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp .8s var(--ease) 1.1s forwards;
}
.intro-loading::after {
  content: "";
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: loadSweep 1.4s ease-in-out infinite;
}
.intro-skip {
  position: absolute;
  top: calc(var(--safe-t) + 14px);
  right: 16px;
  z-index: 3;
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(241, 228, 198, .7);
  padding: 8px 14px;
  border: 1px solid rgba(201, 162, 75, .35);
  border-radius: 999px;
  opacity: 0;
  animation: fadeUp .6s var(--ease) 1.4s forwards;
}
.intro-tap {
  position: absolute; inset: 0; z-index: 4;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(10, 2, 4, .5);
}
.intro-tap.show { display: flex; }

@keyframes loadSweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* ---- Welcome gate ---- */
.gate-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center 40%;
  transform: scale(1.06);
  animation: kenburns 18s ease-in-out infinite alternate;
}
.gate-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,2,4,.4) 0%, rgba(10,2,4,.12) 34%, rgba(10,2,4,.72) 100%);
}
@keyframes kenburns {
  from { transform: scale(1.06) translateY(0); }
  to   { transform: scale(1.14) translateY(-2%); }
}
.gate-inner {
  position: relative; z-index: 1;
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
  gap: 30px;
}
/* soft dark veil behind the title band so the gold text stays readable
   over the bright castle sky, without hiding the artwork */
.gate-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(88% 40% at 50% 45%, rgba(8,2,3,.72), rgba(8,2,3,.4) 52%, transparent 76%);
}
.gate-eyebrow {
  font-family: var(--font-display);
  letter-spacing: .34em; text-transform: uppercase; font-size: 11px;
  color: var(--gold-light);
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
  opacity: 0; animation: fadeUp 1s var(--ease) .3s forwards;
}

/* handwritten gold title — per-line left-to-right reveal */
.gate-title {
  font-family: var(--font-script);
  color: transparent;
  line-height: .96;
  /* dark drop-shadow works on clipped gold text (text-shadow does not) = contrast */
  filter: drop-shadow(0 2px 9px rgba(0,0,0,.8)) drop-shadow(0 4px 20px rgba(201,162,75,.3));
}
.gate-hint { text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.gate-line {
  display: block;
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold-light) 45%, #fff4d6 52%, var(--gold-light) 60%, var(--gold) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  /* start hidden from the right; the sheen sweep runs after */
  clip-path: inset(0 100% -0.3em 0);
  animation: writeLine 1.15s cubic-bezier(.62,.03,.4,1) forwards, sheen 3.4s ease-in-out infinite;
}
.gate-line { white-space: nowrap; }
.gate-line.l1 { font-size: clamp(34px, 13vw, 58px); animation-delay: .5s, 2.6s; }
.gate-line.l2 { font-size: clamp(22px, 8.4vw, 44px); animation-delay: 1.35s, 2.9s; margin-top: -.02em; }
.gate-line.l3 { font-size: clamp(40px, 15vw, 72px); animation-delay: 2.05s, 3.2s; margin-top: -.04em; }
@keyframes writeLine { to { clip-path: inset(0 0% -0.3em 0); } }
@keyframes sheen { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

.gate-sparkles { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sparkle {
  position: absolute;
  width: var(--s, 10px); height: var(--s, 10px);
  opacity: 0;
  background:
    radial-gradient(closest-side, rgba(255,244,214,.95), rgba(255,244,214,0) 70%);
  animation: twinkle 2.6s ease-in-out infinite;
}
.sparkle::before, .sparkle::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, transparent 44%, rgba(255,244,214,.95) 50%, transparent 56%);
}
.sparkle::after { transform: rotate(90deg); }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: 1; transform: scale(1); }
}

.gate-cta {
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 1s var(--ease) 3.2s forwards;
}
.gate-hint {
  font-family: var(--font-body); font-size: 15px; color: var(--cream-dim);
  opacity: 0; animation: fadeUp 1s var(--ease) 3.5s forwards;
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .gate-line { clip-path: none !important; }
  .gate-bg { animation: none !important; transform: scale(1.06) !important; }
}

/* ============================================================
   CHUNK 3 — Onboarding quiz
   ============================================================ */
.quiz-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image: url("assets/img/hall.webp");
  background-size: cover; background-position: center;
  transform: scale(1.1); filter: blur(3px) brightness(.4) saturate(.9);
}
.quiz-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, rgba(42,8,16,.55), rgba(10,3,4,.92));
}
.quiz-inner {
  position: relative; z-index: 1; min-height: 100%; width: 100%;
  display: flex; flex-direction: column;
  padding: calc(28px + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
}
.quiz-top { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.quiz-progress-label {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--gold);
}
.quiz-pips { display: flex; gap: 7px; align-items: center; }
.quiz-pip {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(201,162,75,.5);
  background: transparent;
  transition: background .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.quiz-pip.done { background: var(--gold); border-color: var(--gold); }
.quiz-pip.current { background: var(--gold-light); border-color: var(--gold-light); transform: scale(1.35); box-shadow: var(--glow-gold); }

.quiz-stage { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; width: 100%; }
.quiz-card {
  width: 100%; max-width: 100%; min-width: 0;
  opacity: 0; transform: translateY(18px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.quiz-card.in { opacity: 1; transform: none; }
.quiz-card.out { opacity: 0; transform: translateY(-14px); }

.quiz-q {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(24px, 6.6vw, 30px);
  line-height: 1.28;
  color: var(--cream);
  text-align: center;
  margin-bottom: 28px;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.quiz-q .em { color: var(--gold-light); font-style: italic; }

.quiz-options { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.quiz-opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-width: 0; text-align: left;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(201,162,75,.32);
  background: linear-gradient(180deg, rgba(42,8,16,.5), rgba(20,5,7,.6));
  color: var(--cream);
  font-family: var(--font-body); font-size: 19px; line-height: 1.25;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .12s var(--ease);
}
.quiz-opt:active { transform: scale(.985); }
.quiz-opt .dot {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(201,162,75,.6);
  position: relative; transition: border-color .2s var(--ease);
}
.quiz-opt > span:last-child { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.quiz-q { overflow-wrap: break-word; }
.quiz-opt.sel {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(107,18,38,.55), rgba(42,8,16,.65));
}
.quiz-opt.sel .dot { border-color: var(--gold); }
.quiz-opt.sel .dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--gold-grad); box-shadow: var(--glow-gold);
}

/* result / transition card */
.quiz-result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.quiz-result .crown { color: var(--gold); }
.quiz-result .crown svg { width: 52px; height: 52px; filter: drop-shadow(0 0 14px rgba(201,162,75,.55)); }
.quiz-result h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px,7vw,32px); letter-spacing: .04em; color: var(--cream); }
.quiz-result p { font-family: var(--font-body); font-size: 19px; line-height: 1.4; color: var(--cream-dim); max-width: 30ch; }

/* ============================================================
   CHUNK 4 — Giovanna tour
   ============================================================ */
.tour-figure {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center 18%;
  transition: opacity .5s var(--ease);
}
.tour-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,3,4,.35) 0%, transparent 22%, rgba(10,3,4,.5) 55%, rgba(10,3,4,.96) 88%);
}
.tour-inner {
  position: relative; z-index: 2; min-height: 100%; width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
}
.tour-skip {
  position: absolute; top: calc(var(--safe-t) + 14px); right: 16px; z-index: 3;
  font-family: var(--font-display); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(241,228,198,.75); padding: 8px 14px;
  border: 1px solid rgba(201,162,75,.35); border-radius: 999px;
  background: rgba(10,3,4,.3);
}
.tour-panel {
  border: 1px solid rgba(201,162,75,.34);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(42,8,16,.72), rgba(20,5,7,.82));
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 22px 22px 20px;
}
.tour-name {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; font-size: 12px; color: var(--gold);
  margin-bottom: 12px;
}
.tour-name::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201,162,75,.5), transparent); }
.tour-text {
  font-family: var(--font-body); font-size: 21px; line-height: 1.42; color: var(--cream);
  min-height: 4.3em;
  opacity: 0; transform: translateY(8px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.tour-text.in { opacity: 1; transform: none; }
.tour-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.tour-dots { display: flex; gap: 7px; }
.tour-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(201,162,75,.3);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.tour-dots i.on { background: var(--gold); transform: scale(1.3); }

/* ============================================================
   CHUNK 5 — Lessons hub + player + consultation CTA
   ============================================================ */
.room-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image: url("assets/img/hall.webp");
  background-size: cover; background-position: center;
}
.room-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,3,4,.62) 0%, rgba(10,3,4,.42) 34%, rgba(10,3,4,.9) 100%);
}
.hub-inner {
  position: relative; z-index: 1; min-height: 100%; width: 100%;
  display: flex; flex-direction: column;
  padding: calc(30px + var(--safe-t)) var(--pad) var(--pad);
  pointer-events: none; /* header layer must not swallow taps meant for the medallions */
}
.hub-head { text-align: center; margin-bottom: 26px; }
.hub-crown { color: var(--gold); }
.hub-crown svg { width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(201,162,75,.5)); }
.hub-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  font-size: clamp(26px, 7.5vw, 34px); color: var(--cream); margin-top: 8px;
  text-shadow: 0 2px 22px rgba(0,0,0,.55);
}
.hub-sub { font-family: var(--font-body); font-size: 18px; color: var(--cream-dim); margin-top: 4px; }

.hub-lessons { display: flex; flex-direction: column; gap: 14px; }
.lesson-card {
  display: flex; align-items: center; gap: 16px; width: 100%; min-width: 0; text-align: left;
  padding: 18px; border-radius: 18px;
  border: 1px solid rgba(201,162,75,.34);
  background: linear-gradient(180deg, rgba(42,8,16,.62), rgba(20,5,7,.72));
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transition: transform .15s var(--ease), border-color .2s var(--ease);
}
.lesson-card:active { transform: scale(.99); }
.lesson-card.locked { opacity: .55; }
.lesson-card .badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: #2a0810; background: var(--gold-grad); box-shadow: var(--glow-gold);
}
.lesson-card.locked .badge { background: rgba(201,162,75,.2); color: var(--gold); box-shadow: none; }
.lesson-card .meta { flex: 1 1 auto; min-width: 0; }
.lesson-card .l-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: .04em; color: var(--cream); }
.lesson-card .l-sub { display: block; font-family: var(--font-body); font-size: 16px; color: var(--cream-dim); margin-top: 3px; }
.lesson-card .state { flex: 0 0 auto; color: var(--gold); width: 24px; height: 24px; }
.lesson-card .state svg { width: 24px; height: 24px; }
.lesson-card.done .state { color: var(--gold-light); }

/* ---- Lesson player ---- */
.lesson-inner {
  position: relative; z-index: 1; min-height: 100%; width: 100%;
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) var(--pad) var(--pad);
}
.lesson-topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.icon-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(201,162,75,.4); color: var(--gold);
  background: rgba(20,5,7,.4);
}
.icon-btn svg { width: 20px; height: 20px; }
.lesson-topbar .t { font-family: var(--font-display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: var(--gold); }

.player-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(201,162,75,.4);
  background-size: cover; background-position: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.player-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,5,7,.3), rgba(20,5,7,.72)); }
.player-play {
  position: relative; z-index: 1;
  width: 74px; height: 74px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(42,8,16,.7); border: 2px solid var(--gold);
  box-shadow: var(--glow-gold);
}
.player-play svg { width: 30px; height: 30px; color: var(--gold-light); margin-left: 4px; }
.player-badge {
  position: absolute; z-index: 1; bottom: 12px; left: 12px;
  font-family: var(--font-display); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cream); background: rgba(10,3,4,.6); border: 1px solid rgba(201,162,75,.4);
  padding: 5px 10px; border-radius: 999px;
}
.lesson-heading { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px,6vw,28px); letter-spacing: .04em; color: var(--cream); margin: 22px 0 4px; }
.lesson-eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.lesson-desc {
  font-family: var(--font-body); font-size: 18px; line-height: 1.5; color: var(--cream-dim);
  border: 1px solid rgba(201,162,75,.24); border-radius: 14px;
  background: rgba(20,5,7,.4); padding: 16px 18px; margin-top: 14px;
}
.lesson-foot { margin-top: auto; padding-top: 24px; display: flex; justify-content: center; }
.lesson-foot .btn-royal { width: 100%; max-width: 340px; }

/* ---- Consultation CTA ---- */
.cta-inner {
  position: relative; z-index: 1; min-height: 100%; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 18px;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) var(--pad);
}
.cta-crown { color: var(--gold); }
.cta-crown svg { width: 60px; height: 60px; filter: drop-shadow(0 0 16px rgba(201,162,75,.6)); }
.cta-eyebrow { font-family: var(--font-display); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.cta-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px,8vw,38px); letter-spacing: .04em; color: var(--cream); line-height: 1.12; }
.cta-title .gold-text { display: inline; }
.cta-text { font-family: var(--font-body); font-size: 20px; line-height: 1.46; color: var(--cream-dim); max-width: 32ch; }
.cta-inner .btn-royal { margin-top: 8px; }
.cta-note { font-family: var(--font-body); font-size: 15px; color: var(--cream-dim); opacity: .8; }

/* ============================================================
   CHUNK 6 — Corte (contact capture) + Hub rooms
   ============================================================ */
.corte-inner {
  position: relative; z-index: 1; min-height: 100%; width: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(28px + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
}
.corte-head { text-align: center; margin-bottom: 24px; }
.corte-crown { color: var(--gold); }
.corte-crown svg { width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(201,162,75,.5)); }
.corte-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px,7vw,30px); letter-spacing: .05em; color: var(--cream); margin-top: 8px; }
.corte-sub { font-family: var(--font-body); font-size: 18px; line-height: 1.4; color: var(--cream-dim); margin-top: 6px; }

.corte-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); padding-left: 4px;
}
.field input {
  width: 100%; min-width: 0;
  font-family: var(--font-body); font-size: 19px; color: var(--cream);
  padding: 15px 16px; border-radius: 13px;
  border: 1px solid rgba(201,162,75,.4);
  background: linear-gradient(180deg, rgba(42,8,16,.5), rgba(20,5,7,.62));
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: rgba(205,191,160,.5); }
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.18); }
.field.err input { border-color: #c0566a; }
.field .msg { font-family: var(--font-body); font-size: 14px; color: #e08b9a; padding-left: 4px; min-height: 0; display: none; }
.field.err .msg { display: block; }
.corte-form .btn-royal { width: 100%; margin-top: 8px; }
.corte-note { font-family: var(--font-body); font-size: 14px; color: var(--cream-dim); opacity: .75; text-align: center; margin-top: 14px; }

/* ---- Hub: a single numbered medallion placed IN each room ---- */
.hub-rooms { position: absolute; inset: 0; z-index: 3; } /* above the header layer so medallions are tappable */
.room-mark { pointer-events: auto; }
.room-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: 132px;
}
.mark-badge {
  position: relative;
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 27px;
  color: #2a0810; background: var(--gold-grad);
  border: 2px solid rgba(255,244,214,.7);
  box-shadow: 0 0 0 4px rgba(15,4,6,.55), 0 6px 18px rgba(0,0,0,.55), var(--glow-gold), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .18s var(--ease);
}
.room-mark.open .mark-badge { animation: markPulse 2.6s ease-in-out infinite; }
.room-mark:not(.locked):active .mark-badge { transform: scale(.92); }
.room-mark.locked .mark-badge {
  color: rgba(201,162,75,.75); background: rgba(28,10,14,.82);
  border-color: rgba(201,162,75,.4);
  box-shadow: 0 0 0 4px rgba(15,4,6,.55), 0 6px 16px rgba(0,0,0,.55);
}
.mark-badge .mark-check {
  position: absolute; right: -4px; bottom: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-light); color: #2a0810;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.mark-badge .mark-check svg { width: 13px; height: 13px; }
.mark-badge .mark-lock { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; color: var(--gold); opacity: .9; }
.mark-badge .mark-lock svg { width: 20px; height: 20px; }
.mark-label {
  font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .05em;
  color: var(--cream); text-align: center; line-height: 1.2;
  padding: 5px 11px; border-radius: 9px;
  background: rgba(10,3,4,.62);
  box-shadow: 0 2px 12px rgba(0,0,0,.55);
  max-width: 132px;
}
.room-mark.locked .mark-label { color: var(--cream-dim); opacity: .85; }
@keyframes markPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(15,4,6,.55), 0 6px 18px rgba(0,0,0,.55), 0 0 16px rgba(201,162,75,.5), inset 0 1px 0 rgba(255,255,255,.5); }
  50%     { box-shadow: 0 0 0 4px rgba(15,4,6,.55), 0 6px 18px rgba(0,0,0,.55), 0 0 34px rgba(201,162,75,.95), inset 0 1px 0 rgba(255,255,255,.5); }
}

/* one medallion per room — left / centre / right over the hall's openings */
.room-mark[data-pos="1"] { left: 50%; top: 42%; }
.room-mark[data-pos="2"] { left: 22%; top: 60%; }
.room-mark[data-pos="3"] { left: 78%; top: 60%; }

/* Capture mode (?still=1): freeze to final frame for deterministic screenshots. */
body.still *, body.still *::before, body.still *::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
body.still .gate-line { clip-path: none !important; }
body.still .sparkle { opacity: 1 !important; }
body.still .gate-bg { animation: none !important; transform: scale(1.08) !important; }
