/* Lo de Pocho · Mesa (demo). Bodegón de noche: madera, tapete verde, luz ámbar.
   Un solo look a propósito (oscuro): la mesa se juega de noche. */
:root {
  color-scheme: dark;
  --ink-950: #120b08; --ink-900: #1a110c; --ink-850: #21160f; --ink-800: #2b1b11;
  --cream: #f4e7cf; --cream-dim: #c9ba9c;
  --line: rgba(244, 231, 207, 0.14); --line-strong: rgba(244, 231, 207, 0.28);
  --lamp: #f6b84a; --lamp-hi: #ffd584; --lamp-deep: #d28a1c;
  --blue: #86a8ee; --blue-hi: #b8cffb; --blue-deep: #4468c0;
  --truco: #c92a20; --truco-hi: #e24234; --truco-deep: #8f180f;
  --felt: #1f5238; --felt-deep: #11301f; --wood: #5b3a1e; --wood-hi: #94622e;
  --card: #fbf3df; --card-edge: #d8c79e;
  --font-display: "Alfa Slab One", "Rockwell Extra Bold", Rockwell, "Roboto Slab", "Arial Black", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--cream); font: 400 15px/1.4 var(--font-ui);
  background-color: var(--ink-950);
  background-image: radial-gradient(90% 40% at 50% 0%, rgba(246, 184, 74, 0.12), transparent 72%),
    repeating-linear-gradient(92deg, rgba(255,255,255,.012) 0 1px, transparent 1px 9px);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lamp-hi); outline-offset: 2px; }
#app { height: 100%; max-width: 520px; margin: 0 auto; }
.screen { min-height: 100%; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- marca y textos ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 900 / 430; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -18px #000, 0 0 0 4px rgba(246,184,74,.06); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(18,11,8,.85)); }
.h1 { font: 400 clamp(26px, 8vw, 34px)/1.05 var(--font-display); letter-spacing: .01em; margin: 0; text-wrap: balance; color: var(--cream); }
.lede { margin: 6px 0 0; color: var(--cream-dim); }
.eyebrow { font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); }
.foot { margin-top: auto; padding-top: 8px; text-align: center; color: var(--cream-dim); font-size: 13px; }
.foot strong { color: var(--cream); }
.demo-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px dashed var(--line-strong); color: var(--cream-dim); }

/* ---------- formularios y botones ---------- */
.field { display: grid; gap: 6px; }
.field label, .legend { font-weight: 700; font-size: 14px; color: var(--cream-dim); }
.input { width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line-strong);
  background: var(--ink-850); color: var(--cream); font: 700 20px var(--font-ui); }
.input:focus { border-color: var(--lamp); outline: none; box-shadow: 0 0 0 4px rgba(246,184,74,.2); }
.input[aria-invalid="true"] { border-color: var(--truco-hi); }
.err { color: #ff9a8f; font-weight: 600; min-height: 1.4em; margin: 0; }
.btn { min-height: 52px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--ink-800);
  font-weight: 800; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, background .15s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--lamp-hi), var(--lamp) 45%, var(--lamp-deep)); border-color: #f9d58c; color: #2a1704;
  box-shadow: 0 6px 0 #8a5a10, 0 12px 24px -8px rgba(246,184,74,.5); }
