/* Intro: Vanimechi 2005 se reconstruye en 2026 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; background: #0F2E52; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #FFB000; outline-offset: 2px; }

/* ---------- HUD moderno ---------- */
.hud { position: fixed; top: 12px; right: 12px; z-index: 50; }
.hud__skip {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: .5rem 1rem;
  border-radius: 999px; background: rgba(16,14,12,.82); color: #F2EDE3; text-decoration: none;
  font: 600 .88rem/1 "Bricolage Grotesque", system-ui, sans-serif; backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: background-color .2s;
}
.hud__skip:hover { background: #E94F37; }
.hud__skip kbd { font: .7rem ui-monospace, monospace; border: 1px solid currentColor; border-radius: 4px; padding: .1rem .35rem; opacity: .75; }

/* ---------- 2005 ---------- */
.old {
  position: fixed; inset: 0; z-index: 20; overflow: auto; padding-bottom: 26px;
  background: #E3E8F1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='%23d5dce9'/%3E%3C/svg%3E");
  font: 11px/1.35 Verdana, Tahoma, Arial, sans-serif; color: #111;
}
.old a { color: #0033CC; }
.old a:visited { color: #551A8B; }
.old a:hover { color: #FF0000; }
.old__page { width: 780px; margin: 0 auto; background: #F4F6FA; border: 1px solid #7088B0; border-top: 0; transform-origin: top center; }
.o-top__strip { background: #000; color: #9EC1FF; font-size: 10px; text-align: center; padding: 2px; letter-spacing: 1px; }
.o-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px;
  background: linear-gradient(180deg, #0A2A8A, #001A66 60%, #000C3A); border-bottom: 3px solid #FFCC00; }
.o-logo { font: italic bold 34px/1 "Comic Sans MS", "Trebuchet MS", cursive; color: #fff; letter-spacing: -1px;
  text-shadow: 2px 2px 0 #FF3399, 4px 4px 0 #000; }
.o-logo small { font-size: 14px; color: #FFCC00; text-shadow: 1px 1px 0 #000; }
.o-banner__ad { width: 468px; max-width: 60%; height: 60px; display: grid; place-items: center; border: 1px dashed #7FA2FF; color: #7FA2FF; background: #000A2E; font-size: 10px; }
.o-marquee { overflow: hidden; white-space: nowrap; background: #003399; color: #fff; font-weight: bold; padding: 3px 0; border-bottom: 1px solid #000; }
.o-marquee span { display: inline-block; padding-left: 100%; animation: o-marq 22s linear infinite; }
@keyframes o-marq { to { transform: translateX(-100%); } }

.o-cols { display: grid; grid-template-columns: 150px 1fr 160px; gap: 6px; padding: 6px; }
.o-col { display: flex; flex-direction: column; gap: 6px; }
.o-box { background: #D7DEEA; border: 1px solid #8796B0; padding: 0 0 6px; }
.o-box > :not(.o-box__h) { margin-inline: 7px; }
.o-box p { margin: 6px 7px; }
.o-box__h { margin: 0 0 5px; padding: 3px 6px; font: bold 11px Verdana, sans-serif; color: #fff;
  background: linear-gradient(180deg, #4A6FC9, #1E3F99); border-bottom: 1px solid #0B215E; }
.o-box--center { text-align: center; background: #E9EDF5; }
.o-title { font: bold 13px "Times New Roman", serif; margin: 8px 0 2px; }
.o-welcome { font: bold 12px "Times New Roman", serif; }
.o-red { color: #E00000; font-weight: bold; }
.o-center { text-align: center; }
.o-small { font-size: 10px; }
.o-menu { list-style: square; padding-left: 18px; margin: 0; }
.o-menu li { margin: 1px 0; }
.o-news { margin: 0; padding-left: 18px; }
.o-news li { margin: 3px 0; }
.o-new { color: #fff; background: #FF0000; font-size: 9px; font-weight: bold; padding: 0 3px; animation: o-blink 1s steps(1) infinite; }
@keyframes o-blink { 50% { visibility: hidden; } }
.o-btn { font: 11px Tahoma, sans-serif; padding: 2px 10px; background: linear-gradient(#FFFFFF, #ECE9D8); border: 1px solid #003C74; border-radius: 3px; cursor: pointer; color: #000; }
.o-btn:active { background: #DDD; }
.o-radio { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.o-radio__st { font-size: 10px; color: #333; }
.o-counter { font: bold 12px "Courier New", monospace; background: #000; color: #33FF33; padding: 0 3px; letter-spacing: 1px; }
.o-poll { border: 0; margin: 0; padding: 0; }
.o-poll legend { font-weight: bold; padding: 0 7px; margin-bottom: 4px; }
.o-poll label { display: flex; gap: 4px; align-items: flex-start; margin: 2px 7px; cursor: pointer; }
.o-poll input { margin: 1px 0 0; }
.o-results { font-size: 10px; }
.o-results div { margin: 3px 0; }
.o-results i { display: block; height: 7px; background: linear-gradient(90deg, #FF3399, #FFCC00); border: 1px solid #333; }
.o-aff { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.o-aff span { width: 88px; height: 31px; display: grid; place-items: center; font: bold 11px Impact, sans-serif; letter-spacing: 2px; color: #fff; background: linear-gradient(135deg, #222, #555); border: 1px solid #000; }
.o-aff span:nth-child(2) { background: linear-gradient(135deg, #990066, #FF3399); }
.o-aff span:nth-child(3) { background: linear-gradient(135deg, #003399, #3399FF); }
.o-foot { text-align: center; font-size: 10px; color: #333; padding: 4px 6px 10px; border-top: 1px solid #8796B0; }

.o-status { position: fixed; left: 0; right: 0; bottom: 0; height: 24px; display: flex; align-items: center; gap: 8px; padding: 0 6px;
  background: #ECE9D8; border-top: 1px solid #ACA899; font: 11px Tahoma, sans-serif; color: #000; z-index: 2; }
.o-status__icon { width: 14px; height: 14px; display: grid; place-items: center; font: bold italic 12px Georgia, serif; color: #1E62D0; }
.o-status__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-status__bar { width: 150px; height: 13px; border: 1px solid #7F9DB9; background: #fff; padding: 1px; display: flex; }
.o-status__bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #2FB23A 0 7px, transparent 7px 9px); }
.o-status__zone { padding-left: 8px; border-left: 1px solid #ACA899; }

.o-dialog { position: fixed; left: 50%; top: 42%; translate: -50% -50%; width: min(360px, 90vw); z-index: 5;
  background: #ECE9D8; border: 1px solid #0831D9; border-radius: 7px 7px 0 0; box-shadow: 4px 4px 14px rgba(0,0,0,.45); font: 11px Tahoma, sans-serif; }
.o-dialog[hidden] { display: none; }
.o-dialog__title { display: flex; justify-content: space-between; padding: 5px 8px; color: #fff; font-weight: bold; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #0A5FD8, #0842A8); }
.o-dialog__title span { width: 18px; height: 18px; display: grid; place-items: center; background: #E0411F; border: 1px solid #fff; border-radius: 3px; font-size: 10px; }
.o-dialog__body { display: flex; gap: 12px; align-items: center; padding: 16px; }
.o-dialog__body p { margin: 0; }
.o-dialog__icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #E0411F; color: #fff; font: bold 20px Arial; }

/* Ventanas de error, chat y pantallazo azul */
.o-win { position: fixed; z-index: 6; width: min(320px, 86vw); }
.o-win--big { width: min(440px, 90vw); z-index: 7; font-size: 13px; }
.o-win--big .o-dialog__body { padding: 20px 18px 16px; font-size: 14px; line-height: 1.45; }
.o-win--big .o-dialog__icon { width: 40px; height: 40px; font-size: 24px; }
.o-dialog__icon.is-info { background: #1E62D0; font-family: Georgia, serif; font-style: italic; }
.o-dialog__btns { margin: 10px 0 0 !important; text-align: right; }
.o-dialog__btns .o-btn { display: inline-block; }
.o-btn.is-pressed { background: #CFCAB8; box-shadow: inset 1px 1px 2px rgba(0,0,0,.4); }
.o-chat { position: fixed; z-index: 8; width: min(300px, 86vw); background: #fff; border: 1px solid #0831D9; border-radius: 7px 7px 0 0; box-shadow: 4px 4px 14px rgba(0,0,0,.45); font: 11px Tahoma, sans-serif; }
.o-chat .o-dialog__title { background: linear-gradient(180deg, #3A8D2E, #1F6B17); display: flex; justify-content: space-between; padding: 5px 8px; color: #fff; font-weight: bold; border-radius: 6px 6px 0 0; }
.o-chat .o-dialog__title span { width: 18px; height: 18px; display: grid; place-items: center; background: #E0411F; border: 1px solid #fff; border-radius: 3px; font-size: 10px; }
.o-chat__log { list-style: none; margin: 0; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.o-chat__log b { color: #1E3F99; }
.o-chat__log i { color: #C00; }
.bsod { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #0000AA; color: #fff; padding: 24px; transform-origin: center; }
.bsod pre { margin: 0; white-space: pre-wrap; font: 15px/1.45 "Lucida Console", "Courier New", monospace; max-width: 72ch; }
@media (max-width: 600px) { .bsod pre { font-size: 11px; } }

/* Falla de CRT antes del derrumbe */
.old.is-glitch .old__page, .old.is-glitch .o-win, .old.is-glitch .o-chat { animation: o-glitch .5s steps(2) 2; }
@keyframes o-glitch {
  0% { filter: none; transform: none; }
  20% { filter: hue-rotate(90deg) contrast(1.6); transform: translate(-6px, 2px) skewX(-4deg); }
  40% { filter: contrast(1.8) brightness(.8) hue-rotate(180deg); transform: translate(5px, -3px); }
  60% { filter: saturate(3) hue-rotate(-60deg); transform: translate(-3px, 0) scaleY(1.02); }
  80% { filter: grayscale(1) contrast(2); transform: translate(2px, 3px); }
  100% { filter: none; transform: none; }
}
.old.is-falling { background: transparent; transition: background-color .9s .3s; overflow: hidden; }

/* ---------- Movimiento reducido ---------- */
.still { position: fixed; left: 50%; bottom: 40px; translate: -50% 0; z-index: 30; width: min(560px, calc(100vw - 24px));
  display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.2rem;
  background: #16130F; color: #F2EDE3; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.35);
  font: 500 .95rem/1.4 "Bricolage Grotesque", system-ui, sans-serif; }
.still[hidden] { display: none; }
.still p { margin: 0; flex: 1 1 260px; }
.still__btn { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; background: #E94F37; color: #16130F; font-weight: 700; text-decoration: none; }

/* ---------- Reconstrucción ---------- */
.build { position: fixed; inset: 0; z-index: 10; }
.build iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.build__svg, .build__scans { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.build__svg rect { fill: rgba(120, 200, 255, .05); stroke: #8FD3FF; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.build__svg text { fill: #8FD3FF; font: 600 10px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; }
.build__svg line { stroke: rgba(143, 211, 255, .45); stroke-width: 1; stroke-dasharray: 3 4; }
.scan { position: absolute; pointer-events: none; background: linear-gradient(90deg, transparent, #FFF7D6 45%, #FF6F91 55%, transparent); mix-blend-mode: screen; filter: blur(.3px); box-shadow: 0 0 18px 4px rgba(255, 111, 145, .55); }
.scan--y { background: linear-gradient(180deg, transparent, #FFF7D6 45%, #2EC4B6 55%, transparent); box-shadow: 0 0 18px 4px rgba(46, 196, 182, .55); }
.build__year { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  font: 800 clamp(6rem, 22vw, 20rem)/1 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.06em; font-variant-numeric: tabular-nums;
  color: transparent; -webkit-text-stroke: 2px rgba(143, 211, 255, .8); }
.build__log { position: absolute; left: 16px; bottom: 14px; margin: 0; padding: 10px 14px; list-style: none; pointer-events: none;
  font: 500 12px/1.6 "JetBrains Mono", ui-monospace, monospace; color: #BFE6FF; background: rgba(8, 26, 48, .72);
  border: 1px solid rgba(143, 211, 255, .35); border-radius: 8px; backdrop-filter: blur(6px); opacity: 0; max-width: calc(100vw - 32px); }
.build__log li::before { content: "› "; color: #FF6F91; }
.build__log li.ok::before { content: "✓ "; color: #9BE564; }
.build.is-done .build__svg, .build.is-done .build__scans { opacity: 0; transition: opacity .6s; }

@media (prefers-reduced-motion: reduce) {
  .o-marquee span, .o-new { animation: none; padding-left: 0; }
}

.build__flash { position: absolute; inset: 0; background: #FFF7D6; pointer-events: none; mix-blend-mode: screen; }
.build__ring { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 2px solid #8FD3FF; box-shadow: 0 0 24px #8FD3FF, inset 0 0 18px rgba(255,111,145,.6); pointer-events: none; }

[hidden] { display: none !important; }

/* Tablet y móvil: «Saltar intro» abajo al centro, lejos del menú del sitio. */
@media (max-width: 1100px), (pointer: coarse) {
  .hud { top: auto; right: auto; left: 50%; translate: -50% 0; bottom: calc(34px + env(safe-area-inset-bottom, 0px)); }
  .hud__skip kbd { display: none; }
  .build__log { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); backdrop-filter: none; background: rgba(8, 26, 48, .9); }
  .still { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 700px) {
  .build__log { font-size: 11px; }
}
