/* Identidad: juego de fiesta nocturno. Fondo tinta violeta, lima ácida para
   las acciones principales, violeta y coral de acento. Siempre oscuro. */
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
/* Las cifras y la C de Pixelify se confunden (el 5 parece una S, el 2 una Z y la C una O):
   se toman de Tiny5, que es del mismo estilo. Va después para que gane. */
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/tiny5-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+30-39, U+43;
  size-adjust: 112%;
}

:root {
  --bg: #0d0a1a;
  --bg-2: #141029;
  --surface: #1b1633;
  --surface-2: #251f44;
  --surface-3: #2f2856;
  --ink: #f6f2ff;
  --ink-2: #bdb4de;
  --muted: #8c84b0;
  --line: #342c5e;
  --primary: #c8ff4d;
  --primary-hover: #d6ff73;
  --primary-shade: #86b82a;
  --primary-ink: #141029;
  --primary-soft: rgb(200 255 77 / .12);
  --violet: #8b6cff;
  --violet-soft: rgb(139 108 255 / .16);
  --coral: #ff7a59;
  --gold: #ffd166;
  --good: #8ee6a8;
  --danger: #ff6b5b;
  --bar: #8b6cff;
  --radius: 18px;
  --shadow: 0 10px 30px rgb(0 0 0 / .35);
  --display: "Bricolage Grotesque", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 40rem at -10% -10%, rgb(139 108 255 / .22), transparent 60%),
    radial-gradient(50rem 36rem at 110% 30%, rgb(200 255 77 / .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s, box-shadow .08s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; }
/* El botón principal «se hunde» al pulsarlo, como un botón físico. */
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-ink);
  box-shadow: 0 4px 0 var(--primary-shade);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-shade); }
.btn-primary:disabled { background: var(--surface-3); border-color: var(--surface-3); color: var(--muted); box-shadow: 0 4px 0 #1f1a3b; opacity: 1; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #1a0d0b; }
.btn-big { min-height: 58px; padding: 0 28px; font-size: 18px; font-family: var(--display); font-weight: 800; border-radius: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on-dark { color: #fff; background: rgb(255 255 255 / .08); }
.link-btn { border: 0; background: none; padding: 8px 0; color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--safe-top)) 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 19px; min-height: 44px; }
.brand img { border-radius: 9px; }
.topbar-actions { position: relative; display: flex; gap: 2px; }
.menu {
  position: absolute; right: 0; top: 50px; min-width: 270px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.menu button, .menu label {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; font-size: 15px; font-weight: 600;
}
.menu button:hover, .menu label:hover { background: var(--surface-2); }
.menu input { width: 18px; height: 18px; accent-color: var(--primary); }
.menu .danger { color: var(--danger); }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px calc(40px + var(--safe-bottom)); }

/* ---------- Portada ---------- */
.landing { padding-top: 12px; }
/* Lo principal centrado: texto y botones en una columna, el dibujo debajo. */
.hero-wrap { display: grid; gap: 20px; justify-items: center; text-align: center; padding: 8px 0 12px; }
@media (min-width: 860px) { .hero-wrap { padding: 32px 0 24px; } }
.hero { display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px;
  background: var(--violet-soft); color: #cdbfff; font-size: 13px; font-weight: 700;
}
.hero h1 { font-size: clamp(40px, 11vw, 76px); font-weight: 800; letter-spacing: -.03em; line-height: .98; }
.hero h1 .hl { color: var(--primary); white-space: nowrap; }
.lead { color: var(--ink-2); font-size: 18px; margin: 16px auto 22px; max-width: 34em; }
.play-actions { display: grid; gap: 12px; margin: 0 0 18px; width: 100%; max-width: 520px; }
@media (min-width: 520px) { .play-actions { grid-template-columns: 1fr 1fr; } }
/* Aviso de privacidad: un botón pequeño que abre la ventana con los detalles. */
.privacy-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; cursor: pointer;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  font: inherit; font-size: 13px; color: var(--ink-2);
}
.privacy-chip:hover { background: var(--surface-2); color: var(--ink); }
.privacy-chip svg { width: 18px; height: 18px; flex: none; color: var(--primary); }
.privacy-more { color: var(--primary); text-decoration: underline dotted 2px; text-underline-offset: 3px; }
.privacy-sheet .sheet-inner { max-width: 480px; }
.privacy-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; color: var(--ink-2); }
.privacy-list li { position: relative; padding-left: 22px; }
.privacy-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; background: var(--primary); }
.privacy-list strong { color: var(--ink); }
.privacy-ok { width: 100%; }

/* Móvil de muestra con reacciones flotando */
.hero-art { display: grid; place-items: center; padding: 10px 0 0; }
.phone {
  position: relative; width: min(250px, 66vw); aspect-ratio: 9 / 17; border-radius: 34px; padding: 12px;
  background: linear-gradient(160deg, #2a2350, #15112b); border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgb(0 0 0 / .5), inset 0 0 0 6px #0d0a1a;
  display: flex; flex-direction: column; gap: 10px; transform: rotate(-4deg);
}
.phone-video {
  position: relative; flex: 1; border-radius: 22px; overflow: hidden;
  background: linear-gradient(200deg, #ff7a59 0%, #8b6cff 55%, #2b1f63 100%);
}
.phone-video::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-30%, -50%);
  border-left: 22px solid rgb(255 255 255 / .9); border-top: 14px solid transparent; border-bottom: 14px solid transparent;
}
.phone-tag { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; background: rgb(13 10 26 / .55); font-size: 11px; font-weight: 800; }
.phone-q { font-family: var(--display); font-weight: 800; font-size: 15px; text-align: center; }
.phone-chips { display: flex; justify-content: center; gap: 8px; }
.phone-chips span {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c); color: var(--primary-ink); font-family: var(--display); font-weight: 800;
}
.phone-chips .yo { background: transparent; border: 2px dashed var(--muted); color: var(--ink); font-size: 13px; }
.bub {
  position: absolute; display: flex; flex-direction: column; align-items: center; font-size: 34px; line-height: 1;
  text-shadow: 0 4px 12px rgb(0 0 0 / .5); animation: bub 3.6s ease-in-out infinite;
}
.bub b { font-family: var(--display); font-size: 13px; letter-spacing: .04em; margin-top: 2px; }
.bub.b1 { left: -18px; top: 34%; }
.bub.b2 { right: -22px; top: 18%; animation-delay: -1.2s; }
.bub.b3 { right: 4px; top: 58%; animation-delay: -2.4s; font-size: 30px; }
@keyframes bub { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(3deg); } }

.section-title { font-size: 24px; margin: 34px 0 14px; }
.steps, .modes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } .modes-list { grid-template-columns: 1fr 1fr; } }
.steps li, .modes-list li {
  padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.steps .num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 12px;
  background: var(--primary); color: var(--primary-ink); font-family: var(--display); font-weight: 800;
}
.steps h3, .modes-list h3 { font-size: 18px; margin-bottom: 4px; }
.steps p, .modes-list p { margin: 0; color: var(--ink-2); font-size: 15px; }
.modes-list .mode-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.howto {
  margin-top: 26px; padding: 0 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.howto summary { cursor: pointer; padding: 16px 0; font-family: var(--display); font-weight: 800; font-size: 18px; list-style-position: inside; }
.howto ol { padding-left: 22px; margin: 0 0 16px; color: var(--ink-2); }
.howto li { margin: 6px 0; }
.howto strong { color: var(--ink); }
.note { color: var(--muted); font-size: 14px; }
.dropzone { margin: 20px 0 0; padding: 28px 16px; text-align: center; border: 2px dashed var(--line); border-radius: 20px; background: var(--surface); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dz-icon { width: 34px; height: 34px; color: var(--primary); display: block; margin: 0 auto 12px; }
.dz-hint { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }
.desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: inline; } }
.status { min-height: 1.4em; margin: 8px 0 0; font-weight: 600; color: var(--primary); }
.status:empty { display: none; }
.error {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 15px;
  background: rgb(255 107 91 / .12); color: var(--ink); border: 1px solid rgb(255 107 91 / .4);
}

