:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #eff8fb;
  background: #040a13;
  --cyan: #83eaff;
  --gold: #ffcc91;
  --muted: #afc6d6;
  --atmosphere: #0a3557;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; isolation: isolate; }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 35%, var(--atmosphere), transparent 62%),
    radial-gradient(ellipse at 87% 85%, #94613c32, transparent 36%),
    linear-gradient(155deg, #07172b, #040a13 74%);
}
body::after {
  content: '';
  position: fixed;
  inset: auto 0 0;
  height: 28vh;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, transparent 0 9%, #56d6ff30 9.1% 9.25%, transparent 9.4% 14%),
    repeating-linear-gradient(0deg, transparent 0 34px, #3497b63f 35px 36px);
  mask-image: linear-gradient(transparent, #000 80%);
  transform-origin: bottom;
  transform: perspective(260px) rotateX(32deg);
}
body[data-theme="forest"] { --atmosphere: #104c43; }
body[data-theme="winter"], body[data-theme="zacatlan"] { --atmosphere: #68492d; }
body[data-theme="valquirico"] { --atmosphere: #6c3947; }
body[data-theme="review"] { --atmosphere: #304563; }
body[data-theme="fantasy"] { --atmosphere: #5c492b; }
body[data-theme="cinema"] { --atmosphere: #462446; }
body[data-theme="secret"] { --atmosphere: #543345; }
body[data-theme="hearth"] { --atmosphere: #624135; }
.masthead {
  max-width: 77rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #64c9ec46;
}
.brand { color: var(--cyan); text-decoration: none; letter-spacing: .24em; font-weight: 800; }
main {
  max-width: 77rem;
  margin-inline: auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: .75rem;
  align-items: start;
}
.scene {
  position: relative;
  width: min(100%, 16rem);
  margin-inline: auto;
}
.scene::before {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, #50ceff31, transparent 67%),
    radial-gradient(circle at 18% 22%, #c8edfe 0 1px, transparent 2px),
    radial-gradient(circle at 85% 33%, #b8ecff 0 1px, transparent 2px),
    radial-gradient(circle at 75% 78%, #ffc989 0 1px, transparent 2px);
  pointer-events: none;
}
#sphere { position: relative; }
#sphere svg { display: block; width: 100%; height: auto; }
.sphere-response { opacity: 0; }
body:has(#start) #sphere { opacity: .48; }
body[data-transition] #sphere { filter: brightness(1.48); }
.panel {
  min-width: 0;
  align-self: center;
  border: 1px solid #77d9f38c;
  border-radius: 1rem;
  padding: clamp(1rem, 4vw, 2rem);
  background: linear-gradient(150deg, #0b2032f5, #07111def 72%, #0a2434f5);
  box-shadow: 0 0 2rem #37c8ff22, inset 0 1px #b3eeff39, 0 1rem 4rem #0009;
  overflow-wrap: anywhere;
}
h1, h2 { margin: 0 0 .8em; font-family: Georgia, serif; line-height: 1.14; }
h1 { font-size: clamp(1.65rem, 4vw, 2.7rem); }
h2 { font-size: 1.3rem; }
p { max-width: 67ch; line-height: 1.55; margin: 0 0 .9rem; }
button, input, select, .primary {
  border: 1px solid #6497ab;
  border-radius: .55rem;
  background: #0c2031;
  color: #eff8fb;
  font: inherit;
  padding: .65rem .85rem;
  min-height: 2.75rem;
  max-width: 100%;
}
button, .primary { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
.primary {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  border-color: #e4aa74;
  text-decoration: none;
}
.whatsapp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .65rem .85rem;
  border: 1px solid #69e1a8;
  border-radius: .55rem;
  background: #105333;
  color: #effff5;
  font: inherit;
  text-align: center;
  text-decoration: none;
}
.whatsapp-action:not(:disabled):hover { background: #196643; }
.whatsapp-action svg { display: block; width: 1.25rem; height: 1.25rem; }
button:not(:disabled):hover, .primary:hover { border-color: var(--cyan); background-color: #17394e; }
button:not(:disabled):active, .primary:active { filter: brightness(1.18); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#message > :is(button, .primary, form, details, article) { margin: .35rem .35rem .35rem 0; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); gap: .7rem; margin-block: 1rem; }
.mission-card {
  min-height: 6.25rem;
  text-align: left;
  background:
    repeating-linear-gradient(125deg, transparent 0 26px, #99def512 27px 28px, transparent 29px 43px),
    radial-gradient(ellipse at 0 0, var(--tile, #1a435b), #081522 78%);
}
.mission-card[data-theme="forest"] { --tile: #23634d; }
.mission-card[data-theme="winter"] { --tile: #78544f; }
.mission-card[data-theme="review"] { --tile: #4d5474; }
.mission-card[data-theme="fantasy"] { --tile: #77603b; }
.mission-card[data-theme="cinema"] { --tile: #66384f; }
.mission-card[data-theme="secret"] { --tile: #5d3e54; }
.mission-card[data-theme="hearth"] { --tile: #754b31; grid-column: 1 / -1; border-color: var(--gold); }
.marker, .saved { display: block; font-size: .82rem; font-weight: 650; color: var(--gold); }
.mission-card[data-selected] { box-shadow: inset 3px 0 var(--gold); border-color: var(--gold); }
.field { display: grid; gap: .4rem; margin-block: .9rem; }
form { display: grid; gap: .65rem; }
fieldset { padding: .65rem; border: 1px solid #48748d; border-radius: .65rem; min-inline-size: 0; }
.dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: .4rem; }
.dates label { display: flex; align-items: center; min-height: 2.75rem; gap: .4rem; padding: .25rem .4rem; font-size: .85rem; border: 1px solid #49738870; border-radius: .35rem; }
.date-alternative { grid-column: 1 / -1; }
.dates input { accent-color: #6fe7fb; padding: 0; min-height: auto; }
.dates label:has(input:checked) { color: var(--gold); background: #173447; border-radius: .35rem; }
.notice { color: var(--muted); font-size: .94rem; }
#backdrop, #backdrop picture, #backdrop::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#backdrop { z-index: -1; overflow: hidden; opacity: 0; }
body[data-cinematic] #backdrop { opacity: 1; }
body[data-cinematic]::after { opacity: .2; }
#backdrop picture { opacity: 0; }
#backdrop picture[data-ready] { opacity: 1; }
#backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 40% 45%; }
#backdrop::after {
  content: '';
  background:
    linear-gradient(0deg, #040912eb, #05101a18 70%, #040912b0),
    radial-gradient(ellipse at 22% 28%, transparent 20%, #04091275 100%);
}
body[data-cinematic] .masthead { background: #050d19ab; }
body[data-cinematic] .panel {
  background: linear-gradient(150deg, #081b2aed, #07111df5 66%, #10283beb);
  border-color: #92e4f68c;
  box-shadow: 0 0 2.2rem #39ccff25, inset 0 1px #b3eeff39, 0 1rem 3rem #000a;
}
body[data-cinematic] .scene { width: min(100%, 10.5rem); margin-block: .75rem 0; }
.scene-caption { color: #ffd9a9; font-size: .85rem; }
body[data-theme="review"][data-cinematic] .scene::before {
  background: radial-gradient(circle, #83d9ff24, transparent 68%),
    repeating-radial-gradient(circle, transparent 0 22px, #8ad8ff35 23px, transparent 24px);
}
body[data-theme="secret"][data-cinematic] .scene::before {
  background: radial-gradient(circle, #ffb76428, transparent 68%),
    radial-gradient(circle at 15% 23%, #ffd590 0 1px, transparent 2px),
    radial-gradient(circle at 84% 30%, #ffe0a1 0 1px, transparent 2px),
    radial-gradient(circle at 71% 79%, #ffba6d 0 1px, transparent 2px);
}
@media (min-width: 52rem) {
  body[data-cinematic] main { grid-template-columns: minmax(0, 1.13fr) minmax(0, .87fr); }
  body[data-cinematic] .scene { width: min(100%, 25rem, 54vh); margin-top: clamp(3rem, 17vh, 10rem); }
  #backdrop::after {
    background: linear-gradient(90deg, #03081236 5%, #03081218 42%, #040b15cb 100%),
      linear-gradient(0deg, #040912de, transparent 55%, #04091273);
  }
}
.summary-card { padding: .85rem; border: 1px solid #497388; border-radius: .65rem; }
summary { cursor: pointer; color: var(--cyan); padding: .5rem 0; }
.preview { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 52rem) {
  main { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: clamp(1rem, 5vw, 4rem); padding-top: clamp(1rem, 6vh, 4rem); }
  .scene { width: min(100%, 32rem, 69vh); position: sticky; top: 1rem; }
}
@keyframes orbit { to { transform: rotate(1turn); } }
@keyframes halo { to { opacity: .68; } }
@keyframes tilt { to { transform: rotate(18deg) scaleY(.55); } }
@keyframes appear { from { opacity: 0; transform: translateY(.45rem); } }
@keyframes depth-drift { from { transform: scale(1.015); } to { transform: scale(1.055) translateX(-.35%); } }
@media (prefers-reduced-motion: no-preference) {
  .orbit, .sphere-grid { transform-box: view-box; transform-origin: 200px 200px; }
  .orbit-outer { animation: orbit 55s linear infinite; }
  .orbit-cyan { animation: orbit 30s linear infinite reverse; }
  .orbit-gold { animation: orbit 43s linear infinite; }
  .orbit-inner { animation: orbit 76s linear infinite reverse; }
  .sphere-grid-cyan { animation: tilt 9s ease-in-out infinite alternate; }
  .sphere-grid-gold { animation: tilt 13s ease-in-out infinite alternate-reverse; }
  .sphere-grid-blue { animation: tilt 18s ease-in-out infinite alternate; }
  .core, .projector-energy, .scene::before { animation: halo 3s ease-in-out infinite alternate; }
  #message > h1, #message > .mission-grid { animation: appear .38s ease-out; }
  #backdrop, #backdrop picture { transition: opacity .48s ease; }
  #backdrop picture[data-ready] img { animation: depth-drift 22s ease-in-out infinite alternate; }
  body[data-transition] .orbit-cyan { animation-duration: 5s; }
  body[data-transition] .orbit-gold { animation-duration: 7s; }
  button, .primary { transition: background-color .18s, border-color .18s; }
}