.btn.primary:active { box-shadow: 0 2px 0 #8a5a10; transform: translateY(4px); }
.btn.truco { background: linear-gradient(180deg, var(--truco-hi), var(--truco) 50%, var(--truco-deep)); border-color: #ff8d80; color: #fff4e6;
  box-shadow: 0 5px 0 #5c0f09; font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; }
.btn.truco:active { box-shadow: 0 1px 0 #5c0f09; transform: translateY(4px); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.seg { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.seg > legend { grid-column: 1 / -1; padding: 0; margin-bottom: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; text-align: center; min-height: 58px; padding: 6px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--ink-850); font-weight: 800; line-height: 1.15; }
.seg small { display: block; font-weight: 600; color: var(--cream-dim); font-size: 12px; }
.seg input:checked + span { border-color: var(--lamp); background: rgba(246,184,74,.13); box-shadow: inset 0 0 0 1px var(--lamp); }
.seg input:focus-visible + span { outline: 3px solid var(--lamp-hi); outline-offset: 2px; }
.sum { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--ink-850); border: 1px solid var(--line); color: var(--cream-dim); }
.sum strong { color: var(--cream); }

/* ---------- lobby ---------- */
.linkbox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--ink-850); border: 1px dashed var(--line-strong); }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px var(--font-ui); color: var(--lamp-hi); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.lobby-table { position: relative; width: 100%; aspect-ratio: 5 / 4.6; }
.felt-shape { position: absolute; inset: 7% 3%; border-radius: 50% / 40%;
  background: radial-gradient(120% 90% at 50% 30%, var(--felt), var(--felt-deep));
  border: 9px solid var(--wood); box-shadow: inset 0 0 0 2px var(--wood-hi), inset 0 10px 40px rgba(0,0,0,.55), 0 20px 40px -16px #000; }
.seat-btn { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; min-width: 76px; padding: 8px 6px;
  border-radius: 14px; border: 2px dashed var(--line-strong); background: rgba(18,11,8,.72); cursor: pointer; text-align: center; backdrop-filter: blur(2px); }
.seat-btn.us { border-color: var(--lamp); } .seat-btn.them { border-color: var(--blue); }
.seat-btn.taken { border-style: solid; background: rgba(18,11,8,.9); }
.seat-btn.mine { box-shadow: 0 0 0 4px rgba(246,184,74,.3); }
.seat-btn .nm { font-weight: 800; font-size: 13px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-btn .sub { font-size: 11px; color: var(--cream-dim); font-weight: 600; }
.pillnote { padding: 10px 12px; border-radius: 12px; background: rgba(246,184,74,.1); border: 1px solid rgba(246,184,74,.3); color: var(--lamp-hi); font-weight: 600; }

/* ---------- avatar ---------- */
.av { --c: var(--lamp); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 400 17px var(--font-display);
  color: #1a0f06; background: radial-gradient(circle at 35% 30%, #fff1cc, var(--c) 60%); border: 3px solid rgba(0,0,0,.35); box-shadow: 0 3px 8px rgba(0,0,0,.5); position: relative; }
.av.them { --c: var(--blue); color: #0d1a3a; background: radial-gradient(circle at 35% 30%, #eaf1ff, var(--blue) 60%); }
.av.empty { background: transparent; border: 2px dashed var(--line-strong); box-shadow: none; color: var(--cream-dim); }
.av.turn::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--lamp-hi); animation: pulse 1.1s ease-in-out infinite; }
.av.off { filter: grayscale(1) brightness(.7); }

/* ---------- partida ---------- */
.screen-game { padding: 0; gap: 0; height: 100%; min-height: 0; }
.gbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
.gbar .brand { font: 400 15px var(--font-display); color: var(--lamp-hi); letter-spacing: .01em; }
.gbar .info { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cream-dim); font-weight: 600; line-height: 1.2; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--ink-850); display: grid; place-items: center; cursor: pointer; }
.ibtn svg { width: 22px; height: 22px; }
.ibtn:disabled { opacity: .4; cursor: not-allowed; }
.score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; padding: 4px 14px 8px; }
.score .t { display: grid; gap: 4px; }
.score .t.them { text-align: right; }
.score .nm { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-dim); }
.score .n { font: 400 40px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.score .us .n { color: var(--lamp-hi); } .score .them .n { color: var(--blue-hi); }
.score .ph { font-size: 12px; color: var(--cream-dim); font-weight: 600; }
.score .goal { text-align: center; font-weight: 800; font-size: 13px; color: var(--cream-dim); padding-bottom: 6px; }
.bar { position: relative; height: 7px; border-radius: 9px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 9px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.us .bar i { background: linear-gradient(90deg, var(--lamp-deep), var(--lamp-hi)); }
.them .bar i { background: linear-gradient(90deg, var(--blue-deep), var(--blue-hi)); }
.bar b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.55); left: 50%; }
.chips { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; align-items: center; }
.chip { padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 1px solid var(--line-strong); background: var(--ink-850); white-space: nowrap; }
.chip.hot { background: var(--truco); border-color: #ff8d80; color: #fff4e6; animation: pulse-bg 1.6s ease-in-out infinite; }
.chip .ord { font-size: 11px; color: var(--cream-dim); margin: 0 3px 0 6px; }
.chip .ord:first-child { margin-left: 0; }
.chip .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; background: rgba(255,255,255,.2); }
.chip .dot.us { background: var(--lamp); } .chip .dot.them { background: var(--blue); } .chip .dot.t { background: var(--cream-dim); }

