/* =============================================
   EL PEDRO — style.css
   Salón de cartas: tapete verde, madera y oro,
   cartas españolas grandes y botones fáciles de
   tocar. Alto contraste y cartas grandes para
   quien ve poco.
   ============================================= */

:root {
    --felt: #0e3b28;
    --felt-2: #17583a;
    --felt-edge: #082319;
    --wood: #5a3418;
    --wood-2: #8a5528;
    --ink: #f5f2e8;
    --muted: #bcd0c2;
    --accent: #ffd34d;
    --accent-2: #f0b429;
    --accent-ink: #1c1600;
    --panel: rgba(4, 22, 14, 0.42);
    --panel-line: rgba(255, 255, 255, 0.12);
    --focus: #ffd34d;
    --danger: #ff8a7a;
    --ok: #8ef0a4;
    --btn: #1d6645;
    --btn-2: #164f36;
    --btn-hover: #258056;
    --radius: 14px;
    --card-w: 84px;
    --card-small: 54px;
    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    background:
        radial-gradient(ellipse 120% 80% at 50% 30%, transparent 40%, rgba(0, 0, 0, 0.45) 100%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0 2px, transparent 2px 6px),
        radial-gradient(ellipse at 50% 30%, var(--felt-2), var(--felt) 60%, var(--felt-edge));
    background-color: var(--felt);
    background-attachment: fixed;
    color: var(--ink);
    font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#app { max-width: 1040px; margin: 0 auto; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }

.screen { display: none; }
.screen.active { display: block; animation: screen-in .35s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 { font-family: var(--serif); font-size: 2.1rem; margin: 0.4em 0 0.5em; letter-spacing: 0.01em; }
h2 { font-size: 1.2rem; margin: 1.2em 0 0.5em; color: var(--accent); }
p { margin: 0.5em 0; }
.small { font-size: 0.9rem; color: var(--muted); }
.version { margin-top: 2em; font-size: 0.85rem; color: var(--muted); text-align: center; }
.kicker { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0; opacity: .9; }
.brand {
    font-family: var(--serif); font-weight: 700; margin: 0.05em 0 0.15em; line-height: 1;
    font-size: clamp(2.6rem, 9vw, 4.4rem);
    background: linear-gradient(180deg, #fff7d6 0%, #ffd34d 45%, #c88a12 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .0);
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .45));
}
.small-brand { font-size: clamp(2.1rem, 7vw, 3.2rem); }
.section-title { color: var(--ink); font-family: var(--serif); font-size: 1.35rem; margin-top: 1.4em; }

/* ── Botones ─────────────────────────────── */
button {
    font: inherit; color: var(--ink);
    background: linear-gradient(180deg, var(--btn), var(--btn-2));
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-height: 48px;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: background .15s, transform .08s, box-shadow .15s;
}
button:hover:not(:disabled) { background: linear-gradient(180deg, var(--btn-hover), var(--btn)); }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, button:focus, .vfocus { outline: 4px solid var(--focus); outline-offset: 2px; }
button.big { font-size: 1.2rem; padding: 15px 20px; background: linear-gradient(180deg, #ffe07a, var(--accent) 45%, var(--accent-2)); color: var(--accent-ink); font-weight: 700; border-color: rgba(0, 0, 0, .15); }
button.big:hover:not(:disabled) { background: linear-gradient(180deg, #fff0b0, #ffe07a); }
button.big.alt { background: linear-gradient(180deg, #ffffff, #e2ebe6); color: #102a1d; }
button.big.alt:hover:not(:disabled) { background: #ffffff; }
.ico { width: 1.6em; height: 1.6em; flex: 0 0 auto; }

.menu { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.menu-row { display: flex; gap: 12px; }
.menu-row > * { flex: 1 1 0; }
.screen > .nav { display: block; width: 100%; max-width: 480px; margin: 12px 0 0; }
.panel-screen { max-width: 720px; }


/* ── Portada ─────────────────────────────── */
.hero { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; max-width: 600px; }
.hero-fan { height: 150px; width: 260px; position: relative; margin-bottom: 10px; }
.tagline { font-size: 1.1rem; color: #e6efe9; max-width: 560px; }
.invite { color: var(--accent); font-weight: 700; }
.invite:empty, #net-test:empty { display: none; }
.choose { color: var(--ink); margin: 0.8em 0 0.2em; font-family: var(--serif); font-size: 1.4rem; }
.modes { max-width: 520px; width: 100%; }
.mode-card { display: flex; align-items: center; gap: 14px; text-align: left; }
.mc-text { display: flex; flex-direction: column; gap: 2px; }
.modes .sub { font-size: 0.85rem; font-weight: 400; opacity: 0.85; }

/* En pantallas anchas, todo centrado. */
@media (min-width: 900px) {
    .panel-screen, #screen-gamemenu { margin-left: auto; margin-right: auto; }
    #screen-gamemenu { max-width: 760px; }
    .hero { margin: 0 auto; align-items: center; text-align: center; }
    .hero .tagline { margin-left: auto; margin-right: auto; }
}

/* Abanico de cartas */
.fan { position: relative; display: block; width: 100%; height: 100%; }
.fan-card {
    position: absolute; left: 50%; bottom: 0; width: 84px; height: 126px; margin-left: -42px;
    transform-origin: 50% 110%; transform: rotate(var(--a));
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45));
}
.fan-card svg { width: 100%; height: 100%; display: block; }
.hero-fan .fan-card { width: 96px; height: 144px; margin-left: -48px; animation: fan-in .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes fan-in { from { transform: rotate(0deg) translateY(20px); opacity: 0; } to { transform: rotate(var(--a)); opacity: 1; } }

/* ── El salón ────────────────────────────── */
.salon-head { text-align: left; margin-top: 8px; }
.hello { color: var(--accent); font-size: 1.15rem; margin: 0.2em 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 22px; }
.game-tile {
    display: flex; align-items: center; gap: 18px; text-align: left; padding: 18px 20px; min-height: 170px;
    background:
        radial-gradient(circle at 15% 50%, rgba(255, 211, 77, .14), transparent 55%),
        linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18));
    border: 2px solid rgba(255, 211, 77, .35); border-radius: 20px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.game-tile[data-game="brisca"] { border-color: rgba(224, 68, 77, .55); background: radial-gradient(circle at 15% 50%, rgba(224, 68, 77, .2), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }
.game-tile:hover:not(:disabled), .game-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, .45); }
.tile-art { flex: 0 0 120px; height: 130px; position: relative; }
.tile-art .fan-card { width: 64px; height: 96px; margin-left: -32px; }
.game-tile:hover .tile-art .fan-card, .game-tile:focus .tile-art .fan-card { transform: rotate(calc(var(--a) * 1.5)); transition: transform .3s; }
.tile-text { display: flex; flex-direction: column; gap: 4px; }
.tile-kind { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.tile-name { font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; }
.tile-tag { font-size: .95rem; color: #e1ebe5; }
.tile-players { font-size: .82rem; color: var(--muted); }
.salon-menu { max-width: none; }
.friends-btn { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 1.25rem; }

/* El menú de un juego */
.game-hero { display: flex; align-items: center; gap: 26px; margin: 10px 0 22px; }
.gm-fan { flex: 0 0 170px; height: 170px; position: relative; }
.gm-fan .fan-card { width: 88px; height: 132px; margin-left: -44px; animation: fan-in .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }

/* ── Listas de opciones ──────────────────── */
.optlist { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; width: 100%; }
.opt-label { flex: 1 1 auto; }
.opt-value { flex: 0 1 auto; color: var(--accent); font-weight: 600; text-align: right; }
.opt-value::before { content: "‹ "; opacity: .5; }
.opt-value::after { content: " ›"; opacity: .5; }

.text { max-width: 760px; }
.text ul { padding-left: 1.2em; }
.text li { margin: 0.3em 0; }
#screen-rules .menu { margin-bottom: 1em; }
#rules-text, #news-text { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; padding: 6px 22px 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; max-width: none; margin-bottom: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; padding: 4px 18px 12px; }
.stat-card h2 { font-family: var(--serif); }

/* Formularios y salas */
.field { display: block; font-weight: 700; margin: 14px 0 6px; }
.input { display: block; width: 100%; max-width: 480px; font: inherit; font-size: 1.2rem; padding: 12px 14px; border-radius: var(--radius); border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(3, 25, 16, .7); color: var(--ink); }
.input:focus { outline: 4px solid var(--focus); outline-offset: 2px; }
/* La mano recibe el foco al empezar: un marco suave, que las cartas llevan el suyo. */
.hand:focus { outline: none; }
.hand:focus-visible { outline: 2px dashed rgba(255, 211, 77, .55); outline-offset: 4px; border-radius: 12px; }
.input.code { letter-spacing: 0.4em; font-size: 1.6rem; max-width: 260px; text-align: center; }
.status { min-height: 1.5em; color: var(--accent); font-weight: 600; }
.room-code { display: flex; gap: 8px; margin: 4px 0 10px; }
.room-code:empty { display: none; }
.room-code span { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; width: 1.4em; height: 1.7em; display: grid; place-items: center; background: #fffbe8; color: #1c1600; border-radius: 10px; box-shadow: 0 4px 0 #c9b98a, 0 8px 18px rgba(0, 0, 0, .35); }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; margin-bottom: 16px; }
.lobby-game-card { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; }
.lobby-game-card .fan { width: 90px; height: 92px; flex: 0 0 90px; }
.lobby-game-card .fan-card { width: 48px; height: 72px; margin-left: -24px; }
.lobby-game-card strong { display: block; font-family: var(--serif); font-size: 1.3rem; }
.lobby-game-card .lgc-tag { display: block; font-size: .9rem; color: var(--muted); }
.game-name-line { font-weight: 700; }
.game-name-line:empty { display: none; }
.players { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 8px 12px; font-weight: 600; }
.pairs { color: var(--accent); font-weight: 600; }
.pairs:empty { display: none; }
.rules-summary { color: var(--muted); }
#lobby-title { letter-spacing: 0.02em; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: .9rem; color: #fff; background: #3d6fb6; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); flex: 0 0 auto; }
.avatar[data-c="1"] { background: #c8323c; } .avatar[data-c="2"] { background: #3d8a4a; } .avatar[data-c="3"] { background: #b07d10; }
.avatar[data-c="4"] { background: #7a4fb0; } .avatar[data-c="5"] { background: #1b8c8c; }

/* ── Mesa ────────────────────────────────── */
.status-line { min-height: 1.6em; margin: 0 0 10px; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--accent); text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
#table {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "topleft top topright"
        "left center right"
        "me me me";
    gap: 12px;
    align-items: center;
    padding: 18px;
    border-radius: 36px;
    background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, .06), transparent 65%), rgba(0, 0, 0, .12);
    box-shadow: inset 0 0 0 10px rgba(90, 52, 24, .85), inset 0 0 0 12px rgba(255, 211, 77, .25), inset 0 0 40px 14px rgba(0, 0, 0, .45), 0 20px 50px rgba(0, 0, 0, .35);
}
.seat-topleft { grid-area: topleft; } .seat-top { grid-area: top; } .seat-topright { grid-area: topright; }
.seat-left { grid-area: left; } .seat-right { grid-area: right; } .seat-me { grid-area: me; }
.center { grid-area: center; display: flex; justify-content: center; align-items: flex-end; gap: 14px; flex-wrap: wrap; }

.seat { position: relative; background: rgba(0, 0, 0, 0.2); border: 2px solid transparent; border-radius: 18px; padding: 8px 10px; text-align: center; transition: border-color .25s, background .25s, box-shadow .25s; }
.seat.active { border-color: var(--accent); background: rgba(255, 211, 77, 0.10); box-shadow: 0 0 22px rgba(255, 211, 77, 0.3); }
.seat.caller .seat-name::after { content: " · ¡Pedro!"; color: var(--accent); font-weight: 800; }
.seat.winner { border-color: var(--ok); box-shadow: 0 0 26px rgba(142, 240, 164, 0.45); }
.seat.team-a { background: rgba(61, 111, 182, .16); }
.seat.team-b { background: rgba(200, 50, 60, .12); }
.seat.team-a .seat-name::before { content: "Tu pareja · "; color: #9cc0ff; font-weight: 700; font-size: .8em; }
.seat-me.team-a .seat-name::before { content: ""; }
.seat-name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; margin-bottom: 6px; }
.seat-name .avatar { width: 24px; height: 24px; font-size: .75rem; }
.wins { color: var(--accent); letter-spacing: 2px; margin-left: 2px; }
.score { color: var(--ok); }
.seat-extra:empty { display: none; }

/* Bocadillo: lo que acaba de hacer cada jugador */
.bubble { position: absolute; left: 50%; top: -14px; transform: translate(-50%, -6px) scale(.9); background: #fffbe8; color: #1c1600; font-weight: 700; font-size: .9rem; padding: 5px 12px; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.45); opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .2s, transform .2s; z-index: 5; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.bubble.show { opacity: 1; transform: translate(-50%, -12px) scale(1); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fffbe8; border-bottom: 0; }

.hand { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hand.rival { gap: 6px; }

/* Mazo, mesa y carta robada */
.pile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pile[hidden] { display: none; }
.pile-btn { background: transparent; border: 2px solid transparent; padding: 4px; min-height: 0; border-radius: 14px; box-shadow: none; }
.pile-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.pile-card { display: block; width: var(--card-w); height: calc(var(--card-w) * 1.5); }
.pile-card svg, .ghost svg, .face svg.art, .tcard svg.art { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.pile-cap { font-size: 0.85rem; color: var(--muted); }
#deck-btn .pile-card { box-shadow: 2px 2px 0 #e9dfc4, 4px 4px 0 #d5c8a4, 6px 6px 8px rgba(0,0,0,.3); border-radius: 10px; }
#deck-btn.ready { border-color: var(--accent); box-shadow: 0 0 20px rgba(255, 211, 77, 0.45); animation: breathe 1.6s ease-in-out infinite; }
#table-btn.ready { border-color: var(--accent); }
.land .pile-card, .land.won-pile, .seat-extra.land .won-pile { animation: land .35s ease-out; }
.drawn .pile-card { transform: rotate(-4deg); }
@keyframes breathe { 50% { box-shadow: 0 0 30px rgba(255, 211, 77, 0.75); } }
/* Cambiar la muestra y cantar: brillan mientras se pueden hacer, para que no se pasen */
#act-swapTrump:not([hidden]), #act-cante:not([hidden]) { animation: breathe 1.8s ease-in-out infinite; }
@keyframes land { from { transform: scale(1.12) rotate(4deg); } to { transform: none; } }

/* ── Cartas (botones que se dan la vuelta) ── */
.slot { position: relative; padding: 4px; background: transparent; border: 0; min-height: 0; border-radius: 12px; perspective: 700px; box-shadow: none; }
.slot:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.slot:disabled { opacity: 1; cursor: default; }
.slot .flip { position: relative; width: var(--card-w); height: calc(var(--card-w) * 1.5); transition: transform .55s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; transform: rotateY(180deg); }
.slot.up .flip { transform: rotateY(0deg); }
.slot .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.slot .face.back { transform: rotateY(180deg); }
.slot.small .flip { width: var(--card-small); height: calc(var(--card-small) * 1.5); }
.slot.empty .flip { visibility: hidden; }
.slot.empty::after { content: ""; position: absolute; inset: 4px; border: 2px dashed rgba(255, 255, 255, 0.22); border-radius: 10px; }
.slot-num { position: absolute; top: -8px; right: -6px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 26px; height: 26px; font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.slot .memo { position: absolute; bottom: 8px; left: 8px; right: 8px; background: rgba(0, 0, 0, 0.72); color: #fff; border-radius: 5px; font-size: 0.7rem; text-align: center; z-index: 2; }
.slot .memo:empty { display: none; }
.slot.pickable .flip { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(255, 211, 77, .6); border-radius: 12px; }
.slot.pickable:hover .flip { transform: translateY(-6px) rotateY(180deg); }
.slot.pickable.up:hover .flip { transform: translateY(-6px); }
.slot.chosen .flip { box-shadow: 0 0 0 4px var(--ok), 0 0 22px rgba(142, 240, 164, .8); transform: translateY(-10px) rotateY(180deg); border-radius: 12px; }
.slot.chosen.up .flip { transform: translateY(-14px); }
.slot.hl .flip { box-shadow: 0 0 0 3px #fff, 0 0 20px rgba(255, 255, 255, .7); border-radius: 12px; }
.slot.blocked .flip { filter: brightness(.55) saturate(.6); }
.slot.trumpcard .front::after { content: "Triunfo"; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; letter-spacing: .05em; white-space: nowrap; }
.slot.shake .flip { animation: shake .5s; }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
.ghost { position: fixed; z-index: 50; pointer-events: none; }

/* Número grande en las cartas (alto contraste) */
.badge { display: none; }

/* ── Brisca ──────────────────────────────── */
#table[data-game="brisca"] .center { align-items: center; flex-wrap: nowrap; gap: 18px; }
.stock { position: relative; }
.stock-cards { position: relative; display: block; width: calc(var(--card-w) * 1.5); height: calc(var(--card-w) * 1.5); }
.stock .muestra { position: absolute; left: calc(var(--card-w) * 0.5); top: calc(var(--card-w) * 0.25); width: var(--card-w); height: calc(var(--card-w) * 1.5); transform: rotate(90deg); transform-origin: 50% 50%; }
.stock .deck-top { position: absolute; left: 0; top: 0; box-shadow: 2px 2px 0 #e9dfc4, 4px 4px 0 #d5c8a4, 6px 6px 8px rgba(0,0,0,.3); border-radius: 10px; }
.stock .deck-top[hidden] { display: none; }
.stock.empty .stock-cards { opacity: .25; }
.trick { position: relative; width: calc(var(--card-w) * 3.1); height: calc(var(--card-w) * 2.6); border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, .07), transparent 70%); }
.tcard { position: absolute; width: calc(var(--card-w) * .92); height: calc(var(--card-w) * 1.38); left: 50%; top: 50%; margin-left: calc(var(--card-w) * -.46); margin-top: calc(var(--card-w) * -.69); transition: transform .3s, box-shadow .3s; animation: drop .3s ease-out; z-index: calc(var(--i) + 1); }
.tcard.pos-me { transform: translate(0, 32%) rotate(-3deg); }
.tcard.pos-top { transform: translate(0, -32%) rotate(4deg); }
.tcard.pos-left { transform: translate(-48%, 0) rotate(-12deg); }
.tcard.pos-right { transform: translate(48%, 0) rotate(10deg); }
.tcard.pos-topleft { transform: translate(-40%, -26%) rotate(-8deg); }
.tcard.pos-topright { transform: translate(40%, -26%) rotate(8deg); }
.tcard.best svg.art { filter: drop-shadow(0 0 8px rgba(255, 211, 77, .9)) drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.tcard.gather { opacity: 0; transition: opacity .2s .1s; }
@keyframes drop { from { opacity: 0; scale: 1.15; } to { opacity: 1; scale: 1; } }
/* El triunfo, siempre a la vista bajo el mazo (también cuando ya no queda muestra) */
.trump-chip { display: block; font-size: .85rem; font-weight: 800; color: var(--accent-ink); background: var(--accent); padding: 3px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.trump-chip:empty { display: none; }
.trump-chip[data-suit="copas"] { background: #ff9aa0; } .trump-chip[data-suit="espadas"] { background: #a9c6ff; } .trump-chip[data-suit="bastos"] { background: #a9e08a; }
.mini { display: inline-block; width: 30px; height: 45px; margin: 0 -4px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.mini svg { width: 100%; height: 100%; display: block; }
.hand.rival .mini:nth-child(1) { rotate: -8deg; } .hand.rival .mini:nth-child(3) { rotate: 8deg; }
.seat-extra { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.won-pile { display: inline-block; width: 22px; height: 33px; rotate: 90deg; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.won-pile svg { width: 100%; height: 100%; display: block; }
.won-pile.none { display: none; }
#table[data-game="brisca"] .seat-me .hand { gap: 14px; }

/* ── Parchís ─────────────────────────────── */
[data-color="amarillo"] { --pc: #f5c518; --pc-dark: #8a6a00; --pc-ink: #2e2300; }
[data-color="azul"] { --pc: #2f6fd6; --pc-dark: #173c80; --pc-ink: #fff; }
[data-color="rojo"] { --pc: #d63a3a; --pc-dark: #7c1b1b; --pc-ink: #fff; }
[data-color="verde"] { --pc: #2e9d4f; --pc-dark: #165c2b; --pc-ink: #fff; }
[data-color="naranja"] { --pc: #f07f1a; --pc-dark: #8a4200; --pc-ink: #2e1600; }
[data-color="morado"] { --pc: #8446c4; --pc-dark: #45206e; --pc-ink: #fff; }
.parchis-tile { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.tile-art .parchis-tile { width: 116px; height: 116px; margin: 7px auto 0; }
.gm-fan .parchis-tile { width: 160px; height: 160px; margin: 5px auto 0; }
.lobby-game-card .parchis-tile { width: 84px; height: 84px; flex: 0 0 84px; }
.parchis-tile .pb-cell, .parchis-tile .pb-lane, .parchis-tile .pb-meta { stroke-width: .12; }
.parchis-tile .pb-safe { stroke-width: .15; }

/* La mesa: el tablero en el centro y cada jugador junto a su casa (tú, abajo a la derecha). */
#table[data-game="parchis"] {
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    grid-template-areas: "top center right" "left center me";
    align-items: stretch;
}
body[data-players="3"] #table[data-game="parchis"] { grid-template-areas: "left center right" ". center me"; }
#table[data-game="parchis"] .seat { align-self: start; }
#table[data-game="parchis"] .seat-left, #table[data-game="parchis"] .seat-me { align-self: end; }
body[data-players="3"] #table[data-game="parchis"] .seat-left { align-self: start; }
/* El tablero de seis: cada uno junto a su casa, alrededor de la estrella (la mesa pone a cada sitio en su hueco). */
body[data-players="5"] #table[data-game="parchis"], body[data-players="6"] #table[data-game="parchis"] { grid-template-areas: "top center topright" "topleft center right" "left center me"; }
body[data-players="5"] #table[data-game="parchis"] .seat, body[data-players="6"] #table[data-game="parchis"] .seat { align-self: center; }
#table[data-game="parchis"] .center { align-items: center; justify-content: center; }
.pboard-wrap { display: flex; justify-content: center; }
.pboard {
    display: block; width: min(600px, calc(100vh - 190px)); width: min(600px, calc(100dvh - 190px)); min-width: 280px; height: auto; aspect-ratio: 1;
    border-radius: 12px; background: #f6eedb; touch-action: manipulation; -webkit-user-select: none; user-select: none;
    box-shadow: 0 0 0 6px #5a3418, 0 0 0 8px rgba(255, 211, 77, .35), 0 18px 40px rgba(0, 0, 0, .45);
}
.pb-bg { fill: #f6eedb; }
.pb-home { stroke: rgba(0, 0, 0, .35); stroke-width: .08; }
.pb-yard { fill: #fffaf0; stroke-width: .2; }
.pb-cell { fill: #fffdf7; stroke: #5b4a35; stroke-width: .05; }
.pb-cell.start { stroke-width: .08; }
.pb-lane { stroke: #5b4a35; stroke-width: .05; }
.pb-meta { stroke: #5b4a35; stroke-width: .06; }
.pb-safe { fill: none; stroke: #9a8a74; stroke-width: .09; }
.pb-center { fill: #fffaf0; stroke: #5b4a35; stroke-width: .06; }
.pb-num { font: 700 .42px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: #77654f; text-anchor: middle; pointer-events: none; }
.pz { cursor: pointer; transition: transform .16s ease-out; }
.pz-ring { fill: none; stroke: transparent; stroke-width: .14; }
.pz-body { stroke-width: .1; }
.pz.mine .pz-body { stroke-width: .15; }
.pz-shine { fill: rgba(255, 255, 255, .55); pointer-events: none; }
.pz-num { font: 800 .5px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-anchor: middle; pointer-events: none; }
.pz.can .pz-ring { stroke: #e8a900; animation: pzglow 1.1s ease-in-out infinite; }
.pz.sel .pz-ring { stroke: #11a34e; stroke-width: .22; animation: none; }
@keyframes pzglow { 0%, 100% { stroke-opacity: .3; } 50% { stroke-opacity: 1; } }
.pb-dest { fill: rgba(17, 163, 78, .22); stroke: #11a34e; stroke-width: .12; stroke-dasharray: .3 .2; pointer-events: none; }
.pb-flash { fill: rgba(255, 196, 0, .6); pointer-events: none; animation: pbflash 1s ease-out forwards; }
@keyframes pbflash { from { opacity: 1; } to { opacity: 0; } }
.die { cursor: pointer; transition: transform .35s cubic-bezier(.3, .7, .3, 1); }
.die rect { fill: #fffef8; stroke: #3a2c1a; stroke-width: .1; }
.die .pips circle { fill: #1c1408; }
.die.blank .die-in { opacity: .6; }
.die.ready rect { stroke: #e8a900; stroke-width: .2; }
.die.ready .die-in { animation: dieready 1.2s ease-in-out infinite; }
.die.rolling .die-in { animation: dieroll .14s linear infinite; }
.die.used .die-in { opacity: .35; }
.die.chosen rect { stroke: #11a34e; stroke-width: .24; }
@keyframes dieready { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes dieroll { 0% { transform: rotate(-16deg) scale(1.08); } 50% { transform: rotate(16deg) scale(1.08); } 100% { transform: rotate(-16deg) scale(1.08); } }

/* Tus fichas: un botón grande por ficha */
#table[data-game="parchis"] #my-hand { gap: 10px; flex-wrap: wrap; }
.pzb { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 82px; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 2px solid rgba(255, 255, 255, .15); color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; }
.pzb:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.pzb-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; background: var(--pc); color: var(--pc-ink); border: 3px solid var(--pc-dark); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 3px 6px rgba(0, 0, 0, .4); }
.pzb-txt { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.pzb.pickable { border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 211, 77, .5); }
.pzb.chosen { border-color: var(--ok); box-shadow: 0 0 18px rgba(142, 240, 164, .75); transform: translateY(-4px); }
.pzb.blocked { opacity: .55; }
.pzb.done .pzb-dot { box-shadow: 0 0 0 3px var(--accent), 0 3px 6px rgba(0, 0, 0, .4); }
#table[data-game="parchis"] #my-name::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--pc); border: 2px solid var(--pc-dark); margin-right: 6px; vertical-align: -2px; }
.avatar[data-color] { background: var(--pc); color: var(--pc-ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 0 2px var(--pc-dark); }
/* Las fichas de los demás: un círculo con el número y dónde está */
#table[data-game="parchis"] .hand.rival { gap: 4px; flex-wrap: wrap; }
.pzc { display: inline-flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, .28); border-radius: 999px; padding: 2px 7px 2px 2px; font-size: .78rem; font-weight: 700; }
.pzc-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--pc); color: var(--pc-ink); border: 2px solid var(--pc-dark); }
body[data-contrast="alto"] .pb-num { fill: #000; font-size: .5px; }
body[data-contrast="alto"] .pb-cell { stroke: #000; stroke-width: .08; }
body[data-contrast="alto"] .pz-body { stroke: #000; stroke-width: .16; }
body[data-contrast="alto"] .pzc, body[data-contrast="alto"] .pzb { background: #000; border-color: #fff; }
body[data-cards="grande"] .pzb-dot { width: 52px; height: 52px; font-size: 1.4rem; }
body[data-cards="grande"] .pzb-txt { font-size: 1rem; }

/* ── Trivial ─────────────────────────────── */
.trivial-tile { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.tile-art .trivial-tile { width: 116px; height: 116px; margin: 7px auto 0; }
.gm-fan .trivial-tile { width: 160px; height: 160px; margin: 5px auto 0; }
.lobby-game-card .trivial-tile { width: 84px; height: 84px; flex: 0 0 84px; }
.game-tile[data-game="trivial"] { border-color: rgba(47, 125, 214, .55); background: radial-gradient(circle at 15% 50%, rgba(224, 85, 154, .2), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }

/* La mesa: la rueda en el centro y los jugadores a los lados. */
#table[data-game="trivial"] {
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    grid-template-areas: "topleft center topright" "left center right" "top center me";
    align-items: center;
}
body[data-players="2"] #table[data-game="trivial"] { grid-template-areas: "top center me"; }
body[data-players="3"] #table[data-game="trivial"] { grid-template-areas: "left center right" ". center me"; }
body[data-players="4"] #table[data-game="trivial"] { grid-template-areas: "left center right" "top center me"; }
#table[data-game="trivial"] .center { flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.tboard-wrap { position: relative; display: flex; justify-content: center; }
.tboard {
    display: block; width: min(600px, calc(100vh - 220px)); width: min(600px, calc(100dvh - 220px)); min-width: 280px; height: auto; aspect-ratio: 1;
    border-radius: 50%; touch-action: manipulation; -webkit-user-select: none; user-select: none;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .5));
}
.tb-disc { fill: #fbf5e6; stroke: #5a3418; stroke-width: .35; }
.tb-inner { fill: #f1e6cc; }
.tb-sq { stroke: #fffaf0; stroke-width: .1; }
.tb-sq.roll { fill: #fffdf6; stroke: #d6c7a6; }
.tb-rollico rect { fill: #fff; stroke: #6b5a45; stroke-width: .07; }
.tb-rollico circle { fill: #3a2c1a; }
.tb-hq { stroke-width: .14; filter: drop-shadow(0 .08px .12px rgba(0, 0, 0, .45)); }
.tb-hq-in { fill: rgba(255, 255, 255, .9); }
.tb-ico { font-size: 1.05px; text-anchor: middle; pointer-events: none; }
.tb-hub { stroke: #fffaf0; stroke-width: .12; }
.tb-hub-in { fill: #fffaf0; stroke: #d6c7a6; stroke-width: .06; }
.tb-flash { fill: rgba(255, 196, 0, .55); pointer-events: none; animation: pbflash 1s ease-out forwards; }
.tk { cursor: pointer; transition: transform .14s ease-out; }
.tk-base { fill: #fff; stroke-width: .17; filter: drop-shadow(0 .06px .1px rgba(0, 0, 0, .55)); }
.tk-w { fill: #e6dfcf; stroke: #fff; stroke-width: .05; }
.tk.turn .tk-base { stroke-width: .24; }
.tk.mine .tk-base { stroke-dasharray: none; }
.tmark { cursor: pointer; }
.tmark circle { fill: rgba(255, 255, 255, .92); stroke: #e8a900; stroke-width: .16; animation: tmark 1.1s ease-in-out infinite; }
.tmark text { font: 800 .72px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-anchor: middle; fill: #2a1d00; pointer-events: none; }
.tmark.sel circle { stroke: #11a34e; stroke-width: .26; fill: #eafff0; animation: none; }
@keyframes tmark { 50% { stroke-width: .3; } }
#t-die rect { fill: #fffef8; stroke: #3a2c1a; stroke-width: .08; }
#t-die .pips circle { fill: #1c1408; }
#t-die .die-wedge { fill: #f2c12e; stroke: #8a6a00; stroke-width: .07; }

/* La leyenda de colores, debajo de la rueda */
.tlegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.tleg { display: inline-flex; align-items: center; gap: 5px; }
.tleg i { width: 12px; height: 12px; border-radius: 3px; background: var(--cc); box-shadow: 0 0 0 1px rgba(255, 255, 255, .4); }

/* La tarjeta de la pregunta, encima de la rueda */
.tq { position: absolute; inset: 0; display: grid; place-items: center; padding: 4%; z-index: 4; }
.tq[hidden] { display: none; }
.tq::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(8, 25, 16, .45); backdrop-filter: blur(2px); }
.tq-card { position: relative; width: min(100%, 470px); background: #fffdf6; color: #1c1408; border-radius: 18px; padding: 14px 16px 12px; box-shadow: 0 0 0 5px var(--cc), 0 18px 40px rgba(0, 0, 0, .55); animation: tqin .3s ease-out; }
@keyframes tqin { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.tq-head { display: flex; align-items: center; gap: 8px; margin: -14px -16px 10px; padding: 8px 14px; border-radius: 14px 14px 0 0; background: var(--cc); color: var(--ci); font-weight: 800; letter-spacing: .02em; }
.tq-ico { font-size: 1.2rem; }
.tq-kind { margin-left: auto; font-size: .8rem; background: rgba(255, 255, 255, .85); color: #2a1d00; border-radius: 999px; padding: 1px 9px; }
.tq-kind:empty { display: none; }
.tq-time { margin-left: auto; font-size: .9rem; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .25); color: #fff; border-radius: 999px; padding: 1px 9px; }
.tq-kind:not(:empty) + .tq-time { margin-left: 0; }
.tq-time[hidden] { display: none; }
.tq-time.low { background: #c8323c; animation: tqlow 1s ease-in-out infinite; }
@keyframes tqlow { 50% { transform: scale(1.12); } }
.tq-text { font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; margin: 0 0 12px; font-weight: 700; }
.tq-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tans { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 52px; padding: 8px 10px; border-radius: 12px; background: #f3ecdb; color: #1c1408; border: 2px solid #d9cba8; font-size: 1rem; font-weight: 700; box-shadow: 0 2px 0 #cdbd96; }
.tans:hover:not(:disabled) { background: #fff6dc; }
.tans:disabled { opacity: 1; cursor: default; }
.tans-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--cc, #5a3418); color: var(--ci, #fff); font-weight: 800; font-size: .95rem; }
.tq-card .tans-n { background: var(--cc); color: var(--ci); }
.tans.chosen { border-color: #11a34e; background: #eafff0; transform: translateY(-2px); box-shadow: 0 0 14px rgba(17, 163, 78, .45); }
.tans.cut { opacity: .35; text-decoration: line-through; }
.tans.right { border-color: #11a34e; border-width: 3px; background: #b8f0c8; animation: tright .6s ease-out; }
.tans.wrong { border-color: #c8323c; background: #ffd6d6; animation: shake .5s; }
@keyframes tright { 40% { transform: scale(1.05); } }
.tcat { background: var(--cc); color: var(--ci); border-color: rgba(0, 0, 0, .2); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.tcat .tans-n { background: rgba(255, 255, 255, .9); color: #1c1408; }
.tcat-ico { margin-left: auto; font-size: 1.1rem; }
.tcat.chosen { box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(17, 163, 78, .7); background: var(--cc); }
.tq-foot { margin: 10px 0 0; text-align: center; font-weight: 800; color: #5b4a35; min-height: 1.2em; }
.tq-card.ok .tq-foot { color: #0d7a39; font-size: 1.15rem; }
.tq-card.ko .tq-foot { color: #a1232c; }

/* Tus opciones: adónde puedes ir */
#table[data-game="trivial"] #my-hand { gap: 8px; flex-wrap: wrap; }
.tdest { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 48px; border-radius: 14px; background: var(--cc, #fffdf6); color: var(--ci, #1c1408); border: 2px solid rgba(0, 0, 0, .2); font-weight: 800; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.tdest[data-kind="roll"], .tdest[data-kind="hub"] { --cc: #fffdf6; --ci: #1c1408; }
.tdest[data-kind="hq"] { box-shadow: 0 0 0 3px #fff, 0 3px 0 rgba(0, 0, 0, .3); }
.tdest-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #1c1408; font-size: .9rem; }
.tdest.chosen { outline: 3px solid var(--ok); outline-offset: 2px; transform: translateY(-3px); }
.tpie { flex: 0 0 auto; width: 44px; height: 44px; display: block; margin: 0 auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.tpie.big { width: 52px; height: 52px; margin: 0; }
#table[data-game="trivial"] .hand.rival { align-items: center; gap: 8px; }
.tcount { font-weight: 800; color: var(--ok); white-space: nowrap; }
#table[data-game="trivial"] .seat-name { white-space: nowrap; }
#table[data-game="trivial"] .seat.team-a .seat-name::before { content: "Tu equipo · "; }
#table[data-game="parchis"].trios .seat.team-a .seat-name::before { content: "Tu equipo · "; }
#table[data-game="trivial"] #my-extra { gap: 10px; font-weight: 700; color: var(--ink); }
.tme-where { font-size: .85rem; color: var(--muted); max-width: 260px; text-align: left; }
body[data-contrast="alto"] .tq-card { box-shadow: 0 0 0 6px #000, 0 0 0 9px #fff; }
body[data-contrast="alto"] .tans { border-color: #000; background: #fff; }
body[data-contrast="alto"] .tb-sq { stroke: #000; stroke-width: .12; }
body[data-cards="grande"] .tq-text { font-size: 1.45rem; }
body[data-cards="grande"] .tans { font-size: 1.15rem; min-height: 60px; }

/* ── Efectos ─────────────────────────────── */
.burst { position: fixed; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%; pointer-events: none; z-index: 40; background: radial-gradient(circle, rgba(255, 211, 77, 0) 34%, rgba(255, 211, 77, .8) 46%, rgba(255, 211, 77, 0) 68%); animation: burst .8s ease-out forwards; }
@keyframes burst { from { transform: scale(.15); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; z-index: 30; text-align: center; background: linear-gradient(180deg, #fff7d6, #ffd34d); color: #2a1d00; padding: 12px 28px 10px; border-radius: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 4px rgba(90, 52, 24, .8); }
.banner strong { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.banner span { display: block; font-size: .95rem; font-weight: 600; }
.banner.show { animation: banner 1.9s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.98); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--r)); } }

/* ── Acciones ────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.act { flex: 1 1 140px; max-width: 260px; }
.act.main { background: linear-gradient(180deg, #ffe07a, var(--accent) 45%, var(--accent-2)); color: var(--accent-ink); font-weight: 700; }
.act.call { background: linear-gradient(180deg, #e0444d, #a3202c); font-weight: 800; }
.act.small { flex: 1 1 110px; font-size: 0.95rem; background: rgba(0, 0, 0, 0.28); }
kbd { font: 600 0.75em ui-monospace, monospace; background: rgba(0, 0, 0, 0.25); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.act.main kbd { background: rgba(0, 0, 0, 0.12); }

/* Sin voz: nada de listas ni de botones para oír; solo la mesa */
body[data-output="visual"] .log, body[data-output="visual"] .talk { display: none; }

/* Lo último que ha pasado: la primera línea, grande; las anteriores, más pequeñas */
.log { list-style: none; margin: 14px auto 0; padding: 8px 12px; max-width: 760px; min-height: 3em; background: rgba(0, 0, 0, 0.25); border-radius: 12px; }
.log li { color: var(--muted); font-size: 0.9rem; padding: 2px 0; }
.log li:first-child { color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.log li:nth-child(n+4) { opacity: 0.7; }

/* ── Diálogo ─────────────────────────────── */
.dialog { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 70; backdrop-filter: blur(3px); }
.dialog[hidden] { display: none; }
.dialog-box { background: linear-gradient(180deg, #164c35, #0f3a28); border: 2px solid var(--accent); border-radius: 20px; padding: 20px; width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6); animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-box h2 { margin-top: 0; font-family: var(--serif); font-size: 1.5rem; }
.dialog-items { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.dialog-item { text-align: left; }
/* Abajo y sin tapar la mesa: en la reunión de El Impostor se ve el panel mientras eliges */
.dialog.dock { align-items: flex-end; background: transparent; backdrop-filter: none; pointer-events: none; }
.dialog.dock .dialog-box { pointer-events: auto; max-height: 46vh; max-height: 46dvh; padding: 14px 16px; }
.dialog.dock .dialog-box h2 { font-size: 1.2rem; margin-bottom: 4px; }
.dialog.dock .dialog-items { gap: 8px; margin-top: 8px; }

/* ── Cartas grandes ──────────────────────── */
body[data-cards="grande"] { --card-w: 112px; --card-small: 70px; }
body[data-cards="grande"] .mini { width: 40px; height: 60px; }

/* ── Modo oscuro (Parchís y Trivial) ─────── */
/* Cada uno lo elige en su aparato (data-dark, en applyLook). Se oscurecen el tapete, el tablero y las
   tarjetas; los colores de los jugadores, las fichas y las categorías no cambian. El marco de madera, tampoco. */
body[data-screen="game"][data-game="parchis"][data-dark~="parchis"],
body[data-screen="game"][data-game="trivial"][data-dark~="trivial"] {
    --felt: #0d1210; --felt-2: #151b18; --felt-edge: #060908;
    --panel: rgba(0, 0, 0, .45); --muted: #a9b3ad;
    --btn: #22302a; --btn-2: #18221d; --btn-hover: #2c3d35;
    background-color: #0a0d0c;
}
body[data-screen="game"][data-game="parchis"][data-dark~="parchis"] #table,
body[data-screen="game"][data-game="trivial"][data-dark~="trivial"] #table { background: radial-gradient(ellipse at center, #151b18 0%, #0b0f0d 75%); }

body[data-dark~="parchis"] .pboard { background: #1b1e23; box-shadow: 0 0 0 6px #2a2d33, 0 0 0 8px rgba(255, 211, 77, .25), 0 18px 40px rgba(0, 0, 0, .7); }
body[data-dark~="parchis"] .pboard .pb-bg { fill: #1b1e23; }
body[data-dark~="parchis"] .pboard .pb-yard { fill: #24282e; }
body[data-dark~="parchis"] .pboard .pb-cell { fill: #2b3038; stroke: #4b525d; }
/* El pasillo apagado (night) va en su style, junto a su color: Safari no aplica filter a lo de dentro de un SVG. */
body[data-dark~="parchis"] .pboard .pb-lane { stroke: #4b525d; fill: var(--night) !important; }
body[data-dark~="parchis"] .pboard .pb-meta { stroke: #4b525d; }
body[data-dark~="parchis"] .pboard .pb-safe { stroke: #9aa3b0; }
body[data-dark~="parchis"] .pboard .pb-center { fill: #24282e; stroke: #4b525d; }
body[data-dark~="parchis"] .pboard .pb-num { fill: #c3cad4; }
body[data-dark~="parchis"] .pboard .pb-home { stroke: rgba(0, 0, 0, .6); }
body[data-dark~="parchis"] .pzb { background: rgba(255, 255, 255, .04); }

body[data-dark~="trivial"] .tboard .tb-disc { fill: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-inner { fill: #24282e; }
body[data-dark~="trivial"] .tboard .tb-sq { stroke: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-sq.roll { fill: #2b3038; stroke: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-rollico rect { fill: #c3cad4; stroke: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-rollico circle { fill: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-hq-in { fill: #2b3038; }
body[data-dark~="trivial"] .tboard .tb-hub { stroke: #1b1e23; }
body[data-dark~="trivial"] .tboard .tb-hub-in { fill: #24282e; stroke: #4b525d; }
body[data-dark~="trivial"] .tq::before { background: rgba(0, 0, 0, .55); }
body[data-dark~="trivial"] .tq-card { background: #1f2328; color: #eef0f3; }
body[data-dark~="trivial"] .tans { background: #2b3038; color: #eef0f3; border-color: #4b525d; box-shadow: 0 2px 0 #14171b; }
body[data-dark~="trivial"] .tans:hover:not(:disabled) { background: #343a43; }
body[data-dark~="trivial"] .tans.chosen { background: #173a26; border-color: #3ccf75; }
body[data-dark~="trivial"] .tans.right { background: #1d5a34; border-color: #3ccf75; }
body[data-dark~="trivial"] .tans.wrong { background: #5a1f24; border-color: #ff6b74; }
body[data-dark~="trivial"] .tcat, body[data-dark~="trivial"] .tcat.chosen { background: var(--cc); color: var(--ci); }
body[data-dark~="trivial"] .tq-foot { color: #c3cad4; }
body[data-dark~="trivial"] .tq-card.ok .tq-foot { color: #6fe39a; }
body[data-dark~="trivial"] .tq-card.ko .tq-foot { color: #ff8a8f; }
body[data-dark~="trivial"] .tdest[data-kind="roll"], body[data-dark~="trivial"] .tdest[data-kind="hub"] { --cc: #2b3038; --ci: #eef0f3; }

/* ── Alto contraste ──────────────────────── */
body[data-contrast="alto"] {
    --felt: #000; --felt-2: #0b0b0b; --felt-edge: #000;
    --ink: #ffffff; --muted: #e8e8e8; --panel: #000; --panel-line: #fff;
    --btn: #1a1a1a; --btn-2: #000; --btn-hover: #333;
    background: #000;
}
body[data-contrast="alto"] button { border-color: #fff; }
body[data-contrast="alto"] #table { background: #062012; box-shadow: inset 0 0 0 4px #fff; }
body[data-contrast="alto"] .seat { border-color: #777; background: #000; }
body[data-contrast="alto"] .seat.active { border-color: var(--accent); border-width: 4px; }
body[data-contrast="alto"] .badge { display: flex; position: absolute; left: 4%; top: 3%; flex-direction: column; align-items: center; background: #fff; border: 3px solid var(--c); border-radius: 10px; padding: 2px 4px 4px; z-index: 3; box-shadow: 0 2px 4px rgba(0,0,0,.6); }
body[data-contrast="alto"] .badge b { font: 900 calc(var(--card-w) * .34)/1 system-ui, sans-serif; color: var(--c); }
body[data-contrast="alto"] .badge svg { width: calc(var(--card-w) * .26); height: calc(var(--card-w) * .26); }
body[data-contrast="alto"] .slot.small .badge b { font-size: calc(var(--card-small) * .34); }
body[data-contrast="alto"] .tcard .badge { left: 2%; top: 2%; }
body[data-contrast="alto"] .bubble { border: 3px solid #000; font-size: 1rem; }
body[data-contrast="alto"] .status-line { font-size: 1.35rem; color: #fff; background: #000; border: 2px solid var(--accent); border-radius: 10px; padding: 4px 8px; }
body[data-contrast="alto"] .brand { background: none; color: var(--accent); -webkit-text-fill-color: var(--accent); filter: none; }
.face, .tcard { position: relative; }

/* ── Móvil ───────────────────────────────── */
/* Sin teclado (móvil o tableta), las letras de las teclas sobran. */
@media (hover: none) and (pointer: coarse) {
    kbd { display: none; }
}

@media (max-width: 760px) {
    .lobby-grid { grid-template-columns: 1fr; }
    .game-hero { gap: 14px; }
    .gm-fan { flex-basis: 120px; height: 130px; }
    .gm-fan .fan-card { width: 64px; height: 96px; margin-left: -32px; }
}

@media (max-width: 640px) {
    body { font-size: 17px; }
    #app {
        padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
                 max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    h1 { font-size: 1.6rem; }
    .hero { min-height: 60vh; }
    .hero-fan { height: 120px; width: 220px; }
    .hero-fan .fan-card { width: 76px; height: 114px; margin-left: -38px; }
    .tiles { grid-template-columns: 1fr; }
    .game-tile { min-height: 0; padding: 14px; gap: 12px; }
    .tile-art { flex-basis: 92px; height: 100px; }
    .tile-art .fan-card { width: 50px; height: 75px; margin-left: -25px; }
    .tile-name { font-size: 1.45rem; }
    .room-code span { font-size: 1.8rem; }
    .status-line { font-size: 1rem; margin-bottom: 6px; }
    #table { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px; border-radius: 22px; box-shadow: inset 0 0 0 5px rgba(90, 52, 24, .85), inset 0 0 24px 6px rgba(0, 0, 0, .4); }
    /* De izquierda a derecha, como suenan: izquierda, enfrente y derecha */
    .seat:not(.seat-me) { flex: 1 1 30%; min-width: 0; padding: 5px 4px; }
    /* Con 3 o más rivales, dos por fila: así sus cartas se pueden tocar para quemarlas */
    body[data-players="4"] .seat:not(.seat-me), body[data-players="5"] .seat:not(.seat-me), body[data-players="6"] .seat:not(.seat-me) { flex-basis: 40%; }
    .seat-left { order: 1; } .seat-topleft { order: 2; } .seat-top { order: 3; } .seat-topright { order: 4; } .seat-right { order: 5; }
    .center { order: 6; flex: 1 1 100%; gap: 10px; }
    .seat-me { order: 7; flex: 1 1 100%; padding: 6px 4px; }
    .seat-name { font-size: 0.85rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .seat.team-a .seat-name::before { content: "Pareja · "; }
    #table[data-game="parchis"].trios .seat.team-a .seat-name::before { content: "Equipo · "; }
    .bubble { font-size: .8rem; max-width: 150px; }
    .bubble::after { display: none; }
    .seat-right .bubble, .seat-topright .bubble { left: auto; right: 2px; transform: translateY(-6px) scale(.9); }
    .seat-left .bubble, .seat-topleft .bubble { left: 2px; transform: translateY(-6px) scale(.9); }
    .seat-right .bubble.show, .seat-topright .bubble.show, .seat-left .bubble.show, .seat-topleft .bubble.show { transform: translateY(-12px) scale(1); }
    /* Las cartas se encogen para caber en una fila, aunque haya cartas de castigo */
    .hand { flex-wrap: nowrap; }
    .slot { min-width: 0; }
    .slot .flip, .slot.small .flip { width: 100%; height: auto; aspect-ratio: 2 / 3; }
    .hand.rival { gap: 3px; }
    .slot.small { flex: 0 1 42px; padding: 2px; }
    #my-hand { gap: 6px; }
    #my-hand .slot { flex: 0 1 78px; flex-basis: min(78px, 13vh); flex-basis: min(78px, 13dvh); padding: 3px; }
    body[data-cards="grande"] #my-hand .slot { flex-basis: min(104px, 17dvh); }
    #table[data-game="brisca"] #my-hand .slot { flex-basis: min(96px, 16dvh); }
    .pile-card { width: min(62px, 11vh); width: min(62px, 11dvh); height: auto; aspect-ratio: 2 / 3; }
    .pile-cap { font-size: 0.8rem; }
    #table[data-game="brisca"] { --card-w: 58px; }
    body[data-cards="grande"] #table[data-game="brisca"] { --card-w: 70px; }
    #table[data-game="brisca"] .center { gap: 8px; }
    #table[data-game="parchis"] .seat { align-self: auto; }
    .pboard { width: min(100%, 62dvh); min-width: 0; box-shadow: 0 0 0 4px #5a3418, 0 10px 24px rgba(0, 0, 0, .45); }
    #table[data-game="parchis"] #my-hand { flex-wrap: nowrap; gap: 6px; }
    #table[data-game="parchis"] #my-hand .slot { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
    .pzb-dot { width: 34px; height: 34px; font-size: 1rem; }
    .pzb-txt { font-size: .74rem; }
    .pzc { font-size: .7rem; padding-right: 5px; }
    .pzc-dot { width: 17px; height: 17px; font-size: .64rem; }
    #table[data-game="brisca"] .pile-card { width: var(--card-w); }
    .trump-chip { font-size: .75rem; padding: 2px 8px; }
    .mini { width: 22px; height: 33px; }
    .seat-extra { font-size: .75rem; margin-top: 3px; }
    .won-pile { width: 16px; height: 24px; }
    .actions { gap: 8px; margin-top: 10px; }
    .act { flex: 1 1 45%; max-width: none; }
    .act.small { flex: 1 1 22%; font-size: 0.85rem; padding: 10px 6px; }
    .act.small kbd, .act kbd { display: none; }
    .log { margin-top: 10px; }
    .banner strong { font-size: 1.5rem; }
}

/* Móvil pequeño de pie (como el iPhone SE): un poco más apretado para que se vean tus cartas */
@media (max-width: 640px) and (max-height: 700px) {
    .status-line { font-size: 0.92rem; line-height: 1.3; }
    .seat:not(.seat-me) { padding: 3px 4px; }
    .seat-name { font-size: 0.8rem; margin-bottom: 2px; }
    .slot.small { flex-basis: min(42px, 6.5vh); flex-basis: min(42px, 6.5dvh); }
    .seat-me .seat-name { margin-bottom: 0; }
    .pile-cap { font-size: 0.75rem; }
    .act { min-height: 44px; padding: 8px 10px; }
    #table[data-game="brisca"] { --card-w: 50px; }
}

/* Móvil tumbado (o ventana muy baja): todo más pequeño para que quepa sin bajar */
@media (max-height: 520px) and (orientation: landscape) {
    #app {
        padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
                 max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .status-line { font-size: 0.95rem; margin-bottom: 4px; min-height: 1.3em; }
    #table { gap: 6px; padding: 8px; }
    .seat { padding: 3px 6px; }
    .seat-name { font-size: 0.85rem; margin-bottom: 2px; }
    .slot { padding: 2px; }
    .slot .flip { width: 52px; height: 78px; }
    .slot.small .flip { width: 32px; height: 48px; }
    .hand.rival { gap: 3px; }
    .pile-card { width: 46px; height: 69px; }
    #table[data-game="brisca"] { --card-w: 46px; }
    #table[data-game="brisca"] .trick { height: calc(var(--card-w) * 2.05); }
    /* El mazo, con el número y el triunfo al lado en vez de debajo */
    #table[data-game="brisca"] .stock { display: grid; grid-template-columns: auto auto; column-gap: 14px; align-items: center; }
    #table[data-game="brisca"] .stock-cards { grid-row: 1 / span 2; }
    #table[data-game="brisca"] .stock .pile-cap { align-self: end; }
    #table[data-game="brisca"] .stock .trump-chip { align-self: start; }
    .mini { width: 20px; height: 30px; }
    .seat-extra { font-size: .72rem; margin-top: 1px; }
    .won-pile { width: 14px; height: 21px; }
    .pile-cap { font-size: 0.75rem; white-space: nowrap; }
    .center { gap: 8px; flex-wrap: nowrap; }
    .pboard { width: calc(100vh - 110px); width: calc(100dvh - 110px); min-width: 0; box-shadow: 0 0 0 4px #5a3418, 0 10px 24px rgba(0, 0, 0, .45); }
    #table[data-game="parchis"] { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    #table[data-game="parchis"] #my-hand { gap: 5px; }
    .pzb { min-width: 0; padding: 4px 6px; }
    .pzb-dot { width: 30px; height: 30px; font-size: .9rem; }
    .pzb-txt { font-size: .72rem; }
    .actions { margin-top: 6px; gap: 6px; }
    .act { padding: 6px 10px; min-height: 44px; }
    .act.small { font-size: 0.85rem; }
    .hero { min-height: 0; }
}

/* Trivial en el móvil: la rueda a lo ancho y la pregunta encima, con letra cómoda */
@media (max-width: 640px) {
    #table[data-game="trivial"] .seat { align-self: auto; }
    .tboard { width: min(100%, 60dvh); min-width: 0; }
    .tq { padding: 0; place-items: center; }
    .tq::before { border-radius: 16px; }
    .tq-card { width: 100%; padding: 10px 10px 8px; border-radius: 14px; }
    .tq-head { margin: -10px -10px 8px; padding: 6px 10px; font-size: .9rem; }
    .tq-text { font-size: 1.05rem; margin-bottom: 8px; }
    .tq-answers { gap: 6px; }
    .tans { min-height: 44px; padding: 6px 8px; font-size: .92rem; }
    .tans-n { width: 24px; height: 24px; font-size: .85rem; }
    #table[data-game="trivial"] #my-hand { gap: 6px; }
    #table[data-game="trivial"] #my-hand .slot { flex: 1 1 40%; min-width: 0; padding: 6px 8px; }
    .tlegend { font-size: .72rem; gap: 2px 8px; }
    .tpie { width: 34px; height: 34px; }
    #table[data-game="trivial"] .seat.team-a .seat-name::before { content: "Equipo · "; }
}
@media (max-height: 520px) and (orientation: landscape) {
    .tboard { width: calc(100vh - 110px); width: calc(100dvh - 110px); min-width: 0; }
    .tlegend { display: none; }
    .tq-text { font-size: 1rem; }
    .tans { min-height: 40px; padding: 4px 8px; font-size: .9rem; }
}

/* ── Virus ───────────────────────────────── */
.game-tile[data-game="virus"] { border-color: rgba(126, 224, 122, .55); background: radial-gradient(circle at 15% 50%, rgba(148, 102, 224, .25), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }
.virus-fan .fan-card svg { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
#table[data-game="virus"] { --vorg-w: 50px; --vorg-me: 62px; }
#table[data-game="virus"] .seat-me { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#table[data-game="virus"] .seat-me .seat-name { order: -2; }
#table[data-game="virus"] .seat-me .vbody { order: -1; }
#table[data-game="virus"] .center { flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
#table[data-game="virus"] .seat-extra:empty { display: none; }
#table[data-game="virus"] .hand.rival { margin-top: 4px; }
#table[data-game="virus"] .hand.rival .mini { width: 22px; height: 33px; }
.seat.vdanger { border-color: #ff6b6b; box-shadow: 0 0 20px rgba(255, 107, 107, .45); }
.seat.vdanger.active { border-color: var(--accent); }

.vpiles { display: flex; gap: 14px; justify-content: center; align-items: flex-end; }
.vpiles .pile-card { width: 66px; height: 99px; }
.vstack { box-shadow: 2px 2px 0 #4b2a7a, 4px 4px 0 #3a1f60, 6px 6px 8px rgba(0, 0, 0, .35); border-radius: 9px; }
#v-deck.empty .vstack { opacity: .25; box-shadow: none; }
#v-discard-card.none { border: 2px dashed rgba(255, 255, 255, .25); border-radius: 9px; }
#v-discard-card svg { transform: rotate(-4deg); }

/* Los cuerpos: cada órgano con sus virus y medicinas encima */
.vbody { display: flex; justify-content: center; align-items: flex-start; gap: 8px; min-height: calc(var(--vorg-w) * 1.5 + 22px); flex-wrap: wrap; padding: 2px 4px 4px; border-radius: 14px; }
.seat-me .vbody { min-height: calc(var(--vorg-me) * 1.5 + 22px); }
.vbody-empty { align-self: center; font-size: .8rem; color: var(--muted); border: 2px dashed rgba(255, 255, 255, .2); border-radius: 10px; padding: 8px 10px; }
.vbody.target { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(255, 211, 77, .55); animation: breathe 1.4s ease-in-out infinite; }
.vorg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 3px 0; min-height: 0; background: transparent; border: 0; box-shadow: none; border-radius: 12px; }
.vorg:hover { background: rgba(255, 255, 255, .07); }
.vorg-card { position: relative; display: block; width: var(--vorg-w); height: calc(var(--vorg-w) * 1.5); border-radius: 8px; transition: box-shadow .25s; }
.seat-me .vorg-card { width: var(--vorg-me); height: calc(var(--vorg-me) * 1.5); }
.vorg-card > svg, .vitem svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.vitem { position: absolute; width: 56%; height: 56%; bottom: -26%; z-index: 1; }
.vitem.i0 { left: -4%; transform: rotate(-10deg); }
.vitem.i1 { right: -4%; transform: rotate(10deg); }
.vorg-card:has(.vitem) { margin-bottom: 22%; }
.vtag { min-height: 1.1em; font-size: .68rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; margin-top: 4px; position: relative; z-index: 2; }
.st-infectado .vorg-card { box-shadow: 0 0 0 3px #b03cff, 0 0 16px rgba(176, 60, 255, .8); animation: vsick 1.6s ease-in-out infinite; }
.st-infectado .vtag { color: #e6a3ff; }
.st-vacunado .vorg-card { box-shadow: 0 0 0 3px #9ee8ff, 0 0 12px rgba(158, 232, 255, .6); }
.st-vacunado .vtag { color: #b9efff; }
.st-inmune .vorg-card { box-shadow: 0 0 0 4px var(--accent), 0 0 18px rgba(255, 211, 77, .8); }
.st-inmune .vtag { color: var(--accent); }
.st-inmune .vtag::before { content: "🛡 "; }
@keyframes vsick { 50% { box-shadow: 0 0 0 3px #b03cff, 0 0 26px rgba(176, 60, 255, 1); } }
.vnum { position: absolute; top: -6px; right: -4px; z-index: 3; min-width: 24px; height: 24px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .85rem; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.vorg.target .vnum { display: flex; }
.vorg.target .vorg-card { outline: 3px solid var(--accent); outline-offset: 3px; animation: breathe 1.4s ease-in-out infinite; }
.vorg.marked .vorg-card { outline-color: var(--ok); }
.vorg.marked .vnum { background: var(--ok); }
.vorg.land .vorg-card { animation: land .45s ease-out; }
.vorg.shake .vorg-card { animation: shake .5s; }

/* La carta elegida y lo que puedes hacer con ella */
.vopts { width: min(100%, 440px); background: rgba(10, 4, 22, .55); border: 2px solid rgba(178, 140, 245, .6); border-radius: 16px; padding: 8px; animation: pop .25s ease-out; }
.vopts[hidden] { display: none; }
.vopts-title { margin: 0 0 6px; font-weight: 800; color: #d9c6ff; text-align: center; font-size: .95rem; }
.vopts-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.vopt { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 44px; padding: 6px 10px; font-size: .95rem; background: rgba(255, 255, 255, .08); border: 2px solid transparent; border-radius: 12px; box-shadow: none; }
.vopt:hover { background: rgba(255, 255, 255, .15); }
.vopt.chosen { border-color: var(--ok); background: rgba(142, 240, 164, .16); }
.vopt-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .9rem; }
.slot.discarding .flip { box-shadow: 0 0 0 4px #ff8a7a, 0 0 22px rgba(255, 138, 122, .8); }
.slot.discarding .front::after { content: "Descartar"; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: #ff8a7a; color: #2a0600; font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.act.ghostbtn { background: rgba(0, 0, 0, .3); color: var(--ink); }
body[data-contrast="alto"] .vtag { font-size: .8rem; background: #000; padding: 0 4px; border-radius: 4px; }
body[data-cards="grande"] #table[data-game="virus"] { --vorg-w: 60px; --vorg-me: 76px; }

@media (max-width: 640px) {
    #table[data-game="virus"] { --vorg-w: 34px; --vorg-me: 48px; }
    body[data-cards="grande"] #table[data-game="virus"] { --vorg-w: 42px; --vorg-me: 58px; }
    #table[data-game="virus"] .vbody { gap: 4px; padding: 0 2px 2px; }
    #table[data-game="virus"] .vorg { padding: 2px 1px 0; }
    #table[data-game="virus"] .vtag { font-size: .55rem; margin-top: 4px; }
    #table[data-game="virus"] .hand.rival .mini { width: 16px; height: 24px; }
    .vpiles .pile-card { width: 48px; height: 72px; }
    .vopt { font-size: .88rem; min-height: 40px; }
    body[data-players="4"] #table[data-game="virus"], body[data-players="5"] #table[data-game="virus"], body[data-players="6"] #table[data-game="virus"] { --vorg-w: 26px; }
    #table[data-game="virus"] .seat:not(.seat-me) .hand.rival { position: absolute; top: 4px; right: 6px; margin: 0; gap: 0; }
    #table[data-game="virus"] .seat:not(.seat-me) .seat-name { justify-content: flex-start; padding-right: 40px; }
    #table[data-game="virus"] .hand.rival .mini { width: 12px; height: 18px; margin: 0 -2px; }
    #table[data-game="virus"] .vbody { min-height: calc(var(--vorg-w) * 1.5 + 14px); }
    #table[data-game="virus"] #my-hand .slot { flex-basis: min(92px, 15dvh); }
}
@media (max-height: 520px) and (orientation: landscape) {
    #table[data-game="virus"] { --vorg-w: 30px; --vorg-me: 40px; }
    #table[data-game="virus"] .vtag { display: none; }
    .vpiles .pile-card { width: 40px; height: 60px; }
    .vopts-list { max-height: 30vh; }
}


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

/* ── El Impostor ─────────────────────────── */
.imp-tile { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.tile-art .imp-tile { width: 118px; height: 98px; margin: 16px auto 0; }
.gm-fan .imp-tile { width: 170px; height: 142px; margin: 4px auto 0; }
.game-tile[data-game="impostor"] { border-color: rgba(69, 201, 201, .55); background: radial-gradient(circle at 15% 50%, rgba(69, 201, 201, .22), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }
#table[data-game="impostor"] { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #060a14; border-radius: 26px; box-shadow: inset 0 0 0 4px #2b3448, 0 20px 50px rgba(0, 0, 0, .35); }
#table[data-game="impostor"] .seat:not(.seat-me) { display: none; }
#table[data-game="impostor"] .center { order: 1; display: block; flex: 1 1 auto; min-width: 0; width: 100%; }
#table[data-game="impostor"] .seat-me { order: 2; background: transparent; border: 0; padding: 0; }
#table[data-game="impostor"] .seat-me .seat-name, #table[data-game="impostor"] .seat-me .bubble { display: none; }
/* Tus «cartas» no se ven: el foco se queda en la nave para que las teclas lleguen al juego. */
#table[data-game="impostor"] #my-hand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.imp-wrap { position: relative; }
.imp-hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; font-weight: 700; min-width: 0; }
.imp-area { flex: 1 1 auto; min-width: 0; max-width: 100%; color: var(--accent); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-bar { position: relative; flex: 0 1 340px; height: 26px; border-radius: 13px; background: #1b2233; overflow: hidden; box-shadow: inset 0 0 0 2px #3a4560; }
.imp-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: linear-gradient(90deg, #3f9a52, #5cc46a); transition: width .4s; }
.imp-bar-text { position: relative; display: block; text-align: center; line-height: 26px; font-size: .85rem; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.imp-canvas { display: block; width: 100%; height: min(62vh, 560px); height: min(62dvh, 560px); border-radius: 18px; touch-action: none; cursor: crosshair; background: #060a14; }
.imp-task { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); width: min(92%, 440px); max-height: 92%; overflow: auto; background: rgba(14, 20, 34, .96); border: 2px solid #45c9c9; border-radius: 18px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); text-align: center; z-index: 4; }
.imp-task[hidden] { display: none; }
.imp-task h3 { margin: 0 0 6px; font-size: 1.2rem; color: #45c9c9; }
.imp-task p { margin: 0 0 8px; }
.imp-task-art svg { display: block; width: 100%; max-height: 170px; }
.imp-task-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.imp-tbtn { flex: 1 1 90px; border-left: 8px solid var(--c, transparent); }
.imp-tbtn.imp-key { flex: 0 0 56px; font-size: 1.2rem; font-weight: 800; border-left: 0; }
.imp-tbtn.imp-wide, .imp-tbtn.imp-leave { flex: 1 1 100%; border-left: 0; }
.imp-tbtn.imp-half { flex: 1 1 40%; }
.imp-tbtn.imp-leave { background: rgba(0, 0, 0, .3); }
.imp-dl { height: 26px; border-radius: 13px; background: #1b2233; overflow: hidden; box-shadow: inset 0 0 0 2px #3a4560; }
.imp-dl span { display: block; height: 100%; background: linear-gradient(90deg, #2f7fb0, #45c9c9); }
.imp-dl-pct { font-weight: 800; font-size: 1.3rem; margin: 6px 0 0; }
.imp-code { display: flex; justify-content: center; gap: 10px; }
.imp-code span { width: 46px; height: 58px; display: grid; place-items: center; font-size: 2rem; font-weight: 800; background: #1b2233; border-radius: 10px; box-shadow: inset 0 0 0 2px #3a4560; }
.imp-code span.ok { background: #2f6b3a; box-shadow: inset 0 0 0 2px #5cc46a; }
/* Tu papel, arriba a la izquierda */
.imp-role { flex: 0 0 auto; padding: 2px 12px; border-radius: 999px; font-size: .9rem; white-space: nowrap; background: #1b2233; box-shadow: inset 0 0 0 2px #3a4560; }
.imp-role[hidden] { display: none; }
.imp-role[data-role="crew"] { color: #8fd3ff; box-shadow: inset 0 0 0 2px #2f7fb0; }
.imp-role[data-role="impostor"] { color: #ff8a8a; box-shadow: inset 0 0 0 2px #c0392b; background: #2a1418; }
.imp-role[data-role="ghost"] { color: #c9d2e3; opacity: .8; }
#act-kill { background: linear-gradient(180deg, #c0392b, #8e2a20); border-color: #ff8a8a; color: #fff; }
#act-kill:disabled { opacity: .55; }
#act-report { background: linear-gradient(180deg, #d35400, #9c3d00); border-color: #ffb27a; color: #fff; }
#act-report.ready:not([hidden]) { animation: breathe 1.8s ease-in-out infinite; }
#act-vent { background: linear-gradient(180deg, #4b5670, #2b3448); border-color: #ff8a8a; color: #fff; }
#act-sabotage { background: linear-gradient(180deg, #7a2d3a, #4c1a24); border-color: #ff8a8a; color: #fff; }
/* El sabotaje en marcha, arriba: sin luces, la cuenta atrás del reactor, las puertas cerradas */
.imp-sabtag { flex: 0 0 auto; padding: 2px 12px; border-radius: 999px; font-size: .9rem; white-space: nowrap; color: #fff; background: #7a2d1c; box-shadow: inset 0 0 0 2px #e05656; }
.imp-sabtag[hidden] { display: none; }
.imp-sabtag[data-kind="reactor"] { background: #a01d1d; animation: breathe 1s ease-in-out infinite; }
.imp-sabtag[data-kind="lights"] { background: #2a2f1b; box-shadow: inset 0 0 0 2px #ffd34d; color: #ffd34d; }
.imp-sabtag[data-kind="oxygen"] { background: #1d4fa0; animation: breathe 1s ease-in-out infinite; }
.imp-sabtag[data-kind="comms"] { background: #1b2a2f; box-shadow: inset 0 0 0 2px #45c9c9; color: #8fe9e9; }
.imp-sabtag[data-kind="hide"] { background: #1f2a44; box-shadow: inset 0 0 0 2px #8fd3ff; color: #cfe9ff; }
.imp-sabtag[data-kind="hidefinal"] { background: #5a1d2c; box-shadow: inset 0 0 0 2px #ff8a8a; animation: breathe 1.2s ease-in-out infinite; }
#act-power { background: linear-gradient(180deg, #4b3a8a, #2c2156); border-color: #b9a2ff; color: #fff; }
/* Las cámaras en directo: cuatro pantallas de vigilancia */
.imp-cams { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.imp-cam { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: #060a14; box-shadow: inset 0 0 0 2px #2f7fb0, 0 0 12px rgba(69, 201, 201, .18); }
.imp-cam canvas { display: block; width: 100%; aspect-ratio: 16 / 10; }
.imp-cam figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: .72rem; font-weight: 700; color: #cfe9ff; background: linear-gradient(0deg, rgba(0, 0, 0, .75), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-task:has(.imp-cams) { width: min(96%, 580px); }
.imp-bar.off { opacity: .55; }
.imp-bar[hidden] { display: none; }
.imp-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.imp-pads span { height: 54px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: #1b2233; background: color-mix(in srgb, var(--c) 35%, #1b2233); box-shadow: inset 0 0 0 2px var(--c); transition: background .12s; }
.imp-pads span.on { background: var(--c); color: #0b1020; }
.imp-big { font-size: 2.4rem; font-weight: 800; margin: 4px 0; }
.imp-big small { font-size: 1rem; font-weight: 600; color: #b8c4dc; }
.imp-meet-clock { margin: -4px 0 8px; text-align: center; font-weight: 700; color: #ffd34d; }
.imp-meet-clock:empty { display: none; }
.imp-list { list-style: none; margin: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.imp-list li { padding: 4px 8px; border-radius: 8px; background: #1b2233; }
.imp-list li.dead { color: #ff8a8a; }
.imp-list li.ok { color: #8fe39b; }
/* La reunión: tapa la nave con los tripulantes, sus votos y lo que dicen */
.imp-meet { position: absolute; inset: 0; overflow: auto; background: rgba(8, 12, 22, .96); border: 2px solid #c0392b; border-radius: 18px; padding: 12px 14px; z-index: 5; }
.imp-meet[hidden] { display: none; }
.imp-meet h3 { margin: 0 0 8px; font-size: 1.2rem; color: #ff8a8a; text-align: center; }
.imp-meet-crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.imp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; border-radius: 12px; background: #1b2233; box-shadow: inset 0 0 0 2px #3a4560; min-width: 0; }
.imp-card svg { width: 44px; height: 58px; }
.imp-card .nm { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-card.imp .nm { color: #ff8a8a; }
.imp-card.dead { opacity: .45; }
.imp-card.voted { box-shadow: inset 0 0 0 2px #5cc46a; }
.imp-card.talking { box-shadow: inset 0 0 0 3px #ffd34d; background: #2a2f1b; }
.imp-card .votes { font-weight: 800; color: #ffd34d; }
.imp-card .st { font-size: .8rem; color: #8fe39b; }
.imp-card .said { font-size: .8rem; line-height: 1.25; text-align: center; color: #dfe7f5; background: rgba(255, 255, 255, .08); border-radius: 8px; padding: 3px 6px; }
.imp-meet-log { list-style: none; margin: 10px 0 0; padding: 0; font-size: .9rem; display: flex; flex-direction: column; gap: 3px; }
.imp-meet-log li b { color: #8fd3ff; }
/* La cruceta, para andar tocando (en el móvil) */
.imp-pad { display: none; grid-template-areas: ". up ." "left down right"; grid-template-columns: repeat(3, 64px); gap: 6px; justify-content: center; margin-top: 4px; }
.imp-dir { min-height: 56px; font-size: 1.4rem; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (pointer: coarse) {
    .imp-pad { display: grid; }
    .imp-canvas { height: min(48vh, 480px); height: min(48dvh, 480px); }
    /* Que la tarea quepa en la nave, con sus botones a la vista. */
    .imp-task { padding: 10px 12px; }
    .imp-task-art svg { max-height: 110px; }
}
@media (max-width: 640px) {
    .imp-hud { flex-wrap: wrap; }
    .imp-bar { flex: 1 1 100%; }
    .imp-area { font-size: 1rem; }
    .imp-meet { padding: 10px; }
    .imp-meet-crew { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
    .imp-card svg { width: 34px; height: 46px; }
    .tile-art .imp-tile { width: 92px; height: 78px; margin-top: 11px; }
}

/* ── Blackjack ───────────────────────────── */
.game-tile[data-game="blackjack"] { border-color: rgba(120, 170, 255, .55); background: radial-gradient(circle at 15% 50%, rgba(42, 99, 173, .3), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }
#table[data-game="blackjack"] {
    --bjw: 66px; --bjw-r: 40px;
    grid-template-areas: "center center center" "topleft top topright" "left me right";
    align-items: start;
}
#table[data-game="blackjack"] .center { flex-direction: column; align-items: center; gap: 0; }
.bj-house { display: flex; flex-direction: column; align-items: center; width: 100%; }
.bj-arc { width: min(440px, 92%); height: auto; margin-bottom: -6px; }
.bj-arc text { font: 700 12.5px var(--serif); letter-spacing: .05em; fill: var(--accent); text-transform: uppercase; opacity: .85; }
.bj-dealer-row { display: flex; align-items: center; justify-content: center; gap: 22px; }
.bj-shoe .pile-card { width: 50px; height: 75px; transform: rotate(-8deg); box-shadow: 3px 3px 0 #d8d6cf, 6px 6px 0 #b9b6ac, 8px 8px 10px rgba(0,0,0,.35); border-radius: 8px; }
.bj-dealer { display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(0, 0, 0, .18); border: 2px solid rgba(255, 211, 77, .35); border-radius: 18px; padding: 6px 16px 8px; min-height: 0; box-shadow: none; min-width: 150px; }
.bj-dname { font: 700 .95rem var(--serif); color: var(--accent); letter-spacing: .06em; }
.bj-cards { display: flex; justify-content: center; padding-right: calc(var(--bjw) * .55); }
.bjc { position: relative; display: block; width: var(--bjw); height: calc(var(--bjw) * 1.5); margin-right: calc(var(--bjw) * -.55); animation: drop .3s ease-out; }
.bjc svg.art { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.bjc .badge { display: none; }
.bj-dealer .bjc { --bjw: 66px; }
.bj-total { display: inline-block; min-width: 2.2em; padding: 1px 10px; border-radius: 999px; background: #fffbe8; color: #1c1600; font-weight: 800; font-size: .95rem; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.bj-total[hidden] { display: none; }
.bjh { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 8px; border: 2px solid transparent; border-radius: 14px; background: rgba(0, 0, 0, .12); position: relative; }
.bjh.turn { border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 211, 77, .4); }
.bj-foot { display: flex; align-items: center; gap: 8px; }
.hand.rival .bjc { --bjw: var(--bjw-r); }
.hand.rival .bj-total { font-size: .8rem; padding: 0 7px; }
.bj-tag { position: absolute; top: 30%; left: 50%; transform: translateX(-50%) rotate(-8deg); padding: 2px 10px; border-radius: 8px; font-weight: 900; font-size: .9rem; letter-spacing: .04em; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.5); animation: drop .3s ease-out; z-index: 3; }
.bj-tag.good { background: var(--ok); color: #0b2a14; }
.bj-tag.bad { background: #ff8a7a; color: #3a0a04; }
.bj-tag.even { background: #e9e4d2; color: #2a2618; }
.hand.rival .bj-tag { font-size: .72rem; padding: 1px 6px; }
.bj-chip { --c1: #2a63ad; --c2: #dbe7ff; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle, var(--c1) 0 52%, var(--c2) 53% 58%, var(--c1) 59%); border: 3px dashed var(--c2); box-shadow: 0 2px 6px rgba(0,0,0,.5); font-size: .72rem; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bj-chip.t2 { --c1: #2f8a46; } .bj-chip.t3 { --c1: #c4202f; } .bj-chip.t4 { --c1: #1b1d24; --c2: #ffd34d; } .bj-chip.t5 { --c1: #6c3fb0; --c2: #ffd34d; }
.bj-chip.x2 { box-shadow: 3px -3px 0 -1px var(--c1), 0 2px 6px rgba(0,0,0,.5); }
.hand.rival .bj-chip { width: 30px; height: 30px; font-size: .62rem; border-width: 2px; }
.bj-empty { color: var(--muted); font-size: .85rem; min-height: 1.4em; }
.seat.out { opacity: .55; }
#table[data-game="blackjack"] #my-hand { gap: 12px; }
#table[data-game="blackjack"] .hand.rival { gap: 6px; flex-wrap: wrap; }
body[data-cards="grande"] #table[data-game="blackjack"] { --bjw: 84px; --bjw-r: 50px; }
body[data-contrast="alto"] .bjc .badge { display: flex; }
@media (max-width: 640px) {
    #table[data-game="blackjack"] { --bjw: 50px; --bjw-r: 30px; }
    #table[data-game="blackjack"] .center { order: 0; }
    #table[data-game="blackjack"] #my-hand .slot { flex: 0 1 auto; padding: 4px 6px; }
    .bj-dealer { padding: 4px 10px 6px; min-width: 0; }
    .bj-dealer .bjc { --bjw: 50px; }
    .bj-shoe .pile-card { width: 36px; height: 54px; }
    .bj-chip { width: 32px; height: 32px; font-size: .65rem; }
}

/* ── El Póker ────────────────────────────── */
.game-tile[data-game="poker"] { border-color: rgba(47, 111, 209, .55); background: radial-gradient(circle at 15% 50%, rgba(47, 111, 209, .22), transparent 55%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)); }
#table[data-game="poker"] .center { align-items: center; }
.pk-felt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .09), rgba(0, 0, 0, .12) 75%); box-shadow: inset 0 0 0 2px rgba(255, 211, 77, .22); min-width: min(100%, 440px); }
.pk-info { margin: 0; font-size: .85rem; color: var(--muted); letter-spacing: .02em; }
.pk-board { display: flex; gap: 8px; justify-content: center; }
.pk-card { position: relative; display: block; width: calc(var(--card-w) * .82); height: calc(var(--card-w) * 1.23); border-radius: 10px; }
.pk-card svg.art { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.pk-card.empty { border: 2px dashed rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .08); }
.pk-card.land svg.art { animation: land .35s ease-out; }
.pk-pot { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .28); border: 2px solid rgba(255, 211, 77, .35); border-radius: 999px; padding: 4px 16px 4px 8px; min-height: 0; box-shadow: none; color: var(--ink); }
.pk-pot b { color: var(--accent); font-size: 1.15rem; }
.pk-chips { display: block; width: 34px; }
.chipsvg { width: 34px; height: auto; display: block; overflow: visible; }
.chipsvg.small { width: 22px; }
.pk-clock { margin: 0; min-height: 1.2em; font-weight: 700; color: var(--accent); font-size: .9rem; }
.pk-role { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: #f5f2e8; color: #1c1c26; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.pk-role-CP { background: #6fa8ff; } .pk-role-CG { background: var(--accent); }
.pk-bet { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 700; }
.pk-tag { font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: var(--muted); }
.pk-tag.allin { background: #d4343f; color: #fff; animation: pulse-glow 1.6s ease-in-out infinite; }
@keyframes pulse-glow { 50% { box-shadow: 0 0 12px rgba(212, 52, 63, .9); } }
#table[data-game="poker"] .seat.folded { opacity: .55; }
#table[data-game="poker"] .seat.busted { opacity: .35; filter: grayscale(.8); }
#table[data-game="poker"] .seat-me.folded { opacity: .8; }
#table[data-game="poker"] .hand.rival { min-height: 45px; }
#table[data-game="poker"] .hand.rival .mini:nth-child(1) { rotate: -7deg; } #table[data-game="poker"] .hand.rival .mini:nth-child(2) { rotate: 7deg; }
#table[data-game="poker"] .hand.rival.shown .mini { width: 44px; height: 66px; margin: 0 2px; rotate: 0deg; }
#table[data-game="poker"] .seat-me .hand { gap: 14px; }
.act.danger { background: linear-gradient(180deg, #5a1e24, #3d1418); color: #ffd9d4; }
/* La lista de combinaciones, en «Cómo se juega» */
.pk-ranks { list-style: none; padding: 0; margin: 10px 0 18px; display: grid; gap: 8px; counter-reset: rk; }
.pk-rank { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 14px; background: rgba(0, 0, 0, .22); border: 1px solid var(--panel-line); counter-increment: rk; }
.pk-rank::before { content: counter(rk); flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.pk-rank-cards { display: flex; flex: 0 0 auto; }
.pk-rank-card { width: 44px; height: 66px; margin-right: -6px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.pk-rank-card svg { width: 100%; height: 100%; display: block; }
.pk-rank-card.dim { opacity: .45; filter: saturate(.4); }
.pk-rank-text strong { display: block; color: var(--accent); font-size: 1.05rem; }
.pk-rank-text span { font-size: .92rem; }
body[data-contrast="alto"] .pk-rank { background: #000; border-color: #fff; }
body[data-contrast="alto"] .pk-rank-card.dim { opacity: .7; }
body[data-contrast="alto"] .pk-card.empty { border-color: #fff; }
body[data-cards="grande"] .pk-rank-card { width: 58px; height: 87px; }
@media (max-width: 640px) {
    #table[data-game="poker"] { --card-w: 60px; }
    body[data-cards="grande"] #table[data-game="poker"] { --card-w: 72px; }
    .pk-felt { padding: 8px 10px; border-radius: 22px; min-width: 0; width: 100%; }
    .pk-board { gap: 4px; }
    .pk-card { width: min(17vw, 62px); height: auto; aspect-ratio: 2 / 3; }
    #table[data-game="poker"] #my-hand .slot { flex-basis: min(96px, 16dvh); }
    .pk-rank { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pk-rank::before { position: absolute; }
    .pk-rank { position: relative; padding-left: 46px; }
    .pk-rank::before { left: 10px; top: 10px; }
    .pk-rank-card { width: 38px; height: 57px; }
}
@media (max-width: 640px) {
    #table[data-game="poker"] .seat-name { white-space: normal; flex-wrap: wrap; row-gap: 0; }
}
