/* ============================================================
   MINIJUEGO — BREAK TIME (game.js, solo en la home)
   Una consolita junto al título abre un modal con «Break Time»,
   un juego al estilo de BBTAN: apuntas, sueltas la ráfaga de bolas y
   rompes los bloques numerados antes de que lleguen abajo.
   Mismo sistema que el resto: cristal del botón del menú, Clash
   Display para las cifras, etiquetas pequeñas con tracking y la
   curva de la casa. Solo transform y opacity en lo que se mueve.
   ============================================================ */

/* ---- botón de acceso: una consolita portátil ----
   Dibujada en toon, como el tocadiscos y el muñeco: plástico opaco en el
   color del logo (beige de noche, marrón de día) con una banda de luz
   arriba a la izquierda y una de sombra abajo a la derecha, de corte
   nítido; contorno de tinta y brillos blancos de dibujo en la pantalla y
   en los botones. Sin sombra proyectada. Su pantalla es un canvas con una partida en
   miniatura (game.js). Al pasar el cursor se levanta y se ladea un poco,
   como cuando la coges; el LED se enciende. En ordenador va junto al
   título, en espejo del puntito de «Don’t click!» (ver más abajo); en
   móvil, en la esquina. */
.gb {
  --e: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gb-base: #d6c3a0;
  --gb-light: #ead9b8;
  --gb-shade: #b39d78;
  --gb-line: #2a2019;
  --gb-ink: #2a2620;
  --gb-led: #d4a947;
  position: fixed;
  right: 254px;               /* sin game.js, junto al reproductor */
  bottom: 16px;
  z-index: 1;                 /* bajo las cards (z-index 2): al arrastrarlas pasan por encima */
  width: 46px;
  height: 66px;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
}
body.theme-light .gb {
  --gb-base: #86755b;
  --gb-light: #9d8b6e;
  --gb-shade: #6b5c46;
  --gb-line: #221d17;
  --gb-ink: #221d17;
}
.gb:focus-visible { outline: 1px solid currentColor; outline-offset: 5px; color: rgba(255, 255, 255, 0.7); }
.gb-body {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  transition: transform 0.4s var(--e);
}
/* el plástico: misma silueta que el dibujo (esquina de abajo más curva).
   Las bandas son sombras interiores sin desenfoque (siguen la curva de
   las esquinas) y el contorno, una exterior de grosor fijo */