/* ---------- Vista principal ---------- */
.app { padding-top: 16px; }
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sum-card { display: flex; flex-direction: column; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.sum-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-label { color: var(--ink-2); font-size: 13px; }
.sum-range { grid-column: 1 / -1; }
.sum-range .sum-value { font-size: 17px; }
@media (min-width: 640px) {
  .summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .sum-range { grid-column: auto / span 2; }
}

.tabs { display: flex; gap: 4px; margin: 16px 0 12px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.tab {
  flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 700; font-size: 15px; color: var(--ink-2); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab-count { font-weight: 500; font-size: 13px; opacity: .8; }

.toolbar { display: flex; gap: 8px; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-2); pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; padding: 0 14px 0 40px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 16px;
}
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 12px; }
.filters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end;
  margin-top: 10px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.filters input, .filters select {
  min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 16px; width: 100%;
}
.filters .link-btn { justify-self: start; }
@media (min-width: 640px) { .filters { grid-template-columns: repeat(3, 1fr) auto; } }

.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.count { margin: 0 auto 0 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }

.day {
  position: sticky; top: calc(57px + var(--safe-top)); z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0; padding: 14px 4px 6px; background: var(--bg); font-size: 15px;
}
.day span { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.day-group, .list > .row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > .row { margin-bottom: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px;
  border: 0; border-top: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer;
}
.day-group .row:first-child { border-top: 0; }
.list > .row { border: 1px solid var(--line); }
.row:hover { background: var(--surface-2); }
.thumb {
  display: grid; place-items: center; flex: none; width: 40px; height: 52px; border-radius: 8px; overflow: hidden;
  background: var(--primary-soft); color: var(--primary);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 16px; }
.sentinel { height: 1px; }

/* ---------- Capas ---------- */
.modal { position: fixed; inset: 0; z-index: 50; }

.player-modal { display: flex; flex-direction: column; background: #0d0c11; color: #fff; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
.player-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.player-bar .icon-btn { color: #fff; }
.player-bar .icon-btn:hover { background: rgb(255 255 255 / .12); }
.player-info { display: flex; flex-direction: column; min-width: 0; }
.pi-title { font-weight: 700; }
.pi-sub { font-size: 13px; opacity: .75; }
.player-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 8px; }
.player-stage .video-box { height: 100%; max-width: 100%; }
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: rgb(255 255 255 / .14); color: #fff; cursor: pointer;
}
.nav-btn.prev { left: 8px; }
.nav-btn.next { right: 8px; }
.nav-btn:disabled { opacity: .25; cursor: default; }
@media (min-width: 720px) { .nav-btn { position: static; transform: none; } }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 10px 16px 14px; }
.player-actions .btn:not(.btn-primary) { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); color: #fff; }

/* Caja de vídeo 9:16 */
.video-box { position: relative; aspect-ratio: 9 / 16; max-height: 100%; background: #000; border-radius: 12px; overflow: hidden; }
.tt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; }
.loading::after {
  content: ""; width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgb(255 255 255 / .2); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tt-error {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 24px; text-align: center; background: #16151c; color: #fff;
}
.tt-error p { margin: 0; opacity: .8; font-size: 15px; }
.tt-error .tt-error-title { opacity: 1; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.tt-error-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tt-error .btn:not(.btn-primary) { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .25); color: #fff; }
.sound-cta {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; background: #fff; color: #14131a; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 18px rgb(0 0 0 / .35); cursor: pointer; white-space: nowrap;
}

/* ---------- Modo feed ---------- */
.feed { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; }
.feed-scroll {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; outline: none;
}
.feed-scroll::-webkit-scrollbar { display: none; }
.slide {
  position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  padding: calc(56px + var(--safe-top)) 0 calc(8px + var(--safe-bottom));
}
.slide-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; }
@media (max-aspect-ratio: 9/16) { .slide-frame { width: 100%; height: auto; } }
.slide .video-box { position: absolute; inset: 0; border-radius: 0; }
@media (min-width: 720px) { .slide .video-box { border-radius: 14px; } }
.slide.interact .tap-layer { display: none; }
/* Capa transparente encima del iframe: deja deslizar el feed y sirve para pausar.
   Deja libre la franja inferior, donde están los controles del reproductor. */
.tap-layer { position: absolute; inset: 0 0 64px 0; z-index: 3; display: grid; place-items: center; cursor: pointer; }
.tap-icon { width: 72px; height: 72px; border-radius: 50%; background: rgb(0 0 0 / .45); opacity: 0; background-repeat: no-repeat; background-position: center; background-size: 34px; }
.tap-icon.show { animation: pop .7s ease-out; }
.tap-icon[data-kind="pause"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='6' y='5' width='4' height='14' rx='1'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1'/%3E%3C/svg%3E"); }
.tap-icon[data-kind="play"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5l11 7-11 7z'/%3E%3C/svg%3E"); }
.tap-icon[data-kind="sound"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M17 8.5a5 5 0 010 7M19.5 6a8.5 8.5 0 010 12'/%3E%3C/svg%3E"); }
@keyframes pop { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
.slide-rail {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 4;
  display: flex; flex-direction: column; gap: 10px;
}
@media (min-width: 720px) { .slide-rail { right: -84px; top: auto; bottom: 12px; transform: none; } }
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; min-height: 56px; padding: 8px 4px;
  border: 0; border-radius: 14px; background: rgb(0 0 0 / .45); color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer;
}
.rail-btn[aria-pressed="true"] { background: #fff; color: #14131a; }
.feed-nav { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); z-index: 5; display: none; flex-direction: column; gap: 10px; }
@media (min-width: 720px) and (hover: hover) { .feed-nav { display: flex; } }
.slide-end { flex-direction: column; gap: 12px; }
.slide-end .btn { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .25); }
.feed-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(6px + var(--safe-top)) 10px 6px;
  pointer-events: none;
}
.feed-top > * { pointer-events: auto; }
.feed-pos { font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / .8); text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .ico-sound { display: none; }
.feed:not(.is-muted) .ico-sound { display: block; }
.feed:not(.is-muted) .ico-muted { display: none; }

/* ---------- Hojas (estadísticas, confirmación) ---------- */
.sheet { display: flex; align-items: flex-end; justify-content: center; background: rgb(0 0 0 / .45); }
.sheet-inner {
  width: 100%; max-width: 760px; max-height: calc(100% - 24px - var(--safe-top)); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px calc(24px + var(--safe-bottom)); border-radius: 20px 20px 0 0; background: var(--bg);
}
@media (min-width: 720px) {
  .sheet { align-items: center; }
  .sheet-inner { border-radius: 20px; max-height: 88vh; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet h2 { font-size: 20px; }
.confirm .sheet-inner { max-width: 440px; }
.confirm p { color: var(--ink-2); }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tile:first-child { grid-column: 1 / -1; }
.tile-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--ink-2); font-size: 13px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } .tile:first-child { grid-column: auto; } }
.chart { margin-top: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart h3 { font-size: 15px; margin-bottom: 10px; }
.bars-wrap.scroll { overflow-x: auto; }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; height: 150px; }
.bars-wrap.scroll .bars { grid-template-columns: repeat(var(--n), 44px); }
.bar { position: relative; display: flex; flex-direction: column; height: 100%; outline: none; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; max-width: 28px; margin: 0 auto; background: var(--bar); border-radius: 4px 4px 0 0; }
.bar:hover .bar-fill, .bar:focus-visible .bar-fill { filter: brightness(1.15); }
.bar-label { height: 20px; padding-top: 4px; text-align: center; font-size: 11px; color: var(--ink-2); white-space: nowrap; border-top: 1px solid var(--line); }
.bar::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% - 18px); transform: translateX(-50%);
  padding: 6px 8px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 2;
}
.bar:hover::after, .bar:focus-visible::after { opacity: 1; }
.bar:first-child::after { left: 0; transform: none; }
.bar:last-child::after { left: auto; right: 0; transform: none; }
.as-table { margin-top: 10px; font-size: 14px; }
.as-table summary { cursor: pointer; color: var(--primary); font-weight: 600; min-height: 32px; }
.as-table table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.as-table th, .as-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.as-table td:last-child, .as-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Varios ---------- */
.drop-overlay {
  position: fixed; inset: 12px; z-index: 70; display: grid; place-items: center;
  border: 3px dashed var(--primary); border-radius: 24px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  font-size: 20px; font-weight: 700; pointer-events: none;
}
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); z-index: 80;
  text-align: center;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-size: 15px; box-shadow: var(--shadow);
}

