@font-face {
  font-family: "VT323";
  src: url("/assets/vt323.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Colores medidos en la grabación de referencia */
  --color-abyss: #050c13;
  --color-shallow: #101d33;
  --color-foam: #e8f1ff;
  --color-drift: #8a97ad;
  --color-pink: #f85080; /* rosa frambuesa medido en el vídeo */
  --color-pink-dim: #80314f;
  --color-cyan: #4de3ff;
  --color-cyan-line: #3a9fa8;
  --color-gold: #ffc400;
  --color-warn: #e8893c;
  --dock-bg: #060f16;
  --hairline: #8ea3c033;
  --tier-none: #8d9bb4;
  --font-pixel: "VT323", "Courier New", monospace;
  --font-text: "VT323", "Courier New", monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-snap: cubic-bezier(.34, 1.56, .64, 1);
  --notch: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
  --notch-sm: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
}

:root.colorblind {
  --color-drift: #dbe5f5;
  --color-cyan: #7deaff;
  --color-pink: #ff7bac;
  --hairline: #c6d5ec80;
  --tier-none: #b4c0d4;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-block-size: 100%;
  background: var(--color-abyss);
}

body {
  color: var(--color-foam);
  font-family: var(--font-pixel);
  overflow: hidden;
}

button,
input { font: inherit; }

button,
a,
summary,
input { touch-action: manipulation; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

button,
a,
input,
summary { outline-offset: 4px; }

:where(a, button, input, summary):focus-visible { outline: 2px solid var(--color-cyan); }

img { image-rendering: pixelated; }

[hidden] { display: none !important; }

/* Oculto a la vista pero legible por lectores de pantalla. La variante -always sigue
   oculta aunque reciba el foco (p. ej. el título de resultados, que se enfoca por código). */
.visually-hidden:where(:not(:focus-within, :active)),
.visually-hidden-always {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 60px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--color-abyss);
  background: var(--color-cyan);
}

.skip-link:not(:focus) {
  clip-path: inset(50%);
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

/* ───────────────────────── Escenario ───────────────────────── */

.ds-root {
  --waterline: clamp(120px, 62dvh, 620px);
  --question-top: max(78px, 26dvh);
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: clip;
  color: var(--color-foam);
  background: var(--color-abyss);
  user-select: none;
}

.ds-stage {
  position: absolute;
  inset: 0;
  overflow: clip;
  background: var(--color-abyss);
}

/* El mundo se desplaza desde app.js: la coordenada 0 es la línea de flotación. */
.ds-world {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 1;
  inline-size: 100%;
  block-size: 14800px;
  transform: translate3d(0, var(--waterline), 0);
  will-change: transform;
  /* Agua medida en el vídeo: tres franjas planas bajo la superficie (30, 50 y 160 px),
     luego se aclara poco a poco hasta ~225 m y se oscurece hasta el corte en seco de
     ~475 m (la termoclina); por debajo, color casi plano. La trama la pone .ds-crt.
     Si se mueve el corte de 950 px, actualizar thermoclinePx en app.js. */
  background: linear-gradient(to bottom,
    #10304f 0 30px,
    #0e2a46 30px 80px,
    #0c233b 80px 240px,
    #0f2a44 450px,
    #11283d 760px,
    #132c40 949px,
    #0a121d 950px,
    #08111a 1500px,
    #071018 2400px,
    #060e15 4000px,
    #050c12 7000px,
    #04090e 10500px,
    #03070b 13000px
  );
  pointer-events: none;
}

.ds-sky {
  position: absolute;
  inset-block-start: calc(-1 * var(--waterline));
  inset-inline: 0;
  block-size: var(--waterline);
  background-image: url("/assets/cielo.svg?v=2") /* ?v= cambia con el arte: navegadores y Cloudflare lo guardan un día */;
  background-position: 33% bottom;
  background-repeat: no-repeat;
  /* Ancho automático: conserva la proporción (172×87) para que los píxeles sigan cuadrados. 51vw × 1,974 ≥ 100vw. */
  background-size: auto max(150%, 51vw);
}

.ds-sea-surface {
  --wave-height: 22px;
  position: absolute;
  inset-block-start: calc(-1 * var(--wave-height));
  inset-inline: 0;
  block-size: var(--wave-height);
  overflow: hidden;
}

.ds-sea-wave {
  display: block;
  inline-size: calc(100% + var(--wave-period, 0px));
  block-size: 100%;
}

.ds-surface {
  position: absolute;
  inset-block-start: calc(clamp(40px, 19.7dvh, 190px) - var(--waterline));
  inset-inline: 0;
  padding-inline: 16px;
  text-align: center;
  transition: opacity .3s;
}

/* En el resumen el título se va: si no, se transparenta detrás de las cifras. */
.ds-root:not([data-phase="intro"]) .ds-surface { opacity: 0; transition: none; }

.ds-title {
  margin: 0;
  color: #f4f8ff;
  font-size: clamp(58px, 15vw, 116px);
  font-weight: 400;
  letter-spacing: .06em;
  line-height: .9;
  /* Desdoble violeta y cian, con un halo frío que lo separa del cielo de noche. */
  text-shadow: -4px 3px #7a4dff, 4px -3px #3fdcff, 0 0 28px #3fdcff59;
}

.ds-title span { display: inline-block; }

.ds-tagline {
  margin: clamp(10px, 3dvh, 26px) 0 0;
  color: var(--color-cyan);
  font-size: clamp(16px, 3vw, 21px);
  letter-spacing: .5em;
  text-indent: .5em;
  text-shadow: -1px 1px #f8508099, 1px -1px #2b6b8a;
}

.ds-subline {
  margin: clamp(8px, 3.2dvh, 28px) 0 0;
  color: var(--color-drift);
  font-family: var(--font-text);
  font-size: clamp(15px, 1.9vw, 18px);
  letter-spacing: .1em;
  text-wrap: balance;
  /* Sombra oscura para que se lea sobre el brillo del cielo y del oleaje. */
  text-shadow: 0 1px 2px #050c13, 0 0 8px #050c13;
}

.ds-floor {
  position: absolute;
  inset-inline: 0;
  inline-size: 100%;
  block-size: 500px;
  object-fit: cover;
  opacity: .45;
}

.ds-rays {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 900px;
  background:
    linear-gradient(100deg, transparent 8%, #ffffff0d 12%, transparent 17%),
    linear-gradient(97deg, transparent 27%, #ffffff12 31%, transparent 36%),
    linear-gradient(94deg, transparent 47%, #ffffff0b 52%, transparent 56%),
    linear-gradient(98deg, transparent 63%, #ffffff10 68%, transparent 72%),
    linear-gradient(95deg, transparent 80%, #ffffff0a 85%, transparent 89%);
  mask-image: linear-gradient(#000 0, #000a 40%, transparent);
  animation: rays 10s ease-in-out infinite alternate;
}

.ds-scenery img {
  position: absolute;
  image-rendering: pixelated;
}

.ds-amb {
  position: absolute;
  color: var(--color-drift);
  font-family: var(--font-text);
  font-size: 16px;
  letter-spacing: .1em;
  line-height: 1.25;
  opacity: 0;
  text-wrap: balance;
  transition: opacity .5s;
}

.ds-root:is([data-phase="diving"], [data-phase="feedback"]) .ds-amb { opacity: .7; }
.ds-root:is([data-phase="diving"], [data-phase="feedback"]) .ds-amb.major { opacity: .85; }
/* Sin sitio a los lados, los textos de profundidad se apartan mientras se lee el resultado de la ronda. */
@media (max-width: 1100px) {
  .ds-root[data-phase="feedback"] :is(.ds-amb, .ds-amb.major) { opacity: 0; }
}

/* Nunca entran bajo la tarjeta (centrada, 480 px desplazada 26 px a la izquierda). */
.ds-amb.L { inset-inline-start: 5%; max-inline-size: max(96px, calc(46% - 270px)); }
.ds-amb.R { inset-inline-end: max(6%, 96px); max-inline-size: max(96px, calc(44% - 216px)); text-align: end; }
.ds-amb .dash { color: #8a97ad80; }
.ds-amb.major { color: var(--color-cyan); letter-spacing: .3em; text-shadow: 0 0 10px #4de3ff59; }
.ds-amb.major small { font-size: 13px; letter-spacing: .1em; opacity: .7; }

/* Regla de profundidad. En el vídeo está siempre visible (también en la portada y en el
   resumen), con una marca cada 10 m (20 px) y etiqueta cada 100 m, empezando en "0m". */
.ds-ruler {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 14px;
  inline-size: 70px;
  block-size: 14600px;
  background:
    linear-gradient(#8ea3c080, #8ea3c080) right top / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, #8ea3c066 0 1px, transparent 1px 20px) right top / 10px 100% no-repeat;
}

.ds-ruler span {
  position: absolute;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8ea3c0b3;
  font-family: var(--font-text);
  font-size: 13px;
  white-space: nowrap;
  translate: 0 -50%;
  transition: opacity .2s;
}

.ds-ruler span::after { inline-size: 16px; block-size: 1px; background: #8ea3c099; content: ""; }
/* La etiqueta que queda bajo el marcador TÚ se oculta, como en el vídeo. */
.ds-ruler span.covered { opacity: 0; }

.ds-you {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-pink);
  font-family: var(--font-text);
  font-size: 11px;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  translate: 0 -50%;
}

.ds-you::after {
  inline-size: 32px;
  block-size: 9px;
  background: var(--color-pink);
  clip-path: polygon(0 4px, 24px 4px, 32px 0, 32px 100%, 24px 5px, 0 5px);
  filter: drop-shadow(0 0 3px var(--color-pink));
  content: "";
}

.ds-root:is([data-phase="preparing"], [data-phase="answering"], [data-phase="diving"], [data-phase="feedback"]) .ds-you { opacity: 1; }
.ds-root .ds-you.off { opacity: 0; }

/* Líneas de nivel del hundimiento */
.ds-tier-lines { position: absolute; inset: 0; }

.tier-line {
  position: absolute;
  inset-inline: 20% 23%;
  block-size: 2px;
  color: #ffffff2e;
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 12px);
  transition: color .15s, filter .15s, opacity .4s;
}

.tier-line .tl-label {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-drift);
  font-family: var(--font-text);
  font-size: 14px;
  letter-spacing: .2em;
  opacity: .5;
  white-space: nowrap;
  transition: color .15s, opacity .15s;
}

.tier-line .tl-label > :first-child { inline-size: 12px; block-size: 12px; image-rendering: pixelated; }
.tier-line.lit { color: var(--tier); filter: drop-shadow(0 0 5px var(--tier)); }
.tier-line.lit .tl-label { color: var(--tier); opacity: 1; }
.ds-tier-lines.fade .tier-line { opacity: 0; }

/* ───────────────────────── Capas ───────────────────────── */

.ds-snow {
  position: absolute;
  inset: 0;
  z-index: 3;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.ds-dusk,
.ds-spotlight,
.ds-vignette,
.ds-edge,
.ds-flash,
.ds-crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ds-dusk {
  z-index: 2;
  background: #0a0f18;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.ds-root[data-phase="done"] .ds-dusk { opacity: .78; }

/* Halo cian alrededor de la etiqueta durante todo el hundimiento; el resto de la
   pantalla solo se oscurece en aguas profundas (--dark, de 0 a 1, desde app.js). */
.ds-spotlight {
  z-index: 4;
  background: radial-gradient(circle 300px at var(--sx, 50%) var(--sy, 50%), #4de3ff1c 0, transparent 40%, color-mix(in srgb, #02070c calc(var(--dark, 0) * 87%), transparent) 100%);
  opacity: 0;
}

.ds-vignette {
  z-index: 6;
  background: radial-gradient(at 50% 45%, #0000 60%, #02040a99 100%);
  opacity: .5;
}

.ds-edge {
  z-index: 8;
  /* Pulso suave en los cuatro bordes, un latido por segundo, como en el vídeo. */
  box-shadow: inset 0 0 64px 4px #ff5c8c99;
  opacity: 0;
}

.ds-edge.danger { animation: edge-throb 1s ease-out infinite; }

.ds-flash {
  z-index: 9;
  background: var(--dive-color, var(--color-cyan));
  opacity: 0;
}

.ds-flash.active { animation: flash .5s ease-out; }

.ds-crt {
  z-index: 30;
  /* Trama fina como en el vídeo: una línea oscura cada 3 px. */
  background: repeating-linear-gradient(to bottom, #0000 0 2px, #00000021 2px 3px);
  opacity: 1;
}

.colorblind .ds-crt { opacity: .15; }
.colorblind .ds-vignette { opacity: .1; }
.colorblind .ds-subline { color: #061729; }

/* ───────────────────────── Controles fijos ───────────────────────── */

.menu-trigger {
  position: fixed;
  inset-block-start: max(8px, env(safe-area-inset-top));
  inset-inline-start: max(6px, env(safe-area-inset-left));
  z-index: 65;
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 32px;
  padding: 0;
  color: #8a97c0;
  background: #273246d9;
  border: 2px solid #121a28;
}

.menu-trigger svg { inline-size: 16px; block-size: 16px; }
@media (hover: hover) { .menu-trigger:hover { color: var(--color-cyan); } }
.menu-trigger[data-diving="true"] { inset-block-start: 84px; background: #18222ccc; }

.icon-control {
  position: absolute;
  inset-inline-end: 8px;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 40px;
  block-size: 32px;
  padding: 0;
  color: #9aa6c8;
  background: #273246d9;
  border: 2px solid #121a28;
}

@media (hover: hover) { .icon-control:hover { color: var(--color-cyan); } }
.icon-control svg { inline-size: 16px; block-size: 16px; }
.ds-mute { inset-block-start: 84px; }
.settings-trigger { inset-block-start: 120px; }
.wardrobe-trigger { inset-block-start: 156px; }
.ds-mute[aria-pressed="true"] { opacity: .5; }
.ds-root:not([data-phase="intro"], [data-phase="done"]) :is(.settings-trigger, .wardrobe-trigger) { visibility: hidden; }
.ds-root:not([data-phase="intro"], [data-phase="done"]) .ds-mute { background: #18222ccc; }

/* ───────────────────────── Mascota ───────────────────────── */

.ds-mascot {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 22;
  inline-size: 48px;
  block-size: 48px;
  padding: 0;
  background: transparent;
  border: 0;
  transform: translate3d(40px, 70dvh, 0); /* app.js lo mueve en cada fotograma */
  transition: opacity .4s;
  will-change: transform;
}

.ds-mascot:active { translate: none; }

.ds-mascot-sprite {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  transform: scaleX(var(--flip, 1)) rotate(var(--tilt, 0deg));
}

.ds-mascot-sprite img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  filter: drop-shadow(0 0 8px var(--mascot-glow, #ff3d7fb3));
  animation: mascot-swim 1.6s ease-in-out infinite;
}

.ds-mascot-sprite img[src$="/hipo.svg"] { --mascot-glow: #ffb36b99; }
.ds-mascot-sprite img[src$="/farolillo.svg"] { --mascot-glow: #ffe08a99; }
@media (hover: hover) { .ds-mascot:hover .ds-mascot-sprite img { filter: drop-shadow(0 0 12px #ff7aa8); } }
.ds-mascot.roll .ds-mascot-sprite img { animation: mascot-roll .9s cubic-bezier(.3, .1, .3, 1); }
.ds-root[data-phase="intro"] .ds-mascot { opacity: .45; }

.ds-blub {
  position: absolute;
  inset-block-start: -22px;
  inset-inline-start: 30px;
  color: var(--color-pink);
  font-size: 18px;
  opacity: 0;
  text-shadow: 0 0 9px #ff5d8fb3;
  white-space: nowrap;
  pointer-events: none;
}

.ds-blub.show { animation: blub-up 1s ease-out; }

/* ───────────────────────── HUD ───────────────────────── */

.ds-hud {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(16px, 12vw, 174px);
  padding: 6px 10px 0;
  opacity: 0;
  transform: translateY(-90px);
  transition: transform .35s var(--ease-snap), opacity .2s;
  pointer-events: none;
}

.ds-root:is([data-phase="preparing"], [data-phase="answering"], [data-phase="diving"], [data-phase="feedback"]) .ds-hud {
  opacity: 1;
  transform: none;
}

.ds-pod {
  inline-size: 120px;
  min-block-size: 64px;
  padding: 11px 14px 8px;
  background: #18222ceb;
  clip-path: var(--notch);
}

.ds-pod .label {
  color: #7b879b;
  font-family: var(--font-text);
  font-size: 12px;
  letter-spacing: .35em;
}

.ds-depth-num,
.ds-score-num {
  margin-block-start: 6px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.ds-depth-num { color: var(--color-cyan); text-shadow: 0 0 8px #4de3ff80; }
.ds-score-num { display: inline-block; color: var(--color-pink); text-shadow: 0 0 8px #f8508080; }
.ds-score-pod { text-align: end; }
.ds-score-num.bump { animation: bump .3s var(--ease-snap); }

.ds-hud-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-inline-size: 110px;
  padding-block-start: 12px;
}

.ds-dots { display: flex; gap: 3px; }
.ds-dots i { inline-size: 14px; block-size: 14px; background: #132030; box-shadow: inset 0 0 0 1px #24344a; }
.ds-dots i.done { background: var(--color-gold); box-shadow: 0 0 6px #ffc40066; }
.ds-dots i.miss { background: var(--color-gold); box-shadow: 0 0 6px #ffc40066; }
.ds-dots i.cur { background: var(--color-pink); animation: dot-pulse 1.4s ease-in-out infinite; }
.ds-prompt-count { color: #7b879b; font-family: var(--font-text); font-size: 11px; letter-spacing: .35em; }

/* ───────────────────────── Inicio ───────────────────────── */

.ds-intro {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 14;
  padding: 18px 16px calc(clamp(14px, 5.6dvh, 54px) + env(safe-area-inset-bottom));
}

.ds-intro::before {
  /* Velo del vídeo: el agua pasa de azul a casi negro en ~90 px bajo la línea de flotación. */
  position: fixed;
  inset: calc(var(--waterline) + 4px) 0 0;
  z-index: -1;
  background: linear-gradient(#07101700, #0710178c 40px, #071017f2 90px);
  content: "";
  pointer-events: none;
}

.ds-intro-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  inline-size: min(610px, 100%);
  margin-inline: auto;
}

.ds-howto summary {
  color: var(--color-drift);
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 14px;
  letter-spacing: .3em;
  list-style: none;
  text-transform: uppercase;
}

.ds-howto summary::-webkit-details-marker { display: none; }
.ds-howto summary::before { content: "▸ "; }
.ds-howto[open] summary::before { content: "▾ "; }
.ds-edition { margin: 0; color: var(--color-cyan); font-family: var(--font-text); font-size: 15px; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
.ds-edition:empty { display: none; }
.ds-howto ul { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 0; padding: 0; color: var(--color-drift); font-family: var(--font-text); font-size: 16px; letter-spacing: .08em; list-style: none; }
.ds-howto-more { margin: 10px 0 0; color: var(--color-drift); font-family: var(--font-text); font-size: 16px; letter-spacing: .08em; }
.ds-howto-more a { color: var(--color-cyan); }

.ds-begin-btn {
  inline-size: 100%;
  min-block-size: 76px;
  padding: 12px 24px 10px;
  color: var(--color-foam);
  background: #0f1828;
  border: 3px solid var(--color-cyan);
  box-shadow: 0 0 18px #4de3ff59, inset 0 0 18px #4de3ff1a;
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: .25em;
  text-wrap: balance;
  transition: border-color .15s, box-shadow .15s;
}
/* «SEGUIR · PREGUNTA n DE 7» es largo: letra y espaciado menores para que quepa en una línea. */
.ds-begin-btn.long { padding-inline: 12px; font-size: clamp(14px, 4.2vw, 26px); letter-spacing: .1em; }

@media (hover: hover) { .ds-begin-btn:hover { border-color: #8fdcf0; } }
.ds-begin-btn:active { background: #2a0c1c; border-color: var(--color-pink); box-shadow: 0 0 18px #f8508066, inset 0 0 18px #f850801a; }

/* ───────────────────────── Tarjeta de la pregunta ───────────────────────── */

.ds-card {
  position: absolute;
  inset-block-start: var(--question-top);
  inset-inline-start: calc(50% - 266px);
  z-index: 10;
  inline-size: 480px;
  padding: 24px 26px 18px;
  background: #141d2cf2;
  clip-path: var(--notch);
}

.ds-card::after {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, #0000 0 2px, #e8f1ff 2px 3px);
  opacity: .035;
  content: "";
  pointer-events: none;
}

.ds-card .rnd { color: var(--color-pink); font-family: var(--font-text); font-size: 15px; letter-spacing: .35em; }
.ds-card .prompt { margin: 12px 0 8px; color: var(--color-foam); font-family: var(--font-text); font-size: clamp(28px, 2.8vw, 41px); font-weight: 400; letter-spacing: 0; line-height: 1; }
.ds-card .prompt:focus { outline: none; }
.ds-card .hint { color: var(--color-drift); font-family: var(--font-text); font-size: 15px; letter-spacing: .2em; }
.ds-card.leaving { animation: card-out .45s .15s ease-in forwards; }

/* Píldora de cuenta atrás */
.ds-pill {
  position: absolute;
  inset-block-end: calc(19px + env(safe-area-inset-bottom));
  inset-inline-start: 50%;
  z-index: 13;
  margin: 0;
  padding: 11px 20px 10px;
  color: var(--color-drift);
  background: #141d2ce6;
  clip-path: var(--notch-sm);
  font-family: var(--font-text);
  font-size: 17px;
  letter-spacing: .15em;
  white-space: nowrap;
  translate: -50% 0;
}

.ds-pill b { display: inline-block; color: var(--color-cyan); font-weight: 400; }
.ds-pill b.pop { animation: pop .18s ease-out; }

/* ───────────────────────── Dock de respuesta ───────────────────────── */

.ds-dock {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 13;
  padding: 40px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #060f1600, #060f16e6 34%, var(--dock-bg));
}

.answer-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-inline-size: 660px;
  margin-inline: auto;
}

.ds-clock {
  --clock-color: var(--color-cyan);
  --sweep-alpha: #4de3ff59;
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 64px;
  aspect-ratio: 1;
  overflow: hidden;
  color: var(--clock-color);
  background: radial-gradient(#0d1a26, #070f17);
  border: 2px solid #1a2a3c;
  border-radius: 50%;
  box-shadow: 0 0 14px #4de3ff1f;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 8px color-mix(in srgb, var(--clock-color), transparent 40%);
}

.ds-clock::before {
  position: absolute;
  inset: 16%;
  border: 1px solid #2a5560;
  border-radius: 50%;
  content: "";
}

.ds-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(var(--clock-color), var(--clock-color)) 50% 0 / 1px 50% no-repeat,
    conic-gradient(from 0deg, transparent 0 72%, var(--sweep-alpha) 100%);
  animation: sweep 1s linear infinite;
}

.ds-clock-num { position: relative; }
.ds-dock.hot .ds-clock { --clock-color: var(--color-pink); --sweep-alpha: #f8508066; }

.input-wrap { position: relative; min-inline-size: 0; }

.ds-input {
  inline-size: 100%;
  min-block-size: 56px;
  padding: 10px 14px 8px;
  color: var(--color-foam);
  caret-color: var(--color-pink);
  background: #0a121c;
  border: 2px solid var(--color-cyan-line);
  border-radius: 0;
  outline: none;
  font-family: var(--font-text);
  font-size: 26px;
  letter-spacing: .04em;
  user-select: text;
  transition: border-color .15s;
}

.ds-input::placeholder { color: #4c5a6e; }
.ds-input:focus { border-color: #4dc7d3; }
.ds-dock.hot .ds-input,
.ds-input.bad { border-color: var(--color-pink); }
.ds-input.shake { animation: shake .24s linear; }

.ds-fuse { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-start: 0; inline-size: 100%; block-size: 5px; }
.ds-fuse-fill { inline-size: 100%; block-size: 100%; background: #4dc7d3; box-shadow: 0 0 6px #4de3ff66; transform-origin: left; }
.ds-dock.hot .ds-fuse-fill { background: var(--color-pink); box-shadow: 0 0 6px #f8508088; }

.ds-dive-btn {
  position: relative;
  min-inline-size: 0;
  inline-size: 128px;
  min-block-size: 56px;
  padding: 0 8px;
  color: #2a0d1a;
  background: var(--color-pink-dim);
  border: 0;
  border-block-end: 3px solid #4a1830;
  font-size: 20px;
  letter-spacing: .15em;
  text-indent: .15em;
  overflow: hidden;
  white-space: nowrap;
  transition: background-color .12s, box-shadow .12s, inline-size .15s, opacity .12s;
}

.ds-dive-btn .wait { display: none; }
.ds-dock.has-text .ds-dive-btn { color: #1a0a12; background: var(--color-pink); border-block-end-color: #8d1f4a; box-shadow: 0 0 14px #f8508066; opacity: 1; }
@media (hover: hover) { .ds-dock.has-text .ds-dive-btn:hover { filter: brightness(1.08); } }
.ds-dive-btn:active { translate: 0 2px; }
.ds-dock.checking .ds-dive-btn { inline-size: 48px; color: #e8f1ff99; background: var(--color-pink-dim); box-shadow: none; text-indent: 0; letter-spacing: 0; }
.ds-dock.checking .ds-dive-btn .label { display: none; }
.ds-dock.checking .ds-dive-btn .wait { display: inline; }

/* Sonar mientras se comprueba la respuesta: la espera se ve como parte de la inmersión. */
.ds-dock.checking .ds-input { border-color: var(--color-cyan); box-shadow: 0 0 16px #4de3ff40; }
.ds-dock.checking .input-wrap::before,
.ds-dock.checking .input-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-cyan);
  opacity: 0;
  pointer-events: none;
  animation: sonar 1s ease-out infinite;
}
.ds-dock.checking .input-wrap::after { animation-delay: .5s; }

.ds-reject {
  position: absolute;
  inset-block-start: 14px;
  inset-inline: 16px;
  margin: 0;
  color: var(--color-warn);
  font-family: var(--font-text);
  font-size: 16px;
  letter-spacing: .08em;
  text-align: center;
  text-shadow: 0 1px 2px #000c;
}

.ds-reject:not(:empty) { animation: reject-in .2s ease-out; }

/* ───────────────────────── Etiqueta que se hunde ───────────────────────── */

.ds-sink-tag {
  --tier: var(--color-cyan);
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 12;
  max-inline-size: min(560px, calc(100vw - 40px));
  padding: 9px 18px 7px;
  overflow: hidden;
  color: var(--tier);
  background: #1a2230e6;
  clip-path: var(--notch-sm);
  font-size: clamp(20px, 2vw, 27px);
  letter-spacing: .12em;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px color-mix(in srgb, var(--tier), transparent 50%);
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

.ds-sink-tag .arrow { margin-inline-start: 8px; font-size: .7em; }
.ds-sink-tag.deepcut { text-shadow: -1px 0 #4de3ffaa, 1px 0 #ff3d7faa, 0 0 10px #8f6bff88; }

/* ───────────────────────── Resultado de la ronda ───────────────────────── */

.ds-landed {
  --tier-color: var(--color-cyan);
  position: absolute;
  inset-block-start: max(80px, 27dvh);
  inset-inline: 16px;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.ds-landed > * { animation: rise-in .25s ease-out backwards; }
.ds-landed .ticon { block-size: 84px; animation: icon-in .3s var(--ease-snap) backwards; }
.ds-landed .ticon > * { display: block; inline-size: 84px; block-size: 84px; filter: drop-shadow(0 0 14px var(--tier-color)); animation: float 3s ease-in-out infinite; image-rendering: pixelated; }
.ds-landed .ticon:empty { block-size: 12px; }
.ds-landed .tname { margin-block-start: 18px; color: var(--tier-color); font-size: clamp(32px, 4vw, 44px); letter-spacing: .2em; text-indent: .2em; text-shadow: 0 0 14px color-mix(in srgb, var(--tier-color), transparent 40%); animation-delay: .12s; }
.ds-landed .tans { margin-block-start: 16px; font-family: var(--font-text); font-size: 24px; letter-spacing: .1em; overflow-wrap: anywhere; animation-delay: .2s; }
.ds-landed .tpts { margin-block-start: 14px; font-family: var(--font-text); font-size: 24px; letter-spacing: .08em; animation-delay: .26s; }
.ds-landed .tpts b { color: var(--tier-color); font-weight: 400; }
.ds-landed .tsub { margin-block-start: 14px; color: var(--color-drift); font-family: var(--font-text); font-size: 16px; letter-spacing: .18em; animation-delay: .32s; }
/* En el vídeo "nada encontrado" va en pizarra apagada (#3a4a63). */
.ds-landed.none { --tier-color: #3a4a63; }
.ds-landed.none .tname { letter-spacing: .25em; text-shadow: 0 0 12px #3a4a6380; }
.ds-landed.none :is(.tpts, .tpts b) { color: var(--tier-none); }
/* Cerca de la superficie el agua es clara: un halo oscuro mantiene el contraste. */
.ds-landed :is(.tans, .tpts, .tsub) { text-shadow: 0 1px 0 #0a1622b3, 0 0 12px #0a1622b3; }
.ds-landed.deepcut .tname { text-shadow: -2px 0 #4de3ff88, 2px 0 #ff3d7f88, 0 0 14px #8f6bff99; }
.ds-landed.leaving { animation: fade-out .4s ease forwards; }
.ds-landed.leaving > * { animation: none; }

.ds-next-dock {
  display: grid;
  justify-items: center;
  padding: 30px 16px calc(28px + env(safe-area-inset-bottom));
  background: none;
  animation: rise-in .3s .35s ease-out backwards;
}

.ds-outline-btn {
  min-inline-size: 210px;
  min-block-size: 66px;
  padding: 10px 26px 8px;
  color: var(--color-foam);
  background: #0f1828;
  border: 3px solid var(--color-cyan);
  box-shadow: 0 0 14px #4de3ff40;
  font-size: 23px;
  letter-spacing: .25em;
  text-indent: .25em;
  transition: border-color .15s, box-shadow .15s;
}

@media (hover: hover) { .ds-outline-btn:hover { border-color: #8fb4d4; } }
.ds-outline-btn:active { background: #2a0c1c; border-color: var(--color-pink); box-shadow: 0 0 14px #f8508059; }

/* ───────────────────────── Final ───────────────────────── */

.ds-checking {
  position: absolute;
  inset-block-start: 76px;
  inset-inline: 0;
  z-index: 15;
  margin: 0;
  color: var(--color-foam);
  font-family: var(--font-text);
  font-size: 17px;
  letter-spacing: .4em;
  text-align: center;
}

.ds-checking .dots { animation: blink 1s steps(2, end) infinite; }
/* En el vídeo el texto se va apagando durante los ~0,75 s que está en pantalla. */
.ds-checking { animation: checking-dim .75s linear forwards; }
@keyframes checking-dim { to { opacity: .4; } }

.ds-results {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #4c5a6e transparent;
  scrollbar-width: thin;
  user-select: text;
  /* Velo oscuro: el barco y el fondo siguen detrás, pero no compiten con el texto del resumen. */
  background: #050c13b8;
}

.results-inner {
  inline-size: min(450px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 28px calc(56px + env(safe-area-inset-bottom));
}

.results-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.results-logo { margin: 0; color: #f4f8ff; font-size: 28px; letter-spacing: .06em; text-shadow: -2px 1px var(--color-pink), 2px -1px var(--color-cyan); }
.results-done { margin: 0; color: var(--color-drift); font-family: var(--font-text); font-size: 13px; letter-spacing: .2em; }
.results-score { display: flex; align-items: baseline; gap: 14px; margin: 26px 0 0; }
#final-score { color: #f4f8ff; font-size: clamp(56px, 12vw, 70px); line-height: .8; }
.results-depth { color: var(--color-cyan); font-family: var(--font-text); font-size: 15px; }

.results-section { margin-block-start: 44px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: #c3cde0;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .18em;
  white-space: nowrap;
}

.section-title span { color: #5f6c82; letter-spacing: .15em; }
.section-title::after { flex: 1; border-block-start: 1px dashed #8ea3c040; content: ""; }

.divelog { display: grid; grid-template-columns: 30px minmax(0, 1fr); }

.divelog-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  block-size: 268px;
  color: #5f6c82;
  font-family: var(--font-text);
  font-size: 11px;
  translate: 0 -4px;
}

.divelog-cols {
  --step: 65px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--round-count, 7), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  background:
    linear-gradient(90deg, #8ea3c033 50%, transparent 0) 0 0 / 6px 1px repeat-x,
    linear-gradient(90deg, #8ea3c026 50%, transparent 0) 0 var(--step) / 6px 1px repeat-x,
    linear-gradient(90deg, #8ea3c026 50%, transparent 0) 0 calc(var(--step) * 2) / 6px 1px repeat-x,
    linear-gradient(90deg, #8ea3c026 50%, transparent 0) 0 calc(var(--step) * 3) / 6px 1px repeat-x,
    linear-gradient(90deg, #8ea3c026 50%, transparent 0) 0 calc(var(--step) * 4) / 6px 1px repeat-x;
}

.log-sample {
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: 290px;
  padding: 0;
  color: var(--tier-color);
  background: none;
  border: 0;
}

.log-sample:active { translate: none; }
.log-line { position: absolute; inset-block-start: 0; inset-inline-start: 50%; inline-size: 1px; block-size: calc(var(--drop) * 2.6px); background: linear-gradient(transparent, var(--tier-color)); transform-origin: top; animation: grow .15s ease-out backwards; }
.log-icon { position: absolute; inset-block-start: calc(var(--drop) * 2.6px - 7px); inset-inline-start: calc(50% - 7px); inline-size: 14px; block-size: 14px; filter: drop-shadow(0 0 4px var(--tier-color)); animation: icon-in .25s var(--ease-snap) backwards; animation-delay: calc(.15s + var(--i) * .08s); }
.log-icon > * { display: block; inline-size: 100%; block-size: 100%; image-rendering: pixelated; }
.log-empty { position: absolute; inset-block-start: -5px; inset-inline-start: calc(50% - 5px); inline-size: 11px; block-size: 11px; border: 1px dashed #8ea3c099; border-radius: 50%; animation: icon-in .25s var(--ease-snap) backwards; animation-delay: calc(.15s + var(--i) * .08s); }
.log-num { position: absolute; inset-block-start: 272px; inset-inline: 0; color: #5f6c82; font-family: var(--font-text); font-size: 12px; text-align: center; }
.log-sample:focus-visible .log-num { color: var(--color-cyan); }
@media (hover: hover) { .log-sample:hover .log-num { color: var(--color-cyan); } }

.score-bands { margin: 0; padding: 0; list-style: none; }
.score-band { display: grid; grid-template-columns: 22px 92px minmax(0, 1fr); align-items: center; gap: 8px; min-block-size: 44px; padding-inline: 6px; border-block-end: 1px solid #8ea3c01f; font-family: var(--font-text); }
.score-band .sb-icon > * { display: block; inline-size: 13px; block-size: 13px; image-rendering: pixelated; }
.score-band-range { color: var(--tier-color); font-size: 14px; }
.score-band-text { color: #6d7a90; font-size: 15px; letter-spacing: .05em; }
.score-band[aria-current="true"] .score-band-text { color: var(--color-foam); }

.results-actions { display: grid; gap: 16px; margin-block-start: 34px; }

.ds-big-btn {
  min-block-size: 58px;
  padding: 10px 16px 8px;
  border: 0;
  border-block-end: 3px solid;
  font-size: 22px;
  letter-spacing: .3em;
  text-indent: .3em;
  transition: filter .12s;
}

a.ds-big-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ds-big-btn.pink { color: #1a0a12; background: var(--color-pink); border-color: #8d1f4a; box-shadow: 0 0 18px #f850804d; }
.ds-big-btn.cyan { color: #06141a; background: var(--color-cyan); border-color: #1b7d8a; box-shadow: 0 0 18px #4de3ff33; }
@media (hover: hover) { .ds-big-btn:hover { filter: brightness(1.08); } }
.ds-big-btn:active { translate: 0 2px; }

/* Curva de puntuaciones de hoy (como en el vídeo, bajo la puntuación). */
.results-curve { position: relative; margin: 30px 0 0; }
.results-curve svg { display: block; inline-size: 100%; block-size: 108px; overflow: visible; }
.curve-area--after { fill: #3fc4cf; fill-opacity: .07; }
.curve-line { fill: none; stroke: #45c6d1; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.curve-you { stroke: var(--color-pink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve-dot { position: absolute; inline-size: 9px; block-size: 9px; border-radius: 50%; background: var(--color-pink); box-shadow: 0 0 8px var(--color-pink); translate: -50% -50%; }
.curve-axis { position: relative; block-size: 22px; border-block-start: 1px solid #8ea3c040; color: #5f6c82; font-family: var(--font-text); font-size: 11px; letter-spacing: .08em; }
.curve-axis span { position: absolute; inset-block-start: 6px; }
.curve-you-label { color: var(--color-pink); }
.results-percentile { margin: 10px 0 0; color: var(--color-cyan); font-family: var(--font-text); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.results-percentile b { color: var(--color-foam); font-size: 1.25em; font-weight: normal; letter-spacing: .04em; }

/* Filas del resultado, como «The Catch» del original: se pulsan para desplegar. */
.result-row { border-block-end: 1px solid #8ea3c01f; font-family: var(--font-text); scroll-margin-block-start: 20px; }
.result-summary { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto 14px; gap: 0 12px; align-items: center; padding: 14px 0; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.result-summary::-webkit-details-marker { display: none; }
.result-summary:focus { outline: none; }
.result-summary:focus-visible { outline: 1px dashed #8ea3c080; outline-offset: 2px; }
.result-number { color: #5f6c82; font-size: 13px; }
.result-icon { display: grid; place-items: center; inline-size: 18px; block-size: 18px; filter: drop-shadow(0 0 4px var(--tier-color)); }
.result-icon > :is(img, svg) { display: block; inline-size: 100%; block-size: 100%; image-rendering: pixelated; }
.result-miss { inline-size: 14px; block-size: 14px; border: 1px dashed #8ea3c099; border-radius: 50%; }
.result-copy { display: grid; gap: 6px; min-inline-size: 0; }
.result-prompt { overflow: hidden; color: #6d7a90; font-size: 12px; letter-spacing: .12em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.result-answer { overflow-wrap: anywhere; color: var(--color-foam); font-size: 19px; line-height: 1.1; }
.result-meta { color: #8a97ad; font-size: 13px; letter-spacing: .04em; }
.result-meta b { color: var(--color-cyan); font-weight: inherit; }
.result-points { color: var(--tier-color, var(--color-foam)); font-size: 16px; white-space: nowrap; }
.result-toggle::before { color: #5f6c82; content: "+"; font-size: 14px; }
.result-details[open] .result-toggle::before { content: "−"; }
.result-more { display: grid; gap: 6px; padding: 0 0 14px 60px; }
.result-more > p { margin: 0; font-size: 14px; letter-spacing: .06em; overflow-wrap: anywhere; }
.result-gem { color: var(--color-gold); }
.result-note { color: #8a97ad; }
.reveal-title { margin: 4px 0 0; color: var(--color-cyan); font-size: 13px; letter-spacing: .15em; text-transform: uppercase; }
.results-next { margin: 40px 0 0; color: #8a97ad; font-family: var(--font-text); font-size: 13px; letter-spacing: .2em; }
.results-next span { color: var(--color-cyan); }
.reveal-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px; }
.reveal-search, .reveal-filter { min-block-size: 32px; padding: 4px 8px; border: 1px solid #8ea3c055; color: var(--color-foam); background: #0a1520; font: inherit; font-size: 16px; }
.reveal-search { flex: 1 1 160px; min-inline-size: 0; }
.reveal-list { display: grid; gap: 2px; max-block-size: 320px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.reveal-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 3px 6px; border-inline-start: 3px solid var(--tier-color); background: #ffffff08; font-size: 16px; }
.reveal-name { min-inline-size: 0; overflow-wrap: break-word; color: var(--color-foam); }
.reveal-tier { flex: none; margin-inline-start: auto; color: var(--tier-color); font-size: 13px; letter-spacing: .1em; }
.reveal-more { margin-block-start: 6px; padding: 4px 10px; border: 1px solid #8ea3c055; color: var(--color-cyan); background: none; font: inherit; font-size: 14px; letter-spacing: .1em; cursor: pointer; text-transform: uppercase; }
.ds-link { padding: 0; border: 0; color: var(--color-cyan); background: none; font: inherit; text-decoration: underline; cursor: pointer; }

.results-list { margin: 0; padding: 0; list-style: none; }

/* ───────────────────────── Diálogos ───────────────────────── */

.pixel-dialog {
  inline-size: min(430px, calc(100vw - 36px));
  max-inline-size: none;
  max-block-size: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  color: var(--color-foam);
  background: var(--color-shallow);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 3px #050a14, 0 0 0 5px #1b3050, 10px 10px 0 #02050bd9, 0 0 38px #4de3ff24;
  font-family: var(--font-pixel);
  overscroll-behavior: contain;
}

.pixel-dialog::backdrop { overflow: hidden; background: #02050bd1; overscroll-behavior: contain; }
.dialog-panel { padding: 22px; background: repeating-linear-gradient(0deg, #00000029 0 1px, transparent 1px 3px), var(--color-shallow); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-block-end: 20px; }
.dialog-eyebrow { margin: 0 0 3px; color: var(--color-cyan); font-size: 11px; letter-spacing: .22em; text-shadow: 0 0 8px #4de3ff73; }
.dialog-header h2 { margin: 0; font-size: 34px; font-weight: 400; letter-spacing: .06em; line-height: 1; text-transform: uppercase; text-shadow: -2px 1px #ff5d8fcc, 2px -1px #4de3ffb3; }
.dialog-close { display: grid; place-items: center; flex: none; inline-size: 34px; block-size: 30px; padding: 0 0 3px; color: var(--color-drift); background: var(--color-shallow); border: 0; box-shadow: 0 0 0 2px #050a14, 0 0 0 4px #1b3050, 0 3px 0 4px #0d1a2e; font-size: 25px; line-height: 1; }
@media (hover: hover) { .dialog-close:hover { color: var(--color-foam); box-shadow: 0 0 0 2px #050a14, 0 0 0 4px var(--color-cyan), 0 3px 0 4px #123048; } }
.fathom { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: var(--color-drift); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.fathom::after { content: ""; flex: 1; border-block-start: 1px dashed var(--hairline); }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 4px; }
.menu-grid > :is(button, a) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-block-size: 78px; padding: 12px 6px 10px; color: var(--color-drift); background: #0d1830; border: 0; box-shadow: 0 0 0 2px #050a14, 0 0 0 4px #1b3050, 0 4px 0 4px #0b1424; font-size: 15px; letter-spacing: .09em; line-height: 1.2; text-align: center; text-transform: uppercase; }
.menu-grid > :is(button, a) { text-decoration: none; }
@media (hover: hover) { .menu-grid > :is(button, a):hover { color: var(--color-foam); box-shadow: 0 0 0 2px #050a14, 0 0 0 4px var(--color-cyan), 0 4px 0 4px #123048; } }
.menu-grid > [aria-current="page"] { color: var(--color-pink); box-shadow: 0 0 0 2px #050a14, 0 0 0 4px var(--color-pink), 0 4px 0 4px #2a1024; }
.menu-symbol { display: grid; place-items: center; inline-size: 24px; block-size: 24px; font-size: 26px; line-height: 1; }
.dialog-footer { margin-block-start: 24px; padding-block-start: 12px; color: var(--color-drift); border-block-start: 1px dashed var(--hairline); font-size: 12px; letter-spacing: .05em; }

.preference-list { display: flex; flex-direction: column; }
.preference { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-block-size: 74px; padding: 14px 2px; cursor: pointer; }
.preference > span { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.preference strong { color: var(--color-foam); font-size: 16px; font-weight: 400; letter-spacing: .09em; text-transform: uppercase; }
.preference small { max-inline-size: 30ch; color: var(--color-drift); font-size: 13px; letter-spacing: .035em; line-height: 1.25; }
@media (hover: hover) { .preference:hover strong { color: var(--color-cyan); } }
.preference input { position: relative; flex: none; inline-size: 70px; block-size: 30px; margin: 0; appearance: none; background: #03070f; box-shadow: inset 0 3px 5px #000000e6, 0 0 0 2px #060d1a, 0 0 0 3px #1b3050; cursor: pointer; }
.preference input::before { content: "NO"; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; display: grid; place-items: center; inline-size: 30px; block-size: 24px; color: var(--color-abyss); background: var(--color-drift); box-shadow: 0 2px #02050bcc; font-size: 11px; font-weight: 600; transition: transform .12s steps(2, end); }
.preference input:checked { box-shadow: inset 0 3px 5px #000000e6, 0 0 0 2px #060d1a, 0 0 0 3px var(--color-cyan), 0 0 12px #4de3ff66; }
.preference input:checked::before { content: "SÍ"; background: var(--color-cyan); transform: translateX(34px); }

.wardrobe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block-start: 30px; }
.character-key { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 12px; color: var(--color-drift); background: var(--color-shallow); border: 0; box-shadow: 0 0 0 2px #050a14, 0 0 0 4px #1b3050, 0 3px 0 4px #0d1a2e; font-size: 14px; letter-spacing: .09em; text-transform: uppercase; }
.character-key img { inline-size: 72px; block-size: 72px; }
.character-key[aria-pressed="true"] { color: var(--color-cyan); box-shadow: 0 0 0 2px #050a14, 0 0 0 4px var(--color-cyan), 0 3px 0 4px #123048, 0 0 14px #4de3ff73; }
@media (hover: hover) { .character-key:hover { color: var(--color-cyan); box-shadow: 0 0 0 2px #050a14, 0 0 0 4px var(--color-cyan), 0 3px 0 4px #123048, 0 0 14px #4de3ff73; } }


/* Los controles dibujan su propio estado pulsado: sin el destello gris de WebKit encima. */
:is(button, a.ds-big-btn, .menu-grid > a, .preference) { -webkit-tap-highlight-color: transparent; }

/* ───────────────────────── Animaciones ───────────────────────── */

@keyframes rays { from { opacity: .55; } to { opacity: 1; } }
@keyframes sweep { to { rotate: 360deg; } }
@keyframes mascot-swim { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
@keyframes mascot-roll { to { transform: rotate(360deg); } }
@keyframes blub-up { 0% { opacity: 0; transform: translateY(8px); } 20%, 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
@keyframes dot-pulse { 50% { box-shadow: 0 0 10px #f85080; } }
@keyframes edge-throb { 0% { opacity: 0; } 12% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes flash { 0% { opacity: .16; } 100% { opacity: 0; } }
@keyframes bump { 50% { scale: 1.1; } }
@keyframes pop { from { scale: 1.25; } }
@keyframes card-out { to { opacity: 0; } }
@keyframes card-rise { from { opacity: 0; translate: 0 var(--card-rise, 0px); } 18% { opacity: 1; } }
@keyframes dock-in { from { translate: 0 100%; } }
@keyframes rise-in { from { opacity: 0; translate: 0 10px; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes icon-in { from { opacity: 0; scale: .6; } }
@keyframes float { 50% { translate: 0 -4px; } }
@keyframes shake { 0%, 100% { translate: 0; } 17%, 50%, 83% { translate: -4px; } 33%, 67% { translate: 4px; } }
@keyframes reject-in { from { opacity: 0; translate: 0 4px; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sonar { 0% { opacity: .7; scale: 1; } 100% { opacity: 0; scale: 1.06 1.7; } }
@keyframes grow { from { scale: 1 0; } }
@keyframes sea-drift { to { transform: translateX(calc(-1 * var(--wave-period, 0px))); } }

@media (prefers-reduced-motion: no-preference) {
  .ds-sea-wave { animation: sea-drift 32s linear infinite; }
  .ds-root:not([data-low-power="true"]) .ds-card { animation: card-rise 1.3s cubic-bezier(.45, 0, .2, 1) backwards; animation-delay: var(--card-delay, 0s); }
  .ds-root:not([data-low-power="true"]) .ds-card.leaving { animation: card-out .45s .15s ease-in forwards; }
  .ds-root:not([data-low-power="true"]) #answer-form { animation: dock-in .35s var(--ease-out) backwards; }
  .ds-root:not([data-low-power="true"]) .ds-pill { animation: rise-in .2s ease-out backwards; }
}

.ds-root[data-low-power="true"] .ds-dock.checking .input-wrap::before,
.ds-root[data-low-power="true"] .ds-dock.checking .input-wrap::after { animation: none; }
.ds-root[data-low-power="true"] :is(.ds-rays, .ds-sweep, .ds-mascot-sprite img, .ds-dots i.cur, .ds-sea-wave, .ds-landed .ticon > *) { animation-play-state: paused; }

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

@media (max-width: 700px) {
  .ds-amb, .ds-amb.L, .ds-amb.R { max-inline-size: 64vw; font-size: 14px; }
  .ds-amb.L { inset-inline-start: 10px; }
  .ds-amb.R { inset-inline-end: 44px; }
  .ds-ruler { inline-size: 8px; inset-inline-end: 4px; }
  .ds-ruler span { display: none; }
  .ds-you span { display: none; }
  .tier-line { inset-inline: 8% 8%; }
  .tier-line .tl-label { font-size: 12px; letter-spacing: .12em; }
  .ds-hud { gap: 10px; padding-inline: 8px; }
  .ds-pod { inline-size: 98px; min-block-size: 54px; padding: 9px 10px 6px; }
  .ds-pod .label { font-size: 11px; letter-spacing: .2em; }
  .ds-depth-num,
  .ds-score-num { font-size: 22px; }
  .ds-dots i { inline-size: 10px; block-size: 10px; }
  .ds-prompt-count { font-size: 10px; letter-spacing: .2em; }
  .ds-card { inset-inline: 16px; inline-size: auto; padding: 18px 18px 14px; }
  .ds-card .prompt { font-size: 26px; }
  .ds-card .hint { font-size: 13px; letter-spacing: .12em; }
  .ds-dock { padding-inline: 10px; }
  .answer-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; }
  .ds-clock { inline-size: 52px; font-size: 22px; }
  .ds-input { min-block-size: 50px; font-size: 22px; }
  .ds-dive-btn { inline-size: 92px; min-block-size: 50px; font-size: 17px; letter-spacing: .08em; text-indent: .08em; }
  .ds-landed .tans { font-size: 21px; }
  .ds-landed .tpts { font-size: 21px; }
  .ds-landed .tsub { font-size: 14px; letter-spacing: .1em; }
  .ds-begin-btn { min-block-size: 64px; font-size: clamp(18px, 5.5vw, 24px); letter-spacing: .12em; }
  .ds-begin-btn.long { font-size: clamp(14px, 4.2vw, 22px); letter-spacing: .06em; }
  .ds-tagline { letter-spacing: .3em; }
  .score-band { grid-template-columns: 20px 74px minmax(0, 1fr); }
  .section-title { flex-wrap: wrap; row-gap: 4px; white-space: normal; }
  .section-title::after { display: none; }
  .results-inner { inline-size: auto; margin-inline: 16px 56px; padding-block-start: 56px; }
  .result-more { padding-inline-start: 0; }
  .ds-big-btn { font-size: 19px; letter-spacing: .18em; }
  .dialog-panel { padding: 18px 16px; }
  .menu-grid { gap: 14px; }
  .menu-grid > :is(button, a) { min-block-size: 70px; font-size: 14px; }
  .preference { gap: 12px; }
  .preference small { max-inline-size: 22ch; }
}

@media (max-height: 520px) {
  .ds-root { --question-top: 84px; }
  .ds-card { padding-block: 12px 10px; }
  .ds-card .prompt { margin-block: 6px; font-size: 24px; }
  .ds-landed { inset-block-start: 64px; }
  .ds-landed .ticon,
  .ds-landed .ticon > * { block-size: 48px; inline-size: 48px; }
  .ds-landed .tname { margin-block-start: 8px; font-size: 28px; }
  .ds-landed :is(.tans, .tpts, .tsub) { margin-block-start: 6px; }
  .ds-dock { padding-block: 24px 8px; }
  .ds-next-dock { padding-block: 10px 12px; }
  .ds-begin-btn { min-block-size: 52px; }
  /* En horizontal no caben título, lema, subtítulo y botón: el subtítulo repite lo de «cómo jugar». */
  .ds-title { font-size: clamp(48px, 11vw, 80px); }
  .ds-tagline { margin-block-start: 8px; font-size: 16px; }
  .ds-subline { display: none; }
}

@media (pointer: coarse) {
  .icon-control { inline-size: 42px; block-size: 38px; }
  .ds-mute { inset-block-start: 78px; }
  .settings-trigger { inset-block-start: 122px; }
  .wardrobe-trigger { inset-block-start: 166px; }
  .ds-howto summary { min-block-size: 32px; }
}

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

  .ds-sweep { display: none; }
}

@media (forced-colors: active) {
  :where(a, button, input, summary):focus-visible { outline: 3px solid Highlight; }
  .ds-crt,
  .ds-snow,
  .ds-sweep { display: none; }
  .ds-clock { border-color: CanvasText; }
  .log-line { forced-color-adjust: none; background: CanvasText; }
  /* Estos controles se dibujan solo con box-shadow, que el alto contraste elimina. */
  :is(.dialog-close, .menu-grid > :is(button, a), .character-key, .preference input) { outline: 1px solid CanvasText; }
}
