/* ============================================================
   styles.css — layout y estetica pixel-art / neo-arcade
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 78% 8%, rgba(51, 225, 255, 0.16), transparent 65%),
    radial-gradient(55% 45% at 12% 22%, rgba(255, 95, 162, 0.14), transparent 65%),
    radial-gradient(80% 60% at 50% 105%, rgba(200, 255, 61, 0.1), transparent 70%);
  background:
    radial-gradient(60% 45% at 78% 8%, var(--glow-color), transparent 65%),
    radial-gradient(55% 45% at 12% 22%, color-mix(in srgb, var(--a1) 16%, transparent), transparent 65%),
    radial-gradient(80% 60% at 50% 105%, color-mix(in srgb, var(--a2) 12%, transparent), transparent 70%);
  transition: background 600ms linear;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(90% 70% at 50% 20%, #000 20%, transparent 85%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 20%, #000 20%, transparent 85%);
}

img { display: block; max-width: 100%; }
img, .char, .char__spr { image-rendering: pixelated; image-rendering: crisp-edges; }

button { font: inherit; }

h1, h2, h3, .logo, .btn, .kicker, .tag, .stat b, .footer, .clock,
.dialog__name, .sec__label, .proj h3, .proj__num, .lang__btn {
  font-family: var(--font-display);
}

p { margin: 0 0 1em; }

a { color: var(--c-lime); }

::selection { background: var(--c-lime); color: #07060d; }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10000;
  background: var(--c-lime);
  color: #07060d;
  padding: 12px 18px;
  font-family: var(--font-pixel);
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--c-cyan);
  outline-offset: 3px;
}

/* ---------- Grano ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9001;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Contenedor ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   CABECERA
   ============================================================ */
.top {
  position: sticky;
  top: 0;
  z-index: 800;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(6, 5, 12, 0.78);
  background: color-mix(in srgb, var(--bg-1) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.top__in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
  line-height: 1;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--c-lime);
  border: 2px solid rgba(200, 255, 61, 0.55);
  background: rgba(200, 255, 61, 0.07);
  box-shadow: 0 0 20px rgba(200, 255, 61, 0.22), 3px 3px 0 rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.logo__mark svg { width: 22px; height: 18px; display: block; }
.logo:hover .logo__mark {
  border-color: var(--c-lime);
  box-shadow: 0 0 26px rgba(200, 255, 61, 0.5), 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.logo__text { display: flex; flex-direction: column; gap: 3px; }
@keyframes pulse { 50% { opacity: 0.35; } }
.logo__first {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.logo__name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
}

nav.main {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

nav.main a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
nav.main a:hover { color: var(--fg); border-color: var(--line); }
nav.main a.is-active {
  color: var(--c-lime);
  border-color: rgba(200, 255, 61, 0.45);
  background: rgba(200, 255, 61, 0.07);
}

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

.lang {
  display: flex;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.lang__btn {
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  padding: 5px 9px;
  cursor: pointer;
  letter-spacing: 0.1em;
  font-size: 11px;
}
.lang__btn.is-active { background: var(--fg); color: #07060d; }

.coins {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #ffd23d;
  border: 1px solid rgba(255, 210, 61, 0.45);
  background: rgba(255, 210, 61, 0.08);
  padding: 3px 7px;
  white-space: nowrap;
}
.coins[hidden] { display: none; }
.coins img { width: 16px; height: 16px; }
.coins.is-bump { animation: coin-bump 0.5s steps(3, end) 1; }
@keyframes coin-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-lime);
  box-shadow: 0 0 10px var(--c-lime);
}

.clock {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  padding: 4px 8px;
  white-space: nowrap;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  padding: 86px 0 76px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-lime);
  border: 1px solid rgba(200, 255, 61, 0.35);
  padding: 7px 12px;
  margin-bottom: 26px;
  background: rgba(200, 255, 61, 0.06);
}

h1.title {
  text-transform: uppercase;
  font-size: clamp(3rem, 8.2vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0 0 26px;
  position: relative;
}
h1.title span { display: block; }

h1.title .accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--fg);
  position: relative;
  white-space: nowrap;
}
h1.title .accent::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--c-cyan);
  -webkit-text-stroke: 0;
  opacity: 0.55;
  transform: translate(3px, 3px);
  z-index: -1;
  filter: blur(0.4px);
}
@supports not (-webkit-text-stroke: 1px #000) {
  h1.title .accent { color: var(--c-cyan); }
}

.lede {
  max-width: 46ch;
  color: var(--fg-dim);
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
}
.lede b { color: var(--fg); font-weight: 400; }

.actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 15px 24px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid;
  background: transparent;
  color: var(--fg);
  transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}
.btn--primary {
  background: var(--c-lime);
  color: #07060d;
  border-color: var(--c-lime);
  box-shadow: 5px 5px 0 rgba(200, 255, 61, 0.22);
}
.btn--ghost { border-color: var(--line); }
.btn:hover { transform: translate(-2px, -2px); }
.btn--primary:hover { box-shadow: 9px 9px 0 rgba(200, 255, 61, 0.22); }
.btn--ghost:hover { border-color: var(--fg); box-shadow: 4px 4px 0 rgba(234, 242, 255, 0.12); }

.stats {
  display: flex;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  flex: 1;
  padding: 16px 18px 14px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat b {
  display: block;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat small {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.art { position: relative; justify-self: center; }

.frame {
  position: relative;
  padding: 10px;
  border: 2px solid var(--fg);
  background: #0b0916;
  box-shadow: 16px 16px 0 rgba(0, 0, 0, 0.55);
}
.frame img {
  display: block;
  width: min(400px, 72vw);
  height: auto;
  filter: contrast(1.04) saturate(1.04);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

.corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--c-lime); }
.corner.tl { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -8px; right: -8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -8px; left: -8px; border-right: 0; border-top: 0; }
.corner.br { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

.badge {
  position: absolute;
  left: -18px;
  bottom: 28px;
  background: var(--c-cyan);
  color: #07060d;
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 14px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6);
}

/* ============================================================
   SECCIONES
   ============================================================ */
.section { padding: 88px 0; }
.section--tight { padding-top: 0; }

.sec__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}

.sec__label {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--a1);
  margin: 0 0 12px;
}

h2.sec__title {
  text-transform: uppercase;
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.sec__desc {
  max-width: 40ch;
  color: var(--fg-dim);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
  text-align: right;
}

/* ============================================================
   ESCENA
   ============================================================ */
.stage {
  position: relative;
  height: clamp(560px, 58vw, 660px);
  overflow: hidden;
  isolation: isolate;
  border: 2px solid rgba(200, 255, 61, 0.4);
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.5);
  background: #0b0916;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  opacity: 0.22;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.s-wall {
  position: absolute;
  inset: 0 0 36% 0;
  background: linear-gradient(180deg, #2a1a3d 0%, #1d1230 55%, #150d24 100%);
}
.s-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.25) 0 2px, transparent 2px 26px);
}

.s-skirt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36%;
  height: 22px;
  background: #170f24;
  border-top: 3px solid #3a2a52;
  border-bottom: 3px solid #0d0818;
  z-index: 3;
}

.s-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg, #33201c 0%, #241512 100%);
}
.s-floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(to right, rgba(0, 0, 0, 0.2) 0 3px, transparent 3px 130px);
}