.gb-glass {
  position: absolute;
  inset: 0;
  border-radius: 7px 7px 16px 7px;
  background: var(--gb-base);
  box-shadow: inset -4px -5px 0 0 var(--gb-shade), inset 3px 3px 0 0 var(--gb-light), 0 0 0 1.6px var(--gb-line);
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
}
.gb-shell { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.gb-shine-dot { fill: #fff8ec; opacity: 0.85; }
/* los brillos de la pantalla, encima del canvas */
.gb-glint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: #fff8ec;
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.75;
}
.gb-bezel, .gb-ink { fill: var(--gb-ink); }
.gb-ss { opacity: 0.75; }
.gb-grill { fill: none; stroke: var(--gb-ink); stroke-width: 1.1; stroke-linecap: round; opacity: 0.5; }
.gb-led { fill: var(--gb-led); opacity: 0.4; transition: opacity 0.3s var(--e); }
.gb-a { transform-box: fill-box; transform-origin: center; transition: transform 0.12s var(--e); }
/* la pantalla: encima del hueco del bisel, nítida como un LCD */
.gb-screen {
  position: absolute;
  left: 15.217%;
  top: 12.121%;
  width: 69.565%;
  height: 36.364%;
  display: block;
  border-radius: 1.5px;
  image-rendering: pixelated;
}

@media (hover: hover) and (pointer: fine) {
  .gb:hover .gb-body { transform: translateY(-4px) rotate(-5deg); }
  .gb:hover .gb-led { opacity: 1; }
}
/* al pulsar se hunde un pelín y se aprieta la A */
.gb:active .gb-body { transform: translateY(-1px) rotate(-2deg) scale(0.95); transition-duration: 0.16s; }
.gb:active .gb-a { transform: translateY(0.6px) scale(0.92); }
@media (max-width: 768px) {
  /* en móvil, en la esquina libre: espeja al botón del menú */
  .gb { right: 16px; bottom: 18px; width: 40px; height: 57.4px; cursor: pointer; }
  .gb-glass { border-radius: 6px 6px 14px 6px; box-shadow: inset -3px -4px 0 0 var(--gb-shade), inset 2.5px 2.5px 0 0 var(--gb-light), 0 0 0 1.4px var(--gb-line); }
}
@media (prefers-reduced-motion: reduce) {
  .gb-body, .gb:hover .gb-body, .gb:active .gb-body { transform: none; transition: none; }
}

/* ---- en ordenador: junto al título, en espejo del puntito ----
   El puntito de «Don’t click!» está abajo a la izquierda con su nota y su
   flecha a mano; la consola hace lo mismo a la derecha: la nota «Break
   time!», en la misma letra y el mismo beige, y la flecha bajando hacia
   ella. Entra a la vez que el puntito (game.js copia su posición en espejo
   y su --fs). La consola va un poco girada, como dejada encima de la mesa. */
.gb-hint { display: none; }
@media (min-width: 769px) {
  .gb.is-spot {
    --gb-rot: 9deg;
    right: auto;               /* game.js da left / top */
    bottom: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.4s var(--e), transform 0.6s var(--e), visibility 0s linear 0.4s;
  }
  .gb.is-spot.is-in {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.6s var(--e) 0.45s, transform 0.9s var(--e) 0.45s, visibility 0s linear 0.45s;
  }
  .gb.is-spot .gb-body { transform: rotate(var(--gb-rot)); }
  .gb.is-spot:active .gb-body { transform: translateY(-1px) rotate(calc(var(--gb-rot) - 3deg)) scale(0.95); }

  .gb-hint {
    --hint: #c7b299;
    --fs: 90px;
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;               /* como la consola: bajo las cards */
    width: 0;
    height: 0;
    pointer-events: none;
  }
  body.theme-light .gb-hint { --hint: #8a6f4a; }
  .gb-note,
  .gb-arrow {
    position: absolute;
    opacity: 0;
    transition: opacity 0.6s var(--e), transform 0.8s var(--e);
  }
  /* las mismas medidas que la nota del puntito, en espejo */
  .gb-note {
    right: calc(var(--fs) * -1.7);
    top: calc(var(--fs) * -1.19);
    white-space: nowrap;
    font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
    font-size: calc(var(--fs) * 0.22);
    font-weight: 500;
    line-height: 1;
    color: var(--hint);
    transform: rotate(14deg) translateY(8px);
  }
  .gb-arrow {
    right: calc(var(--fs) * -1.27);
    top: calc(var(--fs) * -0.955);
    width: calc(var(--fs) * 0.65);
    height: auto;
    fill: none;
    stroke: var(--hint);
    stroke-width: 3.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: scaleX(-1) translate(-8px, -8px);
  }
  .gb-hint.is-in .gb-note { opacity: 0.95; transform: rotate(14deg); transition-delay: 0.15s; }
  .gb-hint.is-in .gb-arrow { opacity: 0.9; transform: scaleX(-1); transition-delay: 0.3s; }
  .gb-hint.is-settled .gb-note,
  .gb-hint.is-settled .gb-arrow { transition-delay: 0s; transition-duration: 0.3s; }
}
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  /* cursor encima: la consola se levanta y la flecha se acerca a ella */
  .gb.is-spot:hover .gb-body { transform: translateY(-5px) rotate(calc(var(--gb-rot) - 6deg)); }
  .gb.is-spot:hover + .gb-hint.is-settled .gb-arrow { transform: scaleX(-1) translate(5px, 4px); }
}
@media (min-width: 769px) and (prefers-reduced-motion: reduce) {
  .gb.is-spot, .gb.is-spot.is-in { transform: none; }
  .gb.is-spot .gb-body, .gb.is-spot:hover .gb-body, .gb.is-spot:active .gb-body { transform: rotate(var(--gb-rot)); }
  .gb-note, .gb-hint.is-in .gb-note { transform: rotate(14deg) !important; }
  .gb-arrow, .gb-hint.is-in .gb-arrow { transform: scaleX(-1) !important; }
}


/* ---- modal ---- */
.bk {
  --e: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bk-bg: #100f0d;
  --bk-bg-rgb: 16, 15, 13;
  --bk-ink: #f3ede1;
  --bk-mute: rgba(243, 237, 225, 0.5);
  --bk-line: rgba(243, 237, 225, 0.13);
  /* bloques: del claro (les queda poco) al oscuro (aguantan mucho) */
  --bk-low: #efe3c2;
  --bk-high: #a88d62;
  --bk-num: #1a1714;
  --bk-acc: #c7b299;
  --bk-fire: #d4a947;
  --bk-well: rgba(243, 237, 225, 0.04);
  /* Egg Ninja: la cáscara y la bomba */
  --bk-shell: #efe6d3;
  --bk-shell-line: transparent;
  --bk-bomb: #050504;
  --bk-bomb-line: rgba(243, 237, 225, 0.85);
  position: fixed;
  inset: 0;
  z-index: 8600;              /* sobre la home y el botón del menú; bajo la cortina y el cursor */
  display: grid;
  place-items: center;
  color: var(--bk-ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bk[hidden] { display: none; }
.bk.is-light {
  --bk-bg: #f1ece3;
  --bk-bg-rgb: 241, 236, 227;
  --bk-ink: #2a2620;
  --bk-mute: rgba(42, 38, 32, 0.52);
  --bk-line: rgba(42, 38, 32, 0.15);
  --bk-low: #9b8869;
  --bk-high: #3b3126;
  --bk-num: #f3ede1;
  --bk-acc: #8a6f4a;
  --bk-fire: #b8862b;
  --bk-well: rgba(42, 38, 32, 0.05);
  --bk-shell: #fffdf8;
  --bk-shell-line: rgba(42, 38, 32, 0.42);
  --bk-bomb: #2a2620;
  --bk-bomb-line: transparent;
}
.bk *, .bk *::before, .bk *::after { box-sizing: border-box; }
/* reseteo sin especificidad: los márgenes de cada pieza mandan */
:where(.bk) p, :where(.bk) ol, :where(.bk) h2 { margin: 0; }

.bk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s var(--e);
}
.bk.is-light .bk-backdrop { background: rgba(60, 50, 38, 0.26); }

/* el panel, en vertical como la pantalla de un móvil: entra creciendo un
   poco desde abajo y se va más rápido */
.bk-panel {
  position: relative;
  width: min(500px, calc(100vw - 48px));
  height: min(860px, calc(100svh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--bk-bg);
  border: 1px solid var(--bk-line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.6);
  outline: none;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.18s var(--e), transform 0.22s var(--e);
}
.bk.is-open .bk-backdrop { opacity: 1; transition-duration: 0.3s; }
.bk.is-open .bk-panel {
  opacity: 1;
  transform: none;
  transition-duration: 0.3s, 0.5s;
}
/* abriendo / cerrando desde la pantallita de la consola: lo anima game.js */
.bk.is-zoom .bk-panel { transition: none; }

/* ---- barra superior: ronda, récord, sonido, cerrar ---- */
.bk-hud {
  position: relative;
  flex: none;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 22px;
  border-bottom: 1px solid var(--bk-line);
}
.bk-hud-l { position: relative; display: flex; align-items: center; min-width: 0; height: 100%; }
.bk-lbl,
.bk-brand,
.bk-best,
.bk-k,
.bk-board-h,
.bk-hint,
.bk-stats,
.bk-unit {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-mute);
}
.bk-brand { white-space: nowrap; }
.bk-brand b { color: var(--bk-ink); font-weight: 700; }
.bk-brand,
.bk-scorebox { transition: opacity 0.25s var(--e), transform 0.35s var(--e); }
.bk-scorebox {
  position: absolute;
  left: 0;
  top: 50%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  transform: translateY(-30%);
  pointer-events: none;
}
.bk-score {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--bk-ink);
}
.bk-hud-c { text-align: center; }
.bk-best { opacity: 0; transition: opacity 0.25s var(--e); white-space: nowrap; }
.bk-hud-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bk.is-game .bk-brand,
.bk[data-game] .bk-brand { opacity: 0; transform: translateY(-30%); }
/* «← Juegos»: vuelve al menú desde el inicio o el final de cada juego */
.bk-tohub {
  position: absolute;
  left: -10px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bk-ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-30%);
  transition: opacity 0.25s var(--e), transform 0.35s var(--e), visibility 0s linear 0.25s, background-color 0.2s var(--e);
}
.bk-tohub svg { width: 10px; height: 10px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--e); }
.bk[data-game]:not(.is-game) .bk-tohub { opacity: 1; visibility: visible; transform: translateY(-50%); transition-delay: 0s; }
.bk[data-game]:not(.is-game) .bk-tohub:active { transform: translateY(-50%) scale(0.96); transition-duration: 0.16s; }
.bk-tohub:focus-visible { outline: 1px solid var(--bk-ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .bk-tohub:hover { background: var(--bk-line); }
  .bk-tohub:hover svg { transform: translateX(-2px); }
}
/* las monedas y la tienda son cosa de Break Time */
.bk:not([data-game="bbtan"]) .bk-coins,
.bk:not([data-game="bbtan"]) .bk-shop-b { display: none; }
.bk.is-game .bk-scorebox { opacity: 1; transform: translateY(-50%); }
.bk.is-game .bk-best { opacity: 1; }

.bk-ibtn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--bk-line);
  background: transparent;
  color: var(--bk-ink);
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s var(--e), border-color 0.2s var(--e), transform 0.16s var(--e);
}
.bk-ibtn svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bk-ibtn:active { transform: scale(0.92); }
.bk-ibtn:focus-visible,
.bk-btn:focus-visible,
.bk-recall:focus-visible { outline: 1px solid var(--bk-ink); outline-offset: 3px; }
.bk-mute .bk-off { display: none; }
.bk-mute[aria-pressed="true"] .bk-on { display: none; }
.bk-mute[aria-pressed="true"] .bk-off { display: block; }
@media (hover: hover) and (pointer: fine) {
  .bk-ibtn:hover { background: var(--bk-line); }
}

