/* MultiGames — estilo "app móvil": fondo claro, tarjetas blancas, botones amarillos/azules.
   En pantallas anchas la app se muestra dentro de un marco de teléfono. */
:root {
  color-scheme: light;
  --page: #0b1b36;          /* fondo alrededor del móvil (solo escritorio) */
  --bg: #eef3fb;            /* fondo de la app */
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --border: #dde5f1;
  --text: #0f1d3a;
  --muted: #6a7892;
  --accent: #0b57c5;
  --accent-dark: #083f91;
  --yellow: #ffe500;
  --yellow-dark: #d9c200;
  --ok: #16a34a;
  --bad: #e11d48;
  --warn: #d97706;
  --blue: #2563eb;
  --red: #dc2626;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(15, 29, 58, .08);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Carcasa del móvil ---------- */
.device {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.statusbar { display: none; }
#app {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 560px) and (min-height: 700px) {
  body {
    background: radial-gradient(circle at 50% 30%, #17315e 0%, var(--page) 70%);
    display: flex; align-items: center; justify-content: center;
    min-height: 100%; padding: 24px 16px;
  }
  .device {
    width: 390px; height: min(844px, calc(100vh - 48px));
    border-radius: 52px;
    border: 12px solid #04080f;
    box-shadow: 0 0 0 2px #2a3a57, 0 30px 80px rgba(0, 0, 0, .55);
  }
  .statusbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 26px 4px; font-size: 13px; font-weight: 800; background: var(--surface);
  }
  #app { padding-top: 14px; }
}

/* ---------- Tipografía y utilidades ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 900; text-wrap: balance; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; min-height: 4px; }
ol, ul { margin: 0; padding-left: 22px; }

/* ---------- Barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar h2 { flex: 1; font-size: 19px; }
.icon-btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  min-width: 44px; height: 44px; font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn:focus-visible, .btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: block; width: 100%;
  min-height: 52px; padding: 12px 18px;
  border: none; border-radius: 16px;
  background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 3px 0 var(--border); }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 #0f7a36; }
.btn.bad { background: var(--bad); box-shadow: 0 4px 0 #a3123a; }
.btn.warn { background: var(--yellow); color: var(--text); box-shadow: 0 4px 0 var(--yellow-dark); }
.btn.small { min-height: 44px; font-size: 15px; padding: 8px 14px; width: auto; box-shadow: 0 3px 0 var(--accent-dark); }
.btn.secondary.small { box-shadow: 0 3px 0 var(--border); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* ---------- Inicio ---------- */
.home-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #1e6ee8, #0a3f99); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px; border: 3px solid var(--yellow);
}
.avatar-badge {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--yellow); color: var(--text); font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}
.home-title { font-size: 20px; font-weight: 900; }
.pill-dark { display: inline-block; margin-top: 3px; background: var(--text); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center; padding: 6px 10px;
  border-radius: 14px; background: #fff7e0; border: 1px solid #f3cf7a; color: #9a5b00; font-size: 11px;
}
.stat-pill b { font-size: 15px; }

.banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: none; border-radius: 20px; padding: 18px 16px; color: #fff; text-align: left; cursor: pointer;
  box-shadow: 0 10px 22px rgba(20, 30, 80, .25);
}
.banner.purple { background: linear-gradient(120deg, #6a1fc2, #3f0f8f); }
.banner.blue { background: linear-gradient(120deg, #1569d8, #0a3f9c); }
.banner b { display: block; font-size: 18px; font-weight: 900; }
.banner span span { font-size: 13px; opacity: .9; }
.banner-ico { font-size: 38px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.play {
  background: var(--yellow); color: var(--text); font-weight: 900; font-size: 16px;
  padding: 11px 18px; border-radius: 14px; box-shadow: 0 4px 0 var(--yellow-dark); white-space: nowrap;
}
.section-title { font-size: 18px; margin-top: 6px; }

.game-card {
  display: flex; gap: 14px; align-items: center; width: 100%;
  border-radius: 20px; padding: 12px 14px 12px 12px; cursor: pointer;
  text-align: left; color: var(--text); border: 1px solid transparent;
}
.game-card .tile {
  width: 64px; height: 64px; flex: none; border-radius: 16px; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  box-shadow: var(--shadow);
}
.game-card .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.game-card .meta b { font-size: 17px; font-weight: 900; }
.game-card .desc { font-size: 13px; color: var(--muted); }
.game-card .count { font-size: 13px; font-weight: 800; }
.game-card .chev {
  width: 34px; height: 34px; flex: none; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px;
  box-shadow: var(--shadow);
}
.game-card.purple { background: #f1eafe; border-color: #e0d2fb; } .game-card.purple .count, .game-card.purple .chev { color: #6a1fc2; }
.game-card.teal   { background: #e3f4f5; border-color: #c8e7ea; } .game-card.teal .count, .game-card.teal .chev { color: #0e7c86; }
.game-card.orange { background: #fdf1e2; border-color: #f6dfbf; } .game-card.orange .count, .game-card.orange .chev { color: #b45309; }
.game-card.blue   { background: #e5eefc; border-color: #cddcf6; } .game-card.blue .count, .game-card.blue .chev { color: #1d5bd8; }
.game-card.green  { background: #e5f5e9; border-color: #cbe9d3; } .game-card.green .count, .game-card.green .chev { color: #15803d; }

/* ---------- Barra inferior ---------- */
.tabbar {
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer; padding: 4px 0;
  font-size: 11px; font-weight: 800; color: var(--muted);
}
.tab-ico { font-size: 21px; width: 36px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 10px; filter: grayscale(.6); opacity: .8; }
.tab.on { color: var(--accent); }
.tab.on .tab-ico { background: #e4edfc; filter: none; opacity: 1; }

/* ---------- Formularios ---------- */
input[type=text], input[type=number], select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; font-size: 16px; font-weight: 600;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px 6px 6px 14px; font-weight: 700;
}
.player-item span { flex: 1; min-width: 0; }
.player-item .icon-btn { box-shadow: none; min-width: 40px; height: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 999px; font-weight: 700;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-size: 14px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.switch input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }

/* ---------- Pasar el móvil / cartas secretas ---------- */
.pass {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 16px; text-align: center;
}
.pass .big-name { font-size: 32px; font-weight: 900; color: var(--accent); }
.hero-emoji { font-size: 56px; }
.secret {
  background: var(--surface); border: 3px solid var(--accent);
  border-radius: 22px; padding: 26px 18px; width: 100%; text-align: center; box-shadow: var(--shadow);
}
.secret .word, .role-card .word { font-size: 34px; font-weight: 900; margin: 8px 0; word-break: break-word; }
.secret.danger { border-color: var(--red); }
.secret.good { border-color: var(--blue); }

/* ---------- Votaciones ---------- */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.vote-btn {
  position: relative; min-height: 64px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text); font-size: 16px; font-weight: 800; cursor: pointer; padding: 10px;
}
.vote-btn.selected { border-color: var(--accent); background: #e6efff; }
.vote-btn .count {
  position: absolute; top: 6px; right: 8px; min-width: 26px; height: 26px;
  border-radius: 13px; background: var(--accent); color: #fff; font-size: 14px; line-height: 26px;
}
.vote-btn:disabled { opacity: .35; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border);
}
.badge.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.badge.red { background: var(--red); border-color: var(--red); color: #fff; }
.badge.gold { background: var(--yellow); border-color: var(--yellow-dark); color: var(--text); }

/* ---------- Capturar al Tirano ---------- */
.track { display: grid; gap: 6px; }
.track.lib { grid-template-columns: repeat(5, 1fr); }
.track.fas { grid-template-columns: repeat(6, 1fr); }
.slot {
  aspect-ratio: 3 / 4; max-width: 100%; border-radius: 10px;
  border: 2px dashed var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; color: var(--muted); padding: 2px;
}
.slot.filled.lib { background: var(--blue); border: 2px solid #93c5fd; color: #fff; font-size: 22px; }
.slot.filled.fas { background: var(--red); border: 2px solid #fca5a5; color: #fff; font-size: 22px; }
.tracker { display: flex; gap: 8px; align-items: center; }
.tracker .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); }
.tracker .dot.on { background: var(--warn); border-color: var(--warn); }

.policy-cards { display: flex; gap: 10px; justify-content: center; width: 100%; }
.policy {
  flex: 1; max-width: 130px; aspect-ratio: 3 / 4; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; cursor: pointer; border: 3px solid transparent; font-size: 14px; gap: 6px; padding: 6px;
  text-align: center; box-shadow: var(--shadow);
}
.policy .ico { font-size: 32px; }
.policy.lib { background: var(--blue); }
.policy.fas { background: var(--red); }
.policy.discard { opacity: .35; border-color: var(--text); text-decoration: line-through; }

.ja-nein { display: flex; gap: 6px; }
.ja-nein button {
  min-width: 60px; min-height: 40px; border-radius: 12px; font-weight: 800;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.ja-nein button.on.ja { background: var(--ok); border-color: var(--ok); color: #fff; }
.ja-nein button.on.nein { background: var(--bad); border-color: var(--bad); color: #fff; }

.log { font-size: 13px; color: var(--muted); max-height: 200px; overflow: auto; }
.log div { padding: 4px 0; border-bottom: 1px solid var(--border); }
details summary { cursor: pointer; font-weight: 800; }

/* ---------- Pasapalabra ---------- */
.rosco-wrap { position: relative; width: 100%; max-width: 330px; aspect-ratio: 1; margin: 0 auto; }
.rosco-letter {
  position: absolute; width: 11.5%; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: clamp(12px, 3.6vw, 16px);
  background: var(--blue); color: #fff; transform: translate(-50%, -50%);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(15,29,58,.2);
}
.rosco-letter.ok { background: var(--ok); }
.rosco-letter.bad { background: var(--bad); }
.rosco-letter.current { background: var(--yellow); color: var(--text); transform: translate(-50%, -50%) scale(1.2); z-index: 2; }
.rosco-center {
  position: absolute; inset: 20%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 4px;
}
.rosco-center .time { font-size: 42px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rosco-center .time.low { color: var(--bad); }
.question-card .kind { font-weight: 900; color: var(--accent); text-transform: uppercase; font-size: 13px; letter-spacing: .6px; }
.question-card .q { font-size: 18px; font-weight: 700; margin-top: 6px; }
.feedback { text-align: center; font-weight: 800; min-height: 22px; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.score-row { display: flex; gap: 10px; }
.score-box { flex: 1; text-align: center; padding: 10px; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); }
.score-box.active { border-color: var(--accent); }
.score-box b { font-size: 22px; display: block; }

.review { display: flex; flex-direction: column; gap: 8px; }
.review-item { display: flex; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.review-item.bad { background: #fff0f3; border-color: #fbc8d4; }
.review-letter {
  width: 32px; height: 32px; flex: none; border-radius: 50%; color: #fff; font-weight: 900;
  display: flex; align-items: center; justify-content: center; background: var(--muted);
}
.review-item.bad .review-letter { background: var(--bad); }
.review-answer { margin-top: 4px; font-weight: 800; color: var(--ok); }

/* ---------- El Pueblo Duerme ---------- */
.phase {
  display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 14px;
  font-weight: 800; font-size: 14px;
}
.phase.night { background: linear-gradient(120deg, #2a1f6b, #13103a); color: #e6e3ff; }
.phase.day { background: linear-gradient(120deg, #ffd65a, #ffb938); color: #4a3200; }
.script {
  background: #f1eafe; border: 1px solid #ddcffa; border-radius: 16px; padding: 12px 14px;
  font-size: 17px; font-weight: 700; font-style: italic; color: #3a1580;
}
.script.soft { background: var(--surface-2); border-color: var(--border); color: var(--muted); font-size: 15px; }
.script-label { display: block; font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.info { background: #e6efff; border: 1px solid #c9dafb; border-radius: 14px; padding: 12px 14px; }
.info.good { background: #e5f5e9; border-color: #c3e6cd; }
.warn-box { background: #fff4e0; border: 1px solid #f6d7a4; border-radius: 14px; padding: 10px 12px; }
.role-card {
  width: 100%; border-radius: 22px; padding: 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 3px solid #7c3aed; box-shadow: var(--shadow);
}
.role-card.lobos { border-color: var(--red); background: #fff3f3; }
.role-card.small .word { font-size: 22px; }
.role-emoji { font-size: 52px; }
.role-card.small .role-emoji { font-size: 40px; }
.death { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.death .role-emoji { font-size: 34px; }
.timer {
  text-align: center; font-size: 56px; font-weight: 900; font-variant-numeric: tabular-nums;
  padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
}
.timer.done { font-size: 22px; color: var(--bad); padding: 26px 10px; }
.stepper-row { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { font-size: 20px; min-width: 20px; text-align: center; }
.deal-summary { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; }
.deal-summary.bad { background: #fff0f3; color: var(--bad); }
.narrator { background: #fbfaff; }
.narrator .dead { opacity: .5; text-decoration: line-through; }

.rules { font-size: 14px; color: var(--muted); }
.rules li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Inicio: perfil, modo y Modo Fiesta ---------- */
.avatar-btn { background: none; border: none; padding: 0; cursor: pointer; }
.info-link {
  width: 100%; text-align: left; background: #fff7e0; border: 1px solid #f3cf7a; color: #7a4a00;
  border-radius: 14px; padding: 10px 12px; font-weight: 800; font-size: 14px; cursor: pointer;
}
.segmented { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px; gap: 4px; }
.segmented button {
  flex: 1; min-height: 42px; border: none; border-radius: 12px; background: none; cursor: pointer;
  font-weight: 800; font-size: 14px; color: var(--muted);
}
.segmented button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
.link { background: none; border: none; color: var(--accent); font-weight: 800; cursor: pointer; padding: 0; font-size: inherit; }
.fiesta-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border-radius: 18px; padding: 12px 14px; border: 1px solid #f3cf7a;
  background: linear-gradient(120deg, #fff8d6, #ffe98a); color: var(--text);
}
.fiesta-strip > span:first-child { font-size: 30px; }
.fiesta-strip b { display: block; font-size: 16px; font-weight: 900; }
.fiesta-strip .chev { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; }

/* ---------- Modo Fiesta ---------- */
.premium-hero {
  text-align: center; padding: 22px 16px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #6a1fc2 0%, #3f0f8f 60%, #1a0850 100%);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.premium-hero .crown { font-size: 54px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.premium-hero h1 { font-size: 28px; }
.premium-hero p { opacity: .9; }
.reason { margin-top: 6px; background: rgba(255,255,255,.15); border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 14px; }
.perks { display: grid; gap: 8px; }
.perk { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.perk-ico { font-size: 26px; width: 40px; text-align: center; }
.perk b { display: block; }
.perk span span { display: block; }
.compare { padding: 8px 12px; }
.compare-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.compare-row:last-child { border-bottom: none; }
.compare-row span:first-child { font-weight: 800; }
.compare-row span:last-child { color: #6a1fc2; font-weight: 800; }
.compare-row.head { font-weight: 900; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 4px 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--border);
  cursor: pointer; color: var(--text);
}
.plan b { font-size: 18px; font-weight: 900; }
.plan.on { border-color: #6a1fc2; background: #f4edff; }
.plan-note { position: absolute; top: -10px; background: var(--yellow); color: var(--text); font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.btn.gold { background: var(--yellow); color: var(--text); box-shadow: 0 4px 0 var(--yellow-dark); }

/* ---------- Perfil ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; }
.xp { display: flex; flex-direction: column; gap: 4px; }
.xp-bar { height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; }
.xp-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1e6ee8, #6a1fc2); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; }
.stat b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 700; }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ach { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); opacity: .55; filter: grayscale(1); }
.ach.done { opacity: 1; filter: none; background: #fff8dc; border-color: #f3cf7a; }
.ach-ico { font-size: 26px; }
.ach b { font-size: 13px; }
.game-stat { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); }
.avatar-chip { font-size: 22px; padding: 6px 10px; }
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- Crear ---------- */
.creator-hero { display: flex; gap: 12px; align-items: center; }
.creator-hero .tile, .small-tile {
  width: 56px; height: 56px; flex: none; border-radius: 16px; background: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.small-tile { width: 44px; height: 44px; font-size: 22px; }
.pack-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.pack-actions { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; padding-left: 56px; }
.pack-actions .chip { padding: 6px 10px; font-size: 13px; }
textarea {
  width: 100%; padding: 10px 14px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; font: 600 15px var(--font); resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); }
.rosco-row { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px; }
.rosco-row .review-letter { background: var(--blue); }
.rr-err { color: var(--bad); font-weight: 700; }
input:disabled { opacity: .6; }

.game-card.red  { background: #fdeaea; border-color: #f7cfcf; } .game-card.red .count, .game-card.red .chev { color: #c81e1e; }
.game-card.pink { background: #fce8f3; border-color: #f6cde3; } .game-card.pink .count, .game-card.pink .chev { color: #be185d; }

/* ---------- Variantes (tarjetas seleccionables) ---------- */
.variant {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 16px; padding: 10px 12px; color: var(--text);
}
.variant.on { border-color: #6a1fc2; background: #f4edff; }
.variant b { display: block; }
.variant-ico { font-size: 26px; width: 36px; text-align: center; }
.variant-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; flex: none; }
.variant.on .variant-check { background: #6a1fc2; border-color: #6a1fc2; }

/* ---------- Mentiroso ---------- */
.dice-hero { display: flex; justify-content: center; gap: 8px; padding: 12px; border-radius: 20px; background: radial-gradient(circle at 50% 40%, #1f7a4d, #0f4a2e); }
.dice-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.die {
  width: 52px; height: 52px; border-radius: 12px; background: #fff; border: 2px solid #d9dee8; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font: 900 22px var(--font);
  box-shadow: inset 0 -4px 0 #e3e7ef, 0 3px 6px rgba(0,0,0,.18); color: var(--text); padding: 0;
}
.die.f5, .die.f4 { color: #c81e1e; }
.die.f3, .die.f2 { color: #1f2937; }
.die.f1, .die.f0 { color: #1d5bd8; }
.die.picked { border-color: var(--yellow-dark); background: #fff7c2; transform: translateY(-4px); }
.die.shown { cursor: default; }
.hidden-die { background: #2a3550; color: #fff; border-color: #2a3550; box-shadow: inset 0 -4px 0 #1b2338; cursor: default; }
.die-chip { min-width: 46px; text-align: center; font-weight: 900; }
.cup { background: #f2f7f3; border-color: #cfe5d6; }
.claim-card {
  display: flex; flex-direction: column; gap: 4px; text-align: center; width: 100%;
  background: linear-gradient(120deg, #b91c1c, #7f1010); color: #fff; border-radius: 20px; padding: 16px;
}
.claim-card b { font-size: 22px; font-weight: 900; }
.claim-card.small-claim { padding: 10px; }
.claim-card.small-claim b { font-size: 17px; }
.lives-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lives-chip { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
.lives-chip.active { border-color: var(--accent); }
.lives-chip.out { opacity: .45; }
.verdict { padding: 14px; border-radius: 16px; font-weight: 800; text-align: center; }
.verdict.ok { background: #e5f5e9; color: #14532d; }
.verdict.bad { background: #fde8ea; color: #9f1239; }
.btn.big { min-height: 64px; font-size: 21px; }

/* ---------- Dominó ---------- */
.mini-dom {
  display: inline-block; width: 28px; height: 50px; border-radius: 6px; background: #fff; border: 2px solid #1f2937; position: relative;
  background-image:
    radial-gradient(circle, #1f2937 3px, transparent 3.5px),
    radial-gradient(circle, #1f2937 3px, transparent 3.5px),
    linear-gradient(#1f2937, #1f2937);
  background-size: 12px 12px, 12px 12px, 100% 2px;
  background-position: 1px 1px, 11px 11px, 0 50%;
  background-repeat: no-repeat, no-repeat, no-repeat;
}
.domino {
  display: inline-flex; background: #fffdf7; border: 2px solid #2b2b2b; border-radius: 8px; padding: 2px; gap: 2px;
  cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,.2); flex: none;
}
.domino .half { display: grid; grid-template-columns: repeat(3, 7px); grid-template-rows: repeat(3, 7px); gap: 1px; padding: 2px; }
.domino .half + .half { border-left: 2px solid #2b2b2b; }
.domino .half i { width: 7px; height: 7px; border-radius: 50%; }
.domino .half i.pip { background: #1b1b1b; }
.domino.double .half i.pip { background: #b91c1c; }
.domino.end { box-shadow: 0 0 0 3px var(--yellow); }
.board {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; min-height: 70px;
  padding: 12px; border-radius: 18px; background: radial-gradient(circle at 50% 40%, #1f7a4d, #0f4a2e);
}
.hand { display: flex; flex-wrap: wrap; gap: 8px; }
.hand .domino { transform: scale(1.25); margin: 6px 8px; }
.hand .domino.cannot { opacity: .35; cursor: not-allowed; }
.hand .domino.can { box-shadow: 0 0 0 3px var(--accent); }
.hand .domino.chosen { box-shadow: 0 0 0 3px var(--yellow-dark); }
.small-hand .domino { transform: none; margin: 0; }
.recent { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; color: var(--muted); }

/* ---------- Conexión ---------- */
.mind-hero { display: flex; justify-content: center; gap: 10px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, #be185d, #6a1fc2); }
.mind-card {
  display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 76px; border-radius: 12px;
  background: #fff; color: #6a1fc2; font-weight: 900; font-size: 24px; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.mind-card.big { width: 70px; height: 98px; font-size: 32px; }
.mind-card.huge { width: 120px; height: 168px; font-size: 56px; border: 4px solid #6a1fc2; }
.mind-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mind-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 800; }
.mind-timer { text-align: center; font-weight: 900; font-size: 20px; color: var(--warn); font-variant-numeric: tabular-nums; }
.mind-pile { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mind-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.mind-player {
  display: flex; flex-direction: column; gap: 4px; align-items: center; min-height: 76px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #be185d); color: #fff; border: none; font-size: 17px; padding: 10px;
  box-shadow: 0 4px 0 #4c1d95;
}
.mind-player:active { transform: translateY(3px); box-shadow: 0 1px 0 #4c1d95; }
.mind-player:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* Mentiroso v2 */
.die.used { opacity: .55; position: relative; cursor: not-allowed; }
.die.used::after { content: "↻"; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.die.mini { width: 34px; height: 34px; font-size: 15px; border-radius: 8px; box-shadow: inset 0 -3px 0 #e3e7ef; }
.die.locked { outline: 2px dashed var(--muted); outline-offset: 2px; }
.die.bluff { border-color: #f59e0b; background: #fff4de; }
.claim-card .dice-row { margin-top: 4px; }
.announce-text { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: 14px; background: #e5f5e9; color: #14532d; text-align: center; }
.announce-text b { font-size: 18px; }
.announce-text.bluffing { background: #fff4de; color: #7a4a00; }
.center-chips { justify-content: center; }
.ok-text { color: var(--ok); font-weight: 800; }
.bad-text { color: var(--bad); font-weight: 800; }
#clock-left.low { color: var(--bad); }

/* Dominó v2: mesa grande en serpiente y fichas fijas abajo */
.dom-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.dom-scores { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dom-score { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.dom-score b { font-size: 14px; font-weight: 900; }
.dom-score.active { border-color: var(--accent); background: #e6efff; }
.dom-meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.dom-recent { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dom-board {
  position: relative; flex: 1; min-height: 200px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #0f5a36, #073d24); box-shadow: inset 0 0 30px rgba(0,0,0,.35);
}
.dom-board.fixed { flex: none; height: 260px; }
.board-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-weight: 700; }
.bt {
  position: absolute; display: flex; background: linear-gradient(145deg, #ffffff, #e6e9ee); border-radius: calc(var(--u) * .18);
  box-shadow: 0 1px 0 #b8bec8, 0 2px 4px rgba(0,0,0,.45); box-sizing: border-box; border: 1px solid #9aa2ae;
}
.bt.hz { flex-direction: row; }
.bt.vt { flex-direction: column; }
.bt .bh { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: calc(var(--u) * .14); gap: calc(var(--u) * .04); }
.bt.hz .bh + .bh { border-left: 1px solid #9aa2ae; }
.bt.vt .bh + .bh { border-top: 1px solid #9aa2ae; }
.bt .bh i { border-radius: 50%; margin: 8%; }
.bt .bh i.pip { background: #111; }
.bt.end { box-shadow: 0 0 0 2px var(--yellow), 0 2px 4px rgba(0,0,0,.45); }
.dom-hand {
  flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.dom-hand .hand { gap: 4px; justify-content: center; }
.dom-hand .hand .domino { transform: none; margin: 2px; }
.dom-hand .domino .half { grid-template-columns: repeat(3, 8px); grid-template-rows: repeat(3, 8px); }
.dom-hand .domino .half i { width: 8px; height: 8px; }

/* Mentiroso v3: botones de tirada y animación de dados */
.roll-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.die.selectable { box-shadow: 0 0 0 3px var(--accent), inset 0 -4px 0 #e3e7ef; }
.die.rolling { animation: dice-roll .8s ease-out; }
@keyframes dice-roll {
  0% { transform: translateY(-14px) rotate(-40deg) scale(1.05); }
  25% { transform: translateY(6px) rotate(160deg); }
  50% { transform: translateY(-8px) rotate(280deg); }
  75% { transform: translateY(3px) rotate(340deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .die.rolling { animation: none; } }