.s-rug {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16%;
  width: min(430px, 42%);
  height: 76px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #43265e, #2a1740);
  border: 3px solid #6a3f8c;
  box-shadow: 0 0 0 4px #1b1029 inset;
  z-index: 2;
}
.s-rug::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(200, 255, 61, 0.18);
}

/* ventana */
.s-window {
  position: absolute;
  left: 4%;
  top: 8%;
  width: clamp(120px, 13vw, 170px);
  height: clamp(160px, 17vw, 225px);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
  border: 4px solid #3d2c58;
  box-shadow: 0 0 0 3px #120b1e, 0 0 70px rgba(51, 225, 255, 0.16) inset;
  z-index: 3;
  transition: background 600ms linear;
}
.s-window::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--sky-stars);
  background:
    radial-gradient(2px 2px at 16% 18%, #fff, transparent),
    radial-gradient(2px 2px at 40% 32%, #bfe9ff, transparent),
    radial-gradient(3px 3px at 66% 14%, #fff, transparent),
    radial-gradient(2px 2px at 84% 44%, #bfe9ff, transparent),
    radial-gradient(2px 2px at 24% 58%, #fff, transparent),
    radial-gradient(2px 2px at 58% 66%, #9fd6ff, transparent),
    radial-gradient(2px 2px at 76% 80%, #fff, transparent);
  animation: twinkle 4s steps(2, end) infinite;
  transition: opacity 600ms linear;
}
@keyframes twinkle { 50% { opacity: 0.45; } }

.s-window__orb {
  position: absolute;
  right: 16%;
  top: 12%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sky-orb);
  box-shadow: 0 0 24px var(--sky-glow);
  transition: background 600ms linear;
  overflow: hidden;
}
.s-window__orb::after {
  content: "";
  position: absolute;
  right: -9px;
  top: -5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sky-2);
  opacity: 0;
  transition: opacity 600ms linear;
}
html[data-time="night"] .s-window__orb::after,
html[data-time="evening"] .s-window__orb::after { opacity: 1; }
/* el sol sale bajo y se pone a media altura */
html[data-time="dawn"] .s-window__orb { top: 56%; }
html[data-time="evening"] .s-window__orb { top: 44%; }

.s-window__bar { position: absolute; background: #3d2c58; z-index: 2; }
.s-window__bar.v { left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; }
.s-window__bar.h { left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; }

.s-window__curt {
  position: absolute;
  top: -12px;
  width: 26px;
  height: calc(100% + 22px);
  background: linear-gradient(90deg, #3d1c46, #64245c);
  opacity: 0.92;
  z-index: 4;
}
.s-window__curt.l { left: -20px; }
.s-window__curt.r { right: -20px; }

/* ============================================================
   VISTA DE LA VENTANA (paisaje que cambia con la estacion)
   ============================================================ */
.s-window__view {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.s-hill {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 22px;
  background: var(--hill, #3a7d3f);
  border-top: 3px solid rgba(0, 0, 0, 0.25);
}
.s-tree {
  position: absolute;
  right: 16%;
  bottom: 14px;
  width: 56px;
  height: 70px;
}
.s-tree .trunk {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  height: 30px;
  margin-left: -4px;
  background: #4a2c1c;
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}
.s-tree .crown {
  position: absolute;
  display: block;
  border-radius: 3px;
  background: var(--tree-1, #4fb04a);
  box-shadow: inset 0 3px 0 var(--tree-2, #358a3c);
}
.s-tree .crown.a { left: 4px; bottom: 34px; width: 48px; height: 20px; }
.s-tree .crown.b { left: 12px; bottom: 20px; width: 32px; height: 18px; }
.s-tree .crown.c { left: 18px; bottom: 50px; width: 22px; height: 16px; }
/* primavera: el arbol florece */
html[data-season="spring"] .s-tree .crown.a {
  background-image:
    radial-gradient(circle at 22% 34%, var(--tree-dot, #ff9fc8) 0 3px, transparent 4px),
    radial-gradient(circle at 58% 24%, var(--tree-dot, #ff9fc8) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 58%, var(--tree-dot, #ff9fc8) 0 3px, transparent 4px),
    radial-gradient(circle at 40% 70%, var(--tree-dot, #ff9fc8) 0 2px, transparent 3px);
}
/* invierno: copas nevadas y suelo helado */
html[data-season="winter"] .s-tree .crown {
  border-radius: 2px;
  box-shadow: inset 0 4px 0 #fff;
}

/* ============================================================
   CLIMA EN LA VENTANA (segun la estacion)
   ============================================================ */
.s-window__weather {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.s-window__weather i {
  position: absolute;
  left: var(--x, 50%);
  top: -16%;
  width: var(--s, 4px);
  height: var(--s, 4px);
  background: var(--w-col);
  box-shadow: 0 0 5px var(--w-col);
  animation: weather-fall var(--d, 8s) linear var(--dl, 0s) infinite;
}
/* invierno: copos que caen en saltos, como pixeles */
html[data-season="winter"] .s-window__weather i {
  animation-timing-function: steps(14, end);
}
@keyframes weather-fall {
  0%   { transform: translate3d(0, -12px, 0) rotate(0deg); opacity: 0; }
  12%  { opacity: 0.95; }
  86%  { opacity: 0.95; }
  100% { transform: translate3d(var(--sway, 12px), 260px, 0) rotate(var(--spin, 180deg)); opacity: 0; }
}
/* verano: no cae nada, sube el polen dorado de la luz */
html[data-season="summer"] .s-window__weather i {
  top: 64%;
  background: var(--w-col-2);
  box-shadow: 0 0 6px var(--w-col);
  animation-name: weather-rise;
  animation-timing-function: ease-in-out;
}
@keyframes weather-rise {
  0%   { transform: translate3d(0, 26px, 0); opacity: 0; }
  25%  { opacity: 0.85; }
  100% { transform: translate3d(var(--sway, 10px), -180px, 0); opacity: 0; }
}

/* ============================================================
   TINTE DE TEMPORADA + HAZ DE LUZ DE LA HORA
   ============================================================ */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  background: var(--time-beam, transparent), var(--season-tint, transparent);
}

/* ============================================================
   ACCESORIOS DE FECHAS SEÑALADAS
   ============================================================ */
.s-deco {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.deco { position: absolute; display: none; }

/* ============================================================
   GUIRNALDA DE TEMPORADA (siempre visible, cambia con el año)
   ============================================================ */
/* guirnalda de temporada: solo en fechas senaladas */
.s-season { display: none; }
body.is-halloween .s-season,
body.is-christmas .s-season,
body.is-newyear .s-season { display: block; }
.s-season {
  position: absolute;
  left: 18%;
  right: 16%;
  top: 2%;
  height: 26px;
  transition: opacity 300ms linear;
}
.s-season::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 2px solid rgba(246, 231, 200, 0.35);
}
.s-season i {
  position: absolute;
  top: 3px;
  width: 12px;
  height: 12px;
  background: var(--a1);
  animation: season-sway 3.2s steps(2, end) var(--dl, 0s) infinite;
}
@keyframes season-sway {
  50% { transform: translateY(3px) rotate(8deg); }
}
/* halloween: murcielagos en la guirnalda */
body.is-halloween .s-season i {
  background: #150a1e;
  border-radius: 0;
  clip-path: polygon(0 55%, 20% 0, 42% 50%, 50% 24%, 58% 50%, 80% 0, 100% 55%, 92% 100%, 62% 62%, 50% 100%, 38% 62%, 8% 100%);
  filter: drop-shadow(0 0 5px rgba(255, 138, 61, 0.5));
  animation: season-bat 4.8s ease-in-out var(--dl, 0s) infinite;
}
@keyframes season-bat {
  50% { transform: translateY(4px) scaleX(-1); }
}
/* navidad: bombillas */
body.is-christmas .s-season i {
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.9);
  animation: bulb-glow 2.4s steps(2, end) var(--dl, 0s) infinite;
}
body.is-christmas .s-season i:nth-child(2n) { background: #ffd23d; box-shadow: 0 0 10px rgba(255, 210, 61, 0.9); }
body.is-christmas .s-season i:nth-child(3n) { background: #38e8ff; box-shadow: 0 0 10px rgba(56, 232, 255, 0.9); }
body.is-christmas .s-season i:nth-child(4n) { background: #b6ff3b; box-shadow: 0 0 10px rgba(182, 255, 59, 0.9); }
body.is-christmas .s-season i:nth-child(5n) { background: #ff5fa2; box-shadow: 0 0 10px rgba(255, 95, 162, 0.9); }
/* año nuevo: banderines */
body.is-newyear .s-season i {
  background: #ffd23d;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: flag-sway 3.6s steps(2, end) var(--dl, 0s) infinite;
}
body.is-newyear .s-season i:nth-child(2n) { background: #38e8ff; animation-delay: -1.2s; }
body.is-newyear .s-season i:nth-child(3n) { background: #ff5fa2; animation-delay: -2.4s; }

body.is-halloween .deco--cobweb,
body.is-halloween .deco--bat,
body.is-halloween .deco--pumpkin,
body.is-christmas .deco--garland,
body.is-christmas .deco--wreath,
body.is-christmas .deco--gifts,
body.is-newyear .deco--bunting { display: block; }

/* Halloween: telarana en la esquina, murcielagos y calabaza */
.deco--cobweb {
  right: 0;
  top: 0;
  width: 122px;
  height: 104px;
  opacity: 0.6;
  background:
    radial-gradient(circle at 100% 0, transparent 0 32%, rgba(230, 240, 255, 0.55) 32% 34%, transparent 34% 55%, rgba(230, 240, 255, 0.45) 55% 56.5%, transparent 56.5%),
    repeating-linear-gradient(45deg, rgba(230, 240, 255, 0.42) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(-45deg, rgba(230, 240, 255, 0.42) 0 1px, transparent 1px 13px);
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 0 68%, transparent 70%);
  mask-image: radial-gradient(circle at 100% 0, #000 0 68%, transparent 70%);
}
.deco--bat {
  left: 30%;
  top: 13%;
  width: 26px;
  height: 12px;
  background: #150a1e;
  filter: drop-shadow(0 0 7px rgba(255, 138, 61, 0.55));
  clip-path: polygon(0 55%, 20% 0, 42% 50%, 50% 24%, 58% 50%, 80% 0, 100% 55%, 92% 100%, 62% 62%, 50% 100%, 38% 62%, 8% 100%);
  animation: bat-fly 18s linear infinite;
}
.deco--bat.b {
  top: 21%;
  width: 18px;
  height: 8px;
  animation-duration: 26s;
  animation-delay: -9s;
}
@keyframes bat-fly {
  0%   { transform: translate(0, 0) scaleX(1); }
  25%  { transform: translate(16vw, -16px) scaleX(1); }
  50%  { transform: translate(34vw, 8px) scaleX(-1); }
  75%  { transform: translate(16vw, -8px) scaleX(-1); }
  100% { transform: translate(0, 0) scaleX(1); }
}
.deco--pumpkin {
  left: 23%;
  bottom: 13%;
  width: 46px;
  height: 34px;
  border: 3px solid #120a14;
  border-radius: 46% 46% 42% 42% / 54% 54% 46% 46%;
  background:
    radial-gradient(ellipse 9px 26px at 50% 52%, rgba(0, 0, 0, 0.16), transparent 72%),
    linear-gradient(90deg, #d9621c 0 16%, #ff8a3d 16% 84%, #d9621c 84%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}
.deco--pumpkin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -11px;
  width: 8px;
  height: 10px;
  margin-left: -4px;
  background: #3f8f4a;
  border: 2px solid #120a14;
}
.deco--pumpkin::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 6px;
  height: 5px;
  background: #120a14;
  box-shadow: 14px 0 0 #120a14, 7px 9px 0 #120a14;
}

/* Navidad: guirnalda, corona y regalos */
.deco--garland {
  left: 5%;
  right: 5%;
  top: 2%;
  height: 30px;
}
.deco--garland::before {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom: 4px solid #2f7d3f;
  border-radius: 0 0 50% 50% / 0 0 110% 110%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.deco--garland i {
  position: absolute;
  width: 8px;
  height: 11px;
  border: 2px solid #120a14;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: bulb-glow 2.4s steps(2, end) infinite;
}
.deco--garland i:nth-child(1) { color: #ff4d4d; }
.deco--garland i:nth-child(2) { color: #ffd23d; animation-delay: -0.6s; }
.deco--garland i:nth-child(3) { color: #38e8ff; animation-delay: -1.2s; }
.deco--garland i:nth-child(4) { color: #b6ff3b; animation-delay: -1.8s; }
.deco--garland i:nth-child(5) { color: #ff5fa2; }
.deco--garland i:nth-child(6) { color: #ffd23d; animation-delay: -1.2s; }
.deco--garland i:nth-child(7) { color: #38e8ff; animation-delay: -0.6s; }
.deco--garland i:nth-child(8) { color: #ff4d4d; animation-delay: -1.8s; }
.deco--garland i:nth-child(9) { color: #b6ff3b; }
@keyframes bulb-glow {
  50% { opacity: 0.35; }
}
.deco--wreath {
  right: 29%;
  top: 9%;
  width: 58px;
  height: 58px;
  background:
    radial-gradient(circle at 30% 26%, #ff4d4d 0 4px, transparent 5px),
    radial-gradient(circle at 68% 34%, #ffd23d 0 4px, transparent 5px),
    radial-gradient(circle at 74% 66%, #38e8ff 0 4px, transparent 5px),
    radial-gradient(circle at 32% 72%, #ffd23d 0 4px, transparent 5px),
    radial-gradient(circle, transparent 0 43%, #357a41 43% 61%, #275c33 61% 100%);
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.4));
}
.deco--wreath::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 18px;
  height: 9px;
  margin-left: -9px;
  background: #ff4d4d;
  clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 55%, 50% 100%, 0 55%);
}
.deco--gifts {
  right: 27%;
  bottom: 33%;
  width: 74px;
  height: 34px;
}
.deco--gifts i {
  position: absolute;
  bottom: 0;
  border: 3px solid #120a14;
}
.deco--gifts i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  background: rgba(10, 8, 18, 0.45);
}
.deco--gifts i:nth-child(1) { left: 0; width: 30px; height: 24px; background: #ff4d4d; }
.deco--gifts i:nth-child(2) { left: 26px; width: 24px; height: 18px; background: #38e8ff; }
.deco--gifts i:nth-child(3) { left: 46px; width: 28px; height: 30px; background: #b6ff3b; }

/* Año Nuevo: banderines y confeti */
.deco--bunting {
  left: 4%;
  right: 4%;
  top: 2.5%;
  height: 26px;
  border-top: 3px solid rgba(246, 231, 200, 0.55);
}
.deco--bunting i {
  position: absolute;
  top: 0;
  width: 20px;
  height: 24px;
  background: #ffd23d;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: flag-sway 3.6s steps(2, end) infinite;
}
.deco--bunting i:nth-child(2n) { background: #38e8ff; animation-delay: -1.2s; }
.deco--bunting i:nth-child(3n) { background: #ff5fa2; animation-delay: -2.4s; }
@keyframes flag-sway {
  50% { transform: skewX(-6deg); }
}
.s-confetti {
  position: absolute;
  inset: 0;
  z-index: 33;
  display: none;
  overflow: hidden;
  pointer-events: none;
}
body.is-newyear .s-confetti { display: block; }
.s-confetti i {
  position: absolute;
  left: var(--x, 50%);
  top: -16px;
  width: 7px;
  height: 7px;
  background: var(--c, #ffd23d);
  animation: confetti-fall var(--d, 7s) linear var(--dl, 0s) infinite;
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  100% { transform: translate3d(var(--sway, 30px), 720px, 0) rotate(540deg); opacity: 0.9; }
}


/* biblioteca de juegos de mesa: mueble de cuerpo entero, apoyado en el suelo */
.s-games {
  position: absolute;
  right: 4.5%;
  bottom: 34%;
  width: clamp(140px, 13vw, 180px);
  z-index: 6;
}
.s-games__unit {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 9px 0;
  background: linear-gradient(180deg, #4a2c3a, #2a1822);
  border: 3px solid #120a14;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.045);
}
/* tapa superior del mueble */
.s-games__unit::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  top: -8px;
  height: 10px;
  background: linear-gradient(180deg, #69414f, #3a222c);
  border: 3px solid #120a14;
}
.s-games__row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 52px;
  padding: 0 2px;
}
/* balda alta: cajas grandes de canto, mas altas que el resto */
.s-games__row--tall { height: 66px; }
/* cajas de canto: lomo estrecho, alto y pegado al de al lado */
.s-games__row i {
  position: relative;
  display: block;
  flex: 0 1 auto;
  min-width: 6px;
  width: var(--w, 20px);
  height: var(--h, 40px);
  background: var(--bg, #ff5fa2);
  border: 2px solid #120a14;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.22), inset 0 -4px 0 rgba(0, 0, 0, 0.3);
}
/* banda inferior del lomo */
.s-games__row i::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 3px;
  background: rgba(10, 8, 18, 0.4);
}
.s-games__shelf {
  display: block;
  height: 7px;
  margin: 0 -5px;
  background: linear-gradient(180deg, #5a3746, #2a1720);
  border: 2px solid #120a14;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
/* zócalo: el mueble llega hasta el suelo */
.s-games__plinth {
  display: block;
  height: 18px;
  margin: 5px -9px 0;
  background: linear-gradient(180deg, #3a2029, #1b1016);
  border-top: 3px solid #120a14;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.05);
}

/* cuadro de la pareja */
.s-pic {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%);
  background: #100a1a;
  padding: 6px;
  border: 3px solid #6b4a86;
  box-shadow: 0 0 0 3px #120a1a, 0 8px 0 rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.s-pic img {
  display: block;
  width: clamp(70px, 7vw, 96px);
  height: auto;
  image-rendering: pixelated;
}

/* mesita auxiliar + lampara encima */
.s-side {
  position: absolute;
  left: 2.4%;
  bottom: 35%;
  width: 112px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.s-lamp { display: flex; flex-direction: column; align-items: center; }
.s-lamp .shade {
  width: 84px;
  height: 40px;
  background: linear-gradient(180deg, #ffe6b0, #ffab4a);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  box-shadow: 0 0 70px 22px rgba(255, 169, 74, 0.26);
}
.s-lamp .post {
  width: 6px;
  height: 42px;
  background: linear-gradient(90deg, #6b4453, #3a2330);
  box-shadow: 0 0 6px rgba(255, 190, 120, 0.35);
}
.s-lamp .base { width: 44px; height: 6px; background: #4a2c3a; }

.s-table {
  position: relative;
  width: 104px;
  height: 62px;
  margin-top: 2px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}
.s-table .top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  background: linear-gradient(180deg, #5a3a2a, #3a231a);
  border: 2px solid #160d0b;
}
.s-table .front {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 10px;
  height: 30px;
  background: linear-gradient(180deg, #432a1e, #2c1a13);
  border: 2px solid #160d0b;
}
.s-table .front::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: #c9a15a;
  box-shadow: 0 0 0 2px #160d0b;
}
.s-table .leg {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 22px;
  background: #241610;
  border: 2px solid #120a0a;
}
.s-table .leg.l { left: 8px; }
.s-table .leg.r { right: 8px; }

/* rascador de gatos en la esquina inferior izquierda */
.s-scratch {
  position: absolute;
  left: 1%;
  bottom: 5%;
  width: 76px;
  height: 176px;
  z-index: 5;
}
.s-scratch__base {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(180deg, #5a3a2a, #33201a);
  border: 3px solid #120a14;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.07), 0 5px 0 rgba(0, 0, 0, 0.4);
}
.s-scratch__post {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 20px;
  height: 146px;
  margin-left: -10px;
  background:
    repeating-linear-gradient(158deg, #d8b271 0 3px, #b4863f 3px 7px);
  border: 2px solid #120a14;
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.28), inset 4px 0 0 rgba(255, 255, 255, 0.14);
}
.s-scratch__top {
  position: absolute;
  left: 0;
  bottom: 154px;
  width: 100%;
  height: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, #6b4a86, #43265e);
  border: 3px solid #120a14;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.08);
}
.s-scratch__toy {
  position: absolute;
  left: 8px;
  bottom: 116px;
  width: 12px;
  height: 38px;
  transform-origin: 50% 0;
  animation: scratch-toy 3.6s steps(2, end) infinite;
}
.s-scratch__toy::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 26px;
  margin-left: -1px;
  background: #cbb9d6;
}
.s-scratch__toy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5fa2;
  border: 2px solid #120a14;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4);
}
@keyframes scratch-toy {
  50% { transform: rotate(9deg); }
}

/* sofa */
.s-sofa {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 36%;
  width: min(366px, 31%);
  height: 136px;
  z-index: 5;
}
.s-sofa .back {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 78px;
  background: linear-gradient(180deg, #4a2a63, #33194a);
  border: 3px solid #170d24;
}
.s-sofa .back::after {
  content: "";
  position: absolute;
  inset: 9px 11px;
  border: 2px solid rgba(200, 255, 61, 0.12);
}
.s-sofa .arm {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 96px;
  background: #41255a;
  border: 3px solid #170d24;
}
.s-sofa .arm.l { left: 0; }
.s-sofa .arm.r { right: 0; }
.s-sofa .seat {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 0;
  height: 40px;
  background: linear-gradient(180deg, #5a3474, #3a1e52);
  border: 3px solid #170d24;
}
.s-sofa .cu {
  position: absolute;
  bottom: 36px;
  height: 28px;
  width: calc(50% - 32px);
  background: #633c7f;
  border: 3px solid #170d24;
  box-shadow: 0 -2px 0 #7d4f9c inset;
}
.s-sofa .cu.a { left: 26px; }
.s-sofa .cu.b { right: 26px; }

/* recreativa: arrimada a la izquierda del sofa (se separa un poco del brazo) */
.s-arcade {
  position: absolute;
  left: calc(50% - min(183px, 15.5%) - 136px);
  right: auto;
  bottom: 36%;
  width: 118px;
  height: 200px;
  padding: 0;
  border: 0;
  background: none;
  z-index: 6;
  cursor: pointer;
  filter: drop-shadow(8px 8px 0 rgba(0, 0, 0, 0.45));
  transition: filter 0.2s;
}
.s-arcade:hover,
.s-arcade:focus-visible {
  filter: drop-shadow(0 0 16px rgba(56, 232, 255, 0.55)) drop-shadow(8px 8px 0 rgba(0, 0, 0, 0.45));
}
.s-arcade__cab {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(180deg, #2a1c46 0 24%, #1a1030 24% 100%);
  border: 3px solid #0d0818;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
}
.s-arcade__cab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: #120a20;
  border-top: 3px solid #0d0818;
}
.s-arcade__marquee {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #07060d;
  background: linear-gradient(180deg, #b6ff3b, #38e8ff);
  border: 2px solid #0d0818;
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.35);
}
.s-arcade__screen {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 40px;
  height: 64px;
  background: #05070c;
  border: 3px solid #0d0818;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
/* Pantalla apagada hasta insertar moneda */
.s-arcade__screen i { position: absolute; display: block; opacity: 0; animation-play-state: paused; }
.s-arcade__screen .a {
  left: 12%;
  top: 22%;
  width: 16px;
  height: 6px;
  background: #b6ff3b;
  box-shadow: 0 0 8px #b6ff3b;
  animation: arcade-a 1.7s steps(4, end) infinite;
}
.s-arcade__screen .b {
  left: 40%;
  top: 52%;
  width: 10px;
  height: 10px;
  background: #38e8ff;
  box-shadow: 0 0 8px #38e8ff;
  animation: arcade-b 2.3s steps(4, end) infinite;
}
.s-arcade__screen .c {
  right: 14%;
  top: 30%;
  width: 8px;
  height: 8px;
  background: #ff5fa2;
  box-shadow: 0 0 8px #ff5fa2;
  animation: arcade-c 1.3s steps(3, end) infinite;
}
@keyframes arcade-a { 50% { transform: translate(20px, 10px); } }
@keyframes arcade-b { 33% { transform: translate(-14px, -10px); } 66% { transform: translate(10px, 12px); } }
@keyframes arcade-c { 50% { transform: translate(-10px, 14px); } }

.s-arcade__panel {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 110px;
  height: 26px;
  background: linear-gradient(180deg, #3a2558, #241538);
  border: 2px solid #0d0818;
}
.s-arcade__panel .pstick {
  position: absolute;
  left: 12px;
  top: 4px;
  width: 5px;
  height: 16px;
  background: #0d0818;
}
.s-arcade__panel .pstick::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -7px;
  width: 15px;
  height: 9px;
  background: #ff5fa2;
  border: 2px solid #0d0818;
}
.s-arcade__panel .pbtn {
  position: absolute;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #0d0818;
}
.s-arcade__panel .pbtn.b { right: 26px; background: #38e8ff; }
.s-arcade__panel .pbtn.c { right: 10px; background: #ffd23d; }

.s-arcade__slot {
  position: absolute;
  left: 50%;
  top: 146px;
  width: 30px;
  height: 34px;
  margin-left: -15px;
  background: #120a1c;
  border: 2px solid #0d0818;
  box-shadow: inset 0 0 0 2px rgba(255, 210, 61, 0.1);
}
.s-arcade__slot i {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  background: #ffd23d;
  box-shadow: 0 0 8px rgba(255, 210, 61, 0.8);
}
.s-arcade.is-on .s-arcade__screen {
  background: #071018;
  box-shadow: inset 0 0 22px rgba(182, 255, 59, 0.55), 0 0 20px rgba(182, 255, 59, 0.45);
}
.s-arcade.is-on .s-arcade__screen i { opacity: 1; animation-play-state: running; }
.s-arcade.is-on .s-arcade__marquee { animation: pulse 1s steps(2, end) infinite; }

/* Fin de partida: la pantalla se queda en GAME OVER */
.s-arcade__over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #ff5fa2;
  text-shadow: 0 0 8px rgba(255, 95, 162, 0.85);
  opacity: 0;
  visibility: hidden;
}
.s-arcade.is-over .s-arcade__screen {
  background: #160711;
  box-shadow: inset 0 0 18px rgba(255, 95, 162, 0.3);
}
.s-arcade.is-over .s-arcade__over {
  opacity: 1;
  visibility: visible;
  animation: over-blink 1.1s steps(2, end) infinite;
}
@keyframes over-blink {
  50% { opacity: 0.3; }
}

/* moneda escondida */
.coin {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent url("assets/img/coin.png") center / contain no-repeat;
  z-index: 9;
  cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(255, 210, 61, 0.85));
  animation: coin-float 2.4s steps(2, end) infinite;
}
.coin::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 210, 61, 0.32);
  animation: coin-ring 1.8s ease-out infinite;
}
.coin:hover,
.coin:focus-visible {
  filter: drop-shadow(0 0 12px rgba(255, 250, 190, 0.95));
}
.coin.is-taken { animation: coin-take 0.38s steps(4, end) forwards; }
@keyframes coin-float { 50% { transform: translateY(-4px); } }
@keyframes coin-ring {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes coin-take {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-26px) scale(1.4); opacity: 0; }
}

.coin--0 { left: 6%; bottom: 44.4%; }
.coin--1 { left: 37%; bottom: 13%; }
.coin--2 { left: 61%; bottom: 41.8%; }
.coin--3 { right: 27%; bottom: 24%; }
.coin--4 { right: 12%; bottom: 86%; }
.coin--5 { left: 78%; bottom: 20%; }

/* contador de monedas dentro de la escena */
.stage__coins {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 32;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 8, 18, 0.8);
  border: 2px solid rgba(255, 210, 61, 0.55);
  padding: 5px 9px;
  color: #ffd23d;
  font-family: var(--font-pixel);
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}
.stage__coins[hidden] { display: none; }
.stage__coins img { width: 18px; height: 18px; }
.stage__coins b { font-family: var(--font-display); font-weight: 400; }

/* personajes */
.s-chars {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.char {
  position: absolute;
  pointer-events: auto;
  z-index: 8;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.4));
  transition: filter 0.15s, transform 0.12s steps(2, end);
}
.char::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 70%;
  height: 10px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  z-index: -1;
}
.char:hover { filter: drop-shadow(0 0 16px rgba(200, 255, 61, 0.75)); }
.char.is-on { filter: drop-shadow(0 0 20px rgba(200, 255, 61, 0.95)); }
.char:focus-visible { outline: 3px solid var(--c-lime); outline-offset: 6px; }

/* La hoja tiene 4 frames: solo cambia la posicion del fondo. */
.char__spr {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 400% 100%;
}

.char--human { width: 128px; height: 192px; }
.char--pet { width: 96px; height: 96px; }

/* ---- Ciclos de frames -----------------------------------------------------
   Frames: 0 neutral · 1 derecha · 2 parpadeo · 3 izquierda.
   Con background-size 400% las posiciones exactas son 0 / 33.3333 / 66.6667
   / 100 %. Se usa steps(1, end) para que cada pose se mantenga entera hasta el
   siguiente keyframe (sin mezclar dos frames a medias). */
@keyframes frames-a {
  0%   { background-position: 0 0; }
  20%  { background-position: 33.3333% 0; }
  40%  { background-position: 0 0; }
  58%  { background-position: 100% 0; }
  76%  { background-position: 0 0; }
  82%  { background-position: 66.6667% 0; }
  86%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}
@keyframes frames-b {
  0%   { background-position: 0 0; }
  16%  { background-position: 100% 0; }
  34%  { background-position: 0 0; }
  50%  { background-position: 66.6667% 0; }
  55%  { background-position: 0 0; }
  70%  { background-position: 33.3333% 0; }
  88%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}
@keyframes frames-c {
  0%   { background-position: 0 0; }
  26%  { background-position: 33.3333% 0; }
  54%  { background-position: 0 0; }
  70%  { background-position: 66.6667% 0; }
  78%  { background-position: 0 0; }
  88%  { background-position: 100% 0; }
  96%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}
@keyframes frames-d {
  0%   { background-position: 0 0; }
  18%  { background-position: 33.3333% 0; }
  36%  { background-position: 0 0; }
  52%  { background-position: 100% 0; }
  64%  { background-position: 0 0; }
  78%  { background-position: 66.6667% 0; }
  84%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}
@keyframes frames-e {
  0%   { background-position: 0 0; }
  12%  { background-position: 33.3333% 0; }
  22%  { background-position: 0 0; }
  32%  { background-position: 100% 0; }
  42%  { background-position: 0 0; }
  76%  { background-position: 66.6667% 0; }
  82%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}

/* Cada personaje: ciclo propio y desfase inicial. Los delays negativos
   arrancan la animacion a mitad de ciclo, asi que ninguno coincide con otro.
   Solo se anima el frame del sprite: el personaje no se eleva (no flota). */
.char--sergio .char__spr {
  animation: frames-a 7.2s steps(1, end) infinite;
  animation-delay: -1.4s;
}
.char--lidia .char__spr {
  animation: frames-b 8.6s steps(1, end) infinite;
  animation-delay: -3.9s;
}
.char--kyo .char__spr {
  animation: frames-c 5.4s steps(1, end) infinite;
  animation-delay: -0.9s;
}
.char--sora .char__spr {
  animation: frames-d 4.6s steps(1, end) infinite;
  animation-delay: -2.6s;
}
.char--michito .char__spr {
  animation: frames-e 3.6s steps(1, end) infinite;
  animation-delay: -0.6s;
}
.char--kimba .char__spr {
  animation: frames-c 3.2s steps(1, end) infinite;
  animation-delay: -1.7s;
}

.char.hop { animation: hop 0.5s steps(3, end) 1; }
@keyframes hop {
  0% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

.char--sergio { left: 13%; bottom: 35%; }
.char--lidia { right: 21%; bottom: 35%; }

/* ============================================================
   ACCESORIOS DE PERSONAJES SEGUN FECHAS ESPECIALES
   Medidos sobre el sprite y expresados en % del propio boton para
   que escalen con el responsive sin duplicar reglas:
   - humano 128x192: coronilla y 12-16 px (6-8 %), cara x 36..90
   - gato   96x96  : coronilla y 27 px (28 %), cuello y 48 px (50 %)
   ============================================================ */
.char__acc {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 2;
}

/* ---------- Humanos: caja del gorro ---------- */
body.is-halloween .char--human .char__acc,
body.is-christmas .char--human .char__acc,
body.is-newyear .char--human .char__acc {
  display: block;
  left: 50%;
  top: -12.5%;
  width: 66%;
  height: 23.5%;
  margin-left: -33%;
}
body.is-halloween .char--lidia .char__acc,
body.is-christmas .char--lidia .char__acc,
body.is-newyear .char--lidia .char__acc {
  top: -14.5%;
  width: 72%;
  margin-left: -36%;
}
/* el ala, comun a los tres gorros, se apoya en la coronilla */
body.is-halloween .char--human .char__acc::after,
body.is-christmas .char--human .char__acc::after,
body.is-newyear .char--human .char__acc::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 19%;
}
/* y el cucurucho arranca del ala hacia arriba */
body.is-halloween .char--human .char__acc::before,
body.is-christmas .char--human .char__acc::before,
body.is-newyear .char--human .char__acc::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 19%;
  width: 60%;
  height: 81%;
  margin-left: -30%;
}

/* Halloween: cucurucho de bruja con cinta lima */
body.is-halloween .char--human .char__acc::after {
  background: #241040;
  box-shadow: 0 2px 0 #0a0414, inset 0 2px 0 #4a2170;
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}
body.is-halloween .char--human .char__acc::before {
  background: linear-gradient(180deg, #3a1a5c 0 70%, #b6ff3b 70% 83%, #7a2bd6 83% 100%);
  clip-path: polygon(62% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 8px rgba(182, 255, 59, 0.25));
}

/* Navidad: gorro de Papa Noel con borla en la punta */
body.is-christmas .char--human .char__acc {
  background: radial-gradient(closest-side, #f6e7c8 96%, transparent 100%) 70% 0 / 16% 30% no-repeat;
}
body.is-christmas .char--human .char__acc::after {
  left: 8%;
  width: 84%;
  height: 22%;
  background: linear-gradient(180deg, #fffaf0, #e8d7b4);
  box-shadow: 0 2px 0 #b9a583;
  clip-path: polygon(0 0, 100% 0, 100% 52%, 90% 100%, 80% 58%, 70% 100%, 60% 58%, 50% 100%, 40% 58%, 30% 100%, 20% 58%, 10% 100%, 0 52%);
}
body.is-christmas .char--human .char__acc::before {
  background: linear-gradient(105deg, #ff4d4d 0 55%, #c92a2a 55%);
  clip-path: polygon(70% 0, 100% 100%, 0 100%);
}

/* Año Nuevo: cucurucho de fiesta rayado con estrella en la punta */
body.is-newyear .char--human .char__acc {
  background: radial-gradient(closest-side, #ffffff 90%, transparent 100%) 58% 0 / 14% 26% no-repeat;
}
body.is-newyear .char--human .char__acc::after {
  background: repeating-linear-gradient(90deg, #ffd23d 0 20%, #ff5fa2 20% 40%, #38e8ff 40% 60%, #b6ff3b 60% 80%, #ffd23d 80% 100%);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}
body.is-newyear .char--human .char__acc::before {
  background: repeating-linear-gradient(90deg, #ffd23d 0 22%, #ff5fa2 22% 44%, #38e8ff 44% 66%, #b6ff3b 66% 88%, #ffd23d 88% 100%);
  clip-path: polygon(58% 0, 100% 100%, 0 100%);
}

/* ---------- Gatos ---------- */
/* Halloween: cuernos pegados a la coronilla (y 23-39 px de 96) */
body.is-halloween .char--pet .char__acc {
  display: block;
  left: 50%;
  top: 24%;
  width: 50%;
  height: 17%;
  margin-left: -25%;
  animation: horn-bob 2.4s steps(2, end) infinite;
}
body.is-halloween .char--pet .char__acc::before,
body.is-halloween .char--pet .char__acc::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 26%;
  height: 100%;
  background: linear-gradient(90deg, #ffb066, #ff8a3d 60%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(2px 2px 0 #1a0a10) drop-shadow(0 0 5px rgba(255, 138, 61, 0.45));
}
body.is-halloween .char--pet .char__acc::before { left: 4%; }
body.is-halloween .char--pet .char__acc::after { right: 4%; }
@keyframes horn-bob {
  50% { transform: translateY(-2px); }
}

/* Navidad: collar con cascabel (pecho a y=60 px de 96) */
body.is-christmas .char--pet .char__acc {
  display: block;
  left: 50%;
  top: 62%;
  width: 58%;
  height: 6%;
  margin-left: -29%;
  background: #d92b2b;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 1px 0 #120a14;
}
body.is-christmas .char--pet .char__acc::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 20%;
  height: 160%;
  margin-left: -10%;
  border-radius: 50%;
  background: #ffd23d;
  border: 2px solid #120a14;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.55);
  transform-origin: 50% -40%;
  animation: bell-sway 1.9s steps(2, end) infinite;
}
@keyframes bell-sway {
  50% { transform: rotate(-10deg); }
}

/* Año Nuevo: mini gorro de fiesta sobre la coronilla (y 5-29 px de 96) */
body.is-newyear .char--pet .char__acc {
  display: block;
  left: 50%;
  top: 6%;
  width: 40%;
  height: 24%;
  margin-left: -20%;
  background: radial-gradient(closest-side, #ffffff 90%, transparent 100%) 55% 0 / 22% 34% no-repeat;
  transform-origin: 50% 100%;
  animation: hat-wobble 3.2s steps(2, end) infinite;
}
body.is-newyear .char--pet .char__acc::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 20%;
  background: repeating-linear-gradient(90deg, #ffd23d 0 20%, #ff5fa2 20% 40%, #38e8ff 40% 60%, #b6ff3b 60% 80%, #ffd23d 80% 100%);
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}
body.is-newyear .char--pet .char__acc::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 72%;
  height: 80%;
  margin-left: -36%;
  background: repeating-linear-gradient(90deg, #ffd23d 0 22%, #ff5fa2 22% 44%, #38e8ff 44% 66%, #b6ff3b 66% 88%, #ffd23d 88% 100%);
  clip-path: polygon(54% 0, 100% 100%, 0 100%);
}
@keyframes hat-wobble {
  50% { transform: rotate(-3deg); }
}

/* Los gatos se reparten al azar entre estos huecos en cada recarga.
   Estan separados lo suficiente (12% en escritorio) para no solaparse. */
.sp-0 { left: 26%; bottom: 19%; }
.sp-1 { left: 36%; bottom: 16%; }
.sp-2 { left: 48%; bottom: 20.5%; }
.sp-3 { left: 60%; bottom: 16.5%; }
.sp-4 { left: 72%; bottom: 20%; }
.sp-5 { left: 44%; bottom: 41.5%; }
.sp-6 { left: 56%; bottom: 41.5%; }
.sp-7 { left: 80%; bottom: 19%; }

.stage__hint {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 30;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  pointer-events: none;
}
.stage__hint b { color: var(--c-lime); animation: pulse 1.4s steps(2, end) infinite; }

/* dialogo */
.dialog {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(-50%, 16px);
  width: min(700px, 90%);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s steps(3, end), visibility 0.18s;
}
.dialog.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.dialog__box {
  position: relative;
  background: #0e0918;
  border: 3px solid var(--fg);
  box-shadow: 0 0 0 3px #0e0918, 8px 8px 0 rgba(0, 0, 0, 0.55);
  padding: 20px 22px 30px;
}
.dialog__name {
  position: absolute;
  top: -14px;
  left: 16px;
  background: var(--c-lime);
  color: #07060d;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 2px solid #07060d;
}
.dialog__role {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-orange);
  margin: 2px 0 9px;
}
.dialog__text {
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-cream);
  margin: 0;
  min-height: 3.2em;
}
.dialog__socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed rgba(234, 242, 255, 0.16);
}
.dialog__socials[hidden] { display: none; }
.dialog__socials-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.social {
  font-family: var(--font-pixel);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-cyan);
  text-decoration: none;
  border: 1px solid rgba(56, 232, 255, 0.35);
  padding: 3px 7px;
  transition: border-color 0.15s, background 0.15s;
}
.social:hover {
  border-color: var(--c-cyan);
  background: rgba(56, 232, 255, 0.1);
}
.dialog__close {
  position: absolute;
  right: -10px;
  top: -10px;
  width: 28px;
  height: 28px;
  background: var(--c-pink);
  color: #07060d;
  border: 2px solid #07060d;
  font-family: var(--font-pixel);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.dialog__more {
  position: absolute;
  right: 16px;
  bottom: 8px;
  background: transparent;
  border: 0;
  color: var(--c-lime);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  animation: pulse 1s steps(2, end) infinite;
}
.dialog__more[hidden] { display: none; }

/* Con el dialogo abierto, el resto de la escena invita a avanzar */
.stage.is-talking { cursor: pointer; }

/* ============================================================
   PROYECTOS
   ============================================================ */
.projs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.proj {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.proj:hover {
  border-color: rgba(51, 225, 255, 0.55);
  border-color: color-mix(in srgb, var(--c-cyan) 55%, transparent);
  background: rgba(51, 225, 255, 0.05);
  background: color-mix(in srgb, var(--c-cyan) 5%, transparent);
}
.proj--link { color: inherit; text-decoration: none; cursor: pointer; }
.proj--link:hover .proj__cta { color: var(--c-lime); text-decoration: underline; }

.proj__num {
  font-size: 44px;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(234, 242, 255, 0.22);
}

.proj h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proj p { margin: 0; color: var(--fg-dim); font-size: 14.5px; line-height: 1.6; flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-cyan);
  border: 1px solid rgba(51, 225, 255, 0.35);
  border: 1px solid color-mix(in srgb, var(--c-cyan) 35%, transparent);
  padding: 4px 8px;
}

.proj__cta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-family: var(--font-pixel);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cyan);
}
.proj__cta i { font-style: normal; transition: transform 0.15s; }
.proj--link:hover .proj__cta i { transform: translateX(4px); }

/* ============================================================
   CONTACTO
   ============================================================ */
.form {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 26px;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.35);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form__row { display: flex; flex-direction: column; gap: 8px; }
.form__row--full { grid-column: 1 / -1; }

.form__row > span {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.form input,
.form textarea {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--fg);
  background: #0b0916;
  border: 2px solid var(--line);
  padding: 12px 14px;
  width: 100%;
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form textarea { resize: vertical; min-height: 116px; }

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--c-lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 61, 0.15);
}

.form.is-invalid input:invalid,
.form.is-invalid textarea:invalid { border-color: var(--c-red); }

.form__foot { display: flex; justify-content: flex-end; margin-top: 20px; }

/* ============================================================
   FOOTER + TOAST
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 34px 0 50px;
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 9500;
  max-width: min(520px, 90vw);
  background: var(--c-lime);
  color: #07060d;
  border: 3px solid #07060d;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  padding: 12px 18px;
  font-family: var(--font-pixel);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s steps(3, end), visibility 0.18s;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Cheat mode (Konami) */
body.is-easteregg .stage {
  border-color: var(--c-pink);
  box-shadow: 14px 14px 0 var(--c-pink);
}
body.is-easteregg .char {
  filter: hue-rotate(140deg) drop-shadow(0 0 16px var(--c-pink));
}
body.is-easteregg .grain { opacity: 0.1; }

/* ============================================================
   PANEL DE PRUEBAS (?debug=1)
   ============================================================ */
.debug {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 9300;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: rgba(8, 6, 16, 0.97);
  border: 2px solid var(--c-lime);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--fg);
  padding: 10px 12px 12px;
}
.debug[hidden] { display: none; }
.debug__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--c-lime);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.debug__close {
  width: 22px;
  height: 22px;
  background: var(--c-pink);
  color: #07060d;
  border: 2px solid #07060d;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.debug__row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 6px;
  align-items: start;
  margin-top: 8px;
}
.debug__key {
  color: var(--fg-dim);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 4px;
}
.debug__opts { display: flex; flex-wrap: wrap; gap: 4px; }
.debug__btn {
  font: inherit;
  font-size: 10.5px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  padding: 3px 6px;
  cursor: pointer;
}
.debug__btn:hover { color: var(--fg); border-color: var(--fg); }
.debug__btn.is-on { background: var(--c-lime); color: #07060d; border-color: var(--c-lime); }
.debug__btn--act { color: var(--c-cyan); border-color: rgba(56, 232, 255, 0.4); }
.debug__hint {
  margin: 10px 0 0;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--fg-dim);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .projs { grid-template-columns: 1fr; }
  .char--human { width: 112px; height: 168px; }
  .char--pet { width: 88px; height: 88px; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 50px; padding-bottom: 56px; }
  .art { order: -1; }
  nav.main { display: none; }
  .sec__head { flex-direction: column; align-items: flex-start; }
  .sec__desc { text-align: left; max-width: 52ch; }
  .stats { flex-wrap: wrap; }
  .stat { flex: 1 0 50%; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-right: 0; }
  .stage { height: 600px; }
  .s-games, .s-side { display: none; }
  .char--human { width: 96px; height: 144px; }
  .char--pet { width: 64px; height: 64px; }
  .char--sergio { left: 7%; }
  .char--lidia { right: 7%; }
  .s-pic { top: 4%; }
  .coin--4 { left: 10%; right: auto; bottom: 65.5%; }
  .form__grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .top__in { padding: 12px 18px; gap: 10px; }
  .logo { gap: 8px; }
  .logo__mark { width: 30px; height: 30px; }
  .logo__mark svg { width: 19px; height: 16px; }
  .logo__first { font-size: 8px; letter-spacing: 0.26em; }
  .logo__name { font-size: 13px; }
  .status { display: none; }
  .clock { font-size: 9.5px; padding: 3px 5px; }
  .coins { font-size: 11px; padding: 2px 5px; }
  .coins img { width: 13px; height: 13px; }
  .top__tools { margin-left: auto; gap: 8px; }
  h1.title { font-size: clamp(1.95rem, 9.4vw, 3.1rem); }
  .stat b { font-size: 22px; }
  .section { padding: 64px 0; }
  .section--tight { padding-top: 0; }
  .stage { height: 640px; }
  .s-pic { display: none; }

  .s-scratch { left: 0.5%; bottom: 4.5%; width: 58px; height: 150px; }
  .s-scratch__base { height: 16px; border-width: 2px; }
  .s-scratch__post { bottom: 13px; width: 16px; height: 118px; margin-left: -8px; border-width: 2px; }
  .s-scratch__top { bottom: 125px; height: 13px; border-width: 2px; }
  .s-scratch__toy { left: 6px; bottom: 94px; width: 10px; height: 31px; }
  .s-scratch__toy::before { height: 21px; }
  .s-scratch__toy::after { width: 10px; height: 10px; }

  /* En el movil la escena es muy estrecha: el hueco izquierdo es de Sergio,
     asi que la recreativa se queda a la derecha del sofa. */
  .s-arcade { width: 62px; height: 108px; left: auto; right: 0.5%; bottom: 34%; }
  .s-arcade__over { font-size: 6px; letter-spacing: 0.04em; }
  .s-arcade__marquee {
    left: 4px; right: 4px; top: 4px; height: 14px;
    font-size: 6px; letter-spacing: 0.08em; border-width: 1px;
  }
  .s-arcade__screen { left: 5px; right: 5px; top: 21px; height: 32px; border-width: 2px; }
  .s-arcade__panel { left: 3px; right: 3px; top: 56px; height: 15px; border-width: 1px; }
  .s-arcade__panel .pstick { left: 6px; top: 2px; width: 4px; height: 10px; }
  .s-arcade__panel .pstick::before { left: -3px; top: -4px; width: 9px; height: 6px; border-width: 1px; }
  .s-arcade__panel .pbtn { top: 3px; width: 6px; height: 6px; border-width: 1px; }
  .s-arcade__panel .pbtn.b { right: 14px; }
  .s-arcade__panel .pbtn.c { right: 6px; }
  .s-arcade__slot { top: 74px; width: 18px; height: 20px; margin-left: -9px; border-width: 1px; }
  .s-arcade__slot i { top: 5px; height: 10px; }
  .s-arcade__cab::after { height: 9px; }

  .coin { width: 18px; height: 18px; }
  .coin--0 { left: 50%; bottom: 62%; }
  .coin--1 { left: 70%; bottom: 72%; }
  .coin--2 { left: 88%; bottom: 60%; }
  .coin--3 { left: 38%; bottom: 68%; }
  .coin--4 { left: 12%; bottom: 58%; }
  .coin--5 { left: 60%; bottom: 84%; }

  .s-sofa { width: 46%; height: 120px; }
  .s-sofa .back { height: 66px; }
  .s-sofa .arm { height: 84px; width: 20px; }
  .s-sofa .seat { height: 36px; }
  .s-sofa .cu { height: 24px; bottom: 32px; width: calc(50% - 28px); }
  .s-sofa .cu.a { left: 22px; }
  .s-sofa .cu.b { right: 22px; }

  .char--sergio { left: 2%; bottom: 34%; }
  .char--lidia { right: 20%; bottom: 34%; }
  .sp-0 { left: 1%; bottom: 19%; }
  .sp-1 { left: 19%; bottom: 16%; }
  .sp-2 { left: 37%; bottom: 20%; }
  .sp-3 { left: 55%; bottom: 16.5%; }
  .sp-4 { left: 73%; bottom: 20%; }
  .sp-5 { left: 30%; bottom: 40%; }
  .sp-6 { left: 46%; bottom: 40%; }
  .sp-7 { left: 20%; bottom: 30.5%; }

  .stage__hint { display: none; }
  .stage__coins { top: 10px; right: 10px; bottom: auto; font-size: 13px; padding: 4px 7px; }
  .stage__coins img { width: 15px; height: 15px; }
  .dialog { width: 94%; bottom: 10px; }
  .dialog__box { padding: 17px 16px 28px; }
  .dialog__text { font-size: 15px; min-height: 3.4em; }
  .dialog__role { font-size: 10px; }
  .dialog__socials { gap: 5px; margin-top: 10px; padding-top: 9px; }
  .social { font-size: 9.5px; padding: 2px 5px; }
  .proj { padding: 22px 20px; }
  .form { padding: 20px; }
  .form__foot { justify-content: stretch; }
  .form__foot .btn { width: 100%; justify-content: center; }
  .footer { padding: 28px 0 40px; }
  .toast { font-size: 12px; bottom: 16px; }
  .debug { left: 8px; bottom: 8px; width: calc(100vw - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
