:root {
  --bg: #0b131e;
  --panel: #152232;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #8899a6;
  --gold: #ffb703;
  --cyan: #00f5d4;
  --green: #39ff88;
  --yellow: #ffd60a;
  --red: #e63946;
  --gray: #2a3644;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  min-height: 100vh;
  padding: 16px;
}
.wrap { max-width: 980px; margin: 0 auto; }
.narrow { max-width: 420px; margin: 0 auto; }
h1 { color: var(--gold); font-size: 1.5rem; text-transform: uppercase; letter-spacing: 2px; text-align: center; }
h2 { color: var(--gold); font-size: 1.1rem; margin-bottom: 10px; }
.sub { color: var(--muted); text-align: center; font-size: .9rem; margin: 4px 0 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .85rem; }
.error { color: var(--red); font-weight: 600; margin-top: 8px; }
.ok { color: var(--green); font-weight: 600; }

input, select, button { font: inherit; }
input, select {
  width: 100%; padding: 10px; margin: 4px 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #0e1a28; color: var(--text);
}
label { font-size: .85rem; color: var(--muted); }
button {
  padding: 11px 14px; border: none; border-radius: 10px; cursor: pointer; font-weight: 700;
  background: var(--gray); color: var(--text);
}
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-main { background: linear-gradient(45deg, #00f5d4, #00bbf9); color: #000; width: 100%; font-size: 1.05rem; }
.btn-gold { background: var(--gold); color: #000; }
.btn-red { background: var(--red); color: #fff; }
.btn-green { background: #1fa855; color: #fff; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

/* ----- Tienda: selector de cartones ----- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.shop-cell {
  padding: 10px 0; text-align: center; border-radius: 8px; font-weight: 700; font-size: .9rem;
  background: rgba(57, 255, 136, .12); border: 1px solid var(--green); color: var(--green);
}
.shop-cell.RESERVED { background: rgba(255, 214, 10, .12); border-color: var(--yellow); color: var(--yellow); cursor: not-allowed; }
.shop-cell.SOLD { background: var(--gray); border-color: var(--gray); color: #5c6b7a; cursor: not-allowed; }
.shop-cell.selected { background: var(--green); color: #000; box-shadow: 0 0 12px rgba(57, 255, 136, .7); }
.total { font-size: 1.3rem; font-weight: 800; color: var(--gold); }
.sticky-bar {
  position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--gold);
  border-radius: 12px; padding: 12px; margin-top: 14px;
}

/* ----- Cartilla ----- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bingo-card {
  background: var(--panel); border: 2px solid var(--gold); border-radius: 16px; padding: 10px;
  box-shadow: 0 0 20px rgba(255, 183, 3, .15);
}
.bingo-card.winner { border-color: var(--green); box-shadow: 0 0 30px rgba(57, 255, 136, .6); }
.card-title { text-align: center; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.card-grid { display: grid; gap: 6px; }
/* Hoja de figuras: 6 tablas de 2×4, compacta. Se juega en horizontal: 3 tablas por fila y la hoja entera cabe en pantalla */
.sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
@media (orientation: landscape), (min-width: 700px) { .sheet { grid-template-columns: repeat(3, 1fr); } }
.sheet .card-grid { padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 8px; }
.sheet .cell { border-radius: 6px; }
.sheet .cell img { width: 78%; height: 62%; }
.sheet .cell .fig-name { font-size: .5rem; }
.rotate-hint { display: none; text-align: center; font-size: .8rem; color: var(--cyan); margin-bottom: 6px; }
.suggest-row td { border-top: 0; padding-top: 0; }
.suggest { padding: 8px 10px; border: 1px dashed var(--gold); border-radius: 10px; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.suggest > div { flex: 1 1 220px; }
.suggest button { flex: 0 0 auto; }

.prize.current { outline: 2px solid var(--cyan); box-shadow: 0 0 14px rgba(0, 245, 212, .35); } /* la ronda que se está jugando */

/* ---------- Sacador automático (panel) ---------- */
.auto-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.auto-box h3 { margin: 0 0 8px; }
.auto-cfg label { display: flex; align-items: center; gap: 6px; flex: 1 1 240px; font-size: .9rem; }
.auto-cfg input { width: 80px; margin: 0; text-align: center; }
.auto-status { text-align: center; margin-top: 8px; font-size: 1.05rem; color: var(--cyan); }
.auto-tip { font-size: .8rem; margin: 6px 0 0; }

/* ---------- Modo TV (jugador): pantalla grande, todos los cartones ordenados ---------- */
.btn-tv { display: block; margin: 0 auto 10px; }
.tv-tip { text-align: center; max-width: 760px; margin: 0 auto 10px; }
body.tv .wrap { max-width: none; padding: 0 1.5vw; }
body.tv h1 { display: none; }
body.tv .wrap { padding-top: 8px; }
body.tv .top { display: grid; grid-template-columns: minmax(260px, 28vw) 1fr; gap: 14px; align-items: start; }
body.tv .top > .panel { margin: 0; max-width: none; }
body.tv .last-ball { font-size: clamp(3rem, 4.5vw, 5.5rem); line-height: 1.1; }
body.tv .top > .panel { padding: 10px 14px; }
body.tv .btn-tv { position: fixed; top: 8px; right: 12px; z-index: 5; margin: 0; padding: 6px 12px; font-size: .85rem; opacity: .85; }
body.tv .sub { margin: 0 0 6px; }
body.tv .history span { font-size: 1.2vw; padding: 6px 10px; }
body.tv .prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
body.tv .cards { grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 15vw, 330px), 1fr)); gap: 10px; margin-top: 10px; }
body.tv .cards > .bingo-card:has(.sheet) { grid-column: auto; }
body.tv .cards:has(.sheet) { grid-template-columns: repeat(auto-fill, minmax(clamp(420px, 31vw, 640px), 1fr)); }
body.tv .rotate-hint, body.tv .btn-tv + .tv-tip { display: none; }
body.tv .banner { font-size: 1.1vw; padding: 8px; }

@media (orientation: portrait) and (max-width: 699px) {
  .rotate-hint { display: block; }
  /* con el teléfono parado las casillas miden ~35 px: el nombre no cabe, se ve solo la figura (en horizontal sí sale) */
  .sheet .cell .fig-name { display: none; }
  .sheet .cell img { width: 82%; height: 82%; }
}
.cards > .bingo-card:has(.sheet) { grid-column: 1 / -1; } /* una hoja ocupa todo el ancho */
.col-header { text-align: center; font-weight: 800; font-size: 1.2rem; color: var(--gold); }
.cell {
  aspect-ratio: 1; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700; overflow: hidden; text-align: center;
}
.cell.marked { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(255, 183, 3, .7); }
.cell.free { background: rgba(0, 245, 212, .2); color: var(--cyan); }
.cell img { width: 70%; height: 60%; object-fit: contain; }
.cell .fig-name { font-size: .55rem; line-height: 1.1; padding: 0 2px; }
.cell .fig-num { font-size: .9rem; }
.card-status { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.card-status.near { color: var(--cyan); font-weight: 700; }

/* ----- Bolillas ----- */
.last-ball { font-size: 2.6rem; font-weight: 800; color: var(--cyan); text-shadow: 0 0 15px rgba(0, 245, 212, .6); text-align: center; }
.history { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.history span { background: rgba(255, 255, 255, .1); padding: 4px 8px; border-radius: 6px; font-size: .8rem; }
.board { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; font-size: .75rem; }
.board.figs { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
.board div { text-align: center; padding: 4px 0; border-radius: 4px; background: rgba(255, 255, 255, .04); color: #5c6b7a; }
.board div.on { background: var(--gold); color: #000; font-weight: 700; }
.banner { text-align: center; padding: 14px; border-radius: 12px; font-weight: 800; font-size: 1.1rem; margin-bottom: 14px; }
.banner.win { background: rgba(57, 255, 136, .15); border: 1px solid var(--green); color: var(--green); }
.banner.info { background: rgba(255, 214, 10, .1); border: 1px solid var(--yellow); color: var(--yellow); }
.banner.bad { background: rgba(230, 57, 70, .15); border: 1px solid var(--red); color: var(--red); }

/* ----- Admin ----- */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.tag { padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.tag.PENDING { background: rgba(255, 214, 10, .15); color: var(--yellow); }
.tag.APPROVED { background: rgba(57, 255, 136, .15); color: var(--green); }
.tag.REJECTED { background: rgba(230, 57, 70, .15); color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stat { background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.4rem; color: var(--gold); }
.table-scroll { overflow-x: auto; }
dialog { margin: auto; background: var(--panel); color: var(--text); border: 1px solid var(--gold); border-radius: 12px; padding: 16px; max-width: 360px; width: 92vw; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }

/* ----- Premios y formas ----- */
.prizes { display: grid; gap: 8px; }
.prize { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 10px; }
.prize.done { opacity: .75; }
.prize-name { font-weight: 700; }
.prize-value { color: var(--gold); font-weight: 800; font-size: 1.1rem; }
.prize-won { color: var(--green); font-size: .8rem; font-weight: 600; }
.shape { display: grid; gap: 2px; flex: none; }
.shape.small { width: 54px; }
.shape.small.wide { width: 72px; }
.shape i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.shape i.on { background: var(--gold); box-shadow: 0 0 4px rgba(255, 183, 3, .6); }
.shape.any-line i.on { background: var(--cyan); }

/* Editor visual de formas */
.editor-grid { display: grid; gap: 6px; max-width: 260px; margin: 8px auto; user-select: none; touch-action: none; }
.editor-grid button { aspect-ratio: 1; padding: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.editor-grid button.on { background: var(--gold); box-shadow: 0 0 10px rgba(255, 183, 3, .7); }
.editor-grid button.free { outline: 2px dashed var(--cyan); outline-offset: -4px; }
.editor-grid.disabled { opacity: .35; pointer-events: none; }
.editor-grid.wide { max-width: 340px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.chip .shape.small { width: 22px; gap: 1px; }
.chip .shape.small.wide { width: 30px; }
.chip .x { color: var(--muted); padding: 0 2px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .9rem; margin: 6px 0; }
.check input { width: auto; margin: 0; }
.prize-row { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 8px; margin-bottom: 6px; }
.prize-row .btns { display: flex; gap: 4px; }
.prize-row .btns button { padding: 6px 9px; }
dialog.editor { max-width: 420px; }

/* Conexión y avisos */
.conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 6px 14px; border-radius: 99px; font-size: .85rem; font-weight: 700; z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); background: #0e1a28; border: 1px solid var(--green); border-radius: 12px; padding: 12px; z-index: 60; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.toast pre { white-space: pre-wrap; font-family: inherit; font-size: .85rem; margin: 6px 0 8px; max-height: 120px; overflow: auto; }
.verify-card { max-width: 320px; margin-top: 10px; }

/* ----- Bot de WhatsApp ----- */
.wa-qr { display: block; width: 260px; max-width: 100%; margin: 8px auto; border-radius: 8px; background: #fff; }

/* ---------- Cartón de lotería: igual al cartón impreso (fondo blanco, bordes dobles, "LOTERIA | CODIGO: B07", 2 columnas × 3 filas) ---------- */
.bingo-card.paper { background: #fff; color: #111; border: 4px double #111; border-radius: 6px; padding: 6px; box-shadow: none; }
.bingo-card.paper.winner { border-color: #0a8f4b; box-shadow: 0 0 26px rgba(57, 255, 136, .7); }
.sheet-head { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.sheet-head div { border: 4px double #111; text-align: center; font-weight: 800; font-size: clamp(.8rem, 2.4vw, 1.1rem); padding: 3px 4px; letter-spacing: .5px; }
.bingo-card.paper .sheet { grid-template-columns: repeat(2, 1fr); gap: 6px; }
.bingo-card.paper .card-grid { border: 4px double #111; border-radius: 0; padding: 4px; gap: 0; background: #fff; }
.bingo-card.paper .cell.fig { aspect-ratio: 98 / 106; background: #fff; border: 1px solid #f3c7da; border-radius: 0; position: relative; padding: 0; }
.bingo-card.paper .cell.fig img { width: 100%; height: 100%; object-fit: contain; }
.bingo-card.paper .cell.fig .fig-num { color: #111; font-size: .7rem; }
/* ficha que ya salió: marco dorado y ✔, sin tapar el dibujo ni el nombre */
.bingo-card.paper .cell.fig.marked::before { content: ''; position: absolute; inset: 0; border: 3px solid #ffb703; background: rgba(255, 183, 3, .22); pointer-events: none; }
.bingo-card.paper .cell.fig.marked::after { content: '✔'; position: absolute; top: 0; right: 2px; color: #0a8f4b; font-weight: 900; font-size: clamp(.8rem, 2.6vw, 1.3rem); text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.bingo-card.paper .card-status { color: #444; }
.bingo-card.paper .card-status.near { color: #0a7d6c; }
/* teléfono acostado: la pantalla es baja; las 6 tablas en 3 × 2 para que la hoja completa quepa sin desplazarse */
@media (orientation: landscape) and (max-height: 520px) {
  .bingo-card.paper .sheet { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .bingo-card.paper .card-grid { padding: 2px; }
  .sheet-head div { padding: 1px 4px; }
}

/* ---------- Pozo acumulado, cuenta regresiva y "¡a una ficha!" ---------- */
.hype { display: grid; gap: 10px; max-width: 520px; margin: 0 auto 14px; }
.pozo { text-align: center; padding: 12px; border-radius: 16px; border: 3px solid var(--gold);
  background: radial-gradient(circle at 50% 0%, rgba(255, 183, 3, .35), rgba(58, 29, 143, .55)); box-shadow: 0 0 24px rgba(255, 183, 3, .35); }
.pozo-t { font-weight: 900; letter-spacing: 2px; color: var(--gold); }
.pozo-m { font-size: clamp(2rem, 9vw, 3rem); font-weight: 900; color: #fff; text-shadow: 0 0 14px rgba(255, 183, 3, .9); animation: pozo-brillo 2.4s ease-in-out infinite; }
.pozo-s { font-size: .85rem; color: #ffe8a3; }
@keyframes pozo-brillo { 50% { transform: scale(1.06); } }
.countdown { text-align: center; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--cyan); display: grid; gap: 2px; }
.countdown b { font-size: clamp(1.6rem, 7vw, 2.2rem); color: var(--cyan); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.bingo-card.near { animation: a-uno 1s ease-in-out infinite; }
@keyframes a-uno { 0%, 100% { box-shadow: 0 0 10px rgba(255, 60, 60, .5); } 50% { box-shadow: 0 0 34px rgba(255, 60, 60, 1); } }
.pozo-cfg label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; font-size: .85rem; }
.pozo-cfg input { margin: 0; }

/* ---------- Barra de estado del panel y confeti ---------- */
.health { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 6px; margin: -6px -6px 10px;
  background: rgba(11, 19, 30, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.health span { padding: 4px 10px; border-radius: 20px; font-size: .82rem; font-weight: 700; }
.health .h-ok { background: rgba(57, 255, 136, .15); color: var(--green); }
.health .h-bad { background: rgba(230, 57, 70, .22); color: #ff8a93; animation: h-alerta 1.2s ease-in-out infinite; }
.health .h-off { background: rgba(255, 255, 255, .08); color: var(--muted); }
@keyframes h-alerta { 50% { background: rgba(230, 57, 70, .45); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

/* ---------- Combos ---------- */
.combos { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.combo { flex: 1 1 120px; display: grid; text-align: center; padding: 8px; border-radius: 12px; border: 2px dashed var(--gold); background: rgba(255, 183, 3, .1); }
.combo b { color: var(--gold); } .combo span { font-size: 1.2rem; font-weight: 900; } .combo small { color: var(--green); }
.ahorro { color: var(--green); font-weight: 700; font-size: .85rem; min-height: 1em; }

/* ---------- Pestañas del panel ---------- */
.tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.tabs button { padding: 10px 2px; border-radius: 10px; font-weight: 800; font-size: clamp(.68rem, 2.6vw, .95rem); background: var(--panel); color: var(--muted); border: 1px solid var(--line); position: relative; }
@media (max-width: 520px) { .tabs .ti { display: block; font-size: 1.15rem; margin-bottom: 2px; } .tabs .badge { position: absolute; top: 2px; right: 2px; } }
.tabs button.active { background: var(--gold); color: #111; border-color: var(--gold); }
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; }
#app[data-tab="venta"] [data-tabs]:not([data-tabs~="venta"]),
#app[data-tab="juego"] [data-tabs]:not([data-tabs~="juego"]),
#app[data-tab="clientes"] [data-tabs]:not([data-tabs~="clientes"]),
#app[data-tab="cuentas"] [data-tabs]:not([data-tabs~="cuentas"]),
#app[data-tab="equipo"] [data-tabs]:not([data-tabs~="equipo"]),
#app[data-tab="ludo"] [data-tabs]:not([data-tabs~="ludo"]),
#app[data-tab="ajustes"] [data-tabs]:not([data-tabs~="ajustes"]) { display: none !important; }

/* ---------- Últimos ganadores y ranking ---------- */
.ultimos #ultimos-list { display: grid; gap: 6px; }
.ultimo { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(57, 255, 136, .08); }
.ultimo b { color: var(--green); }
.rank-preview { white-space: pre-wrap; font-family: inherit; font-size: .85rem; color: var(--muted); background: rgba(255,255,255,.04); padding: 10px; border-radius: 10px; }

/* ---------- Cartón de la suerte ---------- */
.suerte { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--green); background: rgba(57, 255, 136, .06); }
.suerte summary { cursor: pointer; font-weight: 800; color: var(--green); }
.suerte input { margin: 10px 0 6px; }
.suerte-res { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.suerte-res > .muted { flex-basis: 100%; }
.suerte-chip { padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.suerte-chip.on { border-color: var(--gold); background: rgba(255, 183, 3, .2); }

/* ---------- Referidos ---------- */
.invite { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px dashed var(--cyan); background: rgba(0, 245, 212, .06); }
.invite b { color: var(--cyan); } .invite input { margin: 6px 0; }
.invite-panel:has(.invite.hidden) { display: none; }

/* Premio por invitar */
.gratis { padding: 10px 12px; border-radius: 10px; background: rgba(61, 220, 132, .12); border: 1px solid #3ddc84; color: #3ddc84; font-weight: 700; }

/* Cuentas */
.ganancia-pos { color: #3ddc84; font-weight: 700; }
.ganancia-neg { color: #ff6b6b; font-weight: 700; }
#cuentas-meses td:not(:first-child), #cuentas-partidas td:not(:first-child) { white-space: nowrap; }
.usd { font-size: .85rem; margin-top: -2px; }
.usd:empty { display: none; }

/* Resultados */
.resultado summary { cursor: pointer; padding: 4px 0; }
.res-premio { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.res-premio .chip.last { background: var(--gold); color: #111; }
.res-premio .bingo-card { max-width: 420px; margin: 8px auto 0; }
.res-link { color: var(--gold); font-weight: 700; }
.res-bolillas { margin-top: 10px; }
.res-bolillas summary { cursor: pointer; color: var(--muted); }

/* Equipo: avisos y app */
.push-kinds { display: grid; gap: 6px; margin-top: 10px; }
.avisos { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.aviso { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.aviso b { display: block; }
.aviso .muted { font-size: .8rem; white-space: pre-line; }
.aviso.nuevo { border-color: var(--gold); }
.reserva-box { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.reserva-box summary { cursor: pointer; }

/* Ludo: perfil y monedero */
.auth-tabs { grid-template-columns: repeat(2, 1fr); }
.saldo-card { text-align: center; }
.saldo-grande { font-size: 1.5rem; margin: 10px 0; }
.saldo-grande b { color: var(--gold); }
.mov { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mov .mov-mas { color: #3ddc84; font-weight: 800; }
.mov .mov-menos { color: #ff6b6b; font-weight: 800; }
.mov .saldo-col { min-width: 90px; text-align: right; }

/* Ludo: salas, colores y asientos */
.colores { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.color-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--panel); border: 2px solid var(--line); color: var(--text); font-weight: 700; }
.color-chip.sel { border-color: var(--gold); background: rgba(240,165,0,.12); }
.color-chip .punto, .asiento .punto { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.asientos { display: grid; gap: 6px; margin: 10px 0; }
.asiento { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }

/* Ludo: tablero en vivo */
.juego-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.turno-chip { padding: 7px 14px; border-radius: 99px; font-weight: 800; color: #10233f; box-shadow: 0 4px 12px rgba(0,0,0,.35); transition: background .3s; }
.tablero-wrap { max-width: 470px; margin: 0 auto; filter: drop-shadow(0 12px 28px rgba(0,0,0,.45)); }
.tablero-wrap.captura { animation: lb-captura .45s ease; }
@keyframes lb-captura { 0%,100% { transform: none; } 20% { transform: translateX(-6px) rotate(-.6deg); } 45% { transform: translateX(5px) rotate(.5deg); filter: drop-shadow(0 0 16px rgba(255,80,60,.9)) drop-shadow(0 12px 28px rgba(0,0,0,.45)); } 70% { transform: translateX(-3px); } }
#tablero { width: 100%; height: auto; display: block; border-radius: 16px; }
/* fichas: deslizan con un leve rebote */
.ficha { transition: transform .5s cubic-bezier(.3,1.5,.5,1); }
.ficha .cuerpo, .ficha .sombra { transition: filter .2s; }
.ficha.movible { cursor: pointer; }
.ficha.movible .cuerpo { stroke: #ffd23f; stroke-width: .15; animation: lb-aro 1s ease-in-out infinite; }
.ficha.movible .sombra { opacity: .35; }
@keyframes lb-aro { 0%,100% { stroke-opacity: .45; } 50% { stroke-opacity: 1; } }
/* paneles de jugador con inicial (avatar) y brillo cuando les toca */
.jug-barra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.jug-barra .jug { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: .85rem; }
.jug-barra .jug.activo { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240,165,0,.35); animation: lb-activo 1.4s ease-in-out infinite; }
@keyframes lb-activo { 0%,100% { box-shadow: 0 0 0 2px rgba(240,165,0,.25); } 50% { box-shadow: 0 0 14px 2px rgba(240,165,0,.55); } }
.jug-ava { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.3); }
.jug-nom { font-weight: 700; line-height: 1.1; }
.juego-controles { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.dado { width: 58px; height: 58px; min-width: 58px; border-radius: 14px; background: linear-gradient(145deg,#fff,#dde5ee); box-shadow: 0 6px 14px rgba(0,0,0,.45), inset 0 2px 3px rgba(255,255,255,.9), inset 0 -3px 5px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; padding: 7px; transition: transform .2s, box-shadow .2s; }
.dado.mi-turno-dado { cursor: pointer; box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(240,165,0,.6); animation: lb-dado-pulse 1.1s infinite alternate cubic-bezier(.4,0,.2,1); }
@keyframes lb-dado-pulse { 0% { transform: scale(1); box-shadow: 0 0 0 3px var(--gold), 0 0 10px rgba(240,165,0,.4); } 100% { transform: scale(1.08); box-shadow: 0 0 0 4px var(--gold), 0 0 24px rgba(240,165,0,.8); } }
.dado-cara { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.dado.rodando { animation: lb-dado .5s cubic-bezier(.3,1.2,.4,1); }
@keyframes lb-dado { 0% { transform: rotate(0) scale(1); } 35% { transform: rotate(160deg) scale(1.25); } 70% { transform: rotate(300deg) scale(.95); } 100% { transform: rotate(360deg) scale(1); } }

/* Ludo: mis partidas */
.mi-sala { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-decoration: none; color: var(--text); margin-bottom: 6px; }

/* Ludo: temporizador visual y reacciones */
.turno-box { display: flex; align-items: center; gap: 8px; }
.timer-badge { font-size: .85rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.4); border: 1px solid var(--line); color: var(--gold); }
.timer-badge.urgente { color: #ff4757; border-color: #ff4757; animation: lb-pulse .6s infinite alternate; }
@keyframes lb-pulse { 0% { transform: scale(1); } 100% { transform: scale(1.08); } }
.timer-bar-wrap { width: 100%; height: 6px; background: rgba(0,0,0,.45); border-radius: 99px; overflow: hidden; margin-bottom: 12px; border: 1px solid rgba(255,255,255,.1); }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #2ed573, #ffa502); border-radius: 99px; transition: width 1s linear, background .5s; }
.timer-bar.urgente { background: #ff4757; }

.tablero-wrap { position: relative; }
.reacciones-flotantes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.emoji-flotante { position: absolute; bottom: 20px; font-size: 2.2rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); animation: lb-float 2.2s forwards cubic-bezier(.1,.8,.2,1); }
.emoji-autor { font-size: .7rem; font-weight: 800; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 6px; color: #fff; margin-top: -6px; display: block; text-align: center; }
@keyframes lb-float { 0% { opacity: 0; transform: translateY(0) scale(.5); } 15% { opacity: 1; transform: translateY(-30px) scale(1.2); } 80% { opacity: 1; transform: translateY(-160px) scale(1); } 100% { opacity: 0; transform: translateY(-220px) scale(.7); } }

.reacciones-barra { display: flex; justify-content: center; gap: 8px; margin: 12px 0 6px; }
.btn-reaccion { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.07); font-size: 1.3rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s, background .15s; }
.btn-reaccion:hover { background: rgba(255,255,255,.15); transform: scale(1.15); }
.btn-reaccion:active { transform: scale(.95); }

/* Botones de acción social para WhatsApp */
.btn-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e) !important; color: #fff !important; font-weight: 800 !important; border: none !important; box-shadow: 0 4px 14px rgba(37,211,102,.4) !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; text-decoration: none !important; }
.btn-whatsapp:hover { filter: brightness(1.1) !important; transform: translateY(-1px) !important; }
.btn-copiar { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); }

/* Tarjeta de recarga asistida cuando falta saldo */
.saldo-aviso-card { background: rgba(240,165,0,.1); border: 1.5px solid var(--gold); border-radius: 14px; padding: 14px; margin: 12px 0; text-align: left; }
.saldo-aviso-card h3 { margin: 0 0 6px; color: var(--gold); font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.saldo-aviso-card p { margin: 0 0 10px; font-size: .9rem; line-height: 1.4; }

/* Ajustes Responsive para cualquier teléfono móvil */
@media (max-width: 600px) {
  body { padding: 6px 8px; }
  .wrap { max-width: 100%; }
  .panel { padding: 12px; border-radius: 14px; }
  .juego-top { gap: 6px; margin-bottom: 6px; }
  .juego-top #juego-pote { font-size: .85rem; }
  .turno-chip { padding: 5px 10px; font-size: .8rem; }
  .timer-badge { font-size: .75rem; padding: 3px 7px; }
  .timer-bar-wrap { height: 5px; margin-bottom: 8px; }
  .tablero-wrap { max-width: min(92vw, 46vh); margin: 0 auto; }
  .jug-barra { gap: 5px; margin: 8px 0; }
  .jug-barra .jug { padding: 4px 8px; font-size: .76rem; border-radius: 8px; }
  .jug-ava { width: 24px; height: 24px; min-width: 24px; font-size: .75rem; }
  .juego-controles { gap: 8px; margin-top: 6px; }
  .dado { width: 48px; height: 48px; min-width: 48px; border-radius: 10px; padding: 5px; }
  .btn-gold { padding: 10px 14px; font-size: .9rem; }
  .btn-reaccion { width: 38px; height: 38px; font-size: 1.15rem; }
}

@media (max-height: 720px) {
  .tablero-wrap { max-width: min(85vw, 40vh); }
  .reacciones-barra { margin: 4px 0 0; }
  .jug-barra { margin: 4px 0; }
}