/* ---- escenario ---- */
.bk-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.bk-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* aviso de cómo tirar: late suave en las primeras rondas */
.bk-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--e);
}
.bk-hint.is-on { opacity: 1; animation: bk-breathe 1.6s ease-in-out infinite alternate; }
@keyframes bk-breathe { from { opacity: 1; } to { opacity: 0.4; } }

/* «Recoger» (si la ronda se alarga) y el aviso de velocidad */
.bk-recall {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--bk-line);
  background: rgba(var(--bk-bg-rgb), 0.72);
  color: var(--bk-ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--e), transform 0.3s var(--e), visibility 0s linear 0.2s, background-color 0.2s var(--e);
}
.bk-recall svg { width: 10px; height: 10px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bk-recall.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.bk-recall:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .bk-recall:hover { background: var(--bk-line); }
}
.bk-speed {
  position: absolute;
  left: 14px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bk-acc);
  color: var(--bk-bg);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s var(--e), transform 0.3s var(--e);
}
.bk-speed.is-on { opacity: 1; transform: none; }

/* rótulo grande en mitad del escenario (récord, rondas redondas) */
.bk-toast {
  position: absolute;
  left: 50%;
  top: 44%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.bk-toast span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; color: var(--bk-mute); }
.bk-toast b {
  text-transform: uppercase;
  white-space: nowrap;
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--bk-ink);
}
.bk-toast.is-on { animation: bk-toast 1.5s var(--e) forwards; }
@keyframes bk-toast {
  0% { opacity: 0; transform: translate(-50%, -38%); }
  16%, 72% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -58%); }
}

