:root {
  --felt-hi: #1b6e4f;
  --felt: #145a40;
  --felt-dark: #0b3527;
  --grain: linear-gradient(transparent, transparent);
  --rail-hi: #9a6436;
  --rail: #7a4a26;
  --rail-dark: #4a2a14;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  /* sombra del paño: también la usa el destello del vale cuatro */
  --felt-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 8px 34px rgba(0,0,0,.42), 0 0 0 1px rgba(0,0,0,.55), 0 16px 34px rgba(0,0,0,.55);
  --ink: #f6f0e1;
  --muted: #b9c9bd;
  --gold: #e8b830;
  --good: #2e9d58;
  --bad: #c0463b;
  --blue: #2f6fae;
  --panel: #fbf6ea;
  --panel-ink: #2a2620;
  --cw: clamp(58px, 19vw, 104px); /* cartas de la mano */
  --cm: clamp(44px, 12vw, 74px); /* mesa */
  --cs: clamp(30px, 9vw, 54px); /* jugadas */
  --ct: clamp(16px, 4.5vw, 26px); /* dorsos chiquitos */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--noise), var(--grain), radial-gradient(120% 90% at 50% 30%, var(--felt-hi) 0%, var(--felt) 45%, var(--felt-dark) 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body.offline::before {
  content: 'Reconectando…';
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  text-align: center; background: var(--bad); color: #fff; font-size: 13px; padding: 3px;
}
button { font: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ---------- botones ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 11px 16px; min-height: 44px;
  background: #f1ead9; color: #2a2620; font-weight: 650;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
  transition: transform .08s, filter .15s;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--gold); color: #3a2a00; }
.btn.good { background: var(--good); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.env { background: var(--blue); color: #fff; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: 14px; }
.link { background: none; border: 0; color: var(--muted); padding: 8px 0; }
.icon { background: rgba(0,0,0,.25); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }

/* ---------- páginas ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.center-page { align-items: center; justify-content: center; min-height: 80vh; }
.brand { text-align: center; padding-top: 12px; }
.brand h1 { font-size: clamp(34px, 9vw, 46px); color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.brand p { margin: 6px 0 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .code-input {
  border: 2px solid transparent; border-radius: 12px; padding: 12px 14px; font-size: 17px;
  background: #fbf6ea; color: #2a2620; outline: none;
}
.field input:focus, .code-input:focus { border-color: var(--gold); }
.code-input { width: 120px; text-transform: uppercase; letter-spacing: 4px; text-align: center; font-weight: 700; }
.games { display: flex; flex-direction: column; gap: 12px; }
.game-tile {
  display: flex; gap: 14px; align-items: center; text-align: left;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); color: var(--ink);
  border-radius: 16px; padding: 14px; transition: background .15s, transform .1s;
}
.game-tile:hover { background: rgba(0,0,0,.32); }
.game-tile:active { transform: scale(.99); }
.game-tile h2 { font-size: 22px; color: #fff; }
.game-tile p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mini-cards { display: flex; flex: none; }
.card.mini { width: 34px; margin-right: -14px; transform: rotate(var(--r, 0deg)); }
.mini-cards .card.mini:nth-child(1) { --r: -10deg; }
.mini-cards .card.mini:nth-child(3) { --r: 10deg; margin-right: 0; }
.join { background: rgba(0,0,0,.18); border-radius: 16px; padding: 14px; text-align: center; }
.join h3 { font-size: 17px; margin-bottom: 10px; font-family: inherit; font-weight: 600; }
footer { text-align: center; }
.seg { display: flex; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; border-radius: 9px; padding: 10px 6px; background: transparent; color: var(--ink); font-weight: 600; }
.seg button.on { background: var(--gold); color: #3a2a00; }
.seg button:disabled:not(.on) { opacity: .5; }
.cta { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.code-box { text-align: center; background: rgba(0,0,0,.22); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.code { font-size: 44px; font-weight: 800; letter-spacing: 10px; color: var(--gold); font-family: ui-monospace, Menlo, monospace; }
.seats { display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.2); min-height: 52px; }
.seat.free { border: 1px dashed rgba(255,255,255,.25); background: transparent; color: var(--muted); }
.seat.me { outline: 2px solid var(--gold); }
.seat .sname { flex: 1; }
.team { font-size: 12px; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.team.t0 { background: #2f6fae; }
.team.t1 { background: #b8322a; }
.spinner { width: 36px; height: 36px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cartas ---------- */
.card { position: relative; width: var(--cw); aspect-ratio: 2 / 3; flex: none; border-radius: 9%/6%; transition: transform .15s ease, box-shadow .15s; }
.card .card-svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.card.big { width: var(--cw); }
.card.mid { width: var(--cm); }
.card.small { width: var(--cs); }
.card.tiny { width: var(--ct); }
.card.micro { width: 22px; display: inline-block; vertical-align: middle; }
.card.playable { cursor: pointer; }
.hand .card.playable:hover { transform: translateY(-6px); }
.card.selected { transform: translateY(-14px) !important; }
.card.selected .card-svg { filter: drop-shadow(0 0 0 var(--gold)) drop-shadow(0 0 6px var(--gold)); }
.card.dim { opacity: .45; }
.card.empty { border: 2px dashed rgba(255,255,255,.3); }
.card.enter { animation: land .42s cubic-bezier(.2,.7,.3,1.2); }
/* cartas con peso: llegan desde arriba, un poco giradas, y "pegan" contra el paño */
@keyframes land {
  0% { transform: translateY(-34px) scale(1.22) rotate(-7deg); opacity: 0; }
  55% { transform: translateY(2px) scale(.97) rotate(1deg); opacity: 1; }
  75% { transform: translateY(-2px) scale(1.01); }
  100% { transform: none; }
}
.card.enter .card-svg { animation: landShadow .42s ease-out; }
@keyframes landShadow { 0% { filter: drop-shadow(0 16px 10px rgba(0,0,0,.45)); } 100% { filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); } }
.card .val { position: absolute; bottom: -8px; right: -6px; background: #222; color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 6px; font-weight: 700; }

/* ---------- mesa ---------- */
.table-wrap { height: 100dvh; }
.table { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; max-width: 900px; margin: 0 auto; position: relative; }
.tools { position: fixed; top: 6px; right: 6px; display: flex; gap: 6px; z-index: 20; align-items: center; }
.roomcode { position: fixed; top: 84px; right: 6px; font-family: ui-monospace, monospace; background: rgba(0,0,0,.3); padding: 3px 8px; border-radius: 8px; letter-spacing: 2px; font-size: 12px; color: var(--muted); }
.scorebar { display: flex; align-items: stretch; gap: 8px; padding: 8px 136px 6px 10px; }
.score { flex: 1; background: rgba(0,0,0,.25); border-radius: 12px; padding: 6px 10px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; max-width: 220px; }
.score.mine { box-shadow: inset 0 0 0 2px rgba(232,184,48,.5); }
.score .sname { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .snum { font-size: 22px; font-weight: 800; grid-row: span 2; align-self: center; }
.score .sbar { height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; align-self: center; overflow: hidden; }
.score .sbar i { display: block; height: 100%; background: var(--gold); }
.score .ssub { display: none; }
.smid { text-align: center; font-size: 13px; display: flex; flex-direction: column; justify-content: center; }
.stake { color: var(--gold); font-weight: 700; text-transform: capitalize; }
.scorebar.chips { flex-wrap: wrap; align-items: center; }
.chip { background: rgba(0,0,0,.25); border-radius: 10px; padding: 5px 10px; font-size: 14px; display: flex; gap: 6px; }
.chip.mine { box-shadow: inset 0 0 0 2px rgba(232,184,48,.5); }
.chip.out { opacity: .45; text-decoration: line-through; }

.felt {
  display: grid; min-height: 0; padding: 4px 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: 'left top right' 'left center right' '. bottom .';
  gap: 6px;
}
.zone { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.zone.pos-top { grid-area: top; }
.zone.pos-left { grid-area: left; justify-content: center; }
.zone.pos-right { grid-area: right; justify-content: center; }
.zone.pos-bottom { grid-area: bottom; }
.felt.n2 .zone.pos-top { grid-column: 1 / -1; }
.zone.out { opacity: .45; }
.center { grid-area: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 0; }
.backs { display: flex; justify-content: center; }
.backs .card.tiny + .card.tiny { margin-left: calc(var(--ct) * -0.45); }
.backs.reveal .card.tiny { width: calc(var(--ct) * 1.5); }
.backs.reveal .card + .card { margin-left: 2px; }
.strip { display: flex; gap: 4px; justify-content: center; min-height: calc(var(--cs) * 1.5); align-items: center; }
.felt.n2 .strip .card.small { width: var(--cm); }
.strip .card.won .card-svg { filter: drop-shadow(0 0 5px var(--gold)); }
.strip .card.lost { opacity: .6; }
.strip .card.parda { opacity: .8; }

.badge { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; background: rgba(0,0,0,.3); border-radius: 999px; padding: 4px 12px; font-size: 14px; max-width: 100%; transition: box-shadow .2s; }
.badge .bname { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.badge.turn { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(232,184,48,.6); }
.badge.away { opacity: .7; }
.badge .bsub { color: var(--muted); font-size: 12px; }
.btag { font-size: 11px; background: rgba(255,255,255,.15); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.btag.warn { background: #8a5a00; }
.bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  background: #fff; color: #222; padding: 6px 12px; border-radius: 14px; font-weight: 750; white-space: nowrap; z-index: 5;
  box-shadow: 0 4px 10px rgba(0,0,0,.35); animation: bubble 2.8s forwards; font-size: 15px;
  transform: none; translate: -50% 0;
}
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
.zone.pos-top .bubble { bottom: auto; top: calc(100% + 8px); }
.zone.pos-top .bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #fff; }
@keyframes bubble { 0% { opacity: 0; scale: .7; } 8% { opacity: 1; scale: 1.05; } 12% { scale: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
/* mi globo va al costado para no tapar mis cartas jugadas */
.zone.pos-bottom .bubble, .row-bottom .bubble { bottom: auto; top: 50%; left: calc(100% + 10px); translate: 0 -50%; }
.zone.pos-bottom .bubble::after, .row-bottom .bubble::after { top: 50%; left: auto; right: 100%; margin: -6px 0 0; border-top-color: transparent; border-right-color: #fff; }
.zone.pos-left .bubble { left: 0; translate: 0 0; }
.zone.pos-left .bubble::after { left: 20px; }
.zone.pos-right .bubble { left: auto; right: 0; translate: 0 0; }
.zone.pos-right .bubble::after { left: auto; right: 14px; }

.note { background: rgba(0,0,0,.25); padding: 5px 10px; border-radius: 10px; font-size: 14px; }
.note.escoba { background: var(--gold); color: #3a2a00; font-weight: 700; }
.call { font-weight: 700; color: var(--gold); font-size: 17px; }
.call small { color: var(--muted); font-weight: 400; font-size: 13px; }
.yourturn { font-weight: 700; color: #fff; background: rgba(232,184,48,.25); padding: 4px 12px; border-radius: 10px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { background: rgba(232,184,48,.45); } }
.result { font-size: 20px; font-weight: 800; padding: 6px 14px; border-radius: 12px; }
.result.good { background: rgba(46,157,88,.35); }
.result.bad { background: rgba(192,70,59,.35); }
.result small { font-weight: 400; font-size: 14px; }

.mine { padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 44px; align-items: center; }
.actions .btn { padding: 9px 13px; }
.hand { display: flex; justify-content: center; gap: 8px; padding-top: 14px; }
.hand.chinchon { gap: 0; }
.hand.chinchon { --cw: clamp(50px, 19vw, 100px); }
.hand.chinchon .card { margin-left: calc(var(--cw) * -0.38); }
.hand.chinchon .card:first-child { margin-left: 0; }
.hand.chinchon .card.gap { margin-left: calc(var(--cw) * -0.18); }
.hand.chinchon.eight .card { margin-left: calc(var(--cw) * -0.45); }
.hand.chinchon.eight .card.gap { margin-left: calc(var(--cw) * -0.25); }
.hand.chinchon .card:first-child { margin-left: 0; }
.hand .card.meld::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 4px; border-radius: 2px; background: var(--mc); }
.card.m0 { --mc: #4cc3ff; } .card.m1 { --mc: #ff8a4c; } .card.m2 { --mc: #b47cff; } .card.m3 { --mc: #7cff9a; }
.card.cancut .card-svg { filter: drop-shadow(0 0 4px #7cff9a); }
.card.fresh .card-svg { filter: drop-shadow(0 0 5px #4cc3ff); }
.info { font-size: 13px; color: var(--muted); text-align: center; }
.row-bottom { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

.piles { display: flex; gap: 18px; align-items: flex-end; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pile.clickable .card { cursor: pointer; animation: glow 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px rgba(232,184,48,.8); } }
.pile .count { font-size: 12px; color: var(--muted); }
.tablecards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 100%; }
.tablecards .card.selected { transform: translateY(-8px) !important; }
.empty-table { padding: 20px; }
.deckinfo { font-size: 12px; }

.log { position: fixed; right: 6px; top: 48px; z-index: 15; font-size: 12px; max-width: min(260px, 70vw); text-align: right; }
.log[open] { text-align: left; }
.log summary { list-style: none; cursor: pointer; background: rgba(0,0,0,.3); padding: 4px 9px; border-radius: 8px; display: inline-block; color: var(--muted); }
.log summary::-webkit-details-marker { display: none; }
.log[open] { background: rgba(0,0,0,.75); padding: 6px 8px; border-radius: 10px; }
.log[open] > div { padding: 2px 0; }
.log-hand { color: var(--gold); }
.log-team0, .log-team1 { color: #9fe0b0; }

/* ---------- paneles ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 16px; animation: fade .2s; }
.overlay.soft { background: rgba(0,0,0,.35); }
@keyframes fade { from { opacity: 0; } }
.panel { background: var(--panel); color: var(--panel-ink); border-radius: 18px; padding: 18px; width: min(520px, 100%); max-height: 90dvh; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.panel h3 { font-size: 20px; }
.panel .muted { color: #6f6a5f; }
.panel.over { text-align: center; align-items: stretch; }
.panel .big { font-family: Georgia, serif; font-size: 34px; font-weight: 800; }
.panel.won .big { color: #1f7a45; }
.panel.lost .big { color: #a8382f; }
.big2 { font-size: 20px; font-weight: 800; color: #6c3483; }
.panel .btn { background: #e9e0c9; }
.panel .btn.primary { background: var(--gold); }
.final { font-size: 18px; }
.res-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid #e6dcc4; padding: 6px 0; text-align: left; }
.res-name { font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.res-name .btag { background: #e8b830; color: #3a2a00; }
.res-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.meldgroup { display: inline-flex; gap: 1px; padding: 2px; border-radius: 4px; background: #e3f1ff; }
.meldgroup.attached { background: #e8f8e8; }
.meldgroup.loose { background: #ffe3e0; }
.res-pts { font-weight: 800; font-size: 18px; }
.res-scores { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 14px; }
.res-scores .out { text-decoration: line-through; opacity: .6; }
.restable { width: 100%; border-collapse: collapse; font-size: 15px; }
.restable th, .restable td { padding: 5px 6px; text-align: center; border-bottom: 1px solid #e6dcc4; }
.restable td:first-child { text-align: left; color: #6f6a5f; }
.restable tr.pts td { font-weight: 800; color: #1f7a45; }
.restable tr.tot td { font-weight: 800; }
.chatgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: opacity .3s; max-width: 90vw; text-align: center; }
.toast.hide { opacity: 0; }

/* ---------- pantallas chicas / apaisadas ---------- */
@media (max-width: 420px) {
  .scorebar { padding-right: 132px; }
  .score .snum { font-size: 19px; }
  .felt { padding: 2px 4px; }
  .badge { font-size: 12.5px; padding: 3px 9px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  :root { --cw: clamp(48px, 12vh, 80px); --cm: clamp(36px, 10vh, 60px); --cs: clamp(26px, 8vh, 44px); }
  .hand { padding-top: 6px; }
}
@media (min-width: 900px) {
  :root { --cw: 108px; --cm: 82px; --cs: 62px; --ct: 28px; }
}

.rules { background: rgba(0,0,0,.18); border-radius: 14px; padding: 12px 14px; }
.rules summary { cursor: pointer; font-weight: 650; }
.rules ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: #dfe8e1; font-size: 14px; line-height: 1.4; }

.bubble.fake { background: #ffe9a8; outline: 2px dashed #b8860b; }
.saybox { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.saybox input { width: 70px; font-size: 20px; font-weight: 800; text-align: center; border-radius: 10px; border: 0; padding: 8px; background: #fbf6ea; color: #222; }
.saybox .hint { font-size: 12px; color: var(--muted); width: 100%; text-align: center; }
.shoutgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shoutgrid .btn.fake { background: #ffe9a8; outline: 2px dashed #b8860b; }
.shoutgrid h4 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; color: #6f6a5f; }
.liar { background: rgba(192,70,59,.4); font-weight: 700; }

/* ---- avatares, palitos, paños ---- */
.badge .avatar { font-size: 16px; line-height: 1; }
.tally svg { display: block; }
.tally path { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.tally .empty rect { stroke: rgba(255,255,255,.12); stroke-width: 1.2; fill: none; stroke-dasharray: 2 2; }
.tally .split { stroke: var(--gold); stroke-width: 1.5; }
.score { grid-template-columns: 1fr auto; }
.score .stally { grid-column: 1 / -1; overflow: hidden; }
.score .stally svg { max-width: 100%; height: auto; min-height: 14px; }
.score .snum { font-size: 18px; }
.ssub2 { color: var(--muted); font-weight: 400; }
.chip .tally svg { height: 14px; width: auto; }
.prefs { display: flex; flex-direction: column; gap: 12px; background: rgba(0,0,0,.18); border-radius: 14px; padding: 12px 14px; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { font-size: 22px; width: 42px; height: 42px; border-radius: 10px; border: 2px solid transparent; background: rgba(255,255,255,.08); }
.avatars button.on { border-color: var(--gold); background: rgba(232,184,48,.2); }
.felts { display: flex; gap: 8px; flex-wrap: wrap; }
.felts button { width: 44px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.felts button.on { border-color: var(--gold); }
body[data-felt='azul'] { --felt-hi: #2a6aa3; --felt: #1b4a7a; --felt-dark: #0d2540; }
body[data-felt='bordo'] { --felt-hi: #8f2b3a; --felt: #6e1f2b; --felt-dark: #3a0d15; }
body[data-felt='madera'] { --felt-hi: #a06a3c; --felt: #7a4e2a; --felt-dark: #3d2512; --grain: repeating-linear-gradient(95deg, rgba(0,0,0,.06) 0 3px, transparent 3px 11px); --rail-hi: #5a3a20; --rail: #3d2512; --rail-dark: #22140a; }
body[data-felt='noche'] { --felt-hi: #34345a; --felt: #23233a; --felt-dark: #0d0d18; --rail-hi: #4a4a5e; --rail: #2c2c3a; --rail-dark: #15151d; }

.daily-box { background: linear-gradient(135deg, rgba(232,184,48,.22), rgba(0,0,0,.2)); border: 1px solid rgba(232,184,48,.35); border-radius: 16px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.daily-box h3 { font-size: 19px; }
.daily-box p { margin: 0; }
.ranking { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.ranking li { padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.15); }
.ranking li span:first-child { display: inline-block; min-width: 50%; }
.ranking li b { margin: 0 8px; }
.ranking li.me { outline: 2px solid var(--gold); }
.panel .ranking li { background: #efe6cf; }

/* ---------- ambiente: la mesa como lugar ---------- */
.props { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.props-left, .props-right { position: absolute; bottom: 6px; display: flex; align-items: flex-end; gap: 4px; }
.props-left { left: 10px; }
.props-right { right: 10px; }
.prop { pointer-events: auto; background: none; border: 0; padding: 0; line-height: 0; cursor: pointer; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); transform-origin: 50% 100%; transition: transform .15s; }
.prop:hover { transform: translateY(-2px); }
.prop:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.prop svg { display: block; width: 100%; height: auto; overflow: visible; }
.prop.mate { width: 42px; position: relative; }
.prop.termo { width: 24px; }
.prop.perro { width: 92px; margin-left: 6px; }
.prop.radio { width: 84px; position: relative; }
/* mate: sorbo y vapor */
.prop.mate.sip { animation: sip 1.2s ease-in-out; }
@keyframes sip { 20% { transform: translateY(-10px) rotate(-14deg); } 70% { transform: translateY(-10px) rotate(-14deg); } }
.prop.mate.steam::before, .prop.mate.steam::after { content: ''; position: absolute; left: 40%; top: 6px; width: 8px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(3px); animation: steam 1.6s ease-out forwards; }
.prop.mate.steam::after { left: 58%; animation-delay: .3s; }
@keyframes steam { from { transform: translateY(0) scale(.6); opacity: 0; } 30% { opacity: .9; } to { transform: translateY(-34px) scale(1.4); opacity: 0; } }
/* termo: se inclina para cebar */
.prop.termo.pour { animation: pour 1.1s ease-in-out; transform-origin: 50% 80%; }
@keyframes pour { 25%, 70% { transform: translate(10px, -14px) rotate(62deg); } }
/* radio: lucecita, aguja y notas */
.prop.radio .luz { transition: fill .2s; }
.prop.radio.on .luz { fill: #ffb347; filter: drop-shadow(0 0 3px #ffb347); }
.prop.radio.on .aguja { animation: dial 3s ease-in-out infinite alternate; transform-box: fill-box; }
@keyframes dial { to { transform: translateX(10px); } }
.prop.radio.on::after { content: '♪'; position: absolute; left: 20px; top: -6px; color: var(--ink); font-size: 18px; line-height: 1; animation: note 1.8s linear infinite; }
@keyframes note { from { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } to { transform: translate(-14px, -30px) rotate(-20deg); opacity: 0; } }
.prop.nope { animation: nope .4s; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* perro: duerme (respira) y se despierta al tocarlo */
.prop.perro .cuerpo { animation: breathe 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scaleY(1.06); } }
.prop.perro .ojo-abierto { display: none; }
.prop.perro.awake .ojo-abierto { display: inline; }
.prop.perro.awake .ojo-dormido { display: none; }
.prop.perro.awake .cabeza { animation: perk 2.2s ease-out; transform-box: fill-box; transform-origin: 80% 90%; }
@keyframes perk { 10%, 80% { transform: translateY(-8px) rotate(8deg); } }
.prop.perro .cola { transform-box: fill-box; transform-origin: 0% 100%; }
.prop.perro.awake .cola { animation: wag .22s ease-in-out 9 alternate; }
@keyframes wag { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
/* los objetos saltan con los golpes en la mesa */
.prop.hop { animation: hop .6s ease-out; }
.fx-temblor .prop.hop { animation: hop .25s ease-in-out 5; }
@keyframes hop { 30% { transform: translateY(-9px) rotate(-4deg); } 60% { transform: translateY(0) rotate(2deg); } }

/* golpes en la mesa: truco (sacudón), retruco (puñetazo), vale cuatro (tiembla todo) */
#app.fx-jolt { animation: jolt .35s ease-out; }
@keyframes jolt { 30% { transform: translateY(3px); } }
#app.fx-golpe { animation: golpe .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes golpe { 15% { transform: translateY(7px) scale(.995); } 35% { transform: translateY(-3px); } 55% { transform: translateY(2px); } }
#app.fx-temblor { animation: temblor 1.2s linear; }
@keyframes temblor {
  0%, 100% { transform: none; }
  10% { transform: translate(-6px, 3px) rotate(-.6deg); } 20% { transform: translate(5px, -4px) rotate(.5deg); }
  30% { transform: translate(-7px, -2px) rotate(-.4deg); } 40% { transform: translate(6px, 4px) rotate(.6deg); }
  50% { transform: translate(-4px, 3px) rotate(-.3deg); } 60% { transform: translate(4px, -3px) rotate(.3deg); }
  70% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -2px); } 90% { transform: translate(-1px, 1px); }
}
#app.fx-temblor .felt { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 999px rgba(255,220,120,.18), var(--felt-shadow); } 100% { box-shadow: var(--felt-shadow); } }

/* en el celu: objetos más chicos y sin el perro */
@media (max-width: 759px) {
  .props-left { left: 4px; bottom: 4px; gap: 2px; }
  .props-right { right: 4px; bottom: 4px; }
  .prop.mate { width: 26px; }
  .prop.termo { width: 14px; }
  .prop.perro { display: none; }
  .prop.radio { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  /* con «Animaciones: siempre» (data-motion='full') se anima igual */
  body:not([data-motion='full']) .card.enter, body:not([data-motion='full']) .card.enter .card-svg, body:not([data-motion='full']) .prop, body:not([data-motion='full']) .prop *, body:not([data-motion='full']) #app[class*='fx-'] { animation: none !important; }
}
.decks { display: flex; gap: 8px; flex-wrap: wrap; }
.decks button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; border: 2px solid transparent; background: rgba(255,255,255,.08); color: var(--ink); }
.decks button.on { border-color: var(--gold); background: rgba(232,184,48,.2); }
.decks small { font-size: 11px; }
.deck-prev { display: flex; }
.deck-prev svg { width: 30px; height: 45px; }
.deck-prev svg + svg { margin-left: -10px; transform: rotate(8deg); }

/* ---------- la mesa: paño con borde de madera en un bar ---------- */
body[data-screen='table'] {
  background: var(--noise), radial-gradient(90% 70% at 50% 42%, #3b2a1d 0%, #20160e 62%, #0f0a06 100%);
  background-attachment: fixed;
}
.table .felt {
  position: relative;
  margin: 2px 12px 6px;
  padding: 8px 10px;
  border: 12px solid transparent;
  border-radius: 58px;
  background:
    var(--noise) padding-box,
    var(--grain) padding-box,
    radial-gradient(130% 100% at 50% 35%, var(--felt-hi) 0%, var(--felt) 50%, var(--felt-dark) 100%) padding-box,
    repeating-linear-gradient(93deg, rgba(0,0,0,.12) 0 2px, transparent 2px 7px, rgba(255,255,255,.05) 7px 8px, transparent 8px 14px) border-box,
    linear-gradient(180deg, var(--rail-hi), var(--rail) 40%, var(--rail-dark)) border-box;
  box-shadow: var(--felt-shadow);
}
.table .scorebar { padding-top: 10px; }
@media (max-width: 759px) {
  .table .felt { margin: 2px 4px 4px; padding: 6px 4px 28px; border-width: 8px; border-radius: 34px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .table .felt { border-width: 7px; border-radius: 28px; margin-bottom: 2px; }
}

/* ---------- lugares (places.js): lo que se ve alrededor de la mesa ---------- */
/* Todo dibujado con CSS y SVG en línea: 0 KB de imágenes. Si un lugar tiene ilustración
   (places.js → art), va en .place-art, detrás de todo y solo en la mesa. */
.place-art { position: fixed; inset: 0; z-index: -1; display: none; background: center / cover no-repeat; opacity: .85; pointer-events: none; }
body[data-screen='table'] .place-art { display: block; }
body[data-screen='table'][data-place='bodegon'] {
  background: var(--noise), radial-gradient(40% 30% at 50% 0%, rgba(255,205,120,.35), transparent 70%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='90'><line x1='80' y1='0' x2='80' y2='30' stroke='%23222' stroke-width='2'/><path d='M50 56 Q50 30 80 28 Q110 30 110 56Z' fill='%23b8862b'/><ellipse cx='80' cy='57' rx='30' ry='5' fill='%23ffd88a'/></svg>") 50% 0 / 160px 90px no-repeat, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='70'><rect y='60' width='120' height='6' fill='%232a1a10'/> <g fill='%231c2a1c' opacity='.9'><path d='M10 60 V30 Q10 24 14 22 V8 H18 V22 Q22 24 22 30 V60Z'/><path d='M34 60 V36 Q34 30 38 28 V16 H41 V28 Q45 30 45 36 V60Z' fill='%233a1420'/> <path d='M58 60 V28 Q58 22 62 20 V6 H66 V20 Q70 22 70 28 V60Z'/><rect x='80' y='40' width='14' height='20' rx='2' fill='%235a3a1a'/><path d='M100 60 V34 Q100 28 104 26 V14 H107 V26 Q111 28 111 34 V60Z' fill='%233a1420'/></g></svg>") 0 0 / 120px 70px repeat-x,
    linear-gradient(180deg, transparent 0 62%, #2a170f 62% 64%, #4a2a18 64% 100%), linear-gradient(180deg, #5c3a22 0%, #3e2416 62%);
  background-attachment: fixed;
}
body[data-screen='table'][data-place='pulperia'] {
  background: var(--noise), radial-gradient(60% 50% at 85% 20%, rgba(255,190,90,.22), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 2px, transparent 2px 46px), repeating-linear-gradient(90deg, #3a2414 0 23px, #43291a 23px 46px);
  background-attachment: fixed;
}
body[data-screen='table'][data-place='club'] {
  background: var(--noise), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='46'><path d='M0 6 Q40 22 80 6 Q120 22 160 6' stroke='%232b2b2b' stroke-width='1.5' fill='none'/> <path d='M8 9 L22 13 L13 34Z' fill='%23d6463b'/><path d='M30 13 L46 14 L36 37Z' fill='%23f5c518'/><path d='M54 13 L70 9 L63 33Z' fill='%232f6fae'/> <path d='M88 9 L104 13 L94 34Z' fill='%232e9d58'/><path d='M112 13 L128 14 L118 37Z' fill='%23fffaf0'/><path d='M136 13 L152 9 L145 33Z' fill='%23d6463b'/></svg>") 0 4px / 160px 46px repeat-x, linear-gradient(180deg, #e9dfc4 0 46%, #1f5a3a 46% 48%, #2e7a50 48% 100%);
  background-attachment: fixed;
}
body[data-screen='table'][data-place='playa'] {
  background: var(--noise), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='220'><path d='M100 40 L100 220' stroke='%235a4632' stroke-width='5'/> <path d='M10 70 Q100 -20 190 70Z' fill='%23e04a3a'/><path d='M40 70 Q60 18 100 12 Q140 18 160 70 Z' fill='%23fffaf0'/><path d='M70 70 Q80 22 100 12 Q120 22 130 70 Z' fill='%23e04a3a'/></svg>") right -40px top 10px / 200px 220px no-repeat, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='80'><g fill='%23fff' opacity='.75'><ellipse cx='60' cy='40' rx='40' ry='12'/><ellipse cx='84' cy='32' rx='24' ry='12'/><ellipse cx='230' cy='22' rx='34' ry='9'/><ellipse cx='250' cy='16' rx='18' ry='8'/></g></svg>") 0 12px / 300px 80px repeat-x,
    linear-gradient(180deg, #8fc4e8 0%, #cfe6f2 32%, #6f9cb0 32%, #4d7f96 44%, #e9f1f0 44.5%, #e7d6ad 46%, #d8c08c 100%);
  background-attachment: fixed;
}
body[data-screen='table'][data-place='quincho'] {
  background: var(--noise), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='40'><path d='M0 4 Q35 20 70 4 Q105 20 140 4' stroke='%23222' stroke-width='1.3' fill='none'/> <g fill='%23ffd88a'><circle cx='17' cy='14' r='4'/><circle cx='52' cy='14' r='4'/><circle cx='87' cy='14' r='4'/><circle cx='122' cy='14' r='4'/></g></svg>") 0 0 / 140px 40px repeat-x, radial-gradient(50% 40% at 0% 100%, rgba(255,120,40,.3), transparent 70%),
    repeating-linear-gradient(0deg, #4a1f14 0 3px, transparent 3px 26px), repeating-linear-gradient(90deg, #4a1f14 0 3px, transparent 3px 52px), linear-gradient(180deg, #9a4a2c, #6e3020);
  background-attachment: fixed;
}
body[data-screen='table'][data-place='litoral'] {
  background: var(--noise), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='90'><g fill='%232f6b2a'><path d='M0 0 Q30 50 10 90 Q-10 50 0 0Z' opacity='.9'/><path d='M40 0 Q90 30 70 70 Q40 40 40 0Z'/> <path d='M110 0 Q100 50 130 80 Q150 40 110 0Z' fill='%23397f30'/><path d='M150 0 Q190 20 180 60 Q150 30 150 0Z' fill='%23255a22'/></g> <g stroke='%231d4a1a' stroke-width='1.2' fill='none'><path d='M3 4 Q12 50 10 86'/><path d='M44 4 Q70 36 70 66'/><path d='M112 4 Q112 46 128 76'/></g></svg>") 0 0 / 180px 90px repeat-x, radial-gradient(60% 40% at 50% 10%, rgba(255,240,170,.25), transparent 70%),
    linear-gradient(180deg, #2c5a2a 0%, #3d6b33 30%, #b8643c 30.5%, #9a4f2e 100%);
  background-attachment: fixed;
}
/* lugares de fondo claro: franja oscura detrás de los puntos y sombra en los textos, si no no se leen */
body[data-screen='table']:is([data-place='club'], [data-place='playa']) .table > :not(.felt) { text-shadow: 0 1px 2px rgba(0,0,0,.8); }
body[data-screen='table']:is([data-place='club'], [data-place='playa']) .table .scorebar { background: linear-gradient(180deg, rgba(20,14,8,.7), rgba(20,14,8,.45)); border-radius: 0 0 16px 16px; }
body[data-screen='table']:is([data-place='club'], [data-place='playa']) .icon { background: rgba(20,14,8,.65); }
/* pulpería: con el farol prendido la mesa se entibia */
body.farol-on .table .felt { box-shadow: var(--felt-shadow), inset 0 0 90px rgba(255,190,90,.28); }

.places { display: flex; gap: 6px; flex-wrap: wrap; }
.places button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 6px 4px; border-radius: 10px; border: 2px solid transparent; background: rgba(255,255,255,.08); color: var(--ink); }
.places button.on { border-color: var(--gold); background: rgba(232,184,48,.2); }
.places .place-ico { font-size: 22px; line-height: 1; }
.places small { font-size: 11px; white-space: nowrap; }

/* objetos de los lugares */
.prop.sifon { width: 26px; }
.prop.vino { width: 52px; }
.prop.farol { width: 52px; }
.prop.trofeo { width: 40px; }
.prop.caracol { width: 46px; }
.prop.parrilla { width: 84px; }
.prop.terere { width: 56px; }
.prop.sifon.squirt { animation: squirt .9s ease-out; }
@keyframes squirt { 0%, 100% { transform: none; } 20% { transform: rotate(-14deg) translateY(-3px); } 60% { transform: rotate(-10deg); } }
.prop.sifon.squirt .burbujas { animation: rise .9s ease-out; }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-40px); opacity: 0; } }
.prop.vino.pour .vino-nivel, .prop.terere.pour .hielos { animation: slosh 1.1s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes slosh { 0%, 100% { transform: none; } 30% { transform: skewY(-4deg); } 60% { transform: skewY(3deg); } }
.prop.farol .llama { opacity: .35; transition: opacity .3s; transform-box: fill-box; transform-origin: 50% 100%; }
.prop.farol.on .llama { opacity: 1; animation: flicker 1.4s ease-in-out infinite alternate; }
.prop.farol.on .llama-luz { opacity: .9; }
.prop.farol.on { filter: drop-shadow(0 0 10px rgba(255,190,90,.8)) drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
@keyframes flicker { 0% { transform: scale(1, 1); } 50% { transform: scale(.92, 1.08); } 100% { transform: scale(1.05, .95); } }
.prop.trofeo.shine { animation: shine 1.4s ease-out; }
@keyframes shine { 0%, 100% { filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); transform: none; } 30% { filter: drop-shadow(0 0 12px #ffe27a); transform: translateY(-6px) rotate(-4deg); } 60% { transform: translateY(-3px) rotate(4deg); } }
.prop.caracol.listen { animation: listen 3.4s ease-in-out; }
@keyframes listen { 0%, 100% { transform: none; } 15%, 85% { transform: translateY(-14px) rotate(-18deg) scale(1.1); } }
.prop.parrilla .brasas { animation: embers 2.4s ease-in-out infinite alternate; }
@keyframes embers { from { opacity: .75; } to { opacity: 1; } }
.prop.parrilla.smoke .humo { animation: smoke 1.8s ease-out; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(-24px); } }
@media (max-width: 759px) {
  .prop.sifon { width: 16px; }
  .prop.vino { width: 32px; }
  .prop.farol { width: 26px; }
  .prop.trofeo { width: 26px; }
  .prop.caracol { width: 30px; }
  .prop.parrilla { width: 50px; }
  .prop.terere { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  /* con «Animaciones: siempre» (data-motion='full') se anima igual */
  body:not([data-motion='full']) .prop.farol.on .llama, body:not([data-motion='full']) .prop.parrilla .brasas { animation: none !important; }
}

/* ---------- portada: fileteado ---------- */
.brand h1 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.filete { width: clamp(42px, 13vw, 78px); flex: none; color: var(--gold); filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.filete svg { display: block; width: 100%; height: auto; }
.filete.r { transform: scaleX(-1); }
.filete .acc { color: #d6463b; }
.filete .acc2 { color: #74b9ea; }
.game-tile { transition: background .15s, border-color .15s, transform .1s; }
.game-tile:hover { border-color: rgba(232,184,48,.45); }
.game-tile::after { content: '›'; margin-left: auto; font-size: 26px; color: var(--gold); opacity: .55; padding-left: 6px; }
.game-tile:hover::after { opacity: 1; }
/* en el celu, los rivales de los costados: tarjetita con el nombre en dos renglones, no una píldora cortada */
@media (max-width: 759px) {
  .zone.pos-left .badge, .zone.pos-right .badge { border-radius: 14px; padding: 5px 6px; gap: 2px 4px; }
  .zone.pos-left .badge .bname, .zone.pos-right .badge .bname { white-space: normal; max-width: 9ch; text-align: center; line-height: 1.15; }
  /* chinchón de a 3-4: los 7-8 dorsos de los costados más encimados, así no se meten en el centro */
  .chinchon .zone.pos-left .backs .card.tiny + .card.tiny, .chinchon .zone.pos-right .backs .card.tiny + .card.tiny { margin-left: calc(var(--ct) * -0.66); }
}

/* ---------- señas (truco 2 contra 2) ---------- */
.senas { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 100%; }
.sena-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; line-height: 1.2; padding: 2px 7px 2px 4px; border-radius: 999px; background: rgba(255,255,255,.14); color: var(--ink); animation: chipIn .35s cubic-bezier(.2,.8,.3,1.4); cursor: help; }
.sena-chip.seen { box-shadow: inset 0 0 0 1.5px #ff8a7a; }
.senas.rival .sena-chip { background: rgba(192,70,59,.45); }
.sena-ico { font-size: 15px; line-height: 1; }
.sena-ico.big { font-size: 26px; }
@keyframes chipIn { from { transform: scale(.4); opacity: 0; } }
.btn.sena-open { background: rgba(0,0,0,.3); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.senagrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sena-btn { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; }
.sena-btn > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.sena-btn b { font-size: 14px; }
.sena-btn small { font-size: 12px; color: #6f6a5f; }
@media (max-width: 420px) {
  .senagrid { grid-template-columns: 1fr; }
  .sena-chip { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  /* con «Animaciones: siempre» (data-motion='full') se anima igual */
  body:not([data-motion='full']) .sena-chip { animation: none; }
}

/* ---------- ritmo y animaciones ---------- */
/* Lo que tiene data-k entra una sola vez (is-new) y en los redibujos siguientes queda
   quieto (seen): la mesa se rehace entera seguido y si no, todo titilaría. */
.overlay.seen, .overlay.seen > .panel { animation: none; }
.overlay.is-new > .panel { animation: panelIn .38s cubic-bezier(.2,.8,.3,1.15); }
@keyframes panelIn { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.final-ov.won.is-new > .panel { animation: popIn .7s cubic-bezier(.3,1.6,.5,1); }
.final-ov.won.is-new .big { animation: bigWin 1.1s ease-out .25s both; }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
@keyframes bigWin { 0% { transform: scale(.6) rotate(-6deg); opacity: 0; } 40% { transform: scale(1.18) rotate(2deg); opacity: 1; } 70% { transform: scale(.97); } 100% { transform: none; } }
.final-ov.lost.is-new { animation: fade .9s ease-out; }
.final-ov.lost.is-new > .panel { animation: sober 1s ease-out; }
@keyframes sober { from { transform: translateY(-14px); opacity: 0; filter: grayscale(.8); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 31; pointer-events: none; }

.note.is-new { animation: noteIn .45s cubic-bezier(.2,.8,.3,1.3); }
@keyframes noteIn { from { transform: translateY(-8px) scale(.9); opacity: 0; } }
.note.escoba.is-new { animation: escobaNote .9s cubic-bezier(.3,1.6,.5,1); }
@keyframes escobaNote { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 45% { transform: scale(1.25) rotate(3deg); opacity: 1; box-shadow: 0 0 0 8px rgba(232,184,48,.45), 0 0 30px rgba(232,184,48,.8); } 100% { transform: none; } }
.call.is-new { animation: callIn .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes callIn { 0% { transform: scale(1.9) rotate(-5deg); opacity: 0; } 55% { transform: scale(.95) rotate(1deg); opacity: 1; } 100% { transform: none; } }
.result.is-new { animation: popIn .6s cubic-bezier(.3,1.6,.5,1); }
.yourturn.is-new { animation: attention .8s ease-out, pulse 1.6s ease-in-out .8s infinite; }
@keyframes attention { 0% { transform: scale(.7); opacity: 0; } 35% { transform: scale(1.18); opacity: 1; background: rgba(232,184,48,.7); } 60% { transform: scale(.96); } 100% { transform: none; } }
.badge.turn.is-new { animation: ring 1s ease-out; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(232,184,48,.9), 0 0 0 2px var(--gold); } 70% { box-shadow: 0 0 0 14px rgba(232,184,48,0), 0 0 0 2px var(--gold); } 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(232,184,48,.6); } }
.sena-chip.seen { animation: none; }

/* truco: quién ganó cada baza */
.strip .card.won .card-svg { filter: drop-shadow(0 0 0 var(--gold)) drop-shadow(0 0 7px var(--gold)); }
.strip .card.won::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: -7px; height: 4px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.strip .card.lost { opacity: .5; }
.strip .card.won.is-new { animation: winPop .7s ease-out .45s backwards; }
@keyframes winPop { 0% { transform: none; } 40% { transform: translateY(-8px) scale(1.14); } 100% { transform: none; } }
.note.baza { font-weight: 700; }
.note.baza.good { background: rgba(46,157,88,.45); }
.note.baza.bad { background: rgba(192,70,59,.45); }
.note.baza.parda { background: rgba(255,255,255,.18); }
.bazas { display: flex; gap: 4px; justify-content: center; margin: 2px 0; }
.bz { display: block; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45); }
.bz.mine { background: var(--gold); box-shadow: none; }
.bz.theirs { background: var(--bad); box-shadow: none; }
.bz.parda { background: linear-gradient(90deg, var(--gold) 50%, var(--bad) 50%); box-shadow: none; opacity: .8; }
.bz.is-new { animation: popIn .5s cubic-bezier(.3,1.6,.5,1); }

/* cartel de los cantos y fantasmas de las cartas que se levantan */
.stamp {
  position: fixed; z-index: 35; pointer-events: none; max-width: min(92vw, 640px); text-align: center; line-height: 1.1;
  font-family: Georgia, 'Times New Roman', serif; font-weight: 800; font-size: clamp(26px, 7vw, 46px);
  color: #3a2a00; background: #fbf6ea; padding: 4px 18px; border-radius: 14px;
  border: 3px solid var(--gold); box-shadow: 0 8px 26px rgba(0,0,0,.5);
  transform: translate(-50%, -50%);
}
.stamp.strong { font-size: clamp(28px, 8vw, 60px); background: var(--gold); border-color: #fff4cf; }
.stamp.gold { background: var(--gold); border-color: #fff4cf; }
.stamp.red { background: #f3d6d1; color: #7a1f17; border-color: var(--bad); }
.card.ghost { position: fixed; z-index: 34; pointer-events: none; margin: 0 !important; }
.score .snum, .chip b { display: inline-block; }
.score .sbar i { transform-origin: 0 50%; }

/* transiciones entre pantallas y botones que se sienten */
.page.screen-in { animation: pageIn .32s ease-out; }
@keyframes pageIn { from { transform: translateY(10px); opacity: 0; } }
.table.screen-in { animation: tableIn .45s ease-out; }
@keyframes tableIn { from { transform: scale(.98); opacity: 0; } }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.96); }
.seg button { transition: background .15s, transform .08s; }
.seg button:active { transform: scale(.95); }
.icon { transition: transform .08s; }
.icon:active { transform: scale(.9); }
.avatars button:active, .felts button:active, .decks button:active, .places button:active { transform: scale(.94); }
.hand .card.playable { transition: transform .16s ease, filter .16s; }
@media (hover: hover) { .hand .card.playable:hover { transform: translateY(-10px); } }
.hand .card.playable:active { transform: translateY(-10px) scale(1.02); }
.hand .card.playable .card-svg { filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)) drop-shadow(0 0 3px rgba(232,184,48,.45)); }

@media (prefers-reduced-motion: reduce) {
  /* con «Animaciones: siempre» (data-motion='full') se anima igual */
  body:not([data-motion='full']) .overlay.is-new, body:not([data-motion='full']) .overlay.is-new > .panel, body:not([data-motion='full']) .final-ov .big, body:not([data-motion='full']) .note.is-new, body:not([data-motion='full']) .call.is-new, body:not([data-motion='full']) .result.is-new, body:not([data-motion='full']) .badge.turn.is-new, body:not([data-motion='full']) .strip .card.won.is-new, body:not([data-motion='full']) .bz.is-new, body:not([data-motion='full']) .page.screen-in, body:not([data-motion='full']) .table.screen-in, body:not([data-motion='full']) .bubble { animation: none !important; }
  body:not([data-motion='full']) .yourturn, body:not([data-motion='full']) .yourturn.is-new { animation: none !important; }
  body:not([data-motion='full']) .btn:active:not(:disabled), body:not([data-motion='full']) .seg button:active, body:not([data-motion='full']) .icon:active, body:not([data-motion='full']) .hand .card.playable:hover, body:not([data-motion='full']) .hand .card.playable:active { transform: none; }
}

/* truco 1 contra 1: cartas jugadas en el medio y lo que pasa al costado (no se pisan) */
.truco .felt.n2 {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: 'top top top' '. duel side' 'bottom bottom bottom';
}
.truco .felt.n2 .duel { grid-area: duel; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 0; }
.truco .felt.n2 .strip { min-height: calc(var(--cd) * 1.5); }
.truco .felt.n2 .strip .card.small { width: var(--cd); }
.truco .felt.n2 { --cd: min(var(--cm), 10dvh); }
/* compus de pantalla baja (laptops de 600-760 px de alto): cartas más chicas para que
   la mano, el paño y lo jugado entren sin pisarse */
@media (min-width: 600px) and (max-height: 760px) {
  :root { --cw: min(108px, 14dvh); --cs: min(62px, 8.5dvh); --ct: min(28px, 4dvh); }
  .truco .felt.n2 { --cd: min(var(--cm), 7.5dvh); }
  .truco .felt.n2 .zone.pos-top { flex-direction: row; justify-content: center; }
  .truco .felt.n4 { --cs: min(62px, 7dvh); }
  /* lo del centro, uno al lado del otro si entra (resultado + «Siguiente mano») */
  .truco .felt .center { flex-flow: row wrap; align-content: center; gap: 6px 10px; }
  .truco .felt.n2 .center { justify-content: flex-start; }
  .hand { padding-top: 8px; }
}
.truco .felt.n2 .center { grid-area: side; align-items: flex-start; text-align: left; padding-left: 12px; }
@media (max-width: 599px) {
  .truco .felt.n2 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: 'top' 'duel' 'side' 'bottom';
  }
  .truco .felt.n2 .center { align-items: center; text-align: center; padding-left: 0; justify-content: flex-start; }
  /* cuando la botonera crece (responder truco con envido a mano) el paño se achica: las
     cartas jugadas se achican con él para que el cartel del canto no pise mi insignia */
  .truco .felt.n2 { container-type: size; }
  .truco .felt.n2 .duel { --cd: min(var(--cm), 10dvh, 11cqh); gap: 6px; }
}
/* truco 2 contra 2: compañero y yo con las jugadas al costado del nombre (no debajo), así
   queda alto para el centro y las cartas no tapan lo que pasa */
@media (min-width: 600px) {
  .truco .felt.n4 .zone.pos-top, .truco .felt.n4 .zone.pos-bottom { display: grid; column-gap: 14px; row-gap: 4px; justify-content: center; align-items: center; align-content: center; }
  .truco .felt.n4 .zone.pos-top { grid-template-areas: 'badge strip' 'backs strip' 'senas strip'; align-content: start; }
  .truco .felt.n4 .zone.pos-bottom { grid-template-areas: 'strip badge' 'strip senas'; }
  .truco .felt.n4 .zone > .badge { grid-area: badge; }
  .truco .felt.n4 .zone > .backs { grid-area: backs; }
  .truco .felt.n4 .zone > .senas { grid-area: senas; }
  .truco .felt.n4 .zone > .strip { grid-area: strip; }
}

/* ---------- truco: cartas tapadas (orejear) ---------- */
/* mi mano apilada: la de arriba se arrastra y las de abajo asoman por el borde que queda libre */
.hand.pile { padding-bottom: 4px; }
.pile-stack { position: relative; width: var(--cw); aspect-ratio: 2 / 3; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pile-stack .card { position: absolute; left: calc(var(--d) * 2px); top: calc(var(--d) * -2px); }
.pile-stack .card.pile-top { cursor: grab; }
.pile-stack.dragging .card.pile-top { cursor: grabbing; }
.pile-stack.dragging .card { transition: none; }
.pile-stack .card.pile-top .card-svg { filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.hand .card.face-down { cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hand.tapadas .card.face-down:hover { transform: translateY(-4px); }
.hand .card.selected.face-down .card-svg { filter: drop-shadow(0 0 0 var(--gold)) drop-shadow(0 0 7px #d6463b); }
.blind-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; width: 100%; }
.unseen-note { white-space: nowrap; }
/* envido a ciegas: aviso de una línea arriba de los botones */
.env-warn { width: 100%; text-align: center; font-size: 12px; color: var(--gold); line-height: 1.2; }
.info .open-pile { padding: 0 0 0 8px; text-decoration: underline; color: var(--ink); font-size: 13px; }
.tap-hint { margin: 4px auto 0; max-width: 34em; font-size: 12px; line-height: 1.35; background: rgba(0,0,0,.28); border-radius: 10px; padding: 6px 10px; color: var(--ink); }
.tap-hint .link { padding: 0 0 0 4px; color: var(--gold); text-decoration: underline; }
/* dorsos del rival que juega tapado: las que ya miró, «orejeadas» (esquina doblada); las otras, quietas y opacas */
.backs.peeking .card.tiny + .card.tiny { margin-left: 3px; }
.backs.peeking { padding-bottom: 8px; }
.backs.peeking .card.bk-seen { transform: translateY(-4px) rotate(-6deg); }
.backs.peeking .card.bk-seen::before { content: ''; position: absolute; left: 0; top: 0; width: 42%; aspect-ratio: 1; border-radius: 9% 0 0 0; background: linear-gradient(135deg, rgba(255,255,255,.0) 49%, #f3ead6 51%); box-shadow: 1px 1px 2px rgba(0,0,0,.35); z-index: 1; }
.backs.peeking .card.bk-unseen { opacity: .6; }
.backs.peeking .card.bk-unseen::after { content: '🙈'; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 11px; line-height: 1; }
/* carta tirada sin mirar */
.strip .card.blindplay::before { content: '🙈'; position: absolute; right: -5px; top: -6px; font-size: 13px; line-height: 1; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }

/* ---------- truco: «apuntar» una carta (estilo Hearthstone) ---------- */
/* la mía bajo el mouse o el dedo, y el dorso que ven los demás, se levantan y brillan */
.hand .card.aiming:not(.in-pile) { transform: translateY(-10px); }
.hand .card.aiming .card-svg, .backs .card.aimed .card-svg { filter: drop-shadow(0 0 0 #ffe27a) drop-shadow(0 0 7px #ffe27a); }
.backs .card { transition: transform .18s ease; }
.backs .card.aimed, .backs.peeking .card.aimed { transform: translateY(-7px) scale(1.12); z-index: 2; }
@media (prefers-reduced-motion: reduce) {
  body:not([data-motion='full']) .hand .card.aiming:not(.in-pile), body:not([data-motion='full']) .backs .card.aimed, body:not([data-motion='full']) .backs.peeking .card.aimed { transform: none; }
  body:not([data-motion='full']) .hand .card.aiming, body:not([data-motion='full']) .backs .card.aimed { outline: 2px solid #ffe27a; outline-offset: 1px; }
}

/* ---------- texto para buscadores (lo pone el Worker), debajo del juego ---------- */
.seo { max-width: 560px; margin: 0 auto; padding: 8px 16px 48px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.seo:empty, body[data-screen='table'] .seo { display: none; }
.seo h2 { font-size: 18px; color: var(--ink); margin: 24px 0 8px; }
.seo h3 { font-size: 15px; color: var(--ink); margin: 20px 0 6px; }
.seo h4 { font-size: 14px; color: var(--ink); margin: 12px 0 2px; }
.seo p { margin: 0 0 8px; }
.seo ul { padding-left: 18px; margin: 0; }
.seo li { margin-bottom: 6px; }
.seo-links { margin-top: 20px; text-align: center; }
.seo a { color: var(--gold); }
.brand h1.long { font-size: clamp(26px, 7.2vw, 38px); gap: 8px; }
.brand h1.long .filete { width: clamp(30px, 9vw, 60px); }
