:root {
  --bg: #170c0a;
  --bg2: #241412;
  --panel: #2a1915;
  --line: #5a3a1e;
  --gold: #d4a63a;
  --gold2: #f3d77a;
  --cream: #f3e7c9;
  --muted: #b9a68a;
  --red: #c0392b;
  --felt: #1d6236;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #3b1f17 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--cream);
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; }
.deco { font-family: 'Limelight', 'Georgia', serif; font-weight: 400; letter-spacing: .04em; color: var(--gold2); text-shadow: 0 2px 0 #000; }

/* ---------- barra superior */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 2px solid var(--line); background: linear-gradient(#2a1612, #1a0e0b); position: sticky; top: 0; z-index: 5; }
.brand { font-family: 'Limelight', serif; font-size: 22px; color: var(--gold2); letter-spacing: .06em; }
.brand-mark { color: var(--gold); margin-right: 4px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.conn { color: #8a3a2a; font-size: 14px; }
.conn.on { color: #4cc06a; }

/* ---------- botones */
.btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: .55em 1.2em; border: 2px solid var(--gold); background: #3a2216; color: var(--cream); transition: transform .08s, background .15s; }
.btn:hover { background: #4a2c1c; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(#f3d77a, #c99a2e); color: #2a1608; border-color: #8a6414; }
.btn.gold:hover { background: linear-gradient(#f8e39a, #d6a73a); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: .3em .8em; font-size: 14px; }
.btn.big { font-size: 20px; padding: .7em 1.6em; }
input, select { font: inherit; padding: .55em .8em; border-radius: 10px; border: 2px solid var(--line); background: #1b0f0c; color: var(--cream); }
input:focus, select:focus, .btn:focus-visible, .card:focus-visible { outline: 3px solid var(--gold2); outline-offset: 2px; }

.screen { padding: 18px 16px 28px; }

/* ---------- instructivo */
.intro-card, .lobby-card { max-width: 920px; margin: 0 auto; background: linear-gradient(#2c1a15, #20120f); border: 2px solid var(--gold); border-radius: 18px; padding: 24px clamp(16px, 4vw, 40px); box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 0 6px #1a0e0b, inset 0 0 0 8px var(--line); }
.page { display: none; animation: fade .3s ease; }
.page.active { display: block; }
.page.static { display: block; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page h1 { font-size: clamp(38px, 7vw, 64px); text-align: center; margin-top: 4px; }
.sub { text-align: center; color: var(--muted); margin-top: -6px; }
.hero-svg { width: 100%; max-height: 220px; display: block; margin: 8px auto; }
.story { font-size: 18px; }
.goal { background: #1d6236; border: 1px solid #2f8a4c; padding: 10px 14px; border-radius: 10px; }
.family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.fam { background: #1b0f0c; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.fam p { font-size: 14px; color: var(--muted); margin: 0; }
.mini { width: 72px; height: 76px; }
.mini.item { width: 44px; height: 40px; vertical-align: middle; }
.roster { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.roster th, .roster td { border-bottom: 1px solid var(--line); padding: 6px; text-align: center; }
.roster th { color: var(--gold2); font-weight: 600; }
.items { list-style: none; padding: 0; display: grid; gap: 10px; }
.items li { display: flex; gap: 8px; align-items: center; background: #1b0f0c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.items li > div { flex: 1; }
.note, .tip, .example { background: #3a2216; border-left: 4px solid var(--gold); padding: 8px 12px; border-radius: 6px; }
.steps { list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: #1b0f0c; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.step-n { flex: 0 0 34px; height: 34px; border-radius: 50%; background: linear-gradient(#f3d77a, #c99a2e); color: #2a1608; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.pay { display: grid; gap: 6px; font-size: 18px; background: #1d6236; padding: 12px 16px; border-radius: 10px; border: 1px solid #2f8a4c; margin-bottom: 10px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.rules-card { display: flex; gap: 10px; background: #f3e7c9; color: #2a1608; border-radius: 12px; padding: 8px; border: 3px solid #8a6414; }
.rules-card .card-art { width: 64px; height: 64px; flex: 0 0 64px; }
.rules-card h3 { font-family: 'Limelight', serif; font-weight: 400; font-size: 17px; margin: 0; color: #5a1a10; }
.rules-card p { margin: 2px 0 0; font-size: 13.5px; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); background: transparent; padding: 0; cursor: pointer; }
.dot.active { background: var(--gold); }
.intro-skip { text-align: center; margin-top: 12px; }

/* ---------- sala de espera */
.lobby-card { max-width: 620px; }
.field { display: grid; gap: 6px; margin: 12px 0; font-weight: 600; }
.lobby-actions { display: grid; gap: 10px; }
.or { text-align: center; color: var(--muted); }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 20px; }
.code { font-family: 'Josefin Sans', sans-serif; letter-spacing: .25em; background: #1b0f0c; border: 2px dashed var(--gold); padding: 0 .4em; border-radius: 8px; }
.members { list-style: none; padding: 0; display: grid; gap: 6px; }
.members li { display: flex; align-items: center; gap: 10px; background: #1b0f0c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.members li.empty { color: #9c8a72; border-style: dashed; }
.members .tags { margin-left: auto; display: flex; gap: 4px; }
.tag { font-size: 12px; background: #3a2216; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.chip { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #000; flex: 0 0 16px; }
.host-tools { display: grid; gap: 12px; margin: 14px 0; }
.host-tools .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.setup { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.setup label { margin-right: 14px; }

/* ---------- partida */
#screen-game { padding: 10px 12px 0; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.board-wrap { background: #120907; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
#board { width: 100%; height: auto; display: block; user-select: none; }
.table-title { font-family: 'Limelight', serif; font-size: 40px; fill: rgba(243,215,122,.18); letter-spacing: .12em; }
.table-bank { font-size: 20px; fill: rgba(243,231,201,.85); font-weight: 700; }
.seat-num { font-size: 10px; fill: rgba(0,0,0,.55); font-weight: 700; }
.seat .hit { cursor: default; }
.seat.can-target .hit { cursor: pointer; fill: rgba(243,215,122,.25); stroke: var(--gold2); stroke-width: 3; stroke-dasharray: 6 4; animation: pulse 1.1s infinite; }
.figure { cursor: default; }
.figure.can-target > .gangster { animation: bob 1s infinite alternate ease-in-out; }
.pie-wrap.can-target > .pie { animation: bob 0.8s infinite alternate; }
.flame { animation: flicker .25s infinite alternate; transform-box: fill-box; transform-origin: bottom; }
.zzz { animation: float 1.6s infinite ease-in-out; font-weight: 700; }
@keyframes pulse { 50% { stroke-opacity: .35; } }
@keyframes bob { to { transform: translateY(-3px); } }
@keyframes boom { from { r: 10; opacity: 1; } to { r: 60; opacity: 0; } }
@keyframes flicker { to { transform: scaleY(.75); } }
@keyframes float { 50% { transform: translateY(-4px); } }

.side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.turn-banner { font-family: 'Limelight', serif; font-size: 20px; padding: 8px 12px; border: 3px solid var(--gold); border-radius: 12px; background: #1b0f0c; text-align: center; }
.turn-banner.mine { background: linear-gradient(#3a2a10, #1b0f0c); box-shadow: 0 0 18px rgba(243,215,122,.35); }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.player { background: #1b0f0c; border: 1px solid var(--line); border-left: 6px solid var(--fam); border-radius: 10px; padding: 6px 10px; }
.player.active { box-shadow: 0 0 0 2px var(--gold2); }
.player.out { opacity: .5; }
.p-top { display: flex; align-items: center; gap: 8px; }
.p-name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-money { font-weight: 700; color: var(--gold2); }
.p-sub { font-size: 13px; color: var(--muted); }
.log-box, .chat-box { background: #1b0f0c; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.log-box summary, .chat-box summary { cursor: pointer; font-weight: 700; color: var(--gold2); }
.log, .chat { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow: auto; font-size: 13.5px; display: grid; gap: 3px; }
.log li { border-bottom: 1px dotted #3a2a1e; padding-bottom: 2px; }
.log .k-kill, .log .k-blast, .log .k-out { color: #ff9b8a; }
.log .k-income { color: #9fe0a8; }
.log .k-turn { color: var(--gold2); font-weight: 700; }
.log .k-end, .log .k-sweep { color: var(--gold2); font-weight: 700; }
#chat-form { display: flex; gap: 6px; margin-top: 6px; }
#chat-form input { flex: 1; min-width: 0; padding: .35em .6em; }

.dock { position: sticky; bottom: 0; margin-top: 10px; background: linear-gradient(transparent, #120907 18%); padding: 16px 4px 10px; display: grid; gap: 8px; }
.prompt { text-align: center; font-weight: 700; font-size: 17px; color: var(--cream); min-height: 1.4em; }
.hand { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.card { width: 112px; height: 150px; border-radius: 12px; border: 3px solid #8a6414; background: linear-gradient(#fbf3dc, #eadbb2); color: #2a1608; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 6px; cursor: pointer; font: inherit; font-weight: 700; box-shadow: 0 6px 14px rgba(0,0,0,.5); transition: transform .12s, box-shadow .12s; }
.card .card-art { width: 82px; height: 82px; }
.card-name { font-family: 'Limelight', serif; font-weight: 400; font-size: 15px; text-align: center; line-height: 1.1; }
.card.playable:hover { transform: translateY(-8px); }
.card.selected { transform: translateY(-14px); box-shadow: 0 0 0 4px var(--gold2), 0 14px 24px rgba(0,0,0,.6); }
.card:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.card:not(.playable):not(:disabled) { opacity: .8; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tray { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tray-item { display: flex; flex-direction: column; align-items: center; background: #1b0f0c; border: 2px solid var(--line); border-radius: 12px; padding: 4px 10px; color: var(--cream); font: inherit; cursor: pointer; }
.tray-item.selected { border-color: var(--gold2); box-shadow: 0 0 12px rgba(243,215,122,.5); }

/* ---------- diálogos y avisos */
.dlg { background: linear-gradient(#2c1a15, #20120f); color: var(--cream); border: 2px solid var(--gold); border-radius: 16px; padding: 22px; max-width: 460px; width: calc(100% - 32px); }
.dlg.wide { max-width: 920px; max-height: 88vh; }
.dlg::backdrop { background: rgba(0,0,0,.65); }
.dlg form { display: inline; }
.end-rank { padding-left: 1.4em; font-size: 18px; }
.end-rank li { border-left: 6px solid var(--fam); padding: 4px 10px; margin: 4px 0; background: #1b0f0c; border-radius: 6px; }
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 20; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #2a1915; border: 2px solid var(--gold); border-radius: 10px; padding: 8px 14px; text-align: center; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.6); animation: fade .25s ease; transition: opacity .5s; }
.toast.error { border-color: var(--red); }
.toast.kill { border-color: #ff7a5a; }
.toast.boom { border-color: #ffb21a; background: #4a2410; font-size: 18px; }
.toast.bye { opacity: 0; }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; }
  .side { order: 2; }
  .card { width: 92px; height: 128px; }
  .card .card-art { width: 64px; height: 64px; }
}
@media (max-width: 520px) {
  .intro-nav { flex-wrap: wrap; }
  .card { width: 30vw; max-width: 92px; }
  .brand { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- historial y jugador ausente */
.history { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 12px; }
.history h3 { font-size: 20px; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.history-list li { background: #1b0f0c; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--muted); }
.history-list li b { color: var(--gold2); }
.history-list li.empty { border-style: dashed; }
.idle-box { background: #3a2216; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.idle-box p { margin: 0 0 6px; }
#board.vertical .table-title { font-size: 34px; }

/* ---------- celular */
@media (max-width: 760px) {
  .screen { padding: 12px 10px 20px; }
  #screen-game { padding: 8px 6px 0; }
  .topbar { padding: 6px 10px; }
  .intro-card, .lobby-card { padding: 18px 14px; border-radius: 14px; }
  .board-wrap { border-radius: 10px; }
  #board.vertical { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
  .turn-banner { font-size: 17px; }
  .dock { padding: 10px 0 8px; gap: 6px; }
  .prompt { font-size: 15px; padding: 0 6px; }
  .hand { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 14px 8px 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .hand .card { flex: 0 0 auto; scroll-snap-align: center; width: 84px; height: 116px; }
  .card .card-art { width: 56px; height: 56px; }
  .card-name { font-size: 13px; }
  .actions .btn { font-size: 14px; padding: .5em 1em; }
  .roster { font-size: 12px; }
  .roster th, .roster td { padding: 4px 2px; }
  .items li { flex-wrap: wrap; }
  .log, .chat { max-height: 180px; }
}

/* ---------- sala de espera: partida rápida y visibilidad */
.hint { margin: -2px 0 4px; text-align: center; color: var(--muted); font-size: 14px; }
.visibility { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.toggle { gap: 8px; font-size: 14px; color: var(--muted); }

/* ---------- celular girado (horizontal): mesa a toda altura, cartas en columna lateral */
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { padding: 2px 10px; }
  .brand { font-size: 16px; }
  #screen-game.screen:not(.hidden) {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(190px, 30vw, 300px);
    grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "board dock" "board side";
    gap: 6px; padding: 4px 6px; height: calc(100dvh - var(--topbar-h, 34px));
  }
  #screen-game .game-layout { display: contents; }
  #screen-game .board-wrap { grid-area: board; display: flex; align-items: center; justify-content: center; min-height: 0; }
  #screen-game #board { height: 100%; width: auto; max-width: 100%; max-height: calc(100dvh - 44px); }
  #screen-game .side { grid-area: side; overflow-y: auto; min-height: 0; gap: 6px; }
  #screen-game .dock { grid-area: dock; position: static; margin: 0; padding: 0; background: none; gap: 4px; }
  .turn-banner { font-size: 14px; padding: 4px 8px; }
  .prompt { font-size: 13px; text-align: left; }
  .hand { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 8px 2px 4px; gap: 6px; }
  .hand .card { flex: 0 0 auto; width: 64px; height: 88px; padding: 4px 3px; border-width: 2px; }
  .card .card-art { width: 40px; height: 40px; }
  .card-name { font-size: 11px; }
  .card.selected { transform: translateY(-6px); }
  .actions { justify-content: flex-start; gap: 4px; }
  .actions .btn { font-size: 12px; padding: .35em .7em; }
  .tray-item { padding: 2px 6px; font-size: 12px; }
  .tray-item .mini { width: 44px; height: 46px; }
  .player { padding: 3px 8px; }
  .p-sub { font-size: 11px; }
  .log, .chat { max-height: 120px; font-size: 12px; }
  .toasts { top: 8px; }
}

.fill-row { gap: 8px; font-weight: 600; }
.hint-inline { font-weight: 400; font-size: 13px; color: var(--muted); }

.btn.icon { padding: .25em .55em; font-size: 16px; line-height: 1.2; }
.btn.icon[aria-pressed="false"] { opacity: .55; }
@media (max-width: 520px) { .topbar-actions { gap: 4px; } #btn-rules { font-size: 0; padding: .3em .55em; } #btn-rules::first-letter { font-size: 16px; } }

/* ---------- íconos propios (trazo de tinta, ver DESIGN.md) */
.ico { display: inline-block; vertical-align: -0.2em; flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .ico { color: var(--gold); }
#btn-rules { display: inline-flex; align-items: center; gap: 6px; }
#btn-quick { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.visibility { display: flex; align-items: center; gap: 6px; }
.pie-tag { white-space: nowrap; }
.pie-tag .ico { color: var(--gold2); }
.history-list .ico { color: var(--gold2); }
.end-rank li { display: flex; align-items: center; gap: 8px; }
.end-rank li b { margin-left: auto; color: var(--gold2); }
.end-rank .ico-crown { color: var(--gold2); }
/* el punto de conexión marca un estado real: conectado o no */
.conn { width: 10px; height: 10px; border-radius: 50%; background: #8a3a2a; display: inline-block; }
.conn.on { background: #4cc06a; }
@media (max-width: 520px) { #btn-rules .lbl { display: none; } }

/* ---------- capas de animación */
.board-wrap { position: relative; }
.fx-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fly-bill {
  position: absolute; width: 30px; height: 16px; margin: -8px 0 0 -15px; border-radius: 2px;
  background: linear-gradient(90deg, #2e7d3c 0 18%, #6fbf73 18% 82%, #2e7d3c 82%); border: 1.5px solid #123f23;
  box-shadow: inset 0 0 0 2px #a8e0a0;
}
.fly-bill::after { content: '$'; position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px/1 'Josefin Sans', sans-serif; color: #123f23; }
.fly-bill.big { width: 44px; height: 22px; }
.fly-plus { position: absolute; transform: translate(-50%, -50%); font: 700 18px/1 'Josefin Sans', sans-serif; color: var(--gold2); text-shadow: 0 2px 0 #000, 0 0 2px #000; white-space: nowrap; }
.turn-banner { transform-style: preserve-3d; }
.player { will-change: transform; }

/* ---------- foco visible en la mesa (teclado) */
#board [tabindex]:focus { outline: none; }
#board [tabindex]:focus-visible .hit, #board .figure[tabindex]:focus-visible { stroke: #7af0ff; stroke-width: 4; filter: drop-shadow(0 0 6px #7af0ff); }

/* ---------- botones: respuesta al toque */
.btn { transition: transform .12s, background .15s, box-shadow .15s; }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn:not(:disabled):active { transform: translateY(1px) scale(.97); }
.btn.busy { opacity: .7; cursor: progress; }

/* ---------- controles de la partida */
.game-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.game-controls .btn { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; justify-content: center; }
#btn-finish { border-color: #8a3a2a; }
.end-actions { display: grid; gap: 8px; margin-top: 12px; }
.end-actions .btn, .end-actions form .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.end-actions .hint { margin: 0; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
@media (orientation: landscape) and (max-height: 520px) { .game-controls .btn { font-size: 12px; padding: .3em .6em; } }

/* ---------- negocios: se nota que dan plata */

/* ---------- cartas con ilustración */
.card.has-art { padding: 5px 5px 6px; justify-content: flex-start; gap: 5px; }
.card .card-img { width: 100%; height: 74%; object-fit: cover; border-radius: 6px; border: 2px solid #2a1608; display: block; }
.card.has-art .card-name { margin-top: auto; }
.rules-card .card-img { width: 64px; height: 86px; flex: 0 0 64px; object-fit: cover; border-radius: 6px; border: 2px solid #2a1608; }
@media (orientation: landscape) and (max-height: 520px) { .card .card-img { height: 64%; } }
.fam .portrait { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold); display: block; margin: 0 auto 6px; }

/* ---------- sala de espera: nada se sale por los lados */
.lobby-card { width: 100%; }
.lobby-actions > .btn { width: 100%; white-space: normal; line-height: 1.2; }
.join-row input { min-width: 0; }
.join-row .btn { flex: 0 0 auto; }

/* ---------- estado compacto y panel: sólo en el celular en vertical */
.mini-status, .sheet-head { display: none; }

@media (max-width: 1024px) and (orientation: portrait) {
  .lobby-actions .btn.big { font-size: 18px; padding: .6em 1em; }
  /* la partida ocupa exactamente la pantalla: mesa arriba (siempre visible), cartas abajo */
  #screen-game.screen:not(.hidden) { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h, 52px)); padding: 4px 6px 0; overflow: hidden; }
  #screen-game .game-layout { display: contents; }
  #screen-game .board-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
  #screen-game #board.vertical { height: 100%; width: auto; max-width: 100%; max-height: none; }
  #screen-game .dock { position: static; margin: 0; padding: 6px 0 8px; gap: 5px; background: none; flex: 0 0 auto; }
  .mini-status { display: flex; align-items: center; gap: 8px; }
  .mini-turn { flex: 1; min-width: 0; font-family: 'Limelight', serif; font-size: 15px; padding: 4px 10px; border: 2px solid var(--gold); border-radius: 10px; background: #1b0f0c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-turn.mine { background: linear-gradient(#3a2a10, #1b0f0c); }
  .mini-money { font-weight: 800; color: var(--gold2); }
  .prompt { font-size: 14px; min-height: 0; }
  .hand { padding: 10px 4px 2px; gap: 8px; }
  .hand .card { width: 74px; height: 102px; }
  .card.has-art .card-img { height: 68%; }
  .card-name { font-size: 12px; }
  /* jugadores, crónica y chat: hoja que sube desde abajo */
  #screen-game .side {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-height: 78dvh; overflow-y: auto;
    background: #1a0e0b; border-top: 2px solid var(--gold); border-radius: 16px 16px 0 0; padding: 10px 12px 18px;
    transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -12px 30px rgba(0,0,0,.6);
  }
  #screen-game .side.open { transform: none; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; color: var(--gold2); }
  /* objetivos más visibles en pantalla pequeña */
  .seat.can-target .hit { stroke-width: 5; fill: rgba(243,215,122,.4); }
}
.lobby-actions { grid-template-columns: minmax(0, 1fr); }
.lobby-actions > * { min-width: 0; }
.join-row input { width: 0; }

@media (max-width: 1024px) and (orientation: portrait) {
  /* con una carta elegida, las acciones van en una sola fila compacta para que la mesa no se encoja */
  #screen-game .actions { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; padding: 0 2px; }
  #screen-game .actions .btn { font-size: 13px; padding: .45em .8em; white-space: nowrap; flex: 0 0 auto; }
  #screen-game .prompt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hand .card { width: 66px; height: 92px; }
  .hand .card.selected { transform: translateY(-8px); }
  .hand { padding-top: 10px; }
}
.host-tools .toggle { display: flex; align-items: flex-start; gap: 8px; }
.host-tools .toggle input { margin-top: 3px; flex: 0 0 auto; }

/* ---------- fichas de información de la mesa */
.seat.has-info, .figure, .pie-wrap { cursor: pointer; }
.info-dlg { max-width: 480px; max-height: 88dvh; overflow-y: auto; }
.info-dlg h2 { margin-bottom: 8px; }
.info-item { display: flex; gap: 12px; align-items: flex-start; background: #1b0f0c; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 0 0 10px; }
.info-item h3 { margin: 0 0 4px; color: var(--gold2); font-size: 17px; }
.info-item p { margin: 0 0 4px; font-size: 14.5px; }
.info-art { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 2px solid #2a1608; flex: 0 0 88px; }
.info-icon { width: 64px; height: 58px; flex: 0 0 64px; background: #f6efdc; border-radius: 8px; }
.info-fig { width: 72px; height: 80px; flex: 0 0 72px; }
.info-portrait { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; border: 2px solid var(--gold); flex: 0 0 64px; order: 3; }
.info-who > div { flex: 1; min-width: 0; }
.info-sub { color: var(--muted); border-left: 4px solid var(--fam, var(--gold)); padding-left: 8px; }
.info-now { color: #9fe0a8; font-weight: 600; }
@media (max-width: 520px) {
  .info-portrait { display: none; }
  .info-art { width: 60px; height: 60px; flex-basis: 60px; }
  .info-icon { width: 52px; height: 48px; flex-basis: 52px; }
  .info-fig { width: 54px; height: 60px; flex-basis: 54px; }
  .info-item { gap: 8px; padding: 8px; }
}

/* ---------- halos de objetivo (SVG puro: funcionan también en Safari/iPhone) */
.halo-glow { fill: rgba(255,226,122,.28); stroke: none; }
.halo-ring { fill: none; stroke: #ffe27a; stroke-width: 4; stroke-dasharray: 10 6; animation: halo-spin 1.2s linear infinite; }
.halo-selected .halo-glow { fill: rgba(122,240,255,.28); }
.halo-selected .halo-ring { stroke: #7af0ff; stroke-dasharray: none; animation: none; }
@keyframes halo-spin { to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) { .halo-ring { animation: none; } }

#board.choosing .figure:not(.can-target):not(.selected):not(.mine-alert),
#board.choosing-pies .pie-wrap:not(.can-target) { opacity: .38; }
#board.choosing .seat:not(.can-target) > g { opacity: .55; }
.halo-ring { stroke-width: 5; }
.halo-glow { fill: rgba(255,226,122,.42); }
@media (max-width: 760px) { .halo-ring { stroke-width: 7; } }

/* ---------- marcador del celular */
.mobile-hud { display: none; }
@media (max-width: 1024px) and (orientation: portrait) {
  .mobile-hud { display: grid; gap: 3px; flex: 0 0 auto; margin-bottom: 4px; }
  .scoreboard { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 4px; }
  .sb { background: #1b0f0c; border: 1px solid var(--line); border-top: 4px solid var(--fam); border-radius: 8px; padding: 3px 4px 2px; display: grid; text-align: center; line-height: 1.15; min-width: 0; }
  .sb.active { box-shadow: 0 0 0 2px var(--gold2); background: #2b1c10; }
  .sb.me .sb-name { color: var(--gold2); }
  .sb.out { opacity: .45; }
  .sb-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-money { font-size: 13px; font-weight: 800; color: var(--gold2); white-space: nowrap; }
  .sb-alive { font-size: 10px; color: var(--muted); white-space: nowrap; }
  .ticker { margin: 0; font-size: 12.5px; color: var(--cream); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
  .ticker.k-kill, .ticker.k-blast, .ticker.k-out { color: #ff9b8a; }
  .ticker.k-income { color: #9fe0a8; }
  /* el turno y la plata propia ya están en el marcador */
  .mini-money { display: none; }
}
@media (max-width: 1024px) and (orientation: portrait) {
  /* colocación (inicio manual o policía): bandeja en una fila compacta */
  #screen-game .tray { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; padding: 2px; }
  #screen-game .tray-item { flex: 0 0 auto; flex-direction: row; gap: 4px; padding: 2px 8px 2px 2px; font-size: 12px; border-radius: 10px; }
  #screen-game .tray-item .mini { width: 34px; height: 38px; }
  .mini-turn { font-size: 13px; }
  #btn-panel { flex: 0 0 auto; font-size: 13px; padding: .35em .7em; }
}

/* objetivos: sin filtros CSS (en Safari apagan el elemento); se marcan con halo SVG y tamaño */
.figure.can-target, .pie-wrap.can-target { cursor: pointer; }
#board.choosing .figure.can-target, #board.choosing .figure.selected, #board.choosing .pie-wrap.can-target { opacity: 1; }

/* ---------- zoom de la mesa */
.zoom-ctl { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.zoom-ctl button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); background: rgba(27,15,12,.88); color: var(--cream); font: 700 22px/1 'Josefin Sans', sans-serif; cursor: pointer; display: grid; place-items: center; }
.zoom-ctl button:disabled { opacity: .35; cursor: default; }
.zoom-ctl .zoom-fit { font-size: 12px; }
.zoom-ctl:not(.zoomed) .zoom-fit { display: none; }

/* ================= REVISIÓN GENERAL ================= */
/* La mesa llena su recuadro (el viewBox mantiene la proporción) */
#screen-game #board { width: 100%; height: 100%; max-height: none; }

@media (min-width: 761px) and (min-height: 521px) and (max-height: 860px) {
  #screen-game .card { width: 92px; height: 124px; }
  #screen-game .card .card-art { width: 62px; height: 62px; }
  #screen-game .card-name { font-size: 13px; }
  #screen-game .dock { gap: 6px; }
  #screen-game .tray-item .mini { width: 52px; height: 56px; }
}

/* ---------- toques cómodos en pantallas táctiles */
@media (max-width: 1024px) {
  .topbar .btn.icon, #btn-rules { min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
}
.host-tools .toggle { flex-wrap: nowrap; }

@media (max-width: 1024px) and (orientation: portrait) {
  /* bandeja de colocación: los cuatro tipos a la vista */
  #screen-game .tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  #screen-game .tray-item { flex-direction: column; padding: 2px; gap: 0; font-size: 11px; min-width: 0; }
  #screen-game .tray-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #screen-game .tray-item .mini { width: 38px; height: 42px; }
}
@media (min-width: 521px) and (max-width: 1024px) and (orientation: portrait) {
  /* tablet en vertical: mismas piezas que el celular, más grandes */
  .sb-name { font-size: 14px; } .sb-money { font-size: 17px; } .sb-alive { font-size: 12px; }
  .ticker { font-size: 15px; }
  .hand .card { width: 100px; height: 136px; }
  .hand { justify-content: center; }
  #screen-game .actions { justify-content: center; }
  #screen-game .actions .btn { font-size: 15px; }
  .mini-turn { font-size: 17px; }
  #screen-game .tray-item { font-size: 14px; } #screen-game .tray-item .mini { width: 56px; height: 62px; }
}

.dock, .mobile-hud { grid-template-columns: minmax(0, 1fr); }
.dock > *, .mobile-hud > * { min-width: 0; }
@media (max-width: 520px) and (orientation: portrait) {
  /* las cinco cartas caben siempre sin cortar */
  .hand { gap: 5px; padding-left: 2px; padding-right: 2px; justify-content: center; }
  .hand .card { width: calc((100vw - 16px - 20px) / 5); max-width: 84px; height: auto; aspect-ratio: 5 / 7; padding: 4px 3px; }
  .card-name { font-size: 10px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; max-width: 100%; }
  .fly-plus { font-size: 14px; }
}

/* grano de papel (textura fija: no se recalcula en cada fotograma) */
.board-wrap::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: var(--paper); opacity: .55; border-radius: inherit; }

/* animaciones fluidas: lo que vuela va en su propia capa de composición */
.fly-bill, .fly-plus, .bam3d { will-change: transform, opacity; }
.monopoly-glow { stroke-opacity: .9; }
/* capas de composición separadas: animar los efectos no repinta la mesa (que es grande) */
/* Capas de GPU forzadas sólo con ratón (PC). En celulares Android la mesa entera en su propia
   capa agota la memoria gráfica de Chrome y se pinta con «basura»; ahí el navegador decide solo. */
@media (hover: hover) and (pointer: fine) {
  #board, #fx, .board-wrap::after { will-change: transform; transform: translateZ(0); }
  .fly-layer { will-change: transform; }
}

/* fin de partida en celular horizontal: ranking y botones lado a lado, sin scroll */
@media (orientation: landscape) and (max-height: 520px) {
  #dlg-end[open] { max-width: 760px; max-height: calc(100dvh - 16px); padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; align-items: start; }
  #dlg-end h2, #dlg-end #end-reason { grid-column: 1 / -1; margin: 0 0 4px; }
  #dlg-end h2 { font-size: 20px; }
  #dlg-end #end-reason { font-size: 13px; }
  #dlg-end .end-rank { margin: 0; font-size: 13px; }
  #dlg-end .end-rank li { padding: 3px 8px; }
  #dlg-end .end-actions { margin-top: 0; }
  #dlg-end .end-actions .btn { font-size: 14px; padding: .45em .8em; }
}
/* Ajustar la mesa a la altura disponible, reservando espacio para la mano.
   El historial tiene su propio scroll y no determina el tamaño del tablero. */
@media (min-width: 1025px) and (min-height: 521px), (min-width: 761px) and (min-height: 521px) and (orientation: landscape) {
  #screen-game.screen:not(.hidden) {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100dvh - var(--topbar-h, 52px));
    min-height: 0;
    overflow: hidden;
    padding: 8px 12px;
    gap: 8px;
  }
  #screen-game .game-layout {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 300px);
    min-height: 0;
  }
  #screen-game .board-wrap { min-width: 0; min-height: 0; display: flex; }
  #screen-game #board { width: 100%; height: 100%; min-height: 0; }
  #screen-game .side { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #screen-game .dock { position: static; margin: 0; padding: 0; background: none; gap: 4px; }
  #screen-game .hand { flex-wrap: nowrap; overflow-x: auto; padding: 14px 8px 4px; }
  #screen-game .hand .card { flex: 0 0 auto; width: 90px; height: clamp(92px, 15vh, 132px); }
  #screen-game .card-name { font-size: 12px; }
  #screen-game .card .card-img { min-height: 0; }
}
#board { touch-action: none; }

/* Identidad editorial: una portada de juego y una invitación sobre papel. */
.intro-cover { display: block; width: min(100%, 540px); height: auto; border: 2px solid #201c17; margin: 20px auto; }
body:has(#screen-lobby:not(.hidden)) { background: #163e32; }
body:has(#screen-lobby:not(.hidden)) .topbar { background: #102e25; border-bottom-color: #49604b; }
#screen-lobby { padding: clamp(14px, 3vw, 42px); color: #27251f; }
.lobby-spread { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); border: 2px solid #171f19; box-shadow: 8px 8px 0 #0d2b23; }
.lobby-cover { min-width: 0; background: #14372e; color: #f3e8c9; display: flex; flex-direction: column; }
.cover-heading { padding: 25px 32px 22px; }
.cover-kicker, .lobby-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; }
#cover-title { font-family: 'Limelight', Georgia, serif; font-size: clamp(58px, 6.5vw, 96px); font-weight: 400; line-height: 1; margin: 0; letter-spacing: -.045em; }
#cover-title span { display: block; font: 600 17px/1.4 'Josefin Sans', sans-serif; letter-spacing: .04em; margin-top: 12px; }
.cover-gallery { margin-top: auto; }
.cover-art { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-top: 2px solid #14251b; }
.cover-scenes { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #81927c; }
.cover-scenes button { min-height: 44px; border: 0; border-right: 1px solid #81927c; background: #14372e; color: #f3e8c9; font: 600 13px 'Josefin Sans', sans-serif; cursor: pointer; }
.cover-scenes button:last-child { border-right: 0; }
.cover-scenes button[aria-pressed=true] { background: #f3e8c9; color: #14372e; }
.cover-scenes button:hover { background: #315547; color: white; }
.cover-scenes button:focus-visible { outline: 3px solid #dca74f; outline-offset: -4px; }
.cover-caption { padding: 22px 30px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cover-caption p { font: 700 clamp(18px, 1.7vw, 25px)/1.3 Georgia, serif; margin: 0; }
.cover-caption em { font-weight: 400; }
.cover-caption > span { font-size: 12px; text-align: right; flex-shrink: 0; line-height: 1.8; }
#screen-lobby .lobby-card { width: 100%; max-width: none; margin: 0; border: 0; border-left: 2px solid #171f19; border-radius: 0; box-shadow: none; padding: clamp(22px, 3vw, 42px); background: #f3e8ce; color-scheme: light; }
#screen-lobby .deco { color: #6d2432; text-shadow: none; letter-spacing: -.02em; }
#screen-lobby h2 { font-size: clamp(26px, 2.3vw, 34px); }
#screen-lobby .lobby-eyebrow { color: #53614b; }
#screen-lobby input, #screen-lobby select { border: 1px solid #8f866e; border-radius: 3px; background: #fff9e9; color: #25291e; min-height: 44px; }
#screen-lobby input[type=checkbox], #screen-lobby input[type=radio] { min-height: 0; accent-color: #792b38; }
#screen-lobby .btn { border: 1px solid #45604b; border-radius: 3px; background: transparent; color: #234736; min-height: 44px; }
#screen-lobby .btn:hover { background: #e1dbc4; }
#screen-lobby .btn.gold { background: #792b38; color: #fff4d6; border-color: #4c1921; box-shadow: 0 3px 0 #4c1921; }
#screen-lobby .btn.gold:hover { background: #923c49; }
#screen-lobby .btn:focus-visible, #screen-lobby input:focus, #screen-lobby select:focus { outline-color: #792b38; }
#screen-lobby .hint, #screen-lobby .or, #screen-lobby .visibility, #screen-lobby .hint-inline { color: #555847; }
#screen-lobby .hint { line-height: 1.45; margin: 2px 0 5px; }
#screen-lobby .or { font-size: 13px; }
#screen-lobby .history { border-top: 1px solid #b3a88a; margin-top: 24px; padding-top: 18px; }
#screen-lobby .history h3 { font-size: 20px; }
#screen-lobby .history-list { max-height: 165px; overflow-y: auto; }
#screen-lobby .history-list li { background: transparent; border: 0; border-bottom: 1px solid #d3c7aa; border-radius: 0; color: #535743; padding: 8px 0; }
#screen-lobby .history-list strong, #screen-lobby .history-list b { color: #6d2432; }
#screen-lobby .members li { background: #fff9e9; border-color: #b3a88a; border-radius: 3px; }
#screen-lobby .members li.empty { color: #626550; }
#screen-lobby .tag, #screen-lobby .code { background: #e3ddc4; color: #234736; border-color: #8f866e; }
#screen-lobby .setup { border-color: #b3a88a; border-radius: 3px; }
@media (max-width: 900px) {
  .lobby-spread { grid-template-columns: 1fr; max-width: 620px; }
  .cover-heading { padding: 20px 24px; }
  #cover-title { font-size: 62px; }
  #cover-title span { font-size: 15px; }
  .cover-art { max-height: none; }
  .cover-caption { padding: 16px 22px; }
  #screen-lobby .lobby-card { border-left: 0; border-top: 2px solid #171f19; padding: 24px; }
}
@media (max-width: 480px) {
  #screen-lobby { padding: 12px 10px 24px; }
  .cover-heading { padding: 16px 20px; }
  .cover-kicker { font-size: 10px; letter-spacing: .1em; }
  #cover-title { font-size: 54px; }
  .cover-caption p { font-size: 17px; }
  .cover-caption > span { font-size: 11px; }
  .cover-scenes button { font-size: 11px; }
  #screen-lobby .lobby-card { padding: 22px 18px; }
}

/* Marca y reglamento: el mismo papel, tinta y jerarquía que la portada. */
.rule-category { margin: 20px 0 8px; color: #6d2432; font-size: 18px; }
.rule-category.secondary { color: #53614b; font-size: 15px; }
.rule-business-art { display: block; width: 58px; height: 58px; object-fit: cover; border: 2px solid #a88640; border-radius: 4px; }
.items .rule-business-symbols { flex: 0 0 auto; display: flex; gap: 5px; }
.items.income-items li { border-left: 4px solid #a88640; }
.intro-card .items.equipment-items li, #dlg-rules .items.equipment-items li { background: transparent; border: 0; border-bottom: 1px solid #c8bea4; border-radius: 0; padding: 8px 2px; }
.equipment-items .mini.item { display: block; width: 40px; height: 36px; }
@media (max-width: 600px) {
  .items.income-items li:first-child { flex-direction: column; align-items: flex-start; }
  .rule-business-art { width: 52px; height: 52px; }
}
.topbar { background: #102e25; border-bottom: 1px solid #49604b; }
.brand { display: flex; align-items: center; gap: 10px; color: #f3e8ce; }
.brand img { display: block; flex: 0 0 32px; }
.btn { border-radius: 4px; background: #234638; border-color: #8d9c7b; }
.btn:hover { background: #355945; }
.btn.gold { background: #792b38; border-color: #a45d65; color: #fff4d6; }
.btn.gold:hover { background: #923c49; }
.topbar .btn { min-width: 36px; min-height: 36px; border: 1px solid #71856b; border-radius: 4px; color: #f3e8ce; }
.topbar .btn:hover { background: #284c3b; }
body:has(#screen-intro:not(.hidden)) { background: #163e32; }
#screen-intro { padding: 28px 16px; }
.intro-card { background: #f3e8ce; color: #27251f; border: 2px solid #172d24; border-radius: 2px; box-shadow: 8px 8px 0 #102e25; padding: 24px clamp(18px, 4vw, 42px); }
.guide-masthead { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #792b38; padding-bottom: 12px; margin-bottom: 18px; font-size: 12px; font-weight: 700; color: #6d2432; }
.intro-card .deco, #dlg-rules .deco { color: #6d2432; text-shadow: none; }
.intro-card .page h1 { text-align: left; margin: 0; font-size: clamp(42px, 6vw, 68px); }
.intro-card .sub { text-align: left; color: #555847; margin: 2px 0 14px; }
.intro-card .story { font-size: 17px; line-height: 1.55; }
.intro-card .goal, #dlg-rules .goal { border: 0; border-left: 4px solid #792b38; border-radius: 0; background: #dedfc6; color: #234736; padding: 12px 16px; }
.intro-card .btn { color: #234736; border: 1px solid #45604b; background: transparent; min-height: 44px; }
.intro-card .btn:hover { background: #e1dbc4; }
.intro-card .btn.gold { color: #fff4d6; background: #792b38; border-color: #4c1921; padding-inline: 32px; }
.intro-nav { border-top: 1px solid #b3a88a; padding-top: 16px; }
.intro-card .dots { gap: 4px; }
.intro-card .dot { border: 0; border-bottom: 2px solid transparent; border-radius: 0; width: 30px; height: 36px; font: 700 14px 'Josefin Sans', sans-serif; color: #555847; }
.intro-card .dot.active { color: #792b38; border-bottom-color: #792b38; background: #e3dbc2; }
.intro-card button:focus-visible { outline: 3px solid #792b38; outline-offset: 2px; }
.intro-card .intro-skip { margin-top: 18px; }
.intro-card .fam, .intro-card .items li, .intro-card .steps li,
#dlg-rules .fam, #dlg-rules .items li, #dlg-rules .steps li { background: #e6dec7; border-color: #b3a88a; border-radius: 3px; }
.intro-card .fam p, #dlg-rules .fam p { color: #555847; }
.intro-card .roster th, #dlg-rules .roster th { color: #6d2432; }
.intro-card .roster th, .intro-card .roster td, #dlg-rules .roster th, #dlg-rules .roster td { border-color: #b3a88a; }
.intro-card .note, .intro-card .tip, .intro-card .example,
#dlg-rules .note, #dlg-rules .tip, #dlg-rules .example { background: #e6dec7; border-color: #792b38; border-radius: 0; }
.intro-card .pay, #dlg-rules .pay { background: #234736; color: #fff4d6; border: 0; border-radius: 3px; }
.intro-card .step-n, #dlg-rules .step-n { background: #792b38; color: #fff4d6; }
.intro-card .rules-card, #dlg-rules .rules-card { background: #fff9e9; border: 1px solid #b3a88a; border-radius: 3px; }
#dlg-rules { background: #f3e8ce; color: #27251f; border: 2px solid #172d24; border-radius: 3px; }
@media (max-width: 600px) {
  #screen-intro { padding: 14px 10px 24px; }
  .guide-masthead { font-size: 10px; }
  .intro-card .story { font-size: 16px; }
  .intro-card .intro-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .intro-card .dots { grid-column: 1 / -1; grid-row: 1; }
  .intro-card .dot { width: 32px; height: 40px; }
  .intro-card .roster { font-size: 11px; }
  .intro-card .roster th, .intro-card .roster td { padding: 5px 2px; }
  .intro-cover { margin: 14px auto; }
}

/* La reserva se lee como una invitación del restaurante, no como un formulario genérico. */
#lobby-join { position: relative; }
.menu-return { display: inline-block; padding: 6px 0; margin-bottom: 22px; background: transparent; border: 0; border-bottom: 1px solid #8f866e; color: #234736; font: 600 14px 'Josefin Sans', sans-serif; cursor: pointer; min-height: 36px; }
.menu-return:hover { color: #792b38; border-color: #792b38; }
.menu-return:focus-visible { outline: 3px solid #792b38; outline-offset: 4px; }
.invitation-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 3px double #8f866e; }
.invitation-heading img { flex: 0 0 48px; transform: rotate(-5deg); }
.invitation-heading p { font: 700 22px Georgia, serif; color: #234736; margin: 0; }
.invitation-heading span { display: block; font: 600 11px 'Josefin Sans', sans-serif; text-transform: uppercase; letter-spacing: .12em; margin-top: 7px; }
.invitation-note { font: italic 19px/1.4 Georgia, serif; color: #555847; margin: 0 0 24px; }
#screen-lobby .history summary { cursor: pointer; font: 700 19px Georgia, serif; color: #6d2432; padding: 8px 0; }
#screen-lobby .history summary span { display: block; margin: 6px 0 0 20px; font: 400 13px 'Josefin Sans', sans-serif; color: #555847; }
#screen-lobby .history-list { scrollbar-color: #8f866e #e6dec7; scrollbar-width: thin; margin-top: 12px; }
.reservation-signoff { display: grid; gap: 5px; margin-top: 22px; padding-top: 18px; border-top: 3px double #8f866e; text-align: center; color: #53614b; font-size: 12px; }
.reservation-signoff em { font: italic 18px Georgia, serif; color: #6d2432; }
.chapter-scene { width: min(100%, 440px); margin: 18px auto 22px; }
.chapter-scene img { display: block; width: 100%; height: auto; border: 1px solid #8f866e; }
.chapter-scene figcaption { margin-top: 7px; text-align: center; font: italic 14px/1.4 Georgia, serif; color: #555847; }
.house-rules { border: 1px solid #8f866e; padding: 12px; margin: 0; }
.house-rules > p { font-size: 13px; margin-top: 0; }
#house-rule-options { display: grid; gap: 14px; }
#house-rule-options label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
#house-rule-options input { flex: 0 0 20px; width: 20px; height: 20px; }
#house-rule-options small { display: block; line-height: 1.4; margin-top: 4px; }
.active-house-rules { font-size: 13px; padding: 6px; }
.active-house-rules li { margin: 6px 0; }
.comic-turn { position: fixed; top: calc(var(--topbar-h, 52px) + 12px); left: 50%; transform: translateX(-50%) rotate(-5deg); z-index: 30; padding: 24px 32px; color: #361c19; background: #f4d363; font: 900 clamp(24px, 5vw, 40px)/1 Georgia, serif; text-transform: uppercase; pointer-events: none; clip-path: polygon(0 30%,18% 24%,12% 0,40% 15%,56% 0,65% 16%,94% 5%,85% 30%,100% 50%,86% 63%,96% 93%,66% 80%,48% 100%,36% 81%,5% 96%,14% 65%,0 60%); animation: comic-pop .2s ease-out; }
/* The normal turn uses the same ink-and-paper sign as the game's illustrations.
   Keep real DOM text for screen readers; preserve the existing auction notice. */
.comic-turn:not(.auction-turn) {
  width: min(90vw, 540px);
  aspect-ratio: 960 / 420;
  padding: 0;
  background: url('/arte/ui/te-toca.svg') center / contain no-repeat;
  clip-path: none;
  font-size: 0;
  color: transparent;
}
@keyframes comic-pop { from { transform: translateX(-50%) scale(.65) rotate(-8deg); } to { transform: translateX(-50%) scale(1) rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .comic-turn { animation: none; } }
.auction-table { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; width: 180px; max-width: 48%; padding: 8px; background: #f3e8ce; color: #351d1c; border: 3px solid #792b38; border-radius: 5px; text-align: center; font-size: 13px; pointer-events: none; }
.auction-table .auction-art { width: 65px; height: 80px; object-fit: contain; }
.auction-table small { font-size: 11px; }
#auction-bid { width: 110px; flex: 0 0 110px; min-width: 0; }
@media (max-height: 650px) { .auction-table .auction-art { width: 42px; height: 50px; } .auction-table { gap: 0; padding: 3px; font-size: 11px; } }

/* Carta de la casa: reglas opcionales como el menú del restaurante. */
.house-rules-btn { display: grid; gap: 2px; width: 100%; text-align: left; margin: 4px 0 14px; padding: 12px 16px; background: #fff9e9; color: #27251f; border: 1px solid #8f866e; outline: 3px double #b3a88a; outline-offset: -7px; border-radius: 3px; cursor: pointer; font-family: 'Josefin Sans', sans-serif; }
.house-rules-btn:hover { background: #f7efd9; }
.house-rules-btn:focus-visible { outline: 3px solid #792b38; outline-offset: 2px; }
.house-rules-btn .hr-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #53614b; }
.house-rules-btn .hr-title { font: 700 20px Georgia, serif; color: #6d2432; }
.house-rules-btn .hr-title::after { content: ' ›'; }
.house-rules-btn .hr-summary { font-size: 13px; color: #555847; }
.house-rules-btn.has-rules { border-color: #792b38; }
.house-rules-btn.has-rules .hr-summary { color: #792b38; font-weight: 700; }
.dlg.house-menu { color-scheme: light; max-width: 560px; max-height: calc(100dvh - 24px); padding: 0; background: #f3e8ce; color: #27251f; border: 2px solid #172d24; border-radius: 3px; box-shadow: 8px 8px 0 #102e25; overflow-y: auto; }
.house-menu .menu-sheet { margin: 10px; padding: clamp(18px, 4vw, 30px); border: 3px double #8f866e; text-align: center; }
.house-menu .menu-kicker { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #53614b; }
.house-menu h2 { font-family: 'Limelight', Georgia, serif; font-weight: 400; font-size: clamp(34px, 7vw, 46px); color: #6d2432; margin: 8px 0 4px; }
.house-menu .menu-sub { font: italic 15px/1.45 Georgia, serif; color: #555847; margin: 0 auto 18px; max-width: 42ch; padding-bottom: 14px; border-bottom: 3px double #8f866e; }
.menu-items { display: grid; gap: 4px; text-align: left; }
.menu-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border-radius: 3px; cursor: pointer; }
.menu-item:hover { background: #e9dfc4; }
.menu-item input { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; accent-color: #792b38; }
.menu-item:has(input:checked) { background: #e6dcc0; }
.menu-item:has(input:checked) strong { color: #792b38; }
.menu-text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.menu-line { display: flex; align-items: baseline; gap: 6px; }
.menu-line strong { font: 700 18px Georgia, serif; color: #234736; }
.menu-dots { flex: 1; border-bottom: 2px dotted #8f866e; transform: translateY(-4px); min-width: 16px; }
.menu-num { font: 700 14px Georgia, serif; color: #6d2432; }
.menu-item small { font-size: 13px; line-height: 1.45; color: #555847; }
.menu-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 3px double #8f866e; }
.house-menu .btn { min-height: 44px; }
.house-menu .btn.ghost { color: #234736; border: 1px solid #45604b; background: transparent; }
.house-menu .btn.ghost:hover { background: #e1dbc4; }
.house-menu .btn.gold { background: #792b38; color: #fff4d6; border-color: #4c1921; }
.dlg.house-menu::backdrop { background: rgba(10, 30, 24, .7); }
/* La ilustración de la portada llena todo el alto disponible, sin franja vacía,
   aunque la tarjeta de la mesa sea más alta. */
@media (min-width: 901px) {
  .lobby-cover .cover-gallery { margin-top: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
  .lobby-cover .cover-art { flex: 1 0 auto; aspect-ratio: auto; height: auto; min-height: 0; object-fit: cover; }
}
/* Escena en vídeo: viñeta de cómic que se salta con un toque. */
.clip-panel { position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-1.5deg); width: min(92vw, 640px); aspect-ratio: 16 / 9; background: #111; border: 4px solid #1b0f0c; outline: 3px solid #f4d363; box-shadow: 10px 10px 0 rgba(0,0,0,.55); cursor: pointer; animation: clip-in .22s ease-out; }
.clip-panel video { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip-panel .clip-skip { position: absolute; right: 8px; bottom: 8px; min-height: 36px; padding: 4px 12px; border: 2px solid #1b0f0c; border-radius: 3px; background: #f4d363; color: #1b0f0c; font: 800 14px 'Josefin Sans', sans-serif; cursor: pointer; }
.clip-panel.out { opacity: 0; transition: opacity .2s; }
@keyframes clip-in { from { transform: translate(-50%, -50%) scale(.7) rotate(-6deg); opacity: 0; } }
.clip-toggle[aria-pressed=false] { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .clip-panel { animation: none; } }
/* Mecha a tu gusto: selector de 1 a 5 turnos al dejar un pastel. */
.fuse-pick { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-weight: 700; }
.fuse-pick > span { margin-right: 2px; }
.fuse-pick .fuse-btn { min-width: 38px; min-height: 38px; padding: 0 8px; }
.fuse-pick .fuse-btn.on { background: #f4d363; color: #2b1712; border-color: #2b1712; }
/* Salas abiertas: elegir en qué mesa sentarse. */
.open-rooms { margin: 6px 0 4px; text-align: left; }
.open-rooms-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 3px double #8f866e; margin-bottom: 8px; }
.open-rooms-head h3 { margin: 0; font: 700 19px Georgia, serif; color: #6d2432; }
.open-rooms-head .menu-return { margin: 0; font-size: 13px; }
.open-rooms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.open-rooms-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; background: #fff9e9; border: 1px solid #b3a88a; border-radius: 3px; }
.open-rooms-list li.empty { display: block; color: #555847; font: italic 14px/1.4 Georgia, serif; background: transparent; border-style: dashed; }
.room-info { display: grid; min-width: 0; }
.room-info b { font: 700 16px Georgia, serif; color: #234736; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-info small { color: #555847; font-size: 12px; }
.room-seats { display: flex; gap: 3px; }
.room-seats i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #792b38; }
.room-seats i.taken { background: #792b38; }
#screen-lobby .open-rooms-list .btn.gold { min-height: 40px; padding: 0 14px; }
@media (max-width: 420px) { .room-seats { display: none; } .open-rooms-list li { grid-template-columns: minmax(0, 1fr) auto; } }
/* Idioma: el letrero del turno en inglés y el botón ES/EN de la barra superior. */
html[lang=en] .comic-turn:not(.auction-turn) { background-image: url('/arte/ui/your-turn.svg'); }
.lang-toggle { min-width: 40px; font-weight: 700; letter-spacing: .06em; }

/* la mesa llena siempre su recuadro (también en vertical): el suelo cubre los lados */
#screen-game #board, #screen-game #board.vertical { width: 100%; height: 100%; max-width: none; max-height: none; }

/* aviso de versión nueva */
.update-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; width: max-content; max-width: calc(100% - 32px); background: #2a1915; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6); font-weight: 700; }
.update-bar .btn { padding: .4em .9em; flex: 0 0 auto; }

/* elegir color en la sala */
.color-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.color-pick-label { font-weight: 700; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); background: var(--sw); cursor: pointer; position: relative; padding: 0; transition: transform .12s, border-color .12s; }
.swatch:hover:not(:disabled) { transform: scale(1.08); }
.swatch.mine { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.swatch.mine::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 2px #000; }
.swatch.taken { opacity: .3; cursor: not-allowed; }
.swatch.taken::after { content: ''; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 3px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.level-row select { margin-left: 6px; }

/* al poner un pastel: tus gángsters se ven y los asientos que los alcanzarían salen en rojo */
#board .figure.mine-alert { opacity: 1; }
.halo-mine .halo-glow { fill: rgba(255,80,80,.22); }
.halo-mine .halo-ring { stroke: #ff5a5a; stroke-dasharray: 4 4; animation: none; }
.seat.can-target.danger .hit { fill: rgba(255,70,70,.32); stroke: #ff5a5a; stroke-dasharray: 3 3; }

/* ---------- chat y reacciones (estilo parchís) */
.react-btn { position: absolute; left: 8px; bottom: 8px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold); background: rgba(27,15,12,.9); font-size: 24px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.react-btn:hover { transform: scale(1.06); }
.react-unread { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red, #c0392b); color: #fff; font: 800 12px/20px 'Josefin Sans', sans-serif; text-align: center; padding: 0 5px; }
.react-panel { position: absolute; left: 8px; bottom: 64px; z-index: 4; width: min(340px, calc(100% - 16px)); max-height: calc(100% - 76px); overflow-y: auto; background: #241512; border: 2px solid var(--gold); border-radius: 14px; padding: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.65); display: grid; gap: 8px; }
.react-emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.react-emoji { font-size: 24px; line-height: 1; padding: 6px 0; border-radius: 10px; border: 0; background: rgba(255,255,255,.06); cursor: pointer; }
.react-emoji:hover { background: rgba(243,215,122,.22); transform: scale(1.12); }
.react-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.react-phrase { border: 1px solid rgba(243,215,122,.45); background: rgba(243,215,122,.08); color: var(--cream); border-radius: 999px; padding: 6px 10px; font: 600 13px/1.2 'Josefin Sans', sans-serif; cursor: pointer; text-align: left; }
.react-phrase:hover { background: rgba(243,215,122,.25); }
.react-form { display: flex; gap: 6px; }
.react-form input { flex: 1; min-width: 0; }
.chat-bubbles { position: absolute; left: 10px; top: 10px; z-index: 3; display: grid; gap: 6px; justify-items: start; pointer-events: none; max-width: min(70%, 360px); }
.chat-bubble { position: relative; background: #fff8e4; color: #221310; border: 2.5px solid #111; border-left: 7px solid var(--fam); border-radius: 14px; padding: 6px 12px 7px; box-shadow: 3px 4px 0 rgba(0,0,0,.45); font: 700 15px/1.25 'Josefin Sans', sans-serif; transition: opacity .4s, transform .4s; }
.chat-bubble b { display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6b4a2a; }
.chat-bubble::after { content: ''; position: absolute; left: 18px; bottom: -10px; border: 8px solid transparent; border-top-color: #111; border-bottom: 0; }
.chat-bubble.big span { font-size: 40px; line-height: 1.1; display: inline-block; }
.chat-bubble.bye { opacity: 0; transform: translateY(-8px); }
@media (max-width: 760px) { .chat-bubble { font-size: 14px; } .react-btn { width: 44px; height: 44px; font-size: 21px; } }

/* «Descarte libre»: cartas marcadas para cambiar */
.card.discard-pick { position: relative; outline: 3px dashed #ff8a5a; outline-offset: 2px; }
.card.discard-pick::after { content: '↺'; position: absolute; top: 4px; right: 6px; font: 900 18px/1 'Josefin Sans', sans-serif; color: #fff; background: #c0392b; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }

/* menú «Cartas adicionales»: miniatura de cada carta */
#board .rank-stars { pointer-events: none; }

/* galería de cartas adicionales: cada carta en grande, tocarla la añade */
#dlg-extra.house-menu { max-width: 860px; }
.extra-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 12px 0 6px; }
.extra-card { position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 6px; padding: 10px; border-radius: 10px; background: #fbf4e0; border: 2px solid #c9b88f; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.extra-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.extra-check { position: absolute; opacity: 0; pointer-events: none; }
.extra-card:has(.extra-check:focus-visible) { outline: 3px solid #792b38; outline-offset: 2px; }
.extra-face { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 3px solid #8a6414; aspect-ratio: 3 / 4; background: #f3e7c9; filter: grayscale(.55) brightness(.92); transition: filter .2s; }
.extra-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.extra-stamp { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%) rotate(-4deg); white-space: nowrap; padding: 5px 12px; border-radius: 6px; background: rgba(39,37,31,.82); color: #fff9e9; font: 700 13px 'Josefin Sans', sans-serif; letter-spacing: .03em; }
.extra-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.extra-head strong { font: 700 18px Georgia, serif; color: #27251f; }
.extra-count { font-size: 12px; color: #6b6450; white-space: nowrap; }
.extra-desc { font-size: 13px; line-height: 1.4; color: #3b382f; }
.extra-card:has(.extra-check:checked) { border-color: #b8860b; background: #fff6d6; box-shadow: 0 0 0 3px #e3b341, 0 8px 18px rgba(0,0,0,.18); }
.extra-card:has(.extra-check:checked) .extra-face { filter: none; }
.extra-card:has(.extra-check:checked) .extra-stamp { background: #2e7d4f; }
.extra-card:has(.extra-check:checked) .extra-head strong { color: #792b38; }
@media (max-width: 520px) { .extra-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .extra-head { flex-direction: column; gap: 0; } .extra-head strong { font-size: 15px; } .extra-desc { font-size: 12px; } .extra-stamp { font-size: 11px; padding: 4px 8px; } }
.extra-strip { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.extra-strip:empty { display: none; }
.strip-thumb { width: 30px; height: 40px; object-fit: cover; border-radius: 4px; border: 1.5px solid #8a6414; }
.extra-card { text-align: left; }

/* carta jugada: se enseña un momento en el centro, con el aspecto de las cartas de la mano */
.played-card { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 3; pointer-events: none; display: grid; justify-items: center; gap: 6px; filter: drop-shadow(0 14px 22px rgba(0,0,0,.55)); }
.pc-ribbon { max-width: 220px; padding: 4px 12px; border-radius: 999px; background: #1b0f0c; color: var(--cream); border: 2px solid var(--fam); font: 700 13px/1.2 'Josefin Sans', sans-serif; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.played-card .pc-card { width: 112px; height: 150px; cursor: default; transform: none; border-top: 6px solid var(--fam); }
@media (max-width: 760px) { .played-card .pc-card { width: 92px; height: 124px; } .pc-ribbon { font-size: 12px; max-width: 170px; } }
/* última carta: etiqueta discreta en la esquina, sobre el suelo */
.last-card { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; align-items: center; gap: 7px; max-width: min(46%, 210px); padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(27,15,12,.82); border: 1px solid rgba(243,215,122,.35); border-left: 4px solid var(--fam); color: var(--cream); cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.last-card:hover { background: rgba(27,15,12,.95); }
.lc-thumb { width: 24px; height: 32px; object-fit: cover; border-radius: 3px; border: 1px solid #8a6414; flex: 0 0 auto; }
svg.lc-thumb { background: #fbf3dc; }
.lc-text { display: grid; min-width: 0; text-align: left; line-height: 1.15; }
.lc-text b { font: 700 11px 'Josefin Sans', sans-serif; color: #e9d9a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-text span { font: 600 12px 'Josefin Sans', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* la carta enseñada nunca se ve «apagada» como las de la mano que no se pueden jugar */
.played-card .pc-card { opacity: 1 !important; filter: none !important; }
/* etiqueta más compacta en el celular */
@media (max-width: 760px) { .last-card { max-width: 42%; gap: 5px; padding: 3px 8px 3px 3px; } .lc-thumb { width: 20px; height: 27px; } .lc-text b { font-size: 10px; } .lc-text span { font-size: 11px; } }

/* celular: la última carta va junto al aviso de arriba, fuera de la mesa */
.hud-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud-row .ticker { flex: 1 1 auto; min-width: 0; }
.last-card-slot { flex: 0 0 auto; display: flex; }
.last-card-slot:empty { display: none; }
.last-card.inline { position: static; max-width: 46vw; box-shadow: none; padding: 2px 8px 2px 2px; }
.last-card.inline .lc-thumb { width: 16px; height: 22px; }

/* velocidad del juego: botón sobre la mesa, encima del zoom */
.speed-btn { position: absolute; left: 8px; bottom: 66px; z-index: 2; display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 17px; border: 2px solid var(--gold); background: rgba(27,15,12,.88); color: var(--cream); font: 700 12px 'Josefin Sans', sans-serif; cursor: pointer; }
.speed-btn span { font-size: 14px; }
.speed-btn.not-host { opacity: .7; }
@media (max-width: 760px) { .speed-btn { bottom: 60px; width: 44px; height: 44px; padding: 0; border-radius: 50%; justify-content: center; } .speed-btn b { display: none; } .speed-btn span { font-size: 18px; } }