/* ---- pantallas (inicio, pausa, fin) ---- */
.bk-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  text-align: center;
  overflow-y: auto;
  background: rgba(var(--bk-bg-rgb), 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--e), visibility 0s linear 0.2s;
}
.bk-screen.is-on { opacity: 1; visibility: visible; transition: opacity 0.3s var(--e), visibility 0s; }
/* el contenido sube un poco al entrar, en cascada */
.bk-screen > * { transform: translateY(10px); transition: transform 0.5s var(--e); }
.bk-screen.is-on > * { transform: none; }
.bk-screen.is-on > :nth-child(2) { transition-delay: 0.04s; }
.bk-screen.is-on > :nth-child(3) { transition-delay: 0.08s; }
.bk-screen.is-on > :nth-child(4) { transition-delay: 0.12s; }
.bk-screen.is-on > :nth-child(5) { transition-delay: 0.16s; }
.bk-screen.is-on > :nth-child(6) { transition-delay: 0.2s; }
.bk-screen.is-on > :nth-child(7) { transition-delay: 0.24s; }
/* inicio: debajo de las filas de muestra, que hacen de cabecera */
.bk-s-start {
  justify-content: flex-start;
  padding-top: calc(var(--bk-gb, 220px) + 22px);
  background: transparent;
}

