@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/PressStart2P-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  --bg: #0f100e; --white: #d8dfd6; --green: #80d16c;
  --orange: #d7b24f; --grey: #9aa295; --sombra: #462422;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
  font-family: 'Press Start 2P', monospace;
  color: var(--white);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.9;
}
#crt {
  position: fixed; inset: 0; z-index: 9; pointer-events: none;
  background: repeating-linear-gradient(#000 0 1px, transparent 1px 3px);
  opacity: .14;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* cabecera: barra de datos */
#datos {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; text-align: center;
  padding: 28px 0 8px;
  font-size: 13px; line-height: 1.3;
}
#datos dt { color: var(--white); margin-bottom: 5px; }
#datos dd { color: var(--green); }
h1 { margin: 22px auto 6px; max-width: 720px; }
h1 svg { display: block; width: 100%; height: auto; }
#sub { text-align: center; color: var(--orange);
       font-size: clamp(10px, 2.6vw, 16px); margin: 14px 0 6px; }

/* escena invaders */
#scene-wrap { overflow: hidden; margin: 10px auto 0; }
#scene {
  position: relative; width: 891px; height: 320px;
  margin: 0 auto; transform-origin: top left;
}
.star { position: absolute; width: 3px; height: 3px; background: #8a9088; }
.sprite {
  position: absolute;
  background-image: url('../px/spritesheet.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
  transform: translate(-50%, -50%) scale(var(--s));
}
#formation { position: absolute; inset: 0;
             animation: march 7s steps(14) infinite alternate; }
@keyframes march { from { transform: translateX(-26px); }
                   to { transform: translateX(26px); } }
#disparo { animation: shoot 1.8s steps(16) infinite; }
@keyframes shoot { 0% { top: 250px; opacity: 1; }
                   80% { top: 40px; opacity: 1; }
                   81%, 100% { opacity: 0; } }
#chan { position: absolute; left: 100px; right: 100px; top: 316px;
        height: 4px; background: #2a4a66; }

/* secciones */
section { padding: 34px 0 8px; }
h2 { color: var(--orange); font-size: 15px; text-align: center;
     margin-bottom: 22px; }
#programa .carrusel { display: flex; align-items: center; gap: 8px; }
#programa .dias { display: flex; flex: 1; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; }
#programa .dias::-webkit-scrollbar { display: none; }
#programa .dia { flex: 0 0 100%; scroll-snap-align: center;
  padding: 0 6px; min-width: 0; }
#programa h3 { color: var(--orange); font-size: clamp(15px, 3.4vw, 20px);
  text-align: center; margin-bottom: 22px; }
#programa ul { list-style: none; font-size: clamp(11px, 2.6vw, 14px);
  max-width: 660px; margin: 0 auto; }
#programa li { margin-bottom: 18px; padding-left: 18px; text-indent: -18px;
  line-height: 2; }
#programa li::before { content: "» "; color: var(--grey); }
#programa b { color: var(--green); font-weight: normal; }
.c-prev, .c-next { font-family: 'Press Start 2P', monospace; font-size: 16px;
  color: var(--orange); background: none; border: 3px solid #2c2e2b;
  padding: 10px 12px; cursor: pointer; flex: none; }
.c-prev:hover, .c-next:hover { border-color: var(--orange); }
.c-dots { text-align: center; margin-top: 20px; }
.c-dots .dot { width: 12px; height: 12px; padding: 0; margin: 0 6px;
  border: 2px solid var(--grey); background: none; cursor: pointer; }
.c-dots .dot.on { background: var(--orange); border-color: var(--orange); }

#inscricion { text-align: center; }
#inscricion .cta {
  display: inline-block; margin: 6px 0 14px; padding: 16px 22px;
  font-size: clamp(12px, 3vw, 18px);
  color: var(--bg); background: var(--orange); text-decoration: none;
  border: 3px solid var(--white); box-shadow: 6px 6px 0 var(--sombra);
}
#inscricion .cta:hover { background: var(--green); }
#inscricion .prezo { color: var(--green); font-size: 13px; margin: 10px 0 4px; }
#inscricion .prazo { font-size: 10px; color: var(--grey); margin-bottom: 16px; }
#inscricion h3 { font-size: 10px; color: var(--white); margin: 18px 0 12px; }
#pago { margin: 6px 0 18px; }
#pago .aviso { font-size: 10px; color: var(--white); margin-bottom: 12px; }
#pago .concepto { font-size: 10px; color: var(--grey); margin-top: 10px; }
#iban { font-family: 'Press Start 2P', monospace;
  font-size: clamp(11px, 2.6vw, 16px); color: var(--green);
  background: #1a1c19; border: 3px dashed var(--grey);
  padding: 14px 16px; cursor: pointer; }
#iban:hover { border-color: var(--green); }
#iban.copiado { color: var(--bg); background: var(--green); }
#lote { list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
        justify-content: center; }
#lote li { font-size: 9px; color: var(--grey); border: 2px solid #2c2e2b;
           padding: 6px 8px; }

#sorteo .premio {
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
#sorteo .premio .sprite { position: relative; display: inline-block;
  transform: scale(var(--s)); transform-origin: center; flex: none; }
#sorteo .premio .espello { transform: scale(var(--s)) scaleX(-1); }
#sorteo p { font-size: 10px; max-width: 480px; text-align: center; }

