/* Juego de la Oca · estilos comunes (pantalla y móviles). Minimalista en blanco y negro, oscuro:
   fondo negro, líneas finas blancas o grises con esquinas redondeadas, tipografía Inter y emojis en grises.
   Los minijuegos también: sólo los 4 colores de jugador tienen color (ver assets/js/minigames/skin.js); la única
   excepción es el tablero gótico de la tele (board.css). */
:root {
  color-scheme: dark;
  --bg: #000;
  --card: #0b0b0b;
  --card-2: #161616;
  --line: #3a3a3a;         /* líneas secundarias */
  --text: #f2f2f2;
  --muted: #8c8c8c;
  /* Nombres heredados del tema de color: en blanco y negro todos son blanco o gris */
  --gold: #fff;
  --orange: #d6d6d6;
  --green: #fff;
  --red: #fff;
  --blue: #bdbdbd;
  --cyan: #d0d0d0;
  --pink: #9a9a9a;
  --purple: #9a9a9a;
  --paper: #e6e6e6;
  --ink: #000;
  --r: 14px;               /* ventanas y tarjetas */
  --r-sm: 10px;            /* tarjetas pequeñas y campos */
  --shadow: none;
  --frame: 0 0 0 2px #fff;
  --stripe: linear-gradient(#fff, #fff);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { color: var(--text); background: var(--bg); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
/* Titular: negrita, mayúsculas y algo de aire entre letras */
.px { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stripe { color: #fff; }
.blink { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .15; } }
::selection { background: #fff; color: #000; }

/* Emojis en grises (core/emoji.js), también en los minijuegos */
.emo { filter: grayscale(1) brightness(1.1); }

/* --- Botones: píldoras. Principal = relleno blanco; secundario = contorno --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .75em 1.4em; border-radius: 999px; font-weight: 800; font-size: .95rem; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .05em; color: #000; background: #fff; border: 2px solid #fff;
  transition: transform .1s, background .15s, color .15s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.btn.big { font-size: 1.15rem; padding: .85em 1.6em; }
.btn.green { color: #000; }
.btn.red, .btn.ghost { color: #fff; background: #000; }
.btn.small { font-size: .78rem; padding: .5em 1em; }
.btn:disabled, .btn.green:disabled, .btn.red:disabled, .btn.ghost:disabled { background: #000; border-color: var(--line); color: var(--muted); }

/* --- Tarjetas y etiquetas --- */
.card { background: #000; border: 2px solid #fff; border-radius: var(--r); padding: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .35em; padding: .25em .75em; border-radius: 999px; background: none; border: 1.5px solid var(--line); font-size: .85rem; font-weight: 700; }
.chip.gold, .chip.green, .chip.red { border-color: #fff; color: #fff; }

.avatar { border-radius: 50%; background: #fff; object-fit: cover; aspect-ratio: 1; }
.avatar.photo { filter: grayscale(1); }

.field { display: grid; gap: .4rem; }
.field > span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.input {
  width: 100%; padding: .75em 1em; background: #000; font-size: 1.15rem; font-weight: 600; outline: none;
  border: 2px solid var(--line); border-radius: var(--r-sm); transition: border-color .15s;
}
.input:focus { border-color: #fff; }
.input::placeholder { color: #555; }

.seg { display: inline-flex; gap: 4px; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; }
.seg button { padding: .3em .8em; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--muted); }
.seg button.on { background: #fff; color: #000; }

/* --- Avisos --- */
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 999; pointer-events: none; width: min(92vw, 420px); }
.toast { background: #000; padding: .8em 1.1em; text-align: center; font-weight: 700; border: 2px solid #fff; border-radius: var(--r-sm); animation: toast-in .25s ease-out; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --- Interruptores de música y efectos (core/sound.js) --- */
.snd-group { display: flex; gap: 8px; }
.snd-btn { font-size: .75rem; font-weight: 800; letter-spacing: .05em; padding: .45em .9em; color: #fff; white-space: nowrap; text-transform: uppercase; border: 1.5px solid #fff; border-radius: 999px; }
.snd-btn.off { color: var(--muted); text-decoration: line-through; border-color: var(--line); }
.snd-group.float { position: fixed; top: 12px; right: 12px; z-index: 85; opacity: .7; transition: opacity .2s; }
.snd-group.float:hover { opacity: 1; }

/* --- Utilidades compartidas --- */
.small { font-size: .85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.emoji { line-height: 1; }
.input.small { font-size: 1rem; padding: .5em .8em; }
.linklike { color: var(--muted); text-decoration: underline; font-size: .95rem; padding: .3em; }
.linklike:hover { color: var(--text); }
.banner { background: #fff; color: #000; text-align: center; font-weight: 800; padding: .6em; position: sticky; top: 0; z-index: 90; }
.bounce { animation: bounce 1.4s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* --- Ficha de instrucciones (core/howto.js): tamaños en em, cada contenedor fija su font-size --- */
.howto { display: grid; gap: .6em; text-align: left; width: 100%; }
.ht-goal { font-weight: 700; line-height: 1.35; }
.ht-ctl { list-style: none; padding: 0; display: grid; gap: .45em; }
.ht-ctl li { display: flex; align-items: center; gap: .6em; font-weight: 600; line-height: 1.3; }
/* Botones del mando dibujados: A relleno, B contorno, cruceta cuadrada */
.key { flex: none; display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; font-weight: 900; font-size: .9em; background: #000; color: #fff; box-shadow: inset 0 0 0 .12em #fff; }
.key.k-dpad { border-radius: .4em; box-shadow: inset 0 0 0 .12em #888; color: #888; }
.key.k-a { background: #fff; color: #000; box-shadow: none; }
.key.k-b { background: #000; color: #fff; }
.ht-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: .6em; }
.ht-role { display: grid; gap: .4em; align-content: start; background: #000; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .6em .8em; }
.ht-role > b { color: #fff; }
.ht-role > p { font-weight: 500; font-size: .92em; line-height: 1.35; }
.ht-tips { list-style: none; padding: 0; display: grid; gap: .25em; color: var(--muted); font-weight: 600; font-size: .9em; }
.ht-tips li::before { content: '— '; color: #fff; }

/* Leyenda del mando (core/howto.js keyLegend): botón dibujado + 1-2 palabras; .on = el que se está usando */
.klegend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em .7em; }
.klegend.roles { flex-direction: column; align-items: center; }
.krole { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5em .7em; }
.krole > b { color: #fff; font-size: .9em; min-width: 6.5em; text-align: right; }
.kchip { display: inline-flex; align-items: center; gap: .45em; padding: .2em .9em .2em .25em; border-radius: 999px; background: #000; border: 1.5px solid var(--line); font-weight: 700; transition: border-color .2s, transform .2s; }
.kchip.on { border-color: #fff; transform: scale(1.06); }

/* Estado de una espera: quién ha aceptado (✓), a quién se espera y quién está ausente (no se le espera) */
.ack-p { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 0; font-weight: 700; }
.ack-p .avatar { transition: opacity .2s; }
.ack-p .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ack-p .tick { position: absolute; top: -4px; right: 50%; margin-right: -1.9em; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-size: .8em; font-weight: 900; }
.ack-p.done .tick { background: #fff; color: #000; animation: pop .3s ease-out; }
.ack-p.wait .avatar { opacity: .5; animation: bounce 1.4s ease-in-out infinite; }
.ack-p.wait .tick { background: #000; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.ack-p.away { opacity: .3; }
.ack-p.away .tick { background: #000; }

/* Barra de tiempo */
.bar-row { width: 100%; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: #222; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 99px; transition: width .25s linear; }
.bar.low > i { animation: blink .6s ease-in-out infinite; }
.bar-text { min-width: 3ch; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; text-align: right; }

/* --- Dado (móvil y pantalla): cubo blanco con puntos negros --- */
.die {
  --s: 56px; width: var(--s); height: var(--s); flex: none;
  background: #fff; border-radius: calc(var(--s) * .2);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: calc(var(--s) * .1);
}
.die.sm { --s: 42px; }
.die.lg { --s: 92px; }
.die.xl { --s: 150px; }
.die .pip { border-radius: 50%; margin: 14%; }
.die .pip.on { background: #000; }
.die.rolling { animation: die-roll .34s linear infinite; }
.die.landed { animation: die-land .4s cubic-bezier(.2, 1.7, .4, 1); }
.die.idle { opacity: .9; }
@keyframes die-roll { 0% { transform: rotate(0) translateY(0); } 25% { transform: rotate(14deg) translateY(-8px); } 50% { transform: rotate(-9deg) translateY(0); } 75% { transform: rotate(11deg) translateY(-5px); } 100% { transform: rotate(0); } }
@keyframes die-land { 0% { transform: scale(1.4) rotate(-10deg); } 100% { transform: scale(1) rotate(0); } }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