.bk-title {
  margin-top: 0;
  text-transform: uppercase;
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(3rem, 13vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: var(--bk-ink);
}
/* dos líneas, como un cartel (con un espacio de verdad entre las dos palabras) */
.bk-title span { display: block; }
.bk-how {
  max-width: 360px;
  margin-top: 18px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--bk-mute);
}
.bk-how b { color: var(--bk-ink); font-weight: 600; }
.bk-keys { display: block; margin-top: 6px; font-size: 0.72rem; }

.bk-form { display: flex; align-items: flex-end; gap: 14px; margin-top: 24px; }
.bk-form.is-bad { animation: bk-shake 0.4s var(--e); }
@keyframes bk-shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.bk-name { display: block; margin: 0; }
.bk-name input {
  display: block;
  width: 210px;
  height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--bk-line);
  border-radius: 0;
  background: transparent;
  color: var(--bk-ink);
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  outline: none;
  cursor: none;
  transition: border-color 0.2s var(--e);
}
.bk-name input::placeholder { color: var(--bk-mute); opacity: 0.6; }
.bk-name input:focus { border-color: var(--bk-ink); }

.bk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--bk-ink);
  background: var(--bk-ink);
  color: var(--bk-bg);
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--e), background-color 0.2s var(--e), border-color 0.2s var(--e), color 0.2s var(--e);
}
.bk-btn svg { width: 10px; height: 10px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--e); }
.bk-btn:active { transform: scale(0.97); }
.bk-btn.bk-ghost { background: transparent; color: var(--bk-ink); border-color: var(--bk-line); }
@media (hover: hover) and (pointer: fine) {
  .bk-btn:hover { background: var(--bk-acc); border-color: var(--bk-acc); }
  .bk-btn:hover svg { transform: translateX(3px); }
  .bk-btn.bk-ghost:hover { background: var(--bk-line); border-color: var(--bk-line); color: var(--bk-ink); }
}
.bk-err { min-height: 1.2em; margin-top: 10px; font-size: 0.72rem; color: var(--bk-acc); }