/* ---------- Juego en grupo ---------- */
body:not(.has-data) .needs-data { display: none !important; }
.menu-label { margin: 6px 12px 2px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* Avatares de color por jugador */
.av {
  display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c, var(--violet)); color: #140f26; font-family: var(--display); font-weight: 800; font-size: 17px;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18);
}
.av-sm { width: 22px; height: 22px; font-size: 11px; box-shadow: none; }
.av-lg { width: 54px; height: 54px; font-size: 24px; }

/* Hoja para crear sala / unirse */
.game-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.game-form input {
  min-height: 54px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--bg-2); color: var(--ink); font-size: 18px;
}
.game-form input:focus { border-color: var(--primary); outline: none; }
.game-form .code-input {
  text-transform: uppercase; letter-spacing: .5em; text-indent: .5em; font-family: var(--display); font-weight: 800; font-size: 30px; text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(20% - 3px), var(--line) calc(20% - 3px) 20%) bottom / 100% 3px no-repeat,
    var(--bg-2);
}
.game-form .btn-big { width: 100%; margin-top: 8px; }
.game-form .error { margin: 0 0 10px; }
.sheet-inner { background: var(--surface); border: 1px solid var(--line); border-bottom: 0; }
.sheet h2 { font-size: 24px; }

.game {
  position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column;
  background:
    radial-gradient(40rem 30rem at 0% 0%, rgb(139 108 255 / .2), transparent 60%),
    var(--bg);
  color: var(--ink);
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
  --g-surface: var(--surface); --g-line: var(--line); --g-muted: var(--muted);
}
.game-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.game-title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-tags { display: flex; gap: 6px; align-items: center; }
.game-code, .game-score:not(:empty) {
  padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--display); font-size: 14px; font-weight: 800; letter-spacing: .04em;
}
.game-score:not(:empty) { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.game-main { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.game .ico-muted { display: none; }
.game.is-muted .ico-muted { display: block; }
.game.is-muted .ico-sound { display: none; }
.game-banner {
  margin: 0 12px 8px; padding: 10px 14px; border-radius: 14px;
  background: var(--gold); color: #1d1405; font-weight: 800; font-size: 14px; text-align: center;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .75; } }
.g-center { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.g-center h2 { font-size: 26px; }
.g-center p { color: var(--ink-2); margin: 0 0 10px; max-width: 26em; }
.g-center .loading { position: static; }
.g-emoji { font-size: 56px; line-height: 1; }
.g-center-text { text-align: center; margin: 6px 0; }
.g-muted { color: var(--muted); font-weight: 600; }

/* ----- Sala ----- */
.g-lobby { max-width: 600px; margin: 0 auto; padding: 4px 16px 28px; display: flex; flex-direction: column; gap: 12px; }
.g-lobby.has-startbar { padding-bottom: 128px; }
.g-card { padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.g-card h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 12px; }
.g-step {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: var(--surface-3); color: var(--primary); font-size: 15px;
}
.g-count { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.g-label { margin: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.g-code { text-align: center; background: linear-gradient(165deg, #2b2257, var(--surface)); }
.g-code-big { display: flex; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.g-code-big span {
  display: grid; place-items: center; width: clamp(44px, 14vw, 58px); aspect-ratio: 4 / 5; border-radius: 14px;
  background: var(--bg-2); border: 1.5px solid var(--line); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25);
  font-family: var(--display); font-weight: 800; font-size: clamp(26px, 8vw, 34px); color: var(--primary);
}
.g-qr { width: 156px; max-width: 56%; margin: 0 auto 14px; background: #fff; border-radius: 16px; padding: 8px; aspect-ratio: 1; }
.g-qr:empty { display: none; }
.g-qr svg { display: block; width: 100%; height: 100%; }
.g-code .btn { min-width: 180px; }
.g-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.g-ok { margin: 0 0 4px; color: var(--good); font-weight: 700; }
.g-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-row .btn { flex: 1; }
.g-upload-status { margin: 8px 0 0; font-size: 14px; color: var(--coral); }
.g-upload-status:empty { display: none; }
.g-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.g-stat { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 14px; background: var(--bg-2); }
.g-stat span { font-size: 20px; }
.g-stat strong { font-family: var(--display); font-size: 24px; line-height: 1.1; }
.g-stat small { color: var(--muted); font-size: 12px; font-weight: 700; }
.g-players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-players li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; background: var(--bg-2); }
.g-players li.off { opacity: .45; }
.g-pname { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.g-pname .g-muted { font-weight: 600; font-size: 13px; }
.g-pstate { font-size: 13px; color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.g-rename { display: block; padding: 0; font-size: 13px; }
.g-kick {
  flex: none; min-width: 40px; height: 36px; padding: 0 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; cursor: pointer;
}
.g-kick.armed { background: var(--danger); border-color: var(--danger); color: #1a0d0b; }
.g-field-label { margin: 14px 0 8px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.g-field-label:first-of-type { margin-top: 0; }
.g-modes { display: grid; gap: 8px; }
@media (min-width: 520px) { .g-modes { grid-template-columns: 1fr 1fr; } }
.g-mode {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; text-align: left;
  border: 2px solid var(--line); background: var(--bg-2); color: var(--ink); cursor: pointer;
}
.g-mode strong { font-family: var(--display); font-size: 17px; }
.g-mode span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.g-mode[aria-pressed="true"] { border-color: var(--violet); background: var(--violet-soft); }
.g-mode[aria-pressed="true"] strong::after { content: " ✓"; color: var(--violet); }
.g-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.g-toggle {
  min-height: 44px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer;
}
.g-toggle .g-muted { font-weight: 700; }
/* El lima queda para las acciones principales; lo elegido va en violeta. */
.g-toggle[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.g-toggle[aria-pressed="true"] .g-muted { color: rgb(255 255 255 / .75); }
.g-wide { width: 100%; margin-top: 12px; }
.g-fields { display: grid; gap: 8px; margin-top: 14px; }
.g-field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0;
  padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--bg-2); font-weight: 700; font-size: 15px;
}
.g-field select {
  min-height: 42px; padding: 0 12px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 15px; font-weight: 700;
}
.g-startbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 10px 16px calc(14px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.g-startbar > * { max-width: 568px; margin-left: auto; margin-right: auto; }
.g-startbar .g-note { text-align: center; margin: 0 auto 8px; }
.g-start { width: 100%; display: flex; }

/* ----- Partida: un vídeo a pantalla completa ----- */
.g-play { height: 100%; display: flex; flex-direction: column; animation: g-in .35s ease-out; }
@keyframes g-in { from { transform: translateY(30%); opacity: 0; } to { transform: none; opacity: 1; } }
.g-top { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; font-size: 13px; font-weight: 800; }
.g-round { font-family: var(--display); font-size: 15px; }
.g-cat { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.g-time { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.g-time-bar { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--coral), var(--primary)); border-radius: 999px; }
.g-secs { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.g-stage { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; padding: 0 10px; }
.g-video { height: 100%; max-width: 100%; border-radius: 20px; box-shadow: 0 16px 40px rgb(0 0 0 / .45); }
.g-imp-title { margin: 0 14px 8px; text-align: center; font-size: 15px; color: var(--ink-2); }
.g-imp-title strong { color: var(--primary); font-family: var(--display); font-size: 17px; }
.g-tabs { display: flex; gap: 6px; justify-content: center; padding: 0 12px 8px; }
.g-tab {
  flex: 1; max-width: 86px; min-height: 42px; border-radius: 13px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 16px; cursor: pointer;
}
.g-tab.seen { border-color: var(--surface-3); color: var(--ink-2); }
.g-tab[aria-selected="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.g-tab.impostor { border-color: var(--coral); color: var(--coral); }
.g-tab.impostor[aria-selected="true"] { background: var(--coral); color: #1d0c06; }
.g-tab.legit:not([aria-selected="true"]) { opacity: .55; }

/* Reacciones */
.g-float { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.g-bubble {
  position: absolute; bottom: 8%; display: flex; flex-direction: column; align-items: center;
  animation: g-float 2.6s ease-out forwards; text-shadow: 0 2px 10px rgb(0 0 0 / .7);
}
.g-bubble-emoji { font-size: 44px; line-height: 1; }
.g-bubble-text { font-family: var(--display); font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.g-bubble-name { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgb(13 10 26 / .6); margin-top: 2px; }
@keyframes g-float {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  12% { transform: translate(0, -24px) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--drift), -280px) scale(1); opacity: 0; }
}
.g-reacts { display: flex; gap: 6px; justify-content: center; padding: 10px 10px 0; overflow-x: auto; scrollbar-width: none; }
.g-reacts::-webkit-scrollbar { display: none; }
/* Centrada si cabe; si no, empieza por la izquierda (con justify-content: center se cortaba el primero). */
.g-reacts { justify-content: flex-start; }
.g-reacts::before, .g-reacts::after { content: ''; margin: auto; }
.g-react {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 52px; min-height: 50px; padding: 4px 6px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 10px; font-weight: 800; letter-spacing: .03em; cursor: pointer;
  touch-action: manipulation; transition: transform .1s;
}
.g-react span { font-size: 23px; line-height: 1; }
.g-react:active { transform: scale(.86); background: var(--surface-3); }

/* Panel de abajo: votar y revelar */
.g-panel {
  position: relative; padding: 16px 16px 16px; margin-top: 10px;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 26px 26px 0 0;
}
.g-panel::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--surface-3); }
@media (min-width: 720px) { .g-panel { max-width: 600px; width: calc(100% - 32px); margin: 10px auto 14px; border-radius: 26px; border: 1px solid var(--line); } }
.g-question { margin: 2px 0 12px; font-family: var(--display); font-weight: 800; font-size: 21px; text-align: center; }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px 0 7px;
  border-radius: 999px; border: 2px solid var(--line); background: var(--bg-2); color: var(--ink);
  font-weight: 800; font-size: 16px; cursor: pointer; transition: transform .08s, border-color .15s;
}
.g-chip .av { width: 36px; height: 36px; font-size: 15px; }
.g-chip:not(:has(.av)) { padding: 0 20px; font-family: var(--display); font-size: 18px; }
.g-chip:hover:not(:disabled) { border-color: var(--ink-2); }
.g-chip:active:not(:disabled) { transform: scale(.95); }
.g-chip.me { border-style: dashed; }
.g-chip.picked { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.g-chip:disabled:not(.picked) { opacity: .4; }
.g-force { display: block; margin: 6px auto 0; font-size: 14px; }
.g-big { margin: 2px 0 0; font-family: var(--display); font-size: 21px; font-weight: 800; text-align: center; line-height: 1.25; }
.g-big strong { color: var(--primary); }
.g-owner { display: inline-flex; align-items: center; gap: 8px; margin: 2px 4px; vertical-align: middle; }
.g-owner .av { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.g-month { color: var(--muted); font-weight: 700; font-size: .7em; }
.g-months { font-size: 13px; margin-top: 2px; }
.g-result {
  display: table; margin: 10px auto 4px; padding: 7px 14px; border-radius: 999px;
  background: rgb(255 122 89 / .14); color: var(--coral); font-weight: 800; text-align: center;
}
.g-result.good { background: rgb(200 255 77 / .14); color: var(--primary); animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.g-votes { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 4px; padding: 0; font-size: 13px; font-weight: 700; }
.g-votes li { padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.g-votes li.ok::before { content: "✓ "; color: var(--good); }
.g-votes li.ko::before { content: "✗ "; color: var(--coral); }
.g-board { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 4px; padding: 0; font-size: 13px; font-weight: 700; }
.g-board li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg-2); }
.g-board li.me { box-shadow: 0 0 0 2px var(--violet); }
.g-board em { font-style: normal; color: var(--primary); font-weight: 800; }
.g-next { width: 100%; margin-top: 12px; }
.g-play.revealed .g-panel { animation: g-pop .35s ease-out; }
@keyframes g-pop { from { transform: translateY(14px); } to { transform: none; } }

/* Confeti al acertar y al ganar */
.g-confetti {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  background: var(--c); animation: confetti var(--t, 2.2s) cubic-bezier(.2, .6, .4, 1) forwards;
}
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x), 110vh) rotate(var(--r)); opacity: .9; }
}

/* ----- Final ----- */
.g-end { padding-top: 12px; }
.g-end .g-card { text-align: center; }
.g-winner { margin: 8px 0 18px; font-size: 32px; }
.g-trophy { font-size: 60px; line-height: 1.15; margin-bottom: 8px; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.g-ranking { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; text-align: left; }
.g-ranking li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--bg-2); }
.g-ranking li.r1 { background: linear-gradient(90deg, rgb(255 209 102 / .2), var(--bg-2)); box-shadow: inset 0 0 0 2px rgb(255 209 102 / .5); }
.g-medal { width: 30px; text-align: center; font-size: 24px; font-family: var(--display); font-weight: 800; color: var(--muted); }
.g-rname { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.g-ranking strong { font-family: var(--display); font-size: 18px; }
.g-ranking li.win strong { color: var(--gold); }
.g-end > .btn-big { width: 100%; }
.g-confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 70; }

/* ----- Ventanas dentro del juego ----- */
.game-leave { position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-end; justify-content: center; background: rgb(5 3 12 / .7); }
.game-leave .sheet-inner { background: var(--surface); color: var(--ink); max-width: 440px; }
.game-leave h2 { font-size: 24px; margin-bottom: 6px; }
.game-leave p { color: var(--ink-2); }
.game-leave input {
  width: 100%; min-height: 52px; margin: 10px 0 16px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg-2); color: var(--ink); font-size: 18px;
}
@media (min-width: 720px) { .game-leave { align-items: center; } .game-leave .sheet-inner { border-radius: 24px; } }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.confirm-actions .btn { flex: 1; }

/* =================================================================
   Capa retro: pixel art. Esquinas en escalón, bordes gruesos,
   biseles de 8 bits, estrellas de fondo y líneas de pantalla CRT.
   ================================================================= */
:root {
  --bg: #100a24;
  --bg-2: #170f33;
  --surface: #1e1540;
  --surface-2: #281d55;
  --surface-3: #35296d;
  --line: #0b0718;
  --edge: #4a3c8f;
  --primary: #b6ff3b;
  --primary-hover: #c8ff66;
  --primary-shade: #5f9a12;
  --violet: #8b6cff;
  --coral: #ff6b5b;
  --gold: #ffd23f;
  --pink: #ff5fd2;
  --n: 4px;
  --display: "Pixelify Sans", ui-monospace, "Courier New", monospace;
}

/* Esquina «pixelada»: se recorta un escalón en cada esquina. */
.btn, .icon-btn, .g-card, .privacy-chip, .eyebrow, .steps li, .modes-list li, .howto-steps figure, .menu,
.g-code-big span, .g-qr, .g-stat, .g-players li, .g-mode, .g-toggle, .g-field, .g-field select, .g-kick,
.g-chip, .g-react, .g-tab, .g-result, .g-votes li, .g-board li, .g-ranking li, .game-code, .game-score,
.g-cat, .av, .game-banner, .g-step, .g-count, .g-awards li, .game-poll, .g-peek, .g-chat-form input,
.game-form input, .game-leave input, .sheet-inner, .g-panel, .g-streak, .error, .toast, .section-title span {
  border-radius: 0 !important;
  clip-path: polygon(0 var(--n), var(--n) var(--n), var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%,
    var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)));
}
.g-panel, .sheet-inner { clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% 100%, 0 100%); }
/* Los dibujos no llevan el trazo de los iconos de línea. */
.spr, .px-art { image-rendering: pixelated; display: inline-block; vertical-align: middle; flex: none; fill: none; stroke: none; stroke-width: 0; }
.px-art { width: auto; height: auto; }

/* Todo el texto en pixel, también el pequeño y gris. */
body {
  font-family: "Pixelify Sans", ui-monospace, "Courier New", monospace;
  /* Pixelify trae una ligadura «fi» que se lee como una A («file», «fijas»...). */
  font-variant-ligatures: none;
}

/* Fondo: estrellas de píxel y líneas CRT */
body {
  background:
    radial-gradient(circle, rgb(255 255 255 / .55) 1px, transparent 1.6px) 0 0 / 53px 53px,
    radial-gradient(circle, rgb(182 255 59 / .35) 1px, transparent 1.6px) 21px 33px / 97px 97px,
    radial-gradient(circle, rgb(255 95 210 / .3) 1px, transparent 1.6px) 61px 9px / 131px 131px,
    radial-gradient(60rem 40rem at -10% -10%, rgb(139 108 255 / .25), transparent 60%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / .16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
h1, h2, h3, .btn, .g-label, .g-step, .g-cat, .g-round, .game-code, .game-score, .g-tab, .g-chip, .g-question, .g-big,
.g-result, .g-stat strong, .g-code-big span, .brand, .eyebrow, .g-toggle, .g-mode strong, .g-medal, .g-ranking strong,
.g-winner, .g-react, .g-field, .g-pname, .section-title, .g-awards b, .game-title, .g-poll-count, .g-streak b {
  font-family: var(--display);
  letter-spacing: .02em;
}
.blink { animation: px-blink 1s steps(1, end) infinite; }
@keyframes px-blink { 50% { opacity: 0; } }
.blink-dot { display: inline-block; width: 8px; height: 8px; background: var(--primary); animation: px-blink 1s steps(1, end) infinite; }

/* Botones de 8 bits: borde negro, bisel claro arriba y sombra abajo */
.btn {
  border: 3px solid var(--line); background: var(--surface-3); color: var(--ink);
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / .35), inset 0 3px 0 rgb(255 255 255 / .14);
  text-transform: uppercase; font-size: 15px; font-weight: 700; padding-bottom: 3px;
}
.btn:hover { background: #40337f; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .35), inset 0 3px 0 rgb(0 0 0 / .2); }
.btn-primary, .btn-primary:hover {
  background: var(--primary); color: #120c26; border-color: var(--line);
  box-shadow: inset 0 -6px 0 var(--primary-shade), inset 0 3px 0 rgb(255 255 255 / .55);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { box-shadow: inset 0 -2px 0 var(--primary-shade), inset 0 3px 0 rgb(0 0 0 / .15); }
.btn-primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 -5px 0 rgb(0 0 0 / .3); }
.btn-danger { background: var(--coral); color: #1a0806; box-shadow: inset 0 -5px 0 #a63328, inset 0 3px 0 rgb(255 255 255 / .35); }
/* Sin esto, al pasar el ratón por encima se volvía violeta (gana .btn:hover). */
.btn-danger:hover { background: #ff8f73; }
.btn-big { font-size: 19px; min-height: 60px; }
.icon-btn.on-dark, .icon-btn { background: var(--surface-2); border: 3px solid var(--line); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); }
.icon-btn:hover { background: var(--surface-3); }
.link-btn { font-family: var(--display); text-decoration-style: dotted; text-decoration-thickness: 2px; }

/* Cajas: borde negro y bisel de píxel */
.g-card, .privacy-chip, .steps li, .modes-list li, .howto-steps figure, .menu, .g-awards li {
  border: 3px solid var(--line); background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--edge), inset 0 -8px 0 3px rgb(0 0 0 / .25);
}
.g-players li, .g-stat, .g-field, .g-ranking li, .g-votes li, .g-board li { background: var(--bg-2); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); }

/* ----- Portada ----- */
.topbar { background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 3px solid var(--line); box-shadow: 0 3px 0 var(--edge); }
.brand { font-size: 22px; }
.eyebrow { background: var(--surface-2); color: var(--primary); border: 3px solid var(--line); font-size: 12px; padding: 7px 12px; }
.hero h1 { font-size: clamp(42px, 12vw, 84px); font-weight: 700; line-height: 1; text-shadow: 4px 4px 0 #5a3fd0, 8px 8px 0 #0b0718; }
.hero h1 .hl { color: var(--primary); text-shadow: 4px 4px 0 var(--primary-shade), 8px 8px 0 #0b0718; }
.hero-art { padding: 8px 0 0; }
.hero-svg { width: min(360px, 92vw); height: auto; filter: drop-shadow(6px 6px 0 #0b0718); animation: px-float 3s steps(6) infinite alternate; }
@keyframes px-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 26px; margin: 40px 0 16px; }
.section-title span { padding: 4px 8px 6px; background: var(--pink); color: #120c26; font-size: 16px; }
.steps li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; }
@media (min-width: 720px) { .steps li { grid-template-columns: 1fr; text-align: center; } .steps .step-art { justify-self: center; } }
.step-svg { width: 92px; height: auto; filter: drop-shadow(4px 4px 0 #0b0718); }
@media (min-width: 720px) { .step-svg { width: 118px; } }
.steps h3, .modes-list h3 { font-size: 20px; }
.modes-list { grid-template-columns: 1fr; }
@media (min-width: 720px) { .modes-list { grid-template-columns: repeat(3, 1fr); } }
.howto-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 12px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.howto-steps figure { margin: 0; padding: 14px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.howto-steps .step-svg { width: 118px; }
.howto-steps figcaption { font-size: 14px; color: var(--ink-2); text-align: center; }
.howto-steps figcaption b {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 4px; background: var(--primary); color: #120c26; font-family: var(--display);
}
.howto-steps figcaption strong { color: var(--ink); }

/* ----- Juego ----- */
.game {
  background:
    radial-gradient(circle, rgb(255 255 255 / .4) 1px, transparent 1.6px) 0 0 / 53px 53px,
    radial-gradient(40rem 30rem at 0% 0%, rgb(139 108 255 / .22), transparent 60%),
    var(--bg);
}
.game-bar { border-bottom: 3px solid var(--line); box-shadow: 0 3px 0 var(--edge); margin-bottom: 8px; padding: 6px 8px; gap: 5px; }
.game-bar .icon-btn { width: 40px; height: 40px; }
@media (max-width: 480px) { .game-title { display: none; } }
/* En el móvil no cabe todo: durante la partida se ven los puntos y no el código. */
.game-tags { margin-left: auto; min-width: 0; }
.game-score { white-space: nowrap; }
.game-score:not(:empty) + .game-code { display: none; }
.game-code { background: var(--surface-2); border: 3px solid var(--line); color: var(--primary); }
.game-score:not(:empty) { border: 3px solid var(--line); }
.g-chat-btn { position: relative; }
.g-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center;
  background: var(--pink); color: #120c26; border: 2px solid var(--line); font-family: var(--display); font-size: 11px; font-weight: 700;
}
.g-code-big span { border: 3px solid var(--line); background: var(--bg); box-shadow: inset 0 -5px 0 rgb(0 0 0 / .4), inset 0 3px 0 rgb(255 255 255 / .08); color: var(--primary); text-shadow: 3px 3px 0 var(--primary-shade); }
.g-qr { border: 3px solid var(--line); }
.g-step { background: var(--pink); color: #120c26; }
.av { box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25), inset 0 2px 0 rgb(255 255 255 / .35); border: 2px solid var(--line); font-family: var(--display); }
.av-sm { border-width: 1px; box-shadow: none; }
.g-mode, .g-toggle { border: 3px solid var(--line); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); }
.g-mode[aria-pressed="true"] { background: #3a2a85; box-shadow: inset 0 0 0 3px var(--violet), inset 0 -6px 0 3px rgb(0 0 0 / .25); }
.g-toggle[aria-pressed="true"] { box-shadow: inset 0 -5px 0 #5a3fd0, inset 0 3px 0 rgb(255 255 255 / .3); }
.g-field select { border: 3px solid var(--line); font-family: var(--display); }
.g-kick { border: 3px solid var(--line); background: var(--surface-2); }
.g-kick:disabled { opacity: .35; }
.g-startbar { border-top: 3px solid var(--line); box-shadow: 0 -3px 0 var(--edge); }
.g-video { border-radius: 0; border: 3px solid var(--line); box-shadow: 6px 6px 0 #0b0718; clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)); }
.g-cat { border: 3px solid var(--line); background: var(--surface-2); }
.g-time { height: 12px; border: 3px solid var(--line); background: var(--bg-2); border-radius: 0; }
.g-time-bar { border-radius: 0; background: repeating-linear-gradient(90deg, var(--primary) 0 6px, var(--primary-shade) 6px 8px); }
.g-tab { border: 3px solid var(--line); background: var(--surface-2); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); }
.g-react { border: 3px solid var(--line); background: var(--surface-2); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); font-family: var(--display); font-size: 11px; }
.g-panel { border: 3px solid var(--line); border-bottom: 0; box-shadow: inset 0 3px 0 var(--edge); }
.g-panel::before { border-radius: 0; background: var(--edge); }
.g-chip { border: 3px solid var(--line); background: var(--surface-2); box-shadow: inset 0 -5px 0 rgb(0 0 0 / .3); }
.g-chip.picked { box-shadow: inset 0 -5px 0 var(--primary-shade); }
.g-result { border: 3px solid var(--line); }
.g-result.good { animation: px-pop .5s steps(5) both; }
@keyframes px-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.g-bubble { animation-timing-function: steps(14); }
.g-bubble-name { border-radius: 0; font-family: var(--display); }
.g-confetti { border-radius: 0; width: 8px; height: 8px; animation-timing-function: steps(28); }
.g-fire { display: inline-flex; align-items: center; gap: 2px; color: var(--gold); font-weight: 800; }

/* Racha: cartel de 8 bits que aparece, parpadea y se va */
.g-streak {
  position: absolute; left: 50%; top: 38%; z-index: 7; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: #120c26; border: 3px solid var(--gold); box-shadow: inset 0 0 0 3px #0b0718, 0 0 0 3px #0b0718;
  transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  animation: streak-in .45s steps(5) both, streak-flash .3s steps(2) 5 .45s, streak-out .4s steps(4) 2.4s forwards;
}
.g-streak b { display: block; font-size: 28px; color: var(--gold); text-shadow: 3px 3px 0 #c9471a; }
.g-streak small { display: block; color: var(--primary); font-family: var(--display); font-size: 15px; }
.g-streak.other { top: 14%; padding: 8px 12px; border-color: var(--pink); }
.g-streak.other b { font-size: 17px; color: #fff; text-shadow: 2px 2px 0 var(--pink); }
@keyframes streak-in { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
@keyframes streak-flash { 50% { border-color: var(--pink); } }
@keyframes streak-out { to { transform: translate(-50%, -160%); opacity: 0; } }

/* Votación para expulsar */
.game-poll { margin: 0 10px 8px; padding: 10px 12px; background: #2a1030; border: 3px solid var(--coral); }
.g-poll-head { display: flex; align-items: center; gap: 10px; }
.g-poll-head p { flex: 1; margin: 0; font-size: 14px; }
.g-poll-count { padding: 1px 6px; background: var(--coral); color: #1a0806; font-weight: 700; }
.g-poll-left { font-family: var(--display); color: var(--coral); }
.g-poll-actions { display: flex; gap: 8px; margin-top: 8px; }
.g-poll-actions .btn { flex: 1; min-height: 40px; font-size: 13px; }
.g-poll-actions span { color: var(--ink-2); font-size: 14px; }

/* Chat */
.g-peek {
  position: fixed; left: 50%; top: calc(64px + var(--safe-top)); z-index: 9; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 8px 12px; border: 3px solid var(--line); background: var(--surface-3); color: var(--ink);
  font-size: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  animation: px-pop .3s steps(3) both;
}
.g-chat { display: flex; flex-direction: column; height: min(78vh, 640px); max-width: 560px; }
.g-chat-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.g-chat-list li { display: flex; gap: 8px; align-items: flex-start; }
.g-chat-list li.me { flex-direction: row-reverse; text-align: right; }
.g-chat-list li > div { max-width: 78%; padding: 6px 10px; background: var(--bg-2); border: 2px solid var(--line); }
.g-chat-list li.me > div { background: #2d3a12; }
.g-chat-list b { font-family: var(--display); font-size: 13px; }
.g-chat-list small { color: var(--muted); font-size: 11px; }
.g-chat-list p { margin: 2px 0 0; overflow-wrap: anywhere; }
.g-chat-empty { justify-content: center; color: var(--muted); padding: 30px 0; }
.g-chat-form { display: flex; gap: 8px; }
.g-chat-form input { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border: 3px solid var(--line); background: var(--bg-2); color: var(--ink); font-size: 16px; }
.game-panel .sheet-inner { max-height: 82vh; overflow-y: auto; }
.game-panel .howto-steps { grid-auto-columns: minmax(170px, 1fr); }

/* Final: puestos y premios */
.g-trophy { animation: px-pop .7s steps(6) both; }
.g-rname small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.g-awards { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
@media (min-width: 520px) { .g-awards { grid-template-columns: 1fr 1fr; } }
.g-awards li { display: flex; align-items: center; gap: 12px; padding: 12px; animation: px-pop .5s steps(5) both; }
.g-awards li:nth-child(2) { animation-delay: .15s; }
.g-awards li:nth-child(3) { animation-delay: .3s; }
.g-awards li:nth-child(4) { animation-delay: .45s; }
.g-awards li:nth-child(5) { animation-delay: .6s; }
.g-awards li:nth-child(6) { animation-delay: .75s; }
.g-awards b { display: block; color: var(--gold); font-size: 16px; }
.g-awards span { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.g-awards small { display: block; color: var(--muted); font-size: 12px; }
.toast { border: 3px solid var(--line); background: var(--surface-3); color: var(--ink); font-family: var(--display); }

/* ----- ¿Quién Fue?: logo, iconos pixel y vídeo grande ----- */
.brand { gap: 10px; }
.logo-svg { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; filter: drop-shadow(2px 2px 0 #0b0718); }
.brand-name { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: .02em; text-shadow: 2px 2px 0 #5a3fd0; }
.brand-name span, .game-title span { color: var(--primary); }
.mode-svg { width: 42px; height: auto; margin-bottom: 4px; }
.modes-list .mode-icon { font-size: 0; }
.g-emoji .spr { filter: drop-shadow(3px 3px 0 #0b0718); }
.g-react { gap: 3px; }
.g-react .spr { filter: drop-shadow(1px 1px 0 #0b0718); }
.g-bubble { animation: g-float 2.4s cubic-bezier(.2, .7, .3, 1) forwards; will-change: transform, opacity; }
.g-bubble-emoji { font-size: 0; filter: drop-shadow(2px 2px 0 #0b0718); }
.g-toggle .spr, .g-mode .spr, .btn .spr, .g-cat .spr, .g-pstate .spr, .g-stat .spr { margin-top: -2px; }
.g-tab .spr { margin: -3px 2px 0 0; }
.howto-steps em { color: var(--muted); font-style: normal; font-size: 12px; }
@media (min-width: 900px) {
  .howto-steps { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; }
}
/* El efecto de pantalla antigua solo en la portada: nunca encima del vídeo. */
body:has(.game:not([hidden]))::after { display: none; }
.g-video { background: #000; isolation: isolate; }

/* Ordenador: vídeo grande a la izquierda y votación a la derecha */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .g-play {
    display: grid; height: 100%; max-width: 1240px; margin: 0 auto; column-gap: 24px; padding: 0 24px 16px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    grid-template-areas: "top top" "stage title" "stage tabs" "stage panel" "stage reacts" "stage .";
  }
  .g-top { grid-area: top; padding: 0 0 10px; }
  /* El vídeo pegado a la columna de la votación */
  .g-stage { grid-area: stage; padding: 0; min-height: 0; justify-content: flex-end; }
  .g-imp-title { grid-area: title; margin: 0 0 8px; text-align: left; }
  .g-tabs { grid-area: tabs; padding: 0 0 10px; justify-content: flex-start; }
  .g-panel { grid-area: panel; align-self: start; width: 100%; max-width: none; margin: 0; border-bottom: 3px solid var(--line); clip-path: none; }
  .g-reacts { grid-area: reacts; flex-wrap: wrap; justify-content: flex-start; padding: 12px 0 0; overflow: visible; }
}

/* ----- Ventana para subir el archivo y reacciones propias ----- */
.g-upload-drop { margin-top: 10px; padding: 14px; text-align: center; border: 3px dashed var(--edge); }
.g-upload-drop.drag { border-color: var(--primary); background: var(--primary-soft); }
.g-upload-drop .btn-big { width: 100%; }
.g-react.mine { border-color: var(--pink); }
.g-react.mine span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-react-add { font-size: 22px; line-height: 1; color: var(--primary); }
.g-react-add span { font-size: 10px; }
.g-rslot { padding: 12px; margin-bottom: 10px; background: var(--bg-2); border: 3px solid var(--line); }
.g-rslot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.g-rslot-prev { display: grid; place-items: center; width: 44px; height: 44px; flex: none; background: var(--surface-2); border: 3px solid var(--line); font-family: var(--display); color: var(--muted); }
.g-rslot-head input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 3px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--display); font-size: 16px; text-transform: uppercase; }
.g-rslot-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.g-rslot-icons button { display: grid; place-items: center; height: 40px; padding: 0; overflow: hidden; border: 3px solid var(--line); background: var(--surface-2); cursor: pointer; }
.g-rslot-icons button[aria-pressed="true"] { background: var(--violet); box-shadow: inset 0 -4px 0 #5a3fd0; }
.g-react.mine span, .g-react-add span { font-size: 10px; line-height: 1.1; }
.g-react-add { min-width: 46px; }
/* Botón GIF: cambia la barra entre las reacciones normales y las animadas. */
.g-react-gif { min-width: 46px; color: var(--pink); font-size: 15px; }
.g-react-gif[aria-pressed="true"] { color: var(--primary); font-size: 20px; }
.g-reacts:not(.show-gifs) .g-react.gif, .g-reacts.show-gifs .g-react.std { display: none; }
.g-react.gif { border-color: var(--pink); }
/* Sprites animados: los fotogramas están en fila y se pasan como en un GIF. */
.spr-anim { animation: spr-play var(--d) steps(var(--n)) infinite; }
@keyframes spr-play { to { transform: translateX(var(--to)); } }
@media (prefers-reduced-motion: reduce) { .spr-anim { animation: none; } }
.g-myreacts { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }

/* ----- Idioma ----- */
.art-es, .art-en { display: contents; }
html[lang="en"] .art-es, html[lang="es"] .art-en { display: none; }

/* ----- Ventanas del tutorial grandes en el ordenador ----- */
@media (min-width: 900px) {
  #gameUpload .sheet-inner, #gameHowto .sheet-inner { width: min(1100px, 94vw); max-width: none; max-height: 90vh; padding: 22px 28px 26px; }
  #gameUpload .howto-steps, #gameHowto .howto-steps { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 16px; }
  #gameUpload .howto-steps .step-svg, #gameHowto .howto-steps .step-svg { width: 150px; }
  #gameUpload .howto-steps figcaption, #gameHowto .howto-steps figcaption { font-size: 15px; }
  #gameUpload .g-upload-drop { max-width: 520px; margin: 16px auto 0; }
}

/* Barra ES | EN: el idioma activo, destacado */
.lang-toggle { display: inline-flex; align-self: center; padding: 3px; gap: 3px; background: var(--bg-2); border: 3px solid var(--line); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .3); }
.lang-toggle button {
  min-width: 38px; height: 32px; padding: 0 8px; border: 0; background: transparent; color: var(--muted);
  font-family: var(--display); font-size: 14px; font-weight: 700; letter-spacing: .04em; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); box-shadow: inset 0 -3px 0 var(--primary-shade); }
.lang-toggle button:not([aria-pressed="true"]):hover { color: var(--ink); }
.game-bar .lang-toggle button { min-width: 32px; height: 28px; padding: 0 5px; font-size: 13px; }

/* ----- Battle royale: vida, zona y eliminados ----- */
.g-hp-strip {
  display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 6px 10px;
  background: var(--bg-2); border: 3px solid var(--line); font-family: var(--display); font-size: 14px;
}
.g-hp-strip b { color: var(--ink); }
.g-hp-strip .g-dead { color: var(--coral); }
.g-hp-strip.hit { animation: hp-hit .5s steps(6); border-color: var(--danger); }
@keyframes hp-hit { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.g-hp { position: relative; flex: 1; min-width: 50px; height: 12px; background: #0b0718; border: 2px solid var(--line); }
.g-hp > span { position: absolute; inset: 0 auto 0 0; background: var(--good); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25); transition: width .5s steps(8); }
.g-hp > span.low { background: var(--danger); animation: px-blink 1s steps(1, end) infinite; }
.g-hp-sm { flex: none; width: 54px; height: 10px; }
.g-zone { padding: 2px 6px; background: var(--danger); color: #120c26; font-size: 12px; }
.g-left { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.g-hpboard li.dead { opacity: .55; }
.g-fell { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.g-board em.g-hit { color: var(--danger); }
.g-royale-note { color: var(--coral); }
.g-streak.g-banner-out { border-color: var(--danger); }
.g-streak.g-banner-out b { color: var(--danger); text-shadow: 3px 3px 0 #5b0f0f; }
.g-streak.g-banner-zone { border-color: var(--danger); top: 30%; }
.g-streak.g-banner-zone b { font-size: 20px; color: #fff; text-shadow: 3px 3px 0 var(--danger); }
.g-streak.g-banner-other { border-color: var(--danger); }
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .g-hp-strip { grid-area: title; margin: 0 0 8px; }
}

/* ----- Avatares de pixel art (js/avatars.js) ----- */
.av.px { background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible; }
.av.px .pxa, .pxa { width: 100%; height: 100%; overflow: visible; stroke: none; filter: drop-shadow(1px 1px 0 rgb(11 7 24 / .9)); }
.pxa .pxa-ec, .pxa .pxa-fb { visibility: hidden; }
.pxa-idle .pxa-fig { animation: pxa-bob 1.6s steps(1) infinite; }
.pxa-idle .pxa-eo { animation: pxa-blink 3.6s steps(1) infinite; }
.pxa-idle .pxa-ec { animation: pxa-blink 3.6s steps(1) infinite reverse; }
.pxa-win .pxa-fig { animation: pxa-jump .7s steps(1) infinite; }
.pxa-win .pxa-fa { animation: pxa-swap .5s steps(1) infinite; }
.pxa-win .pxa-fb { animation: pxa-swap .5s steps(1) infinite reverse; }
.pxa-lose .pxa-fig { animation: pxa-shiver 1.2s steps(1) infinite; }
.pxa-lose .pxa-tear { animation: pxa-tear 1.2s steps(4) infinite; }
.pxa-dead { filter: grayscale(1) brightness(.75) !important; opacity: .75; }
.pxa-dead .pxa-fig { transform: translateY(1px); }
@keyframes pxa-bob { 0%, 100% { transform: none; } 50% { transform: translateY(1px); } }
@keyframes pxa-blink { 0%, 93% { visibility: visible; } 94%, 100% { visibility: hidden; } }
@keyframes pxa-jump { 0% { transform: none; } 20% { transform: translateY(-2px); } 40% { transform: translateY(-3px); } 60% { transform: translateY(-2px); } 80% { transform: translateY(1px); } }
@keyframes pxa-swap { 0% { visibility: visible; } 50% { visibility: hidden; } }
@keyframes pxa-shiver { 0%, 40%, 100% { transform: translateY(1px); } 50% { transform: translate(-1px, 1px); } 60% { transform: translate(1px, 1px); } 70% { transform: translate(-1px, 1px); } }
@keyframes pxa-tear { from { transform: none; opacity: 1; } to { transform: translateY(5px); opacity: .2; } }
/* Los pequeños de listas y chat no se mueven si no hay nada que celebrar. */
.av-sm .pxa-idle .pxa-fig, .av-sm .pxa-idle .pxa-eo, .av-sm .pxa-idle .pxa-ec { animation: none; }
@media (prefers-reduced-motion: reduce) { .pxa *, .pxa { animation: none !important; } }
/* Tamaños en múltiplos del lienzo (16x22) para que cada píxel salga nítido. */
.av.px { --k: 2; width: calc(var(--k) * 16px); height: calc(var(--k) * 22px); display: inline-block; flex: none; vertical-align: middle; }
.av.px.av-sm { --k: 1; }
.av.px.av-hero { --k: 3; }
.av.px.av-xl { --k: 4; }
.g-chip .av.px { --k: 2; width: 32px; height: 44px; margin: -6px 0; }
.g-owner .av.px { animation: px-pop .5s steps(5) both; }
.g-av-edit { padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.g-av-edit::after {
  content: "✎"; position: absolute; right: -8px; bottom: -4px; width: 14px; height: 14px; display: grid; place-items: center;
  background: var(--primary); color: #120c26; border: 2px solid var(--line); font-size: 10px; line-height: 1;
}

/* Fila del resultado con tu muñeco */
.g-result-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 4px; }
.g-result-row .g-result { margin: 0; }

/* Podio: ganadores bailando junto al trofeo */
.g-trophy { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }

/* Editor de avatar */
.g-av-field { margin-bottom: 14px; }
.g-av-field > span { display: block; margin-bottom: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.ave { display: grid; gap: 8px; }
.ave-stage { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--bg-2); border: 3px solid var(--line); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3); }
.ave-preview.av.px { --k: 4; margin: 4px 6px; }
.ave-side { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ave-try { display: flex; gap: 4px; }
.ave-try button, .ave-tabs button {
  flex: 1; min-width: 0; min-height: 36px; padding: 4px 6px; border: 3px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-family: var(--display); font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ave-try button[aria-pressed="true"] { background: var(--primary); color: #120c26; }
.ave-dice { min-height: 38px; font-size: 14px; }
.ave-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ave-tabs button[aria-selected="true"] { background: #3a2a85; color: var(--ink); box-shadow: inset 0 0 0 2px var(--violet); }
.ave-opts { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.ave-opt {
  flex: none; width: 50px; height: 60px; display: grid; place-items: center; padding: 0; scroll-snap-align: start;
  background: var(--surface); border: 3px solid var(--line); cursor: pointer;
}
.ave-opt .pxa { width: 32px; height: 44px; }
.ave-opt[aria-checked="true"] { background: #3a2a85; border-color: var(--primary); }
.ave-swatch { width: 30px; height: 30px; border: 3px solid #0b0718; box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25); }
@media (min-width: 720px) {
  .ave-preview.av.px { --k: 5; }
  .ave-opts { flex-wrap: wrap; overflow: visible; }
}
#gameProfileAv { margin: 6px 0 12px; }

/* Modos de texto: comentarios y mensajes directos */
.g-textcard { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 18px; overflow-y: auto; background: var(--bg-2); box-shadow: inset 0 -6px 0 rgb(0 0 0 / .3); }
.g-textmsg { margin: 0; max-width: 34ch; padding: 18px 20px; font-size: clamp(1.15rem, 2.2vw + .7rem, 1.7rem); line-height: 1.35; overflow-wrap: anywhere; color: #0d0a1a; background: #c8ff4d; box-shadow: 0 6px 0 rgb(0 0 0 / .35); }
.g-text-dms .g-textmsg { color: #fff; background: #8b6cff; }
.g-textrows { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 6px; }
.g-textrows li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-2); }
.g-textrows li > span { flex: 1; min-width: 0; }
.g-textrows small { display: block; }
.g-review-box { margin: 12px 0 8px; display: grid; gap: 10px; }
.g-review { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-rv { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 10px; text-align: left; color: inherit; font: inherit; background: var(--bg-2); border: 0; cursor: pointer; }
.g-rv span:last-child { min-width: 0; overflow-wrap: anywhere; }
.g-rv-mark { flex: none; width: 1.3em; color: #c8ff4d; }
.g-rv[aria-pressed="false"] { opacity: .5; }
.g-rv[aria-pressed="false"] span:last-child { text-decoration: line-through; }
.g-rv[aria-pressed="false"] .g-rv-mark { color: #ff6b6b; }
