:root {
  --purple: #A45CFF;
  --lime: #D4FF00;
  --pink: #FF4DCC;
  --cyan: #4DE3FF;
  --green: #2FE85A;
  --ink: #141414;
  --paper: #F6F5EF;
  --orange: #FF7A45;
  --sky: #7EC8F7;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Silkscreen', monospace;
  background: #FFE9F4;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--lime);
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 26px;
  width: auto;
  display: block;
  filter: drop-shadow(2px 2px 0 rgba(20, 20, 20, .4));
}

.nav { display: flex; gap: 22px; }

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  padding: 2px 6px;
}

.nav a:hover { background: var(--ink); color: var(--lime); }

.btn-enter {
  background: var(--pink);
  color: var(--ink);
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-enter:active { transform: translate(3px, 3px); box-shadow: none; }

@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .logo img { height: 20px; }
  .nav { gap: 6px; }
  .nav a { font-size: 9px; padding: 2px 3px; }
  .btn-enter { padding: 4px 10px; font-size: 10px; border-width: 2px; }
  .hero { gap: 14px; padding: 16px 10px 56px; }
  .hero-logo { width: min(560px, 90vw); max-width: 100%; }
  .chars { gap: 12px; }
  .char { width: 112px; padding: 8px 6px 8px; border-radius: 12px; }
}

/* ---------- hero ---------- */
main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 16px 60px;
}

.hero {
  position: relative;
  min-height: calc(100svh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  background: url('personajes/fondo_general.png') center / cover no-repeat #FFE9F4;
  padding: 24px 16px 64px;
}

.hero-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: min(1040px, 96vw);
  height: auto;
  margin-top: 6px;
  animation: heroFloat 4.5s ease-in-out infinite;
  filter:
    drop-shadow(0 0 30px rgba(255, 77, 204, .6))
    drop-shadow(0 8px 0 rgba(20, 20, 20, .3));
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.insert-coin {
  position: relative;
  color: var(--paper);
  background: rgba(20, 20, 20, .68);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, .35);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px 22px;
  margin: 0;
}

.scroll-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink);
  background: rgba(255, 255, 255, .75);
  border: 2px solid var(--ink);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  animation: hintBounce 1.6s ease-in-out infinite;
}

@keyframes hintBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ---------- juego dentro del hero ---------- */
.cabinet {
  width: min(920px, 96vw);
  position: relative;
  z-index: 1;
}

.screen {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 rgba(20, 20, 20, .25);
  overflow: hidden;
  background: var(--sky);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: transparent;
  touch-action: none;
}

.sound {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}

.sound:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 10px;
  background: rgba(20, 20, 20, .18);
}

.hidden { display: none !important; }

.o-title {
  font-size: clamp(22px, 4.5vw, 34px);
  color: var(--pink);
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink),
    0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    5px 5px 0 rgba(20, 20, 20, .4);
}

.o-title.small { color: var(--lime); }

.o-score {
  color: var(--lime);
  font-size: clamp(12px, 2.4vw, 16px);
  text-shadow:
    2px 0 0 var(--ink), -2px 0 0 var(--ink),
    0 2px 0 var(--ink), 0 -2px 0 var(--ink);
}

.o-hint {
  color: var(--paper);
  font-size: 11px;
  text-shadow: 2px 2px 0 var(--ink);
}

.btn-replay {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  background: var(--lime);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 10px 26px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-replay:active { transform: translate(4px, 4px); box-shadow: none; }

.o-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.btn-alt { background: var(--paper); }

/* ---------- seleccion de personaje ---------- */
.chars { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }

.char {
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 132px;
  padding: 12px 10px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.char:hover, .char.kb-focus {
  background: var(--lime);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.char:active { transform: translate(4px, 4px); box-shadow: none; }

.char img, .avatar-fb {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  border: 3px solid var(--ink);
  object-fit: cover;
  background: #DDE1E6;
  image-rendering: pixelated;
}

.avatar-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  background: var(--cyan);
}

.cname { font-size: 11px; font-weight: 700; color: var(--ink); }

.blink { animation: blink 1.1s steps(2, start) infinite; }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- footer ---------- */
.howto {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(20, 20, 20, .12);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .08);
  font-size: 12px;
  text-align: center;
  max-width: 660px;
  line-height: 1.8;
  padding: 12px 20px;
}

.howto span { color: #D63384; }

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgba(20, 20, 20, .75);
  font-size: 10px;
  padding: 18px;
}

/* ============ BIO + MERCH (landing retro-OS) ============ */
.bio-section, .merch-section {
  position: relative;
  background:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(160deg, #7c3aed 0%, #a855f7 35%, #ec4899 100%);
  background-size: 64px 64px, 64px 64px, cover;
  border-top: 3px solid var(--ink);
  padding: 84px 20px 96px;
  overflow: hidden;
}

/* la BIO ocupa toda la pantalla, como el home */
.bio-section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 20px 84px;
}

/* FX flotantes de la bio (detras de las ventanas y los stickers) */
.bio-fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.bio-wrap {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  width: 100%;
  max-width: 1180px;
  align-items: stretch;
}

/* ventana de SO */
.os-window {
  position: relative;
  z-index: 3;
  max-width: 1060px;
  margin: 0 auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 rgba(20, 20, 20, .35);
}
.os-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--purple);
  color: #fff;
  border-bottom: 3px solid var(--ink);
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 1px;
}
.os-buttons { display: inline-flex; gap: 6px; }
.os-buttons i {
  width: 12px; height: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  position: relative;
  display: inline-block;
}
.os-buttons .b1::after { content: "_"; position: absolute; inset: -4px 0 0 1px; color: var(--ink); font-size: 10px; line-height: 12px; }
.os-buttons .b2::after { content: "▢"; position: absolute; inset: -3px 0 0 0; color: var(--ink); font-size: 8px; line-height: 12px; text-align: center; }
.os-buttons .b3::after { content: "✕"; position: absolute; inset: -3px 0 0 0; color: var(--ink); font-size: 9px; line-height: 12px; text-align: center; }
.os-body { padding: 30px 30px 36px; }