/* ---- menú: elige un juego ---- */
.bk-s-hub { background: var(--bk-bg); justify-content: center; justify-content: safe center; }
.bk-title-hub { margin-top: 10px; }
/* las tarjetas entran una a una (el contenedor no se mueve) */
.bk-screen > .bk-games { transform: none; }
.bk-games {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(410px, 100%);
  margin-top: 28px;
}
.bk-game {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--bk-line);
  border-radius: 18px;
  background: transparent;
  color: var(--bk-ink);
  font: inherit;
  text-align: left;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  translate: 0 12px;
  transition: opacity 0.3s var(--e), translate 0.5s var(--e), scale 0.16s var(--e), background-color 0.2s var(--e), border-color 0.2s var(--e);
}
.bk-s-hub.is-on .bk-game {
  opacity: 1;
  translate: none;
  transition-delay: calc(60ms + var(--i) * 60ms), calc(60ms + var(--i) * 60ms), 0s, 0s, 0s;
}
.bk-game:active { scale: 0.98; }
.bk-game:focus-visible { outline: 1px solid var(--bk-ink); outline-offset: 3px; }
.bk-game-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 13px;
  background: var(--bk-well);
}
.bk-game-art svg { display: block; width: 42px; height: 42px; overflow: visible; transition: transform 0.45s var(--e); }
.bk-game-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bk-game-txt b {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.bk-game-txt span { font-size: 0.72rem; line-height: 1.42; color: var(--bk-mute); }
.bk-game-best { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.bk-game-best small {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bk-mute);
}
.bk-game-best b {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bk-game-go {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--bk-line);
  transition: background-color 0.2s var(--e), border-color 0.2s var(--e), color 0.2s var(--e);
}
.bk-game-go svg { width: 10px; height: 10px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--e); }
@media (hover: hover) and (pointer: fine) {
  .bk-game:hover { background: var(--bk-well); border-color: var(--bk-mute); }
  .bk-game:hover .bk-game-art svg { transform: translateY(-3px) rotate(-6deg); }
  .bk-game:hover .bk-game-go { background: var(--bk-ink); border-color: var(--bk-ink); color: var(--bk-bg); }
  .bk-game:hover .bk-game-go svg { transform: translateX(2px); }
}
.bk-hub-note { margin-top: 18px; font-size: 0.72rem; color: var(--bk-mute); }
/* los dibujos de cada juego, con los colores del modal */
.bk-art-high { fill: var(--bk-high); }
.bk-art-low { fill: var(--bk-low); }
.bk-art-ink { fill: var(--bk-ink); }
.bk-art-bg { fill: var(--bk-bg); }
.bk-art-gold { fill: var(--bk-fire); }
.bk-art-shell { fill: var(--bk-shell); stroke: var(--bk-shell-line); stroke-width: 1.4; }
.bk-art-slash { fill: none; stroke: var(--bk-ink); stroke-width: 2.4; stroke-linecap: round; }
.bk-art-body { fill: none; stroke: var(--bk-acc); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- top 3 ---- */
.bk-board { width: min(340px, 100%); margin-top: 14px; text-align: left; }
.bk-board-h { display: flex; justify-content: space-between; padding-bottom: 10px; }
.bk-board-h span:first-child { color: var(--bk-ink); }
.bk-list { list-style: none; padding: 0; }
.bk-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  border-top: 1px solid var(--bk-line);
}
.bk-list li:last-child { border-bottom: 1px solid var(--bk-line); }
.bk-r {
  width: 24px;
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bk-mute);
  font-variant-numeric: tabular-nums;
}
.bk-n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bk-p {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.bk-list li.is-empty .bk-n,
.bk-list li.is-empty .bk-p { color: var(--bk-mute); }
.bk-list li.is-me .bk-r,
.bk-list li.is-me .bk-n { color: var(--bk-acc); }
.bk-list li.is-me .bk-n::after { content: ' · tú'; letter-spacing: 0.14em; }
.bk-board.is-loading .bk-list li { animation: bk-breathe 0.9s ease-in-out infinite alternate; }
.bk-rank { margin-top: 12px; font-size: 0.74rem; color: var(--bk-mute); text-align: center; min-height: 1.2em; }

/* ---- fin de la partida ---- */
.bk-final {
  display: block;
  margin-top: 10px;
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(4.4rem, 20vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--bk-ink);
}
.bk-unit { margin-top: 8px; }
.bk-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-top: 14px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bk-acc);
  color: var(--bk-bg);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.2s var(--e), transform 0.35s var(--e);
}
/* su hueco está siempre reservado: al aparecer no empuja nada */
.bk-screen.is-on > .bk-badge { transform: scale(0.92); }
.bk-screen.is-on > .bk-badge.is-on { opacity: 1; transform: none; }
.bk-stats { margin-top: 12px; }
.bk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.bk-s-pause .bk-k { font-size: 0.64rem; color: var(--bk-ink); }
.bk-s-pause .bk-actions { margin-top: 20px; }