.bubble { position: absolute; z-index: 5; transform: translate(-50%, -100%); padding: 5px 11px; border-radius: 14px; background: var(--cream); color: #2a1704; font-weight: 800; font-size: 14px;
  white-space: nowrap; box-shadow: 0 6px 14px rgba(0,0,0,.5); animation: pop .25s ease-out both; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.bubble.hot { background: var(--truco); color: #fff4e6; }
.shout { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; pointer-events: none; }
.shout .burst { position: absolute; width: 86%; aspect-ratio: 1; background: radial-gradient(circle, #ffe08a, #f6b84a 60%, #d28a1c); animation: burst .9s cubic-bezier(.2,1.3,.3,1) both; opacity: .96; }
.shout b { position: relative; font: 400 clamp(38px, 13vw, 62px)/1 var(--font-display); color: var(--truco); -webkit-text-stroke: 7px var(--cream); paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0,0,0,.35); transform: rotate(-5deg); animation: shout .9s cubic-bezier(.2,1.4,.3,1) both; text-align: center; padding: 0 12px; }
.pause { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; padding: 12px 16px; border-radius: 16px; background: rgba(18,11,8,.92); border: 1px solid var(--lamp);
  text-align: center; font-weight: 700; max-width: 80%; }

.dock { align-content: start; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, rgba(18,11,8,.9) 28%); display: grid; gap: 8px; }
.dock.play { min-height: 300px; }
.hint { min-height: 22px; font-weight: 700; color: var(--cream-dim); text-align: center; font-size: 14px; }
.hint strong { color: var(--lamp-hi); }
.hand { display: flex; justify-content: center; gap: 10px; }
.hand .card { --cw: clamp(72px, 24vw, 100px); cursor: pointer; transition: transform .15s, box-shadow .15s; padding: 0; }
.hand .card:not(:disabled):hover { transform: translateY(-6px); }
.hand .card:disabled { cursor: default; }
.hand.waiting .card { filter: brightness(.9) saturate(.9); }
.hand .card.gone { visibility: hidden; }
.actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.actions .btn { min-height: 48px; padding: 0 8px; font-size: 15px; }
.envrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.resp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resp .wide { grid-column: 1 / -1; }
.pie-note { text-align: center; font-size: 13px; color: var(--lamp-hi); font-weight: 700; }
.specbox { padding: 14px; border-radius: 14px; background: var(--ink-850); border: 1px dashed var(--line-strong); text-align: center; display: grid; gap: 8px; }

/* ---------- cartas ---------- */
.card { --cw: 60px; position: relative; width: var(--cw); aspect-ratio: 2 / 3; border-radius: calc(var(--cw) * .1); flex: none; display: block; font-size: calc(var(--cw) * .24); }
.card.face { background: linear-gradient(160deg, #fffaf0, var(--card) 55%, #f1e4c4); border: 1px solid var(--card-edge); color: #2a1704;
  box-shadow: 0 8px 14px -6px rgba(0,0,0,.65), inset 0 0 0 calc(var(--cw) * .035) #fffdf6, inset 0 0 0 calc(var(--cw) * .05) rgba(120,90,40,.28); }
.card.oro { --sc: #946009; } .card.copa { --sc: #a2222a; } .card.espada { --sc: #2f4d7a; } .card.basto { --sc: #4a6a22; }
.card .rk { position: absolute; display: grid; justify-items: center; line-height: 1; font-family: var(--font-display); color: var(--sc); gap: 1px; }
.card .rk svg { width: .8em; height: .8em; }
.card .rk.tl { left: 8%; top: 5%; } .card .rk.br { right: 8%; bottom: 5%; transform: rotate(180deg); }
.card .pip { position: absolute; width: 25%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.card .pip.big { width: 58%; } .card .pip.fig { width: 44%; }
.card .figname { position: absolute; left: 0; right: 0; bottom: 17%; text-align: center; font: 800 .38em var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--sc); }
.card.back { background: repeating-linear-gradient(45deg, #2d4aa0 0 4px, #243b84 4px 8px); border: 2px solid var(--cream); box-shadow: inset 0 0 0 3px #1c2f6c, 0 4px 8px rgba(0,0,0,.5); }
.card.back i { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, #f6b84a 0 30%, transparent 32%); opacity: .8; }

/* ---------- pantallas superpuestas ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(8,4,2,.72); backdrop-filter: blur(3px); }
.panel { width: min(100%, 380px); padding: 20px; border-radius: 22px; background: linear-gradient(180deg, var(--ink-800), var(--ink-900)); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -20px #000; display: grid; gap: 12px; text-align: center; animation: pop .3s ease-out both; }
.panel .big { font: 400 32px/1.05 var(--font-display); margin: 0; text-wrap: balance; }
.panel .big.us { color: var(--lamp-hi); } .panel .big.them { color: var(--blue-hi); }
.panel .pts { font: 400 56px/1 var(--font-display); }
.panel p { margin: 0; color: var(--cream-dim); }
.sheet { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: rgba(8,4,2,.6); }
.sheet .body { width: 100%; max-height: 82%; overflow: auto; padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0;
  background: var(--ink-900); border: 1px solid var(--line-strong); display: grid; gap: 12px; }
.sheet h2 { margin: 0; font: 400 22px var(--font-display); }
.sheet h3 { margin: 6px 0 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-dim); }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--ink-850); border: 1px solid var(--line); flex-wrap: wrap; }
.person .who { flex: 1; min-width: 110px; font-weight: 800; }
.person .who small { display: block; font-weight: 600; color: var(--cream-dim); font-size: 12px; }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 99;
  padding: 10px 16px; border-radius: 12px; background: var(--cream); color: #2a1704; font-weight: 800; max-width: 88vw; text-align: center; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes pulse-bg { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@keyframes pop { from { transform: translate(-50%, -100%) scale(.6); opacity: 0; } to { transform: translate(-50%, -100%) scale(1); opacity: 1; } }
.panel { animation-name: popc; } @keyframes popc { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drop { from { transform: translate(-50%, -50%) translate(var(--fx, 0px), var(--fy, 90px)) scale(1.25) rotate(var(--fr, -10deg)); opacity: .2; } to { transform: translate(-50%, -50%); opacity: 1; } }
@keyframes burst { from { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1) rotate(0); opacity: .96; } }
@keyframes shout { 0% { transform: rotate(-5deg) scale(.3); opacity: 0; } 55% { transform: rotate(-5deg) scale(1.15); opacity: 1; } 100% { transform: rotate(-5deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-height: 700px) { .dock.play { min-height: 250px; } .score .n { font-size: 32px; } .felt { min-height: 210px; } .hand .card { --cw: clamp(62px, 20vw, 84px); } }
@media (max-width: 359px) { .actions { grid-template-columns: 1fr 1fr; } .actions .btn:first-child { grid-column: 1 / -1; } }

/* ---------- equipo ---------- */
.hand .card { --cw: clamp(64px, 21vw, 88px); }

/* ---------- aviso, pica pica ---------- */
.nobets { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(214,69,69,.1); border: 1px solid rgba(214,69,69,.45); color: #ffd9d4; font-size: 14px; line-height: 1.3; }
.nobets svg { flex: none; width: 22px; height: 22px; color: #ff8a7a; }
.nobets strong { color: #fff; }
.picasum strong { color: var(--lamp-hi); }
.chip.pica { background: var(--lamp-deep); color: #fff; border-color: var(--lamp-hi); }

/* ---------- mesa ---------- */
.felt { position: relative; flex: 1; min-height: 270px; margin: 0 8px; --pw: 44px; }
.felt.n6 { --pw: 34px; } .felt.n2 { --pw: 62px; }
.felt .tapete { position: absolute; inset: 3% 0 2%; border-radius: 50% / 30%;
  background: radial-gradient(110% 80% at 50% 38%, #2a6a4a 0%, var(--felt) 45%, var(--felt-deep) 100%);
  border: 10px solid var(--wood); box-shadow: inset 0 0 0 2px var(--wood-hi), inset 0 14px 50px rgba(0,0,0,.6), 0 24px 40px -18px #000, 0 0 60px -10px rgba(246,184,74,.25); }
.felt .tapete::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(60% 40% at 50% 36%, rgba(255,222,150,.22), transparent 70%); pointer-events: none; }
.seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; width: 74px; z-index: 3; }
.seat.out { opacity: .5; }
.seat .av { width: 40px; height: 40px; font-size: 15px; }
.seat .nm { font-weight: 800; font-size: 11px; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(18,11,8,.82); padding: 1px 8px; border-radius: 99px; }
.tags { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.tag { font-size: 9px; font-weight: 800; padding: 0 5px; border-radius: 99px; line-height: 14px; background: rgba(244,231,207,.22); letter-spacing: .03em; text-transform: uppercase; }
.tag.pie { background: var(--lamp); color: #2a1704; } .tag.off { background: var(--truco); color: #fff; }
.backs { display: flex; justify-content: center; margin-top: 1px; }
.backs .card { --cw: 15px; margin-left: -5px; box-shadow: 0 1px 3px rgba(0,0,0,.6); border-width: 1px; }
.backs .card:first-child { margin-left: 0; } .backs .card i { display: none; }
.mid { position: absolute; left: 20%; right: 20%; top: 50%; transform: translateY(-50%); display: grid; gap: 4px; z-index: 2; pointer-events: none; }
.felt.n2 .mid { left: 8%; right: 8%; }
.trow { display: grid; grid-template-columns: 18px 1fr; align-items: center; min-height: calc(var(--pw) * 1.5 + 16px); border-radius: 10px; background: rgba(0,0,0,.16); }
.trow.empty { background: rgba(0,0,0,.08); }
.rlab { font-size: 11px; font-weight: 800; color: rgba(244,231,207,.45); text-align: center; }
.rcards { display: flex; gap: 4px; justify-content: center; align-items: flex-start; flex-wrap: nowrap; }
.pl { display: grid; justify-items: center; gap: 1px; }
.pl .card { --cw: var(--pw); filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.pl .card.fresh { animation: slotin .4s cubic-bezier(.2,.9,.25,1.1) both; }
.pl .card.won.us { box-shadow: 0 0 0 2px var(--lamp-hi), 0 0 12px rgba(255,213,132,.8); }
.pl .card.won.them { box-shadow: 0 0 0 2px var(--blue-hi), 0 0 12px rgba(134,168,238,.8); }
.who { font-style: normal; font-size: 9px; font-weight: 800; line-height: 13px; padding: 0 5px; border-radius: 99px; color: #1a0f06; background: var(--lamp); }
.who.them { background: var(--blue); color: #0d1a3a; }
.seat .bubble { left: 50%; top: -2px; font-size: 13px; padding: 4px 9px; }
.band { margin: 8px 8px 0; padding: 6px 8px 8px; border-radius: 14px; background: rgba(246,184,74,.08); border: 1px solid rgba(246,184,74,.28); display: grid; gap: 4px; min-height: 84px; align-content: start; }
.bandtitle { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lamp-hi); }
.mates { display: flex; gap: 12px; justify-content: space-around; }
.mate { display: grid; gap: 3px; justify-items: center; min-width: 0; }
.mn { font-weight: 800; font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcards { display: flex; gap: 4px; min-height: 54px; align-items: center; }
.mcards .card { --cw: 36px; }
.mnone { font-size: 12px; color: var(--cream-dim); font-weight: 600; }
@keyframes slotin { from { transform: translateY(-22px) scale(1.25); opacity: .2; } to { transform: none; opacity: 1; } }
.dock.play { min-height: 0; }
.screen-game { overflow-y: auto; }
.hand .card { --cw: clamp(56px, 18vw, 72px); }
.score .n { font-size: 34px; } .score { padding-bottom: 6px; }
.hint { min-height: 20px; }
.dock { padding-top: 4px; gap: 6px; }
@media (max-height: 780px) {
  .felt { min-height: 240px; } .felt.n6 { --pw: 28px; } .felt.n4 { --pw: 36px; } .felt.n2 { --pw: 48px; }
  .hand .card { --cw: clamp(50px, 16vw, 60px); }
  .mcards .card { --cw: 30px; } .mcards { min-height: 45px; } .band { min-height: 62px; padding-bottom: 6px; } .bandtitle { display: none; }
  .score .n { font-size: 28px; } .chips { padding-bottom: 4px; } .actions .btn { min-height: 44px; }
  .seat .av { width: 34px; height: 34px; font-size: 13px; }
}

/* ---------- mesa: ajustes finos ---------- */
.felt { margin-top: 16px; margin-bottom: 14px; min-height: 300px; }
.felt .tapete { inset: 6% 0 5%; }
.felt.n6 { --pw: 30px; } .felt.n4 { --pw: 42px; } .felt.n2 { --pw: 58px; }
.mid { left: 15%; right: 15%; gap: 3px; }
.felt.n2 .mid { left: 10%; right: 10%; }
.trow { position: relative; grid-template-columns: 1fr; min-height: calc(var(--pw) * 1.5 + 15px); }
.trow::before { content: attr(data-k); position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 800; color: rgba(244,231,207,.38); }
.trow:not(.empty)::before { top: 6px; transform: none; }
.rcards { padding: 2px 0; }
.seat .nm { max-width: 70px; } .seat { width: 70px; }
@media (max-height: 780px) {
  .felt { min-height: 260px; margin-top: 12px; margin-bottom: 10px; }
  .felt.n6 { --pw: 26px; } .felt.n4 { --pw: 36px; } .felt.n2 { --pw: 48px; }
  .who { font-size: 8px; line-height: 11px; padding: 0 4px; }
  .trow { min-height: calc(var(--pw) * 1.5 + 12px); }
  .seat .av { width: 30px; height: 30px; font-size: 12px; } .seat .nm { font-size: 10px; }
}

.felt { margin-top: 20px; margin-bottom: 22px; }
.felt .tapete { inset: 5% 0 4%; }
.backs .card { --cw: 13px; }
.trow { min-height: calc(var(--pw) * 1.5 + 13px); }
.mid { top: 49%; }
@media (max-height: 780px) { .felt { margin-top: 16px; margin-bottom: 20px; } .trow { min-height: calc(var(--pw) * 1.5 + 11px); } }
.felt.n2 { --pw: 46px; }
@media (max-height: 780px) { .felt.n2 { --pw: 40px; } }

/* tags y cartas ocultas: junto al avatar en los asientos de arriba y abajo, así no invaden el centro */
.aside { display: grid; gap: 3px; justify-items: center; }
.seat.cx .aside { position: absolute; top: 2px; left: calc(50% + 26px); justify-items: start; }
.seat.cx .tags { flex-direction: column; align-items: flex-start; gap: 2px; }
.felt.n4 { --pw: 38px; }
.felt.n4 { --pw: 34px; } .felt.n4 .mid { top: 52%; }
@media (max-height: 780px) { .felt.n4 { --pw: 31px; } }

/* ---------- cartas frente a cada jugador ---------- */
.mid { inset: 0; left: 0; right: 0; top: 0; transform: none; display: block; }
.felt.n6 { --pw: 30px; } .felt.n4 { --pw: 36px; } .felt.n2 { --pw: 52px; }
.lane { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 3px; z-index: 2; pointer-events: none; }
.lane.out { display: none; }
.lslot { width: var(--pw); aspect-ratio: 2 / 3; border-radius: calc(var(--pw) * .12); display: grid; place-items: center; border: 1px dashed rgba(244,231,207,.2); background: rgba(0,0,0,.14); }
.lslot > span { font-size: calc(var(--pw) * .34); font-weight: 800; color: rgba(244,231,207,.3); }
.lslot.full { border: 0; background: none; }
.lslot .card { --cw: var(--pw); filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.lslot .card.fresh { animation: slotfrom .45s cubic-bezier(.2,.9,.25,1.1) both; }
.lslot .card.won.us { box-shadow: 0 0 0 2px var(--lamp-hi), 0 0 12px rgba(255,213,132,.8); }
.lslot .card.won.them { box-shadow: 0 0 0 2px var(--blue-hi), 0 0 12px rgba(134,168,238,.8); }
@keyframes slotfrom { from { transform: translate(var(--fx, 0), var(--fy, 40px)) scale(1.3); opacity: .2; } to { transform: none; opacity: 1; } }
@media (max-height: 780px) { .felt.n6 { --pw: 26px; } .felt.n4 { --pw: 32px; } .felt.n2 { --pw: 44px; } }
.felt .mid, .felt.n4 .mid, .felt.n2 .mid { inset: 0; left: 0; right: 0; top: 0; transform: none; display: block; }

/* ---------- mis cartas más chicas, leyenda siempre visible ---------- */
.hand .card { --cw: clamp(46px, 14vw, 58px); }
.hand { gap: 8px; }
.hint { min-height: 38px; display: grid; align-content: center; line-height: 1.25; padding: 0 4px; font-size: 14px; }
.band { margin-bottom: 4px; }
@media (max-height: 780px) { .hand .card { --cw: clamp(42px, 13vw, 50px); } .hint { min-height: 34px; font-size: 13px; } }
.hint { display: block; min-height: 38px; }
@media (max-height: 780px) { .hint { min-height: 34px; } }

/* ---------- caras ---------- */
.av svg.face { width: 100%; height: 100%; display: block; border-radius: 50%; clip-path: circle(50%); }
.av.big { width: 84px; height: 84px; flex: none; border-width: 4px; }
.faceset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.faceprev { display: flex; align-items: center; gap: 14px; }
.faceprev .seg { flex: 1; margin: 0; }
.facegrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.facepick { position: relative; display: block; cursor: pointer; }
.facepick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.facepick .av { width: 100%; height: auto; aspect-ratio: 1; border-width: 2px; transition: transform .15s; }
.facepick:hover .av { transform: translateY(-2px); }
.facepick input:checked + .av { outline: 3px solid var(--lamp-hi); outline-offset: 2px; transform: scale(1.04); }
.facepick input:focus-visible + .av { outline: 3px solid #fff; outline-offset: 2px; }

.facegrid { padding: 4px 4px 0; margin-bottom: 8px; }
.resp { grid-template-columns: 1fr 1fr 1.15fr; } .resp .wide { grid-column: auto; }
.resp .btn { padding: 0 6px; font-size: 15px; }

/* compactar el pie de pantalla para que entren también las respuestas a envido */
.bandtitle { display: none; }
.band { min-height: 74px; padding-top: 6px; }
.mcards { min-height: 50px; } .mcards .card { --cw: 33px; }
.btn { min-height: 48px; } .actions .btn { min-height: 46px; } .envrow .btn { min-height: 38px; }
.hint { min-height: 32px; }
.dock { gap: 5px; }

.score .nm i { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .8; }
.gbar { padding: 4px 12px; }
.score { gap: 8px; padding: 0 14px 6px; }
.score .goal { padding-bottom: 0; }
@media (max-height: 780px) { .felt { min-height: 236px; } .hint { min-height: 28px; font-size: 13px; } .gbar .ibtn { width: 36px; height: 36px; } }
.resp { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }

/* Mazo individual: el que se fue mira, sin cartas */
.seat.folded .av{opacity:.45;filter:grayscale(.8)}
.seat.folded .nm{opacity:.6;text-decoration:line-through}
.tag.fold{background:#3a2a2a;color:#ffb4a8}
.mate.folded .mn{opacity:.6;text-decoration:line-through}
.tag{white-space:nowrap}

/* Fin de la partida: Pocho se burla de los que perdieron */
.pocho{position:relative;width:104px;height:128px;margin:-46px auto 6px;animation:pocho-in .5s cubic-bezier(.2,1.4,.4,1) both}
.pocho img{width:100%;height:100%;object-fit:cover;border-radius:50% 50% 46% 46%/56% 56% 44% 44%;border:3px solid var(--lamp,#f2b24a);box-shadow:0 8px 22px rgba(0,0,0,.55);animation:pocho-laugh .55s ease-in-out .5s infinite alternate;transform-origin:50% 90%}
.pocho-bubble{position:absolute;left:68%;top:-8px;z-index:1;background:#fff6e0;color:#b3201a;font:900 15px/1 'Alfa Slab One',Georgia,serif;padding:7px 10px;border-radius:14px 14px 14px 2px;white-space:nowrap;box-shadow:0 4px 12px rgba(0,0,0,.4);animation:pocho-pop .55s ease-in-out .5s infinite alternate}
.mock{font-weight:800;color:var(--lamp,#f2b24a);margin:0 0 4px}
@keyframes pocho-in{from{transform:translateY(30px) scale(.4);opacity:0}to{transform:none;opacity:1}}
@keyframes pocho-laugh{from{transform:rotate(-7deg) scale(1)}to{transform:rotate(7deg) scale(1.06)}}
@keyframes pocho-pop{from{transform:scale(.92) rotate(-3deg)}to{transform:scale(1.08) rotate(3deg)}}
@media (prefers-reduced-motion:reduce){.pocho,.pocho img,.pocho-bubble{animation:none}}

/* Volver al inicio del sitio */
.homelink{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px 0 10px;border:1px solid var(--line-strong);border-radius:99px;color:var(--cream);text-decoration:none;font-weight:700;font-size:.92rem;background:rgba(244,231,207,.07)}
.homelink:hover{background:rgba(244,231,207,.14)}
.homelink:focus-visible{outline:3px solid var(--lamp-hi);outline-offset:2px}

.watchers { margin: 0; font-size: 13px; color: var(--cream-dim); }
.watchers strong { color: var(--cream); }

/* voz */
.ibtn.on { border-color: var(--lamp-hi); background: color-mix(in srgb, var(--lamp-hi) 18%, var(--ink-850)); color: var(--lamp-hi); }
.ibtn.joined:not(.on) { border-color: var(--line-strong); }
.av { position: relative; }
.av.talk::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid #4ade80; box-shadow: 0 0 12px #4ade80; pointer-events: none; }
.vbadge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-850); border: 1.5px solid var(--line-strong); color: var(--cream-dim); }
.vbadge.live { background: #166534; border-color: #4ade80; color: #fff; }
.vbadge svg { width: 11px; height: 11px; }
@media (prefers-reduced-motion: reduce) { .av.talk::before { box-shadow: none; } }
/* la hoja "La mesa" usaba .who, que también es la etiqueta chiquita de los asientos */
.person .who { font-size: 15px; line-height: 1.3; padding: 0; border-radius: 0; background: none; color: var(--cream); }