/* ventana de spotify */
.tbar-green { background: #1DB954; }
.tbar-yellow { background: #FFD400; color: var(--ink); }

.spotify-window {
  display: flex;
  flex-direction: column;
}

.spotify-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #FFD400;
}

/* reproductor estándar de spotify, enmarcado como app retro */
.sp-frame {
  flex: 1 1 auto;
  display: flex;
  min-height: 352px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
  background: #fff;
}
.sp-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.sp-caption {
  margin: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink);
  opacity: .75;
}

.bio-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 30px;
  align-items: center;
}
.bio-title {
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.12;
  margin: 0 0 18px;
  color: var(--ink);
}
.bio-copy p {
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 12px;
  color: rgba(20, 20, 20, .82);
}
.bio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.bio-stats .stat {
  border: 2px solid var(--ink);
  padding: 10px 6px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
}
.bio-stats .stat:nth-child(1) { background: var(--lime); }
.bio-stats .stat:nth-child(2) { background: var(--cyan); }
.bio-stats .stat:nth-child(3) { background: var(--pink); }
.bio-stats .stat:nth-child(4) { background: var(--paper); }
.bio-stats .stat b { display: block; font-size: 22px; }
.bio-stats .stat span { font-size: 9px; letter-spacing: 1px; }

.bio-pilots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.bio-pilots figure {
  margin: 0;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(20, 20, 20, .3);
  padding: 12px;
}
.bio-pilots figure:nth-child(1) { transform: rotate(-1.5deg); }
.bio-pilots figure:nth-child(2) { transform: rotate(1.5deg); }
.bio-pilots img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid var(--ink);
  background: var(--sky);
}
.bio-pilots figcaption {
  font-size: 16px;
  letter-spacing: 1.5px;
  margin-top: 10px;
  text-align: center;
  white-space: nowrap;
}

/* ticker marquee */
.ticker {
  background: var(--ink);
  color: var(--lime);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  padding: 10px 0;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  animation: tick 22s linear infinite;
  font-size: 14px;
  letter-spacing: 2px;
}
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* merch */
.merch-heading {
  text-align: center;
  color: #fff;
  font-size: clamp(26px, 4.5vw, 44px);
  margin: 0 0 6px;
  text-shadow: 4px 4px 0 rgba(20, 20, 20, .45);
}
.merch-sub {
  text-align: center;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  letter-spacing: 2px;
  margin: 0 0 40px;
}
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  max-width: 1100px;
  margin: 0 auto;
}
.merch-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(20, 20, 20, .35);
  transform: rotate(var(--rot, 0deg));
  transition: transform .25s ease, box-shadow .25s ease;
}
.merch-card:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 12px 12px 0 rgba(20, 20, 20, .4);
}
.merch-imgwrap {
  border-bottom: 3px solid var(--ink);
  background: #fff;
  padding: 16px;
}
.merch-imgwrap img {
  display: block;
  width: 100%;
  image-rendering: pixelated;
}
.merch-info { padding: 14px 14px 16px; }
.merch-info h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1px; }
.merch-price { margin: 0 0 12px; font-size: 16px; color: var(--purple); }
.btn-buy {
  width: 100%;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 10px 8px;
  background: var(--lime);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.btn-buy:hover { background: var(--pink); color: var(--ink); }
.btn-buy:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(46px) rotate(var(--rot, 0deg)) scale(.96);
  transition: opacity .6s ease var(--d, 0s), transform .7s cubic-bezier(.2, .9, .25, 1.25) var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0) rotate(var(--rot, 0deg)) scale(1);
}
.reveal.in-view.merch-card:hover { transform: rotate(0deg) translateY(-6px); }

/* stickers flotantes con parallax */
.sticker-wrap { position: absolute; z-index: 2; pointer-events: none; }
.sticker {
  display: block;
  width: 72px;
  animation: floaty 3.2s ease-in-out infinite alternate;
  filter: drop-shadow(4px 4px 0 rgba(20, 20, 20, .3));
}
.sw-1 { top: 3%; left: 3%; }
.sw-2 { top: 4%; right: 4%; }
.sw-3 { bottom: 10%; left: 7%; }
.sw-4 { bottom: 14%; right: 5%; }
.sw-5 { top: 10%; left: 5%; }
.sw-6 { top: 16%; right: 6%; }
.sw-2 .sticker { width: 88px; animation-delay: .5s; }
.sw-3 .sticker { width: 64px; animation-delay: 1s; }
.sw-4 .sticker { width: 58px; animation-delay: 1.5s; }
.sw-5 .sticker { width: 80px; animation-delay: .3s; }
.sw-6 .sticker { width: 68px; animation-delay: .9s; }
@keyframes floaty {
  from { transform: translateY(0) rotate(-4deg); }
  to   { transform: translateY(-14px) rotate(5deg); }
}

@media (max-width: 860px) {
  .bio-grid { grid-template-columns: 1fr; }
  .bio-wrap { grid-template-columns: 1fr; }
  .sticker-wrap { display: none; }
  .os-body { padding: 20px 16px 26px; }
}

/* audio desactivado por ahora: se esconde el boton de sonido del juego */
.sound { display: none; }
