/* =========================================================================
   PALAG · extras.css
   -------------------------------------------------------------------------
   1. Reacciones (😂 💀 🔥)
   2. El Buzón (el sobre por avión)
   3. Hoy bici? (el juego)
   4. Arreglos generales (menú con más secciones)
   ========================================================================= */

/* ---------- 1. REACCIONES ---------- */
.reacciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.reac {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 12px 6px 10px;
  font: inherit;
  color: var(--tinta);
  background: var(--carta);
  border: 2px solid var(--tinta);
  box-shadow: 3px 3px 0 var(--tinta);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .15s;
}
.reac span { font-size: 19px; line-height: 1; }
.reac b { min-width: 1ch; font-family: var(--f-pixel); font-size: 10px; font-weight: 400; }
.reac b:empty { display: none; }
.reac:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinta); }
.reac:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.reac.mio { background: var(--acento); color: var(--sobre-acento); }
.reac.mio span { animation: reac-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes reac-pop { 40% { transform: scale(1.45) rotate(-10deg); } }
.reac-vuela {
  position: absolute;
  left: 12px;
  top: 4px;
  font-size: 22px;
  pointer-events: none;
  animation: reac-vuela .8s ease-out forwards;
}
@keyframes reac-vuela { to { transform: translate(var(--x, 0), -58px) scale(1.5); opacity: 0; } }

/* Versión chica: arriba de papel (memes, post-its, muro) toma el color de la tinta del papel */
.reacciones.chica { gap: 6px; margin-top: 12px; }
.reacciones.chica .reac {
  min-height: 34px;
  padding: 4px 9px 4px 7px;
  color: currentColor;
  background: transparent;
  border: 1.5px solid currentColor;
  box-shadow: none;
}
.reacciones.chica .reac span { font-size: 16px; }
.reacciones.chica .reac b { font-size: 9px; }
.reacciones.chica .reac.mio { color: #1b1512; background: rgba(27, 21, 18, .14); border-width: 2px; }
.momento .reacciones.chica .reac.mio { color: var(--tinta); background: var(--carta-2); }

/* ---------- 2. EL BUZÓN ---------- */
.buzon { padding-top: 34px; padding-bottom: 20px; }
.buzon-cab { max-width: 640px; margin-bottom: 30px; }
.buzon-cab h1 {
  margin: 0 0 8px;
  font-family: var(--f-mano);
  font-size: clamp(54px, 10vw, 104px);
  font-weight: 400;
  line-height: .95;
  transform: rotate(-2deg);
  transform-origin: left;
}
.buzon-cab p { color: var(--tinta-2); max-width: 52ch; }

.buzon-grilla { display: grid; gap: 34px; align-items: start; }
@media (min-width: 900px) { .buzon-grilla { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 46px; } }

/* El sobre: papel madera con borde de correo aéreo */
.sobre {
  --papel: #efe4cf;
  --tinta-papel: #1b1512;
  --tinta-papel-2: #5e5248;
  position: relative;
  display: grid;
  gap: 18px;
  padding: 30px clamp(18px, 4vw, 36px) 26px;
  color: var(--tinta-papel);
  background: var(--papel);
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #c8352b 0 14px, var(--papel) 14px 22px, #2f5fb8 22px 36px, var(--papel) 36px 44px) 10;
  box-shadow: var(--sombra);
  transition: transform .7s cubic-bezier(.6, -0.3, .7, 1), opacity .5s .2s;
}
.sobre.enviado { transform: translateY(-40px) rotate(-4deg) scale(.92); opacity: 0; }
.sobre .campo { color: var(--tinta-papel); background: #fbf6ea; border-color: #cbbb9c; }
.sobre .campo::placeholder { color: #9a8c78; }
.sobre .campo:focus { border-color: var(--tinta-papel); box-shadow: 4px 4px 0 #c8352b; }
.sobre .btn.sec { color: var(--tinta-papel); background: #fbf6ea; border-color: var(--tinta-papel); box-shadow: 3px 3px 0 var(--tinta-papel); }
.sobre .btn { border-color: var(--tinta-papel); box-shadow: 4px 4px 0 var(--tinta-papel); }

.sobre-cab { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: 104px; }
.sobre-para { display: grid; line-height: 1.2; padding-top: 34px; }
.sobre-para small { font-size: 13px; color: var(--tinta-papel-2); }
.sobre-para b { font-family: var(--f-mano); font-size: clamp(24px, 4vw, 32px); font-weight: 400; }
.sobre-para span { font-family: var(--f-mano); font-size: 18px; color: var(--tinta-papel-2); }

.estampilla {
  flex-shrink: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 92px;
  padding: 12px 8px 9px;
  color: #fff;
  background: #c2246e;
  /* borde dentado: los puntos del borde son del color del papel, como agujeritos */
  border: 6px dotted var(--papel);
  outline: 3px solid #c2246e;
  outline-offset: -9px;
  transform: rotate(4deg);
}
.estampilla-emoji { font-size: 38px; line-height: 1.1; }
.estampilla-txt { font-family: var(--f-pixel); font-size: 8px; line-height: 1.5; text-align: center; }
.estampilla-txt small { font-size: 7px; opacity: .85; }
.matasellos {
  position: absolute;
  top: 6px;
  right: 74px;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  font-family: var(--f-pixel);
  font-size: 7px;
  line-height: 1.6;
  text-align: center;
  color: rgba(27, 21, 18, .55);
  border: 2px solid rgba(27, 21, 18, .45);
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
}
.matasellos b { font-size: 10px; font-weight: 400; }
@media (max-width: 520px) { .matasellos { right: 62px; top: 52px; width: 70px; height: 70px; } }

.sobre-tipos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.sobre-tipos legend, .sobre-et { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.tipo-env { position: relative; }
.tipo-env input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-env span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.2;
  border: 2px dashed #b3a385;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tipo-env i { font-style: normal; font-size: 18px; }
.tipo-env span:hover { border-color: var(--tinta-papel); }
.tipo-env input:checked + span { color: #fbf6ea; background: var(--tinta-papel); border: 2px solid var(--tinta-papel); }
.tipo-env input:focus-visible + span { outline: 3px dashed #c8352b; outline-offset: 2px; }

.sobre-campo { display: block; }
.sobre-campo .campo { margin-top: 0; }
.sobre-foto { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sobre-foto small { font-size: 13px; color: var(--tinta-papel-2); }
.sobre-foto-prev { position: relative; width: 100%; }
.sobre-foto-prev[hidden] { display: none; }
.sobre-foto-prev img { max-height: 240px; width: auto; border: 6px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); transform: rotate(-1.5deg); }
.sobre-foto-prev .ctrl { position: absolute; top: -10px; left: -10px; width: 34px; height: 34px; color: #fff; background: #c8352b; border-color: #1b1512; }
.sobre-pie { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; padding-top: 16px; border-top: 2px dashed #cbbb9c; }
.sobre-pie .btn { min-height: 48px; }
@media (max-width: 520px) { .sobre-pie { grid-template-columns: 1fr; } }
.sobre-letra-chica { margin: -6px 0 0; font-size: 13px; color: var(--tinta-papel-2); }

.buzon-lado h2 { margin: 0 0 14px; font-family: var(--f-titulo); font-size: 36px; font-weight: 400; line-height: 1; letter-spacing: .01em; }
.buzon-pasos { margin: 0 0 30px; padding: 0; list-style: none; counter-reset: paso; }
.buzon-pasos li { position: relative; padding: 0 0 18px 46px; color: var(--tinta-2); counter-increment: paso; }
.buzon-pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-family: var(--f-pixel);
  font-size: 11px;
  color: var(--sobre-acento);
  background: var(--acento);
}
.buzon-pasos li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 34px; bottom: 2px; border-left: 2px dotted var(--linea); }
.buzon-pasos b { color: var(--tinta); }
.mis-envios { padding: 18px; background: var(--carta); border: 2px solid var(--linea); }
.mis-envios h3 { margin: 0 0 10px; font-size: 15px; }
.mis-envios ul { margin: 0; padding: 0; list-style: none; }
.mis-envios li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--linea); font-size: 15px; }
.mis-envios li b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-envios time { font-size: 12px; color: var(--tinta-2); }
.mis-nada { margin: 0; font-size: 14px; color: var(--tinta-2); }

/* ---------- 3. HOY BICI? ---------- */
.bici { padding-top: 30px; }
.bici-cab { display: grid; gap: 22px; align-items: end; margin-bottom: 24px; }
@media (min-width: 860px) { .bici-cab { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; } }
.bici-titulo h1 {
  margin: 0 0 12px;
  font-family: var(--f-pixel);
  font-size: clamp(30px, 6vw, 58px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--neon-lima);
  text-shadow: 4px 4px 0 var(--neon-brasa), 8px 8px 0 rgba(255, 79, 43, .35);
}
[data-theme="claro"] .bici-titulo h1 { color: var(--acento); text-shadow: 4px 4px 0 var(--acento-2); }
.bici-titulo p { margin: 0; max-width: 54ch; color: var(--tinta-2); }

/* El chat del grupo que da origen al juego */
.chat { display: grid; gap: 6px; justify-items: start; }
.msj {
  position: relative;
  max-width: 85%;
  margin: 0;
  padding: 6px 12px 7px;
  font-size: 15px;
  line-height: 1.35;
  background: var(--carta);
  border-radius: 2px 12px 12px 12px;
  border: 1px solid var(--linea);
}
.msj b { display: block; font-size: 12px; color: var(--acento-3); }
.msj-erik { font-size: 18px; font-weight: 700; color: var(--sobre-acento); background: var(--acento); border-color: var(--acento); }
.msj-erik b { color: inherit; opacity: .7; }
.chat .msj:nth-child(3) b { color: var(--acento-4); }
.chat .msj:nth-child(4) b { color: var(--acento-2); }
.chat .msj:nth-child(5) b { color: #7cf0c5; }
[data-theme="claro"] .chat .msj:nth-child(5) b { color: #1f7a5a; }

/* La máquina: marco de arcade con la pantalla */
.maquina {
  padding: clamp(8px, 2vw, 18px);
  background: #1a1416;
  border: 3px solid #000;
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), var(--sombra);
}
.pantalla {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pantalla canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: auto; /* el canvas ya tiene 2-3 veces más píxeles */ }
.pantalla::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .55);
}
.pantalla:focus-visible { outline: 3px dashed var(--neon-lima); outline-offset: 4px; }
.bici-ayuda { margin: 12px 4px 0; font-size: 13px; color: #b8ab9a; }
.bici-vol { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 12px 4px 0; }
.bici-vol label { display: grid; grid-template-columns: auto minmax(110px, 180px) 30px; align-items: center; gap: 8px; font-size: 13px; color: #d9cdbb; }
.bici-vol input[type="range"] { width: 100%; accent-color: var(--neon-lima); cursor: pointer; }
.bici-vol b { font-family: var(--f-pixel); font-size: 10px; font-weight: 400; color: var(--neon-lima); text-align: right; }
.solo-teclado { display: none; }
@media (hover: hover) and (pointer: fine) { .solo-teclado { display: inline; } .solo-tactil { display: none; } }

/* Resultado al terminar */
.bici-fin {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  background: var(--carta);
  border: 2px solid var(--neon-brasa);
  box-shadow: 5px 5px 0 var(--neon-brasa);
}
.bici-fin[hidden] { display: none; }
.fin-numeros { display: flex; flex-wrap: wrap; gap: 12px 30px; }
.fin-numeros p { display: grid; margin: 0; line-height: 1.1; }
.fin-numeros b { font-family: var(--f-pixel); font-size: clamp(18px, 3vw, 26px); font-weight: 400; color: var(--acento); }
.fin-numeros p:first-child b { color: var(--acento-3); }
.fin-numeros span { font-size: 13px; color: var(--tinta-2); }
.fin-guardar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.fin-guardar label { flex: 1 1 220px; font-size: 14px; font-weight: 700; }
.fin-guardar .btn { min-height: 48px; }
.fin-poco, .fin-ok { margin: 0; color: var(--tinta-2); }
.fin-ok { color: var(--acento); }

.bici-abajo { display: grid; gap: 30px; margin-top: 34px; }
@media (min-width: 900px) { .bici-abajo { grid-template-columns: 1.2fr 1fr; } .bici-leyenda { grid-column: 1 / -1; } }
.bici-abajo .titulo-pixel { margin-bottom: 14px; }

.ciclistas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.ciclista {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px 9px;
  font: inherit;
  color: var(--tinta);
  background: var(--carta);
  border: 2px solid var(--linea);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.ciclista img { width: 100%; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; }
.ciclista b { font-family: var(--f-titulo); font-size: 22px; font-weight: 400; line-height: 1; }
.ciclista:hover { border-color: var(--tinta-2); }
.ciclista[aria-checked="true"] { border-color: var(--acento); box-shadow: 4px 4px 0 var(--acento); transform: translate(-2px, -2px); }
.bici-elegir.jugando .ciclista { opacity: .45; cursor: not-allowed; }
.perk { display: grid; gap: 2px; margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid var(--acento-3); background: var(--bg-2); }
.perk b { font-family: var(--f-pixel); font-size: 10px; font-weight: 400; color: var(--acento-3); }
.perk span { font-size: 15px; color: var(--tinta-2); }

.bici-lista { margin: 0; padding: 0; list-style: none; }
.bici-lista li { display: grid; grid-template-columns: 26px 36px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--linea); }
.bici-lista img { width: 36px; height: 36px; object-fit: cover; image-rendering: pixelated; border: 2px solid var(--tinta); }
.bici-pos { font-family: var(--f-pixel); font-size: 11px; color: var(--tinta-2); }
.bici-quien { display: grid; line-height: 1.15; min-width: 0; }
.bici-quien b { font-family: var(--f-titulo); font-size: 22px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bici-quien small { font-size: 12px; color: var(--tinta-2); }
.bici-pts { font-family: var(--f-pixel); font-size: 11px; }
.bici-lista .primero .bici-pos, .bici-lista .primero .bici-pts { color: var(--acento-3); }
.bici-nadie { color: var(--tinta-2); }
.bici-mio { margin: 12px 0 0; font-size: 14px; color: var(--tinta-2); }
.bici-mio b { color: var(--tinta); }

.bici-leyenda ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.bici-leyenda li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px 10px; background: var(--carta); border: 1px solid var(--linea); }
.bici-leyenda canvas { justify-self: center; width: 48px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.bici-leyenda span { display: grid; font-size: 14px; line-height: 1.3; color: var(--tinta-2); }
.bici-leyenda b { color: var(--tinta); }

/* Tapa: accesos al juego y al buzón */
.mod-bici { background: #1a1416; color: #f3ece1; border-color: #000; }
.mod-bici h3 { color: var(--neon-lima); }
.mod-bici .mod-caras { display: flex; margin: 4px 0 12px; }
.mod-bici .mod-caras img { width: 44px; height: 44px; margin-right: -8px; object-fit: cover; image-rendering: pixelated; border: 2px solid #000; }
.mod-bici p { margin: 0; font-size: 15px; color: #b8ab9a; }
.mod-bici p b { color: #f3ece1; }
.mod-buzon { background: #efe4cf; color: #1b1512; border: 8px solid transparent; border-image: repeating-linear-gradient(-45deg, #c8352b 0 10px, #efe4cf 10px 16px, #2f5fb8 16px 26px, #efe4cf 26px 32px) 8; }
.mod-buzon h3 { color: #c8352b; }
.mod-buzon p { margin: 0; font-family: var(--f-mano); font-size: 22px; line-height: 1.25; }

/* ---------- 4. ARREGLOS GENERALES ---------- */
/* Con 10 secciones, en compu el menú puede pasar a dos renglones en vez de salirse de la pantalla */
@media (min-width: 980px) { .menu { flex-wrap: wrap; row-gap: 2px; } }
/* En celular, si el menú no entra a lo alto, se puede bajar sin perder los primeros */
@media (max-width: 979px) { .menu { justify-content: safe center; } }

/* Hoy bici? en celular: primero el título, el chat en una tira compacta y los cinco ciclistas en una fila */
@media (max-width: 859px) {
  .bici { padding-top: 20px; }
  .bici-titulo { order: -1; }
  .bici-titulo p { font-size: 15px; }
  .chat { display: flex; flex-wrap: wrap; gap: 5px; }
  .msj { max-width: none; padding: 4px 9px 5px; font-size: 13px; }
  .msj b { display: inline; margin-right: 5px; font-size: 11px; }
  .msj-erik { font-size: 14px; }
  .ciclistas { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .ciclista { padding: 5px 3px 6px; }
  .ciclista b { font-size: 16px; }
}

/* ---------- Carrusel: varias fotos en una misma publicación ---------- */
.carru { position: relative; }
.carru-pista { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.carru-pista::-webkit-scrollbar { display: none; }
.carru-pista > img { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.carru-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: rgba(14, 12, 11, .72);
  border: 2px solid #fff;
  translate: 0 -50%;
  cursor: pointer;
}
.carru-btn:hover { background: #0e0c0b; }
.carru-btn.ant { left: 8px; }
.carru-btn.sig { right: 8px; }
.carru-cuenta {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 6px;
  font-family: var(--f-pixel);
  font-size: 8px;
  color: #fff;
  background: rgba(14, 12, 11, .78);
  pointer-events: none;
}
.carru-ticket { grid-column: 1 / -1; }
.meme-img .carru-cuenta { top: auto; bottom: 8px; right: 8px; }
/* Galerías de 5 fotos (anécdotas y notas) */
.galeria-5 { grid-template-columns: 1fr 1fr; }
.galeria-5 img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
/* Reacciones dentro de La Saga */
.nivel-carta .reacciones.chica { color: var(--tinta); }
.nivel-carta .reacciones.chica .reac.mio { color: var(--tinta); background: var(--carta-2); }