.bk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* con el juego abierto, el fondo de la home se queda quieto */
body.bk-open .bg-blob { animation-play-state: paused; }

/* ---- monedas: el contador de arriba (abre la tienda fuera de la partida) ---- */
.bk-coins {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin-right: 2px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--bk-line);
  background: transparent;
  color: var(--bk-ink);
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s var(--e), transform 0.16s var(--e);
}
.bk-coins:not(:disabled):active { transform: scale(0.95); }
.bk-coins:focus-visible { outline: 1px solid var(--bk-ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .bk-coins:not(:disabled):hover { background: var(--bk-line); }
}
.bk-coin-ico { display: block; flex: none; width: 15px; height: 15px; overflow: visible; }
.bk-coin-ico circle { fill: var(--bk-fire); }
.bk-coin-ico .bk-coin-in { fill: none; stroke: var(--bk-bg); stroke-opacity: 0.5; stroke-width: 1.3; }
/* un puntito cuando ya te llega para una bola */
.bk-coins.has-new::after,
.bk-shop-b.has-new::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bk-fire);
  box-shadow: 0 0 0 2px var(--bk-bg);
  animation: bk-ping 1.6s ease-in-out infinite alternate;
}
.bk-shop-b { position: relative; }
@keyframes bk-ping { from { transform: scale(1); } to { transform: scale(0.7); } }

/* la moneda que vuela del tablero al contador (game.js la anima) */
.bk-fly {
  position: fixed;
  left: 0;
  top: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bk-fire);
  box-shadow: inset 0 0 0 3px var(--bk-fire), inset 0 0 0 4.3px rgba(var(--bk-bg-rgb), 0.45);
  pointer-events: none;
  will-change: transform;
}