#colaboradores .inst {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 20px 40px; margin-bottom: 22px;
}
#colaboradores .inst img { width: 190px; image-rendering: pixelated; }
#colaboradores .inst span { font-size: 10px; }
#sponsors { overflow: hidden; white-space: nowrap; padding: 6px 0; }
#sponsors .m-track { display: flex; width: max-content; align-items: baseline;
  animation: marquee 45s linear infinite; will-change: transform; }
#sponsors .m-track > span { flex: none; }
#sponsors .m-name { color: var(--white); font-size: 20px; padding: 0 26px; }
#sponsors .m-name:nth-child(4n+1) { color: var(--green); }
#sponsors .m-sep { color: var(--orange); font-size: 20px; }
#sponsors:hover .m-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

footer { text-align: center; font-size: 9px; color: var(--grey);
         padding: 40px 0 26px; }

@media (max-width: 640px) {
  #datos { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; font-size: 9px; }
  #sorteo .premio .espello { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  #sponsors { overflow-x: auto; }
}

#inscricion .selo {
  display: inline-block; margin: 14px 0 18px; padding: 12px 22px;
  font-size: clamp(12px, 3.6vw, 24px); letter-spacing: 2px;
  color: #e0503f; border: 4px solid #e0503f; outline: 2px solid #e0503f;
  outline-offset: 4px; transform: rotate(-8deg); opacity: .92;
}
#inscricion .cta-off { background: #2c2e2b; color: var(--grey);
  border-color: #2c2e2b; box-shadow: none; cursor: default; }

/* xogo */
#scene-wrap { position: relative; }
#game { display: block; width: 100%; max-width: 891px; margin: 0 auto;
        image-rendering: pixelated; touch-action: none; }
#play-btn {
  position: absolute; right: max(18px, calc(50% - 345px)); bottom: 12px;
  font-family: 'Press Start 2P', monospace; font-size: 13px;
  color: var(--bg); background: var(--green); border: 3px solid var(--white);
  box-shadow: 4px 4px 0 var(--sombra); padding: 12px 16px; cursor: pointer;
}
#play-btn:hover { background: var(--orange); }
#game-over {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  background: rgba(15, 16, 14, .82); text-align: center; padding: 20px;
}
#game-over[hidden] { display: none; }
#go-title { color: var(--orange); font-size: clamp(20px, 5vw, 34px); }
#go-score { color: var(--white); font-size: clamp(10px, 2.6vw, 14px); }
.go-botons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
#go-again, .go-cta {
  font-family: 'Press Start 2P', monospace; font-size: 11px; cursor: pointer;
  padding: 12px 14px; border: 3px solid var(--white); text-decoration: none;
  color: var(--bg); background: var(--grey); box-shadow: 4px 4px 0 var(--sombra);
}
.go-cta { background: var(--orange); }
#go-again:hover, .go-cta:hover { background: var(--green); }

/* ranking arcade no game over */
#go-rank .go-sub { color: var(--green); font-size: 12px; margin-bottom: 14px; }
#go-iniciais { font-family: 'Press Start 2P', monospace; font-size: 26px;
  width: 120px; text-align: center; text-transform: uppercase;
  color: var(--orange); background: #1a1c19; border: 3px solid var(--grey);
  padding: 10px; letter-spacing: 6px; }
#go-iniciais:focus { outline: none; border-color: var(--orange); }
#go-gardar { font-family: 'Press Start 2P', monospace; font-size: 12px;
  color: var(--bg); background: var(--green); border: 3px solid var(--white);
  box-shadow: 4px 4px 0 var(--sombra); padding: 14px; cursor: pointer;
  margin-left: 10px; }
#go-gardar:disabled { background: #2c2e2b; color: var(--grey); }
#go-top { list-style: none; font-size: 12px; color: var(--white);
  margin: 4px 0 6px; max-height: 40vh; overflow-y: auto; }
#go-top li { padding: 4px 0; }
#go-top li b { color: var(--orange); font-weight: normal; padding: 0 12px 0 0; }
#go-top li:first-child { color: var(--green); }

/* táboa de récords */
#top-btn {
  position: absolute; right: max(160px, calc(50% - 203px)); bottom: 12px;
  font-family: 'Press Start 2P', monospace; font-size: 13px;
  color: var(--orange); background: var(--bg); border: 3px solid var(--orange);
  box-shadow: 4px 4px 0 var(--sombra); padding: 12px 14px; cursor: pointer;
}
#top-btn:hover { color: var(--bg); background: var(--orange); }
#records {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  background: rgba(15, 16, 14, .9); text-align: center;
}
#records[hidden] { display: none; }
#records .r-title { color: var(--orange); font-size: 20px; }
#records-ol { list-style: none; font-size: 13px; color: var(--white);
  max-height: 60%; overflow-y: auto; }
#records-ol li { padding: 5px 0; }
#records-ol li b { color: var(--orange); font-weight: normal; padding-right: 14px; }
#records-ol li:first-child { color: var(--green); }
#records-close { font-family: 'Press Start 2P', monospace; font-size: 10px;
  color: var(--grey); background: none; border: 3px solid #2c2e2b;
  padding: 8px 12px; cursor: pointer; }
#records-close:hover { border-color: var(--grey); }