/* ---- tienda de bolas ---- */
.bk-title-s { margin-top: 8px; font-size: clamp(2.6rem, 11vw, 3.6rem); }
.bk-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bk-mute);
}
.bk-wallet .bk-coin-ico { width: 17px; height: 17px; }
.bk-wallet b {
  font-family: 'Clash Display', 'Inter', sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--bk-ink);
}
.bk-skins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(380px, 100%);
  margin-top: 22px;
}
.bk-skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 14px;
  border: 1px solid var(--bk-line);
  border-radius: 18px;
  transition: border-color 0.3s var(--e);
}
.bk-skin.is-on { border-color: var(--bk-ink); }
.bk-skin.is-ready { border-color: var(--bk-fire); }
.bk-skin-pv {
  display: grid;
  place-items: center;
  width: 100%;
  height: 104px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--bk-well);
  color: var(--bk-ink);
}
.bk-skin-pv > * { transition: transform 0.45s var(--e), opacity 0.3s var(--e); }
.bk-skin-dot { display: block; width: 30px; height: 30px; border-radius: 50%; background: currentColor; }
.bk-skin-logo { display: block; width: auto; height: 58px; overflow: visible; }
.bk-skin-logo path { fill: currentColor; }
.bk-skin.is-locked:not(.is-ready) .bk-skin-pv > * { opacity: 0.3; }
@media (hover: hover) and (pointer: fine) {
  .bk-skin:hover .bk-skin-pv > * { transform: translateY(-5px) rotate(-10deg); }
}
.bk-skin-n {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-ink);
}
.bk-skin-p { font-size: 0.7rem; color: var(--bk-mute); font-variant-numeric: tabular-nums; }
/* lo que llevas ahorrado para esa bola */
.bk-skin-bar {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bk-line);
}
.bk-skin-bar i {
  display: block;
  height: 100%;
  background: var(--bk-fire);
  transform-origin: left center;
  transition: transform 0.6s var(--e);
}
.bk-skin:not(.is-locked) .bk-skin-bar { visibility: hidden; }
.bk-skin-b { width: 100%; height: 40px; margin-top: 4px; padding: 0 12px; font-size: 0.6rem; letter-spacing: 0.14em; }
.bk-skin-b .bk-coin-ico { width: 12px; height: 12px; margin-right: -4px; }
.bk-skin-b .bk-coin-ico .bk-coin-in { stroke: var(--bk-ink); }
.bk-btn:disabled { cursor: default; opacity: 0.5; }
.bk-btn.is-on:disabled { opacity: 1; }
.bk-shop-note { max-width: 320px; margin-top: 16px; font-size: 0.74rem; line-height: 1.5; color: var(--bk-mute); }
.bk-s-shop .bk-actions { margin-top: 18px; }
/* opaca: desde el inicio, la muestra de bloques no se ve por detrás */
.bk-s-shop { background: var(--bk-bg); }

/* ---- móvil: pantalla completa ---- */
@media (max-width: 640px) {
  .bk-panel {
    width: 100vw;
    height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .bk-hud {
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 8px 0 16px;
  }
  .bk-score { font-size: 1.45rem; }
  .bk-ibtn { width: 36px; height: 36px; cursor: pointer; }
  .bk-coins { height: 32px; padding: 0 10px 0 8px; cursor: pointer; }
  .bk-hud-r { gap: 6px; }
  .bk-skin-pv { height: 92px; }
  .bk-screen { padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .bk-s-start { padding-top: calc(var(--bk-gb, 200px) + 18px); }
  .bk-how { font-size: 0.8rem; }
  .bk-form { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; margin-top: 18px; }
  .bk-name input { width: 100%; font-size: 1.4rem; cursor: text; }
  .bk-btn { cursor: pointer; }
  .bk-tohub { height: 40px; cursor: pointer; }
  .bk-games { margin-top: 22px; }
  .bk-game { grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; padding: 11px 14px 11px 11px; cursor: pointer; }
  .bk-game-go { display: none; }
  .bk-game-art { width: 54px; height: 54px; border-radius: 12px; }
  .bk-game-art svg { width: 38px; height: 38px; }
  .bk-game-txt b { font-size: 1.15rem; }
  .bk-game-txt span { font-size: 0.7rem; }
  .bk-board { margin-top: 10px; }
  .bk-list li { padding: 9px 2px; }
  .bk-recall { height: 40px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); cursor: pointer; }
  .bk-speed { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .bk-hint { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 400px) {
  .bk-best { display: none; }
}
@media (max-height: 640px) and (min-width: 641px) {
  .bk-panel { height: calc(100svh - 20px); }
  .bk-how .bk-keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-panel,
  .bk.is-open .bk-panel { transform: none; }
  .bk-screen > *,
  .bk-screen.is-on > * { transform: none; transition: none; }
  .bk-toast.is-on { animation-name: bk-toast-fade; }
  .bk-form.is-bad { animation: none; }
  .bk-hint.is-on { animation: none; }
  .bk-game, .bk-s-hub.is-on .bk-game { translate: none; }
}
@keyframes bk-toast-fade {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%); }
  16%, 72% { opacity: 1; transform: translate(-50%, -50%); }
}
