:root {
  --gold: #f5c518;
  --ink: #1b1c17;
  --panel: #24261f;
  --line: rgba(255, 255, 255, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: #fff;
  background: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Fondo de la mesa: malecón al atardecer */
/* Desenfocado como el fondo de una foto con la mesa en primer plano; se agranda un poco para tapar los bordes borrosos */
.sky { position: fixed; inset: -24px; z-index: -1; background: #1b1410 center / cover no-repeat; filter: blur(5px) saturate(1.08); }
.sky.sharp { inset: 0; filter: saturate(1.08); } /* Ajustes: sin fondo desenfocado */

.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; }

/* Inicio y sala de espera: interfaz oscura */
#shell, #lobby {
  background:
    radial-gradient(40% 50% at 85% 10%, rgba(255, 255, 255, .04), transparent),
    radial-gradient(40% 50% at 10% 90%, rgba(255, 255, 255, .04), transparent),
    var(--ink);
}
.card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  display: grid; gap: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
  user-select: text;
}
.logo { margin: 0; font-size: 34px; display: flex; align-items: center; gap: 12px; justify-content: center; letter-spacing: .5px; }
.logo-tile { display: inline-flex; width: 46px; height: 24px; background: #f6f1e4; border-radius: 5px; transform: rotate(-12deg); box-shadow: 0 3px 0 #b9b19c; }
.logo-tile i { flex: 1; position: relative; }
.logo-tile i + i { border-left: 2px solid #bbb; }
.logo-tile i::after { content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: #1c1c1c; }
.sub { margin: -6px 0 4px; text-align: center; opacity: .7; }
.field { display: grid; gap: 6px; font-size: 13px; }
.field > span { opacity: .75; }
.field input:not([type=checkbox]), .join input {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px; font-size: 16px; outline: none; min-width: 0;
}
.field input:focus, .join input:focus { border-color: var(--gold); }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 6px; font-weight: 600; font-size: 15px;
}
.seg button small { display: block; font-weight: 400; font-size: 11px; opacity: .7; margin-top: 2px; }
.seg button.on { background: var(--gold); color: #1b1b1b; border-color: var(--gold); }
.row2 { display: grid; gap: 12px; }
.row2 .seg button { padding: 9px 2px; }
.check { grid-template-columns: auto 1fr; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.check small { display: block; opacity: .7; font-size: 11px; }
.btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  border-radius: 8px; padding: 12px 16px; font-weight: 700; font-size: 16px;
}
.btn:hover { background: rgba(255, 255, 255, .13); }
.btn.primary { background: var(--gold); color: #1b1b1b; border-color: var(--gold); box-shadow: 0 4px 0 #b08c06; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { font-size: 24px; font-weight: 900; letter-spacing: 1px; padding: 12px 16px 10px; }
.btn.big small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: .65; }
.btn.ghost { background: none; border-color: transparent; opacity: .8; font-weight: 500; }
.btn.small { font-size: 13px; padding: 8px 12px; justify-self: center; }
.join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join input { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-weight: 700; }
.err { color: #ff9c8a; min-height: 18px; margin: 0; text-align: center; font-size: 14px; }
.hint { margin: 0; font-size: 12.5px; opacity: .7; text-align: center; }
.cfg { margin: 0; text-align: center; font-size: 14px; }

/* Mesa */
#game { padding: 0; display: block; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.topbar { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 5; }
.pill {
  background: rgba(40, 30, 34, .6); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; backdrop-filter: blur(6px);
}
.pill.static { cursor: default; letter-spacing: 2px; font-weight: 700; }
.scoremini {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; text-align: center;
  background: #f4f1dc; color: #1e4a5c; border: 2px solid #2c7d86; border-radius: 4px; padding: 4px 12px 2px;
  font-family: "Segoe Print", "Comic Sans MS", cursive; box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.scoremini span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #9bb5ae; }
.scoremini b { font-size: 20px; line-height: 1.25; }

#bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.bubble, #toast div {
  background: #14261d; color: #fff; border: 2px solid #9ad17c; border-radius: 8px;
  font-family: "Segoe Print", "Comic Sans MS", cursive; white-space: nowrap;
  animation: pop 2s forwards;
}
.bubble { position: absolute; transform: translate(-50%, -50%); padding: 3px 12px; font-size: clamp(15px, 2vw, 22px); }
#toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; }
#toast div { padding: 10px 22px; border-width: 3px; font-size: clamp(22px, 3.2vw, 38px); }
@keyframes pop { 0% { opacity: 0; scale: .6; } 12%, 80% { opacity: 1; scale: 1; } 100% { opacity: 0; } }
#turnHint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4; pointer-events: none;
  background: rgba(20, 30, 36, .7); border: 1px solid #3fa9f5; border-radius: 999px; padding: 4px 16px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}

.tip {
  position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 4; pointer-events: none;
  width: min(560px, 86vw); text-align: center; font-size: clamp(14px, 1.7vw, 19px); text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
  animation: pop 5.2s forwards;
}
.tip small { display: block; color: var(--gold); font-size: 11px; letter-spacing: 3px; font-weight: 700; margin-bottom: 4px; }

/* Libreta de puntos */
#sheet { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 12px; overflow: auto; }
#sheet.final { background: rgba(10, 12, 10, .55); backdrop-filter: blur(5px); }
.sheet-box { display: grid; gap: 10px; text-align: center; justify-items: center; }
#sheet.final .sheet-box {
  background: var(--panel); border: 2px solid var(--gold); border-radius: 10px; padding: 0 22px 18px; min-width: min(360px, 100%);
}
.sheet-box h2 { margin: 0; font-size: 20px; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
#sheet.final h2 {
  margin-top: -14px; padding: 5px 26px; border-radius: 4px; font-size: 15px; letter-spacing: 2px; text-transform: uppercase;
  background: #c0392b; text-shadow: none; box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
#sheet.final.won h2 { background: #2e9e5b; }
.sheet-box p { margin: 0; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); font-weight: 600; }
.pad {
  background: #f4f1dc; color: #1e4a5c; border: 2px solid #2c7d86; border-radius: 4px; padding: 8px 14px; width: min(290px, 92vw);
  font-family: "Segoe Print", "Comic Sans MS", cursive; box-shadow: 0 10px 24px rgba(0, 0, 0, .5);
}
/* La libreta cae sobre la mesa y los puntos de la mano se van escribiendo */
.pad.enter { animation: padIn .6s cubic-bezier(.2, 1.25, .4, 1) both; }
@keyframes padIn { from { transform: translate(55vw, -55vh) rotate(16deg) scale(.6); opacity: 0; } }
.sheet-box.leave { animation: padOut .45s ease-in both; }
@keyframes padOut { to { transform: translate(55vw, -55vh) rotate(16deg) scale(.6); opacity: 0; } }
.pad .fresh { animation: write .4s ease-out both; transform-origin: right center; }
@keyframes write { from { opacity: 0; transform: scale(1.9) rotate(-7deg); filter: blur(2px); } }
.pad-head, .pad-body, .pad-total { display: grid; grid-template-columns: 1fr 1fr; }
.pad-head { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #1e4a5c; padding-bottom: 2px; }
.pad-body { min-height: 110px; max-height: 250px; overflow: auto; }
.pad-body > div + div { border-left: 2px solid #1e4a5c; }
.pad-body .e { display: flex; justify-content: space-between; align-items: baseline; padding: 0 10px; font-size: 22px; line-height: 1.25; }
.pad-body .e small { font-size: 9px; color: #c0392b; text-transform: uppercase; }
.pad-total { border-top: 2px solid #1e4a5c; font-size: 26px; }
.pad-total b.win { color: #c0392b; text-decoration: underline wavy #c0392b 2px; }
.pad-foot { font-size: 14px; }
.sheet-actions { display: flex; gap: 8px; justify-content: center; }
#endBar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; gap: 10px; }
#endBar .btn { box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
.sheet-actions .btn { backdrop-filter: blur(6px); }
.sheet-actions .btn.ghost { background: rgba(20, 30, 36, .6); opacity: 1; }

/* Botones redondos y avisos */
.round {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(30, 32, 26, .75);
  font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0; flex: none;
}
.round:hover { background: rgba(60, 62, 52, .9); }
#note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: grid; gap: 6px; pointer-events: none; }
#note div { background: #2c2e26; border: 1px solid var(--gold); border-radius: 8px; padding: 9px 16px; font-size: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }

/* Acceso */
#auth .card { width: min(560px, 100%); background: rgba(24, 26, 21, .88); backdrop-filter: blur(10px); }
.provgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 2px; }
.provgrid { grid-auto-rows: max-content; }
.provgrid button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: rgba(255, 255, 255, .06); overflow: hidden; display: flex; flex-direction: column; }
.provgrid img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.provgrid span { font-size: 12px; padding: 4px 2px; font-weight: 600; }
.provgrid button.on { border-color: var(--gold); background: rgba(245, 197, 24, .18); }

/* Aplicación */
#shell { display: grid; grid-template-columns: 200px 1fr; padding: 0; place-items: stretch; overflow: hidden; }
.side { background: #20221c; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
.logo.small { font-size: 22px; justify-content: flex-start; }
.logo.small .logo-tile { width: 34px; height: 18px; }
.side nav, .side-foot { display: grid; gap: 4px; }
.side-foot { margin-top: auto; }
.side button { text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px; font-weight: 600; font-size: 14px; opacity: .8; }
.side button:hover, .side button.on { background: rgba(255, 255, 255, .08); opacity: 1; }
#shell main { position: relative; overflow: auto; padding: 16px 24px 110px; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; min-height: 40px; }
.top h2 { margin: 0 auto 0 0; font-size: 20px; }
.chip { border: 1px solid var(--line); background: #24261f; border-radius: 999px; padding: 6px 13px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip b { color: var(--gold); }
.chip.user .av { width: 26px; height: 26px; margin: -3px 0 -3px -7px; font-size: 15px; }
button.chip { color: inherit; font-family: inherit; cursor: pointer; }
#chipFace { display: contents; }
.chip.user b { color: #fff; }
#vHome { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.fhead { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 8px; }
.fimg { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; background: #333 center / cover; overflow: hidden; }
.fprev, .fnext { position: absolute; top: 50%; margin-top: -18px; }
.fprev { left: 12px; }
.fnext { right: 12px; }
.fcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); display: grid; }
.fcap b { font-size: 26px; }
.fcap small { opacity: .8; }
.rrow { border: 1px solid var(--line); border-left: 4px solid #c0392b; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12.5px; background: #22241d; }
.rrow.won { border-left-color: #2e9e5b; }
.rrow .rnames { grid-column: 1 / -1; font-weight: 600; }
.rrow .tag { border: 1px solid #7a6a22; color: #e5c95a; border-radius: 999px; padding: 1px 8px; font-size: 11px; justify-self: start; }
.rrow b { color: #ff7a6a; }
.rrow.won b { color: #5fd08c; }
.rrow small { opacity: .6; grid-column: 1 / -1; }
.jugar {
  position: fixed; left: calc(50% + 100px); bottom: 22px; transform: translateX(-50%); width: min(520px, calc(100% - 260px));
  background: linear-gradient(#ffd83a, #e9b400); color: #1b1b1b; border: 0; border-radius: 10px; padding: 10px 16px 8px;
  font-size: 26px; font-weight: 900; letter-spacing: 1px; box-shadow: 0 5px 0 #9c7a00, 0 14px 30px rgba(0, 0, 0, .5);
}
.jugar small { display: block; font-size: 10px; letter-spacing: 2px; opacity: .65; }
.jugar:hover { filter: brightness(1.06); }
.setsel { max-width: 520px; margin-bottom: 14px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.mode { border: 0; border-radius: 12px; padding: 26px 20px; text-align: left; display: grid; gap: 6px; min-height: 120px; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.mode b { font-size: 19px; letter-spacing: 1px; }
.mode span { font-size: 14px; opacity: .9; }
.mode.quick { background: linear-gradient(120deg, #f7c94b, #e9a920); color: #2a1d00; }
.mode.ranked { background: linear-gradient(120deg, #c93a36, #8f1f24); }
.mode.mesa { background: linear-gradient(120deg, #34507e, #1f3358); }
.mode:hover { filter: brightness(1.08); }
#vPlay .join { max-width: 420px; }

/* Pantalla Jugar estilo referencia: 2 columnas, iconos, tarjetas */
#vPlay { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px 26px; align-items: stretch; max-width: 1100px; margin: 0 auto; }
#vPlay #optSet { grid-column: 1; max-width: none; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#vPlay #optPlayers { grid-column: 1; max-width: none; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#vPlay #optPlayers button[data-v="2"] { grid-column: 1 / -1; }
#vPlay #optTarget { grid-column: 1; max-width: none; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#vPlay .modes { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 14px; margin: 0; align-self: stretch; }
#vPlay .mode { flex: 1; min-height: 0; border-radius: 14px; padding: 22px 20px; align-content: center; }
#vPlay .join { grid-column: 1 / -1; max-width: none; margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
#vPlay .join #btnWatch { grid-column: 1 / -1; }
#vPlay .setsel button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 12px; }
#vPlay .setsel button .pic { font-size: 30px; line-height: 1; flex: none; width: 44px; text-align: center; }
#vPlay .setsel button .tx { font-weight: 700; font-size: 16px; min-width: 0; }
#vPlay .setsel button small { display: block; font-weight: 400; font-size: 12px; opacity: .75; margin-top: 2px; }
#vPlay #optPlayers button:not([data-v="2"]) { flex-direction: column; justify-content: center; text-align: center; gap: 6px; }
#vPlay #optPlayers button:not([data-v="2"]) .tx { text-align: center; }
/* Fichas de dominó en miniatura: 6-6 y 9-9 */
#vPlay .dmtile { display: flex; flex-direction: column; background: #f7f4ea; border-radius: 8px; padding: 3px; width: 40px; flex: none; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
#vPlay .dmhalf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, 1fr); padding: 3px 2px; aspect-ratio: 1 / 1; }
#vPlay .dmhalf + .dmhalf { border-top: 2px solid #b9b19c; }
#vPlay .dmhalf i { width: 6px; height: 6px; border-radius: 50%; place-self: center; }
#vPlay .dmhalf i.p { background: #141414; }
@media (max-width: 760px) {
  #vPlay { grid-template-columns: 1fr; }
  #vPlay .modes { grid-column: 1; grid-row: auto; }
  #vPlay .join { grid-column: 1; }
  #vPlay #optSet { grid-template-columns: 1fr; }
  #vPlay #optPlayers { grid-template-columns: 1fr 1fr; }
  #vPlay #optTarget { grid-template-columns: 1fr; }
}
.krow { display: grid; grid-template-columns: 34px 44px 1fr auto auto 60px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.krow.me { background: rgba(245, 197, 24, .12); border-radius: 8px; }
.krow img { width: 44px; height: 30px; object-fit: cover; border-radius: 4px; }
.krow .pos { color: var(--gold); text-align: center; }
.krow small, .krow .kwl { opacity: .65; font-size: 12px; }
.krow .krat { text-align: right; font-size: 16px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.sitem { background: #24261f; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; justify-items: center; }
.shophead { margin: 18px 0 10px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.shophead:first-child { margin-top: 0; }
.sart { height: 68px; display: grid; place-items: center; font-size: 40px; }
.sart.skin { width: 96px; height: 48px; border-radius: 8px; display: flex; box-shadow: 0 4px 0 rgba(0, 0, 0, .4); transform: rotate(-8deg); margin: 10px 0; }
.sart.skin i { flex: 1; position: relative; }
.sart.skin i + i { border-left: 2px solid currentColor; }
.sart.skin i::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
/* Vasito visto de lado: el líquido asoma por arriba */
.sart.drink::before {
  content: ""; width: 46px; height: 58px; background: linear-gradient(var(--liquid) 0 14px, #f7f4ee 14px);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%); border-radius: 4px;
}
.sitem .btn { width: 100%; font-size: 13px; padding: 9px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Sala de la mesa */
.lobby { width: min(560px, 100%); display: grid; gap: 16px; }
.ring { display: grid; grid-template: ". t ." auto "l m r" auto ". d ." auto / 1fr 1.3fr 1fr; gap: 10px; align-items: center; justify-items: center; }
.rtable { grid-area: m; width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; background: #333 center / cover; box-shadow: 0 0 0 4px #1f5d86, 0 10px 24px rgba(0, 0, 0, .5); }
.rseat { background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 4px; }
.rseat.p0 { grid-area: d; }
.rseat.p1 { grid-area: r; }
.rseat.p2 { grid-area: t; }
.rseat.p3 { grid-area: l; }
.rseat img, .rseat .plus { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); display: grid; place-items: center; font-size: 26px; }
.rseat.them img, .rseat.them .plus { border-color: #3fb0a8; }
.rseat .plus { border-style: dashed; opacity: .7; }
.rseat.taken { cursor: default; }
.rseat small { opacity: .65; font-size: 11px; }
.lobby-actions { display: grid; gap: 12px; justify-items: center; }
.lobby .jugar { position: static; transform: none; width: 100%; font-size: 20px; padding: 14px; }

/* Diálogos */
.dlg { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 14px; }
.dlg-box { width: min(560px, 100%); max-height: 90vh; background: #1f211b; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.dlg-box header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#dlgBody { overflow: auto; padding: 14px 16px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.opt small { grid-column: 1 / -1; opacity: .6; font-size: 12px; }
.opt .seg button { padding: 6px 10px; font-size: 13px; flex: none; }
.opt .check { grid-column: 1 / -1; display: flex; gap: 8px; font-size: 14px; }

/* Emoticones en la mesa */
.emotes { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: grid; justify-items: end; gap: 8px; }
#emoteList { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(30, 32, 26, .9); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
#emoteList button { background: rgba(255, 255, 255, .08); border: 0; border-radius: 6px; padding: 7px 10px; font-size: 13px; }
/* Aviso de turno elegante: pastilla oscura con borde dorado; en los últimos segundos, número grande en rojo */
#turnHint { border-color: var(--gold); background: rgba(16, 20, 24, .82); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); padding: 6px 20px; }
#turnHint.low { border-color: #ff4b3a; color: #ff6b5c; font-size: 26px; font-weight: 900; padding: 2px 22px; animation: beat .5s infinite alternate; }
@keyframes beat { to { transform: translateX(-50%) scale(1.12); } }
#voiceBar { position: absolute; left: calc(50% + 96px); bottom: 8px; z-index: 5; display: flex; gap: 6px; }
.round.alert { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 24, .35); }
.round.live { background: #2e9e5b; border-color: #5fd08c; }
.panel { width: min(300px, 80vw); background: rgba(30, 32, 26, .94); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; }
#histList { max-height: 220px; overflow: auto; margin-top: 6px; }
#histList p { margin: 2px 0; }
#histList p.passed { opacity: .55; }
#watchTag { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; }

/* Chat de la mesa */
.chat { display: grid; gap: 8px; user-select: text; }
.chatlog { height: 150px; overflow: auto; background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 8px; font-size: 13px; }
.chatlog p { margin: 0 0 4px; overflow-wrap: anywhere; }
.chatlog b { color: var(--gold); }
.chatform { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.chatform input { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; min-width: 0; outline: none; }
.chatform .btn { padding: 8px 12px; font-size: 13px; }
.lobby-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Amigos */
.friends { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.frow img { width: 44px; height: 30px; object-fit: cover; border-radius: 4px; grid-row: span 2; }
.frow small { opacity: .6; font-size: 12px; grid-column: 2; }
.frow small.on { color: #5fd08c; opacity: 1; }
.facts { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 4px; }
.facts .btn { padding: 6px 9px; font-size: 12px; }
#note { pointer-events: auto; }
#note div { display: flex; align-items: center; gap: 12px; }
#note .btn { padding: 5px 12px; font-size: 13px; }
#gbtn { justify-self: center; }

@media (max-width: 760px) {
  #shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; padding: 8px; gap: 8px; overflow: auto; }
  .side nav, .side-foot { display: flex; margin: 0; }
  .side button { white-space: nowrap; padding: 8px; }
  #vHome { grid-template-columns: 1fr; }
  .jugar { left: 50%; width: calc(100% - 32px); }
  .chip.user b { display: none; }
}

/* Reloj del turno: cápsula de cristal oscuro con filete dorado, esfera y barra */
#clock {
  --f: 1; --c1: #19c3a6; --c2: #f5c518;
  position: absolute; z-index: 4; pointer-events: none; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(38, 44, 50, .92), rgba(12, 15, 18, .94));
  border: 1px solid rgba(245, 197, 24, .75);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 0 3px rgba(0, 0, 0, .25);
  backdrop-filter: blur(4px);
}
#clock .dial {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c2) calc(var(--f) * 360deg), rgba(255, 255, 255, .1) 0);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c2) 55%, transparent);
}
#clock .dial b {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2c343b, #0c1013); color: #fff6d8;
  font: 800 15px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
#clock .track {
  position: relative; width: clamp(84px, 13vw, 150px); height: 12px; border-radius: 999px; overflow: hidden;
  background: rgba(0, 0, 0, .55); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .12);
}
#clock .track i {
  position: absolute; inset: 0; width: calc(var(--f) * 100%); border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  box-shadow: 0 0 12px var(--c2);
}
#clock .track i::after { /* brillo de cristal por encima */
  content: ''; position: absolute; left: 4px; right: 4px; top: 2px; height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .55);
}
#clock .track span { /* destello que recorre la barra */
  position: absolute; top: 0; bottom: 0; width: 34px; left: -40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: clockShine 1.8s linear infinite;
}
@keyframes clockShine { to { left: 110%; } }
#clock.low { --c1: #ff7a1a; --c2: #ff2d2d; border-color: #ff4b3a; animation: clockBeat .5s ease-in-out infinite alternate; }
#clock.low .dial b { color: #ff8d80; font-size: 18px; }
@keyframes clockBeat { to { box-shadow: 0 8px 22px rgba(0, 0, 0, .55), 0 0 0 5px rgba(255, 60, 40, .35), 0 0 26px rgba(255, 60, 40, .7); } }

/* Acceso: enlaces y avisos */
.link { background: none; border: 0; color: var(--gold); font-size: 13.5px; text-decoration: underline; padding: 2px; justify-self: center; cursor: pointer; }
.info { color: #bfe6c8; margin: 0; text-align: center; font-size: 14px; line-height: 1.35; }
.info:empty, .err:empty { display: none; }
#auth .card { max-height: 100dvh; overflow: auto; }

/* Radio */
#radioPanel { position: absolute; left: 10px; top: 58px; z-index: 6; display: grid; gap: 8px; width: min(310px, 86vw); }
#radioList { display: grid; gap: 5px; }
.radio-st { text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 13.5px; }
.radio-st.on { background: #2e9e5b; border-color: #5fd08c; font-weight: 700; }
.radio-vol { display: flex; align-items: center; gap: 8px; font-size: 12.5px; opacity: .85; }
.radio-vol input { flex: 1; }

@media (max-width: 560px) { #btnLeave { padding: 8px 10px; font-size: 12px; } .scoremini { transform: scale(.82); transform-origin: top right; } }

@media (max-width: 620px) { #voiceBar { left: 10px; } }
@media (max-height: 480px) { #clock { transform: translate(-50%, -50%) scale(.8); } .emotes { transform: scale(.85); transform-origin: bottom right; } }

/* Entrar con Google y elegir nombre */
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.gmark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 14px/1 Arial, sans-serif; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.namebox { display: grid; gap: 10px; }
.namebox input { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 16px; outline: none; color: inherit; }
.namebox input:focus { border-color: var(--gold); }

/* Amigos: apartados */
.fsec { margin: 10px 0 0; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .65; }
.facts { flex-wrap: wrap; justify-content: flex-end; }

/* Voz: en cola y quién habla */
.round.wait { background: #a8741a; border-color: #f5c518; animation: waitPulse 1s ease-in-out infinite alternate; }
@keyframes waitPulse { to { box-shadow: 0 0 0 4px rgba(245, 197, 24, .35); } }
#voiceWho { font-size: 12px; padding: 6px 10px; white-space: nowrap; align-self: center; }

/* Menú de regalos */
#giftMenu { position: fixed; z-index: 8; display: grid; gap: 8px; width: auto; text-align: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .6); border-color: var(--gold); }
.giftgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gift { display: grid; justify-items: center; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); cursor: pointer; }
.gift:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.gift:disabled { opacity: .35; cursor: default; }
.gift .gi { font-size: 26px; line-height: 1; }
.gift small { font-size: 11px; opacity: .8; }

/* Ranking por ligas */
#rankList { max-width: 760px; }
.rktabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); margin: 0 auto 14px; }
#vRank { text-align: center; }
#vRank > #rankList { text-align: left; margin: 0 auto; }
.rktabs button { border: 0; background: none; color: inherit; opacity: .6; font-weight: 700; font-size: 14px; padding: 8px 20px; border-radius: 999px; cursor: pointer; }
.rktabs button.on { opacity: 1; background: rgba(255, 255, 255, .1); }
.rkhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rktitle { font-weight: 800; letter-spacing: 2px; font-size: 13px; opacity: .8; }
.rkhead small { opacity: .6; font-size: 12.5px; }
.rkfind { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; font-size: 16px; color: inherit; outline: none; }
.rkfind:focus { border-color: var(--gold); }
.rkleague { display: flex; align-items: center; gap: 14px; margin: 26px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rkleague b { font-size: 24px; }
.rkleague small { opacity: .5; font-size: 12px; margin-left: auto; }
/* Escudo de cada liga */
.rkbadge { width: 54px; height: 60px; display: grid; place-items: center; font-size: 24px; color: #fff; text-shadow: 0 2px 3px rgba(0, 0, 0, .5);
  clip-path: polygon(50% 0, 100% 16%, 100% 58%, 50% 100%, 0 58%, 0 16%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35); }
.rkbadge.maestro { background: linear-gradient(160deg, #ffd65a, #7b2cbf 55%, #3c096c); }
.rkbadge.diamante { background: linear-gradient(160deg, #e0fbff, #48cae4 45%, #0077b6); }
.rkbadge.platino { background: linear-gradient(160deg, #f1f5f9, #7f9cc0 50%, #1d3557); }
.rkbadge.oro { background: linear-gradient(160deg, #fff3b0, #f5c518 45%, #9c6b00); }
.rkbadge.plata { background: linear-gradient(160deg, #ffffff, #b8bec7 50%, #6b7280); }
.rkbadge.bronce { background: linear-gradient(160deg, #f6c9a0, #b87333 50%, #6b3f1d); }
.rkempty { font-style: italic; opacity: .5; margin: 14px 10px 4px; }
.rkcard { border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .045); }
.rkrow { display: grid; grid-template-columns: 52px auto 1fr auto; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rkrow:last-child { border-bottom: 0; }
.rkrow.me { background: rgba(245, 197, 24, .12); box-shadow: inset 4px 0 0 var(--gold); }
.rkpos { text-align: right; font-weight: 800; opacity: .5; }
.rkfaces { display: flex; }
.rkfaces img, .rkini { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #1c1e19; }
.rkfaces > * + * { margin-left: -12px; }
.rkini { display: grid; place-items: center; font-weight: 800; color: #fff; }
.rkini.c0 { background: #c1121f; } .rkini.c1 { background: #0077b6; } .rkini.c2 { background: #2e9e5b; } .rkini.c3 { background: #b5651d; } .rkini.c4 { background: #7b2cbf; }
.rkwho { display: grid; gap: 2px; min-width: 0; }
.rkwho b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rkwho small { font-size: 13px; }
.rkwho i { font-style: normal; font-weight: 700; }
.rkw { color: #5fd08c; } .rkl { color: #ff7a6a; } .rkfire { color: #ffb347; }
.rkpts { color: var(--gold); font-size: 18px; }
@media (max-width: 560px) { .rkrow { grid-template-columns: 34px auto 1fr auto; gap: 8px; padding: 10px; } .rkfaces img, .rkini { width: 36px; height: 36px; } .rkleague b { font-size: 20px; } }

/* Pollona en la libreta: la palabra en lugar del cero */
.pad-total b.pollona { color: #c0392b; font-size: .8em; letter-spacing: 1px; white-space: nowrap; overflow: visible; text-transform: uppercase; }

/* Logo: la imagen ya trae las fichas y el nombre */
.logo img { display: block; height: 76px; width: auto; max-width: 100%; margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.logo.small img { height: 44px; margin: 0; }
@media (max-width: 760px) { .logo.small img { height: 36px; } }
.logo.small { flex: none; }
.logo.small img { max-width: none; }

/* Tienda por pestañas */
.shoptabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.shoptabs button { flex: none; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 14px; color: inherit; cursor: pointer; }
.shoptabs button.on { background: rgba(245, 197, 24, .16); border-color: var(--gold); color: var(--gold); }
.shoppick { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.shoppick button { border: 0; background: none; color: inherit; opacity: .6; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.shoppick button.on { opacity: 1; background: rgba(255, 255, 255, .1); }
.shopintro { margin: 12px 0 0; opacity: .7; font-size: 13.5px; }
.shophead { display: flex; align-items: center; gap: 8px; }
.shopcount { background: rgba(245, 197, 24, .18); border-radius: 999px; padding: 1px 9px; font-size: 11px; }
.shopx .sitem { position: relative; padding: 14px; text-align: center; }
.shopx .sitem.inuse { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.sfav { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .45); color: #fff; font-size: 15px; cursor: pointer; }
.sfav.on { color: #ff5a6e; border-color: #ff5a6e; }
.sdesc { opacity: .65; font-size: 12px; line-height: 1.3; }
.sart.plate { width: 100%; height: auto; background: none; }
.sart.plate img { display: block; width: 100%; border-radius: 6px; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.sart.table { width: 100%; aspect-ratio: 16 / 10; border: 7px solid #000; border-radius: 12px; display: grid; place-items: center; font-size: 40px; box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
.sart.table.c32 { border-radius: 26px; }
.sart.table.c4 { border-radius: 4px; }
.sart.remate, .sart.emotes { font-size: 46px; line-height: 1; height: 64px; display: grid; place-items: center; }
.shop.t-table, .shop.t-plate { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shoptabs { scrollbar-width: none; }
.shoptabs::-webkit-scrollbar { display: none; }

/* El menú y la barra de arriba, en pantallas estrechas, se deslizan de lado sin barra a la vista */
#shell main { min-width: 0; }
@media (max-width: 760px) {
  .side, .top { overflow-x: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar, .top::-webkit-scrollbar { display: none; }
  .top > * { flex: none; }
  .top h2 { font-size: 17px; }
}

/* Vista previa de un remate (desde la tienda): solo la mesa y estos controles */
#previewBar { display: none; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 8; align-items: center; gap: 10px; background: rgba(20, 18, 14, .78); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; backdrop-filter: blur(6px); white-space: nowrap; }
#previewBar b { font-size: 14px; color: var(--gold); }
#game.preview #previewBar { display: flex; }
#game.preview > *:not(canvas):not(#previewBar):not(#flash) { display: none !important; }

/* Fogonazo al caer la ficha del remate */
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; mix-blend-mode: screen; }

/* Bandera cubana dibujada (el emoji no sale en Windows) */
.gi.flagcu {
  display: block; width: 42px; height: 28px; margin: 6px auto 2px; border-radius: 3px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(#0a3a8c 0 20%, #fff 20% 40%); box-shadow: 0 2px 5px rgba(0, 0, 0, .5);
}
.gi.flagcu::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-style: solid;
  border-width: 14px 0 14px 24px; border-color: transparent transparent transparent #cf142b;
}
.gi.flagcu::after { content: "★"; position: absolute; left: 2px; top: 5px; font-size: 10px; line-height: 1; color: #fff; }

/* ---------- Retratos (avatar de la tienda o foto de la provincia) ---------- */
.av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
span.av { display: inline-grid; place-items: center; background: #33362c; font-size: 24px; line-height: 1; }
.rseat .av { width: 62px; height: 62px; border: 3px solid var(--gold); font-size: 32px; }
.rseat.them .av { border-color: #3fb0a8; }
.rkfaces .av { border: 2px solid #1c1e19; }
.frow .av { width: 40px; height: 40px; font-size: 21px; grid-row: span 2; }
.frow img.av { border-radius: 50%; }
.rkrow.tap { cursor: pointer; }
.rkrow.tap:hover { background: rgba(255, 255, 255, .06); }
.sart.avatar, .sart.emote { font-size: 46px; line-height: 1; height: 64px; display: grid; place-items: center; }
/* Foto del artículo: ocupa el ancho de la tarjeta */
.sart.photo { width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; transform: none; border: 0; border-radius: 10px; overflow: hidden; background: #15110d; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }
.sart.photo::before { content: none; }
.sart.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shopx .shop { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- Ajustes ---------- */
.cfg, .prof, #vAchs { max-width: 760px; text-align: left; }
.cfghead { margin: 22px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.cfgsec:first-child .cfghead { margin-top: 0; }
.cfgcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cfgrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.cfgrow:last-child { border-bottom: 0; }
.cfgtext { display: grid; gap: 3px; min-width: 0; }
.cfgtext b { font-size: 14.5px; }
.cfgtext small { font-size: 12.5px; opacity: .65; line-height: 1.35; }
.switch { flex: none; width: 46px; height: 27px; border-radius: 999px; border: 0; padding: 0; background: rgba(255, 255, 255, .2); position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .15s; }
.switch.on { background: #2e9e5b; }
.switch.on::after { transform: translateX(19px); }
.cfgrange { flex: none; width: min(46%, 220px); accent-color: var(--gold); }
.cfgseg { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.cfgseg button { border: 0; background: none; opacity: .65; font-weight: 700; font-size: 13px; padding: 6px 11px; border-radius: 8px; }
.cfgseg button.on { opacity: 1; background: var(--gold); color: #1b1b1b; }
.cfgselect { flex: none; max-width: 50%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: inherit; font: inherit; }
.cfgselect option { color: #111; }
.cfgreset { margin-top: 18px; }
#fps { position: fixed; left: 12px; top: 62px; z-index: 5; font-size: 12px; pointer-events: none; }
@media (max-width: 560px) { .cfgrow:has(.cfgrange, .cfgseg, .cfgselect) { flex-wrap: wrap; } .cfgrange { width: 100%; } .cfgselect { max-width: 100%; } }

/* ---------- Perfil ---------- */
.profhead { display: flex; align-items: center; gap: 16px; }
.profhead .av { width: 84px; height: 84px; border: 3px solid var(--gold); font-size: 46px; }
.profwho { display: grid; gap: 4px; min-width: 0; }
.profname { font-size: 24px; overflow-wrap: anywhere; }
.profwho small { opacity: .65; font-size: 13px; }
.profchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.profdiv { margin: 16px 0 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(120deg, rgba(245, 197, 24, .18), rgba(245, 197, 24, .03)); display: grid; gap: 3px; }
.profdiv b { font-size: 18px; color: var(--gold); }
.profdiv small { opacity: .7; font-size: 13px; }
.profgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profstat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; display: grid; gap: 2px; }
.profstat b { font-size: 26px; color: var(--gold); }
.profstat small { font-size: 12px; opacity: .65; }
.prof .cfgrow > b { text-align: right; }
@media (max-width: 560px) { .profgrid { grid-template-columns: repeat(2, 1fr); } .profhead .av { width: 64px; height: 64px; font-size: 34px; } }

/* ---------- Logros ---------- */
.achlist { display: grid; gap: 8px; }
.ach { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ach.done { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.ach.claimed { opacity: .55; }
.achicon { font-size: 30px; line-height: 1; }
.achtext { display: grid; gap: 3px; min-width: 0; }
.achtext small { font-size: 12.5px; opacity: .7; }
.achbar { height: 6px; border-radius: 3px; background: rgba(128, 128, 128, .3); overflow: hidden; margin-top: 3px; }
.achbar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.achnum { font-variant-numeric: tabular-nums; }
.ach .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: #d63a2f; color: #fff; font-size: 11.5px; font-weight: 800; }

/* ---------- Menú de usuario y ventanas de texto ---------- */
.umenu { display: grid; gap: 6px; }
.umenu button { color: inherit; font: inherit; cursor: pointer; }
.umhead { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(128, 128, 128, .12); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 4px; }
.umhead div { display: grid; gap: 2px; }
.umhead b { font-size: 17px; }
.umhead small { opacity: .65; font-size: 12.5px; }
.umstate { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; }
.umstate i { width: 11px; height: 11px; border-radius: 50%; background: #2e9e5b; }
.umstate.busy i { background: #e0a020; }
.umstate.off i { background: #888; }
.umstate small { opacity: .6; font-size: 12px; }
.umstate.on { border-color: var(--gold); background: rgba(245, 197, 24, .12); }
.umlink { display: flex; align-items: center; justify-content: space-between; text-align: left; background: none; border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.umlink:hover, .umstate:hover { background: rgba(128, 128, 128, .14); }
.umenu .btn.ghost { margin-top: 6px; }
.namebox textarea { width: 100%; resize: vertical; background: rgba(128, 128, 128, .12); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: inherit; font: inherit; outline: none; user-select: text; }
.namebox textarea:focus { border-color: var(--gold); }
.textlist { display: grid; gap: 14px; }
.textlist p { margin: 0; font-size: 14px; line-height: 1.5; }
.textlist b { display: block; color: var(--gold); margin-bottom: 2px; }

/* ---------- Inicio: logros por reclamar, racha diaria y destacados ---------- */
#homeExtra { display: grid; gap: 10px; margin-bottom: 18px; }
#homeExtra:empty { display: none; }
#homeExtra .fhead { margin: 4px 0 -2px; }
.achbanner { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; color: inherit; background: linear-gradient(120deg, rgba(245, 197, 24, .26), rgba(245, 197, 24, .06)); border: 1px solid var(--gold); border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px; }
.achbanner b { color: var(--gold); white-space: nowrap; }
.dailychip { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.4; }
.featgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.featgrid .sitem { padding: 10px; gap: 6px; text-align: center; font-size: 13px; color: inherit; cursor: pointer; }
.featgrid .sitem:hover { border-color: var(--gold); }
.featgrid .sitem small { color: var(--gold); font-weight: 700; }

/* ---------- Tema Porcelana (claro): menús, sala y ventanas. La mesa de juego no cambia. ---------- */
:root[data-theme="porcelana"] :is(#shell, #lobby, .dlg-box) {
  --ink: #efe9dc; --panel: #fbf8f1; --line: rgba(50, 42, 24, .18); --gold: #a86f00;
  color: #24251f;
}
:root[data-theme="porcelana"] .dlg-box { background: #fbf8f1; }
:root[data-theme="porcelana"] .side { background: #e4dccb; }
:root[data-theme="porcelana"] :is(.chip, .sitem, .rrow) { background: #fbf8f1; }
:root[data-theme="porcelana"] :is(#shell, #lobby, .dlg-box) :is(.btn:not(.primary), .seg button:not(.on), .rkfind, .namebox input, .join input, .shoptabs button:not(.on)) {
  background: rgba(50, 42, 24, .07); border-color: rgba(50, 42, 24, .2); color: inherit;
}
:root[data-theme="porcelana"] :is(#shell, #lobby, .dlg-box) .btn.primary { background: #f5c518; border-color: #d9aa00; }
:root[data-theme="porcelana"] :is(.side button:hover, .side button.on) { background: rgba(50, 42, 24, .1); }
:root[data-theme="porcelana"] :is(.rkcard, .rktabs, .shoppick, .cfgseg, .cfgselect) { background: rgba(50, 42, 24, .07); }
:root[data-theme="porcelana"] :is(.rktabs button.on, .shoppick button.on) { background: #fbf8f1; }
:root[data-theme="porcelana"] .rkrow { border-bottom-color: rgba(50, 42, 24, .1); }
:root[data-theme="porcelana"] .switch:not(.on) { background: rgba(50, 42, 24, .25); }
:root[data-theme="porcelana"] .cfgseg button.on { background: #f5c518; }
:root[data-theme="porcelana"] .rrow .tag { color: #7a5a00; border-color: #b08c06; }
:root[data-theme="porcelana"] span.av { background: #ddd4c0; }

/* Menú de regalos: pestañas y rejilla que se desplaza */
#giftMenu { width: min(94vw, 400px); }
.gifttabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gifttabs button { flex: none; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 700; color: inherit; cursor: pointer; }
.gifttabs button.on { background: rgba(245, 197, 24, .16); border-color: var(--gold); color: var(--gold); }
#giftMenu { max-height: 88vh; grid-template-rows: auto auto minmax(0, 1fr); }
#giftMenu .giftgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: min(50vh, 380px); overflow-y: scroll; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--gold) rgba(255, 255, 255, .08); }
#giftMenu .giftgrid::-webkit-scrollbar { width: 7px; }
#giftMenu .giftgrid::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 6px; }
.gift .gph { width: 100%; max-width: 92px; aspect-ratio: 1; object-fit: cover; border-radius: 9px; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.gift .gname { font-size: 10.5px; line-height: 1.15; opacity: .85; min-height: 24px; display: grid; place-items: center; }


/* Ruleta de regalos: redonda y chiquita, sin ventana cuadrada */
#giftMenu { display: block; position: fixed; width: 190px; height: 190px; padding: 0; border-radius: 50%; z-index: 8; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(46, 38, 28, .96), rgba(14, 11, 8, .96) 72%); border: 2px solid var(--gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .65), inset 0 0 22px rgba(0, 0, 0, .6); animation: wheelIn .16s ease-out; }
#giftMenu[hidden] { display: none; }
@keyframes wheelIn { from { transform: scale(.55); opacity: 0; } to { transform: none; opacity: 1; } }
#giftMenu .ghub { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px 0 0 -33px; border-radius: 50%; display: grid; place-content: center; gap: 1px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: #fff; cursor: pointer; padding: 4px; }
#giftMenu .ghub b { font-size: 11px; line-height: 1.1; color: var(--gold); max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
#giftMenu .ghub span { font-size: 9px; opacity: .8; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#giftMenu .gslot { position: absolute; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .22); animation: slotIn .22s ease-out backwards; animation-delay: calc(var(--i) * 18ms); }
@keyframes slotIn { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
#giftMenu .gslot:hover:not(:disabled), #giftMenu .gslot:focus-visible { border-color: var(--gold); transform: scale(1.14); z-index: 2; }
#giftMenu .gslot:disabled { opacity: .35; cursor: default; }
#giftMenu .gslot .gi { font-size: 21px; line-height: 1; }
#giftMenu .gslot .gph { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 50%; object-fit: cover; box-shadow: none; }
#giftMenu .gslot .flagcu { width: 24px; height: 16px; }

/* Regalos animados sobre el portavasos */
#giftLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.giftIcon { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; user-select: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }

/* Radio: tarjetas compactas con su color, y un ecualizador cuando suena */
#radioPanel { width: min(300px, 88vw); padding: 12px; gap: 10px; border-radius: 16px; background: linear-gradient(160deg, rgba(34, 28, 22, .96), rgba(16, 13, 10, .96)); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
.radiohead { font-size: 14px; letter-spacing: .3px; color: var(--gold); }
#radioList { gap: 6px; max-height: 58vh; overflow-y: auto; scrollbar-width: thin; }
.radio-st { display: grid; grid-template-columns: 36px 1fr 22px; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); color: inherit; cursor: pointer; transition: transform .12s, background .15s; }
.radio-st:hover { background: rgba(255, 255, 255, .1); transform: translateX(2px); }
.radio-st.on { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 38%, transparent), rgba(255, 255, 255, .06)); border-color: var(--c); font-weight: 400; }
.rbadge { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 19px; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 45%, #000)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(0, 0, 0, .4); }
.rbadge i { width: 3px; height: 14px; border-radius: 2px; background: #fff; animation: eqb .9s ease-in-out infinite; transform-origin: bottom; }
.rbadge i:nth-child(2) { animation-delay: .25s; }
.rbadge i:nth-child(3) { animation-delay: .5s; }
@keyframes eqb { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.rtext { display: grid; gap: 1px; min-width: 0; text-align: left; }
.rtext b { font-size: 13.5px; line-height: 1.15; }
.rtext small { font-size: 11px; opacity: .65; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-st .eq { display: none; }
.radio-st::after { content: '▶'; font-size: 11px; opacity: .5; justify-self: end; }
.radio-st.on::after { content: '⏸'; opacity: .9; }
.radio-vol { gap: 10px; font-size: 12px; }
.radio-vol input { accent-color: var(--gold); }

/* Retrato de cada jugador junto a su chapa, y fila de "subir foto" en el perfil */
.avBadge { position: absolute; left: 0; top: 0; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; pointer-events: none; will-change: transform; background: radial-gradient(circle at 35% 30%, #4a3a2a, #1c140d); border: 2px solid #d4a017; box-shadow: 0 3px 8px rgba(0, 0, 0, .6); box-sizing: border-box; }
.avBadge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photorow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.photorow small { flex-basis: 100%; opacity: .7; font-size: 12px; }
#radioList { overflow-x: hidden; }
.radio-st:hover { transform: none; }

/* ===== Móvil y tablet: mesa arriba, mano grande abajo ===== */
#hand, #handSides { display: none; }
#game.compact #hand { display: flex; position: absolute; left: 0; right: 0; bottom: calc(70px + env(safe-area-inset-bottom)); justify-content: center; align-items: flex-end; gap: 5px; padding: 0 10px; z-index: 4; touch-action: manipulation; }
#game.compact #hand[hidden], #game.compact #handSides[hidden] { display: none; }
#game.compact #handSides { display: flex; position: absolute; left: 12px; right: 12px; bottom: calc(70px + var(--hh, 124px) + env(safe-area-inset-bottom)); justify-content: center; gap: 10px; z-index: 5; }
#game.compact #handSides .btn { flex: 1; max-width: 190px; padding: 11px 8px; font-size: 14px; }
.htile { width: var(--hw, 50px); aspect-ratio: 1 / 2; border-radius: 9px; background: linear-gradient(160deg, color-mix(in srgb, var(--face) 78%, #fff), var(--face) 55%, color-mix(in srgb, var(--face) 80%, #000)); border: 1px solid color-mix(in srgb, var(--face) 55%, #000); box-shadow: 0 4px 0 var(--edge), 0 8px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5); display: grid; grid-template-rows: 1fr 1fr; position: relative; cursor: pointer; transition: transform .12s; -webkit-tap-highlight-color: transparent; }
.htile .hbar { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; margin-top: -1px; background: color-mix(in srgb, var(--pip) 70%, transparent); border-radius: 2px; }
.hhalf { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 11% 14%; }
.hhalf i { display: block; place-self: center; width: 70%; aspect-ratio: 1; border-radius: 50%; }
.hhalf i.on { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pip) 60%, #fff), var(--pip) 60%); box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .35); }
.htile.ok { transform: translateY(-14px); box-shadow: 0 4px 0 var(--edge), 0 0 0 2px #f5c518, 0 10px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .5); }
.htile.sel { transform: translateY(-30px) scale(1.06); box-shadow: 0 4px 0 var(--edge), 0 0 0 3px #3fe0a0, 0 14px 22px rgba(0, 0, 0, .6); }
.htile.dim { filter: brightness(.62) saturate(.8); }
/* Barra inferior: voz a la izquierda y botones de la mesa en fila a la derecha */
@media (orientation: portrait) {
  #game.compact .emotes { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 6px; }
  #game.compact #voiceBar { left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  #game.compact #turnHint { bottom: calc(70px + var(--hh, 124px) + 46px + env(safe-area-inset-bottom)); }
}
#game.compact .round { width: 46px; height: 46px; font-size: 21px; }
@media (orientation: landscape) and (max-height: 520px) {
  #game.compact #hand { bottom: 6px; }
  #game.compact #handSides { bottom: calc(6px + var(--hh, 100px)); }
  #game.compact .emotes { transform: scale(.9); }
}

.avBadge { pointer-events: auto; cursor: pointer; }

@media (orientation: landscape) and (max-height: 520px) {
  #game.compact #hand { left: auto; right: 12px; top: 56px; bottom: 112px; width: 40%; flex-wrap: wrap; align-content: center; justify-content: center; align-items: flex-end; gap: 14px 6px; padding: 0; }
  #game.compact #handSides { left: auto; right: 12px; width: 40%; bottom: 62px; }
  #game.compact .emotes { left: 10px; right: auto; bottom: 10px; display: flex; flex-direction: column-reverse; transform: none; }
  #game.compact #voiceBar { left: auto; right: 12px; bottom: 8px; }
  #game.compact #turnHint { left: 36%; bottom: 8px; }
  #game.compact .round { width: 42px; height: 42px; font-size: 19px; }
}


/* Marcador de 3 o 4 jugadores: cuadrícula pequeña para no tapar los botones */
.scoremini.multi { gap: 2px 10px; padding: 3px 8px; text-align: left; }
.scoremini.multi .smc { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.scoremini.multi .smc span { border: 0; font-size: 9px; letter-spacing: .3px; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoremini.multi .smc b { font-size: 16px; line-height: 1.2; }
@media (max-width: 700px) { .scoremini.multi { transform: none; max-width: calc(100vw - 232px); } }

/* Móvil vertical: el reloj de mi turno va encima de mi mano (no sobre las fichas) y "Salir" es corto */
@media (orientation: portrait) {
  #game.compact #clock { left: 50% !important; top: auto !important; bottom: calc(70px + var(--hh, 124px) + 40px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.82); }
  #game.compact #turnHint { bottom: calc(70px + var(--hh, 124px) + 100px + env(safe-area-inset-bottom)); }
  #game.compact #btnLeave { font-size: 0; padding: 0 14px; height: 46px; }
  #game.compact #btnLeave::after { content: 'Salir'; font-size: 14px; }
}

/* ===== Móvil vertical: tarjetas de los jugadores ===== */
#chips { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#chips[hidden] { display: none; }
#chips .chip { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 5px 9px 7px 5px; border-radius: 28px; background: rgba(22, 17, 12, .82); border: 1.5px solid rgba(255, 255, 255, .2); color: #fff; max-width: 31vw; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); cursor: pointer; }
#chips .chip.turn { border-color: #f5c518; box-shadow: 0 0 0 2px rgba(245, 197, 24, .35), 0 4px 12px rgba(0, 0, 0, .45); }
#chips .chip.turn.low { border-color: #ff4b3a; box-shadow: 0 0 0 2px rgba(255, 75, 58, .4); }
.chip .cav { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 1.5px solid #d4a017; background: #2a1f14; }
.chip .ctx { display: grid; min-width: 0; line-height: 1.15; }
.chip .ctx b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .ctx small { font-size: 10.5px; opacity: .75; white-space: nowrap; }
.chip .cmic { font-size: 12px; position: relative; flex: none; }
.chip .cmic.off { opacity: .55; }
.chip .cmic.off::after { content: ''; position: absolute; left: -1px; right: -1px; top: 50%; height: 2px; background: #ff4d4d; transform: rotate(-35deg); }
.chip .cgift { position: absolute; right: -4px; top: -16px; width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); pointer-events: none; }
.chip .cbar { position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); display: none; overflow: hidden; }
#chips .chip.turn .cbar { display: block; }
.chip .cbar u { display: block; height: 100%; background: linear-gradient(90deg, #19c3a6, #f5c518); text-decoration: none; width: 100%; }
#chips .chip.turn.low .cbar u { background: #ff4b3a; }
#chips .chip[data-p="3"] { left: 8px; top: 66px; }
#chips .chip[data-p="2"] { left: 50%; top: 66px; transform: translateX(-50%); }
#chips .chip[data-p="1"] { right: 8px; top: 66px; }
#chips .chip.mine { left: 8px; bottom: calc(70px + var(--hh, 124px) + 6px + env(safe-area-inset-bottom)); top: auto; right: auto; }
@media (orientation: landscape) { #chips { display: none; } }

/* Móvil vertical: el reloj y el cartel de mi turno no se ponen sobre mis fichas; el contador va en mi tarjeta */
@media (orientation: portrait) {
  #game.compact #clock { display: none !important; }
  #game.compact:not(.picking) #turnHint { display: none; }
  #chips .chip.mine.turn { padding-right: 14px; }
  #chips .chip.mine.turn .ctx small { font-size: 13px; font-weight: 700; opacity: 1; color: #f5c518; }
  #chips .chip.mine.turn.low .ctx small { color: #ff6b5c; }
}

/* ===== Móvil vertical, como en la referencia: botones en columnas a los lados y la mano pegada abajo ===== */
@media (orientation: portrait) {
  #game.compact .topbar { flex-direction: column; top: 10px; left: 8px; gap: 8px; align-items: flex-start; }
  #game.compact #btnLeave { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
  #game.compact #btnLeave::after { content: '🚪'; font-size: 20px; }
  #game.compact #hand { bottom: calc(8px + env(safe-area-inset-bottom)); }
  #game.compact #handSides { bottom: calc(8px + var(--hh, 124px) + env(safe-area-inset-bottom)); }
  #game.compact .emotes { right: 8px; left: auto; bottom: calc(var(--hh, 124px) + 150px + env(safe-area-inset-bottom)); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
  #game.compact #voiceBar { left: 8px; bottom: calc(var(--hh, 124px) + 150px + env(safe-area-inset-bottom)); flex-direction: column; }
  #game.compact #voiceBar .pill { position: absolute; left: 54px; bottom: 0; white-space: nowrap; }
  #chips .chip.mine { bottom: calc(var(--hh, 124px) + 14px + env(safe-area-inset-bottom)); }
  /* Los tres rivales van en una fila compacta ENCIMA de la mesa: nada de sus tarjetas cae sobre el tablero ni las tablillas.
     La fila empieza a la derecha de la columna de botones y reparte el ancho en tres. */
  #chips .chip[data-p="3"], #chips .chip[data-p="2"], #chips .chip[data-p="1"] {
    top: var(--rowtop, 100px); bottom: auto; transform: none; flex-direction: row; gap: 5px; padding: 4px 6px 7px 4px; border-radius: 20px;
    width: calc((100vw - 62px - 8px - 12px) / 3); max-width: none; text-align: left; box-sizing: border-box;
  }
  #chips .chip[data-p="3"] { left: 62px; right: auto; }
  #chips .chip[data-p="2"] { left: calc(62px + (100vw - 62px - 8px - 12px) / 3 + 6px); right: auto; }
  #chips .chip[data-p="1"] { right: 8px; left: auto; }
  #chips .chip[data-p="3"] .cav, #chips .chip[data-p="2"] .cav, #chips .chip[data-p="1"] .cav { width: 28px; height: 28px; }
  #chips .chip[data-p="3"] .ctx, #chips .chip[data-p="2"] .ctx, #chips .chip[data-p="1"] .ctx { flex: 1; min-width: 0; justify-items: start; }
  #chips .chip[data-p="3"] .ctx b, #chips .chip[data-p="2"] .ctx b, #chips .chip[data-p="1"] .ctx b { font-size: 11.5px; }
  #chips .chip[data-p="3"] .ctx small, #chips .chip[data-p="2"] .ctx small, #chips .chip[data-p="1"] .ctx small { font-size: 10px; }
  /* La bandera pasa a una insignia sobre el retrato (sin el nombre del país) y el micrófono a la esquina */
  #chips .chip[data-p="3"] .ctx small.cgeo, #chips .chip[data-p="2"] .ctx small.cgeo, #chips .chip[data-p="1"] .ctx small.cgeo {
    position: absolute; left: 17px; bottom: 4px; max-width: none; width: 16px; height: 12px; padding: 0; font-size: 0; overflow: visible; border-radius: 2px;
    box-shadow: 0 0 0 1.5px #1b1b1b, 0 1px 3px rgba(0, 0, 0, .6);
  }
  #chips .chip[data-p="3"] .ctx small.cgeo img, #chips .chip[data-p="2"] .ctx small.cgeo img, #chips .chip[data-p="1"] .ctx small.cgeo img { width: 16px; height: 12px; margin: 0; display: block; border-radius: 2px; }
  #chips .chip[data-p="3"] .cmic, #chips .chip[data-p="2"] .cmic, #chips .chip[data-p="1"] .cmic { position: absolute; top: -7px; right: 6px; font-size: 11px; }
  #chips .chip[data-p="3"] .cbar, #chips .chip[data-p="2"] .cbar, #chips .chip[data-p="1"] .cbar { left: 10px; right: 10px; }
  #game.compact #turnHint { bottom: calc(var(--hh, 124px) + 80px + env(safe-area-inset-bottom)); }
}

/* Los regalos altos (un vaso) conservan su proporción en vez de estirarse a cuadrado */
.giftIcon, .chip .cgift { object-fit: contain; }

/* Robando: foto de una mano robando una ficha */
#vPlay .setsel button .pic img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; display: block; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
#vPlay .setsel button .pic:has(img) { width: auto; flex: none; line-height: 0; }

#vPlay #optSet button .pic img { width: 60px; height: 60px; }
#vPlay #optSet button { flex-direction: column; justify-content: center; text-align: center; gap: 6px; }
#vPlay #optSet button .tx { text-align: center; }

/* Las tres formas de jugar llevan su foto detrás, con el color del botón por delante para que el texto se lea */
#vPlay .mode.quick { background: linear-gradient(90deg, rgba(247, 201, 75, .97) 0%, rgba(233, 169, 32, .86) 62%, rgba(233, 169, 32, .08) 100%), url(opciones/rapida.webp) center / cover; }
#vPlay .mode.ranked { background: linear-gradient(90deg, rgba(201, 58, 54, .97) 0%, rgba(143, 31, 36, .86) 62%, rgba(143, 31, 36, .08) 100%), url(opciones/competitivo.webp) center / cover; }
#vPlay .mode.mesa { background: linear-gradient(90deg, rgba(52, 80, 126, .97) 0%, rgba(31, 51, 88, .86) 62%, rgba(31, 51, 88, .08) 100%), url(opciones/mesa.webp) center / cover; }

/* Acceso internacional y selector de ubicación */
#authHome { display: grid; gap: 10px; }
#authHome .btn { width: 100%; }
.tagline { margin: -2px 0 6px; font-size: 13.5px; opacity: .8; }
.homelinks { display: flex; justify-content: center; gap: 22px; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; opacity: .85; padding: 6px; font-size: 14px; cursor: pointer; }
.geochip {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 7px 12px; font-size: 13.5px;
  background: rgba(248, 201, 28, .1); border: 1px solid rgba(248, 201, 28, .35); border-radius: 999px;
}
.geochip img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
#btnHome { justify-self: center; }

.geo {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: minmax(0, 1fr); justify-items: center; padding: 12px;
  background: rgba(10, 14, 12, .82); backdrop-filter: blur(6px);
}
.geo[hidden] { display: none; }
.gcard {
  width: min(560px, 100%); height: 100%; max-height: 720px; align-self: center; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  background: #24312C; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.ghead { display: flex; align-items: center; gap: 10px; }
.gtitles { flex: 1; min-width: 0; }
.gtitle { margin: 0; font-size: 19px; }
.gstep { margin: 2px 0 0; font-size: 12.5px; opacity: .7; }
.gback, .gx {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  font-size: 20px; line-height: 1; flex: none; cursor: pointer;
}
.gback[hidden] { display: none; }
.gbar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.gbar i { display: block; height: 100%; background: #F8C91C; transition: width .25s; }
.gsearch {
  width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; outline: none; color: inherit;
}
.gsearch:focus { border-color: #F8C91C; }
.glist { flex: 1; overflow-y: auto; display: grid; gap: 8px; align-content: start; padding-right: 2px; -webkit-overflow-scrolling: touch; }
.gitem {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 54px;
  background: #36423B; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.gitem:hover, .gitem.on { border-color: #F8C91C; }
.gitem small { margin-left: auto; opacity: .6; font-weight: 400; font-size: 12px; }
.gname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.gitem .gname + small { flex: none; }
.gflag { width: 40px; height: 30px; object-fit: cover; border-radius: 4px; flex: none; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.gitem img:not(.gflag) { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; }
.gflag-miss { display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.gflag.big { width: 120px; height: 90px; border-radius: 8px; }
.gempty { margin: 18px 6px; text-align: center; opacity: .7; }
.gmore { min-height: 4px; text-align: center; }
.gfoot { display: grid; gap: 8px; }
.gfoot .btn { width: 100%; }
.gconfirm { display: grid; justify-items: center; gap: 10px; padding: 18px 6px; text-align: center; }
.gconfirm h3 { margin: 4px 0 0; font-size: 24px; }
.gconfirm p { margin: 0; opacity: .85; }
.gconfirm .btn { width: 100%; max-width: 360px; }
body.geo-open { overflow: hidden; }
.glist { scrollbar-color: #5a6a60 transparent; scrollbar-width: thin; }
.seatflag { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
#chips .chip .ctx small.cgeo { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 400; opacity: .85; color: inherit; }

/* Celebraciones: tranqué, capicúa y pollona (capa que no recibe toques) */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.fxlayer { position: absolute; inset: 0; }
.fxcanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fxbanner { position: absolute; left: 50%; top: 1.5%; max-width: calc(100% - 130px); transform: translateX(-50%); text-align: center; animation: fxb var(--life) ease-out both; will-change: transform, opacity; }
.fxbanner b {
  display: block; font: 900 clamp(26px, 7.5vw, 74px)/1 Georgia, "Times New Roman", serif; letter-spacing: 2px; color: #F8C91C;
  -webkit-text-stroke: 2px #24312C; paint-order: stroke fill; text-shadow: 0 4px 0 #24312C, 0 0 26px rgba(248, 201, 28, .55); white-space: nowrap;
}
.k-capicua .fxbanner b { text-shadow: 0 4px 0 #24312C, 0 0 34px rgba(248, 201, 28, .85), 0 0 8px #fff3c4; }
.k-pollona .fxbanner b { font-size: clamp(28px, 8.5vw, 86px); background: linear-gradient(#fff3c4, #F8C91C 55%, #d79b00); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 0; filter: drop-shadow(0 4px 0 #24312C) drop-shadow(0 0 16px rgba(248, 201, 28, .6)); }
.fxcrown { display: block; margin: 0 auto -2px; width: clamp(36px, 7vw, 64px); animation: fxcrown 700ms ease-out both; }
.fxring { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 4px solid #F8C91C; border-radius: 50%; opacity: 0; animation: fxr 800ms ease-out both; box-shadow: 0 0 14px rgba(248, 201, 28, .6); }
.fxhalo { position: absolute; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; background: radial-gradient(circle, rgba(248, 201, 28, .75), rgba(248, 201, 28, 0) 68%); animation: fxh 1700ms ease-in-out both; }
.fxplus { position: absolute; top: 84px; right: 16px; font: 900 26px/1 Georgia, serif; color: #F8C91C; -webkit-text-stroke: 1px #24312C; text-shadow: 0 2px 0 #24312C; animation: fxplus 1800ms ease-out both; }
.scoremini.fxflash { animation: fxflash 1400ms ease-out; }
@keyframes fxb { 0% { opacity: 0; transform: translateX(-50%) scale(.5); } 12% { opacity: 1; transform: translateX(-50%) scale(1.12); } 22% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
@keyframes fxcalm { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.calm .fxbanner { animation: fxcalm var(--life) linear both; }
@keyframes fxr { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(var(--max, 6)); } }
@keyframes fxh { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.1); } 60% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes fxcrown { 0% { transform: translateY(-14px) scale(.4); opacity: 0; } 60% { transform: translateY(2px) scale(1.15); opacity: 1; } 100% { transform: none; } }
@keyframes fxplus { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes fxflash { 0%, 100% { box-shadow: none; } 25% { box-shadow: 0 0 0 3px #F8C91C, 0 0 22px rgba(248, 201, 28, .8); } }
.fxcrown svg { width: 100%; height: auto; display: block; margin: 0 auto; }
@media (max-width: 700px) { .fxbanner { top: 19.5%; max-width: calc(100% - 24px); } .fxplus { top: 76px; } }

/* ---------- Chat y stickers rediseñados ---------- */
/* Mensaje sobre quien lo escribe */
.bubble.chatbub { background: none; border: 0; padding: 0; font-family: inherit; white-space: normal; transform: translate(-50%, -112%); animation: chatpop var(--ms, 2600ms) ease-out forwards; }
.chatb { position: relative; max-width: min(240px, 62vw); text-align: left; background: #24312C; color: #f4f1dc; border: 1px solid rgba(248, 201, 28, .6); border-radius: 14px 14px 14px 4px; padding: 6px 12px 7px; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); font: 600 14px/1.3 system-ui, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
.chatb::after { content: ""; position: absolute; left: 12px; bottom: -7px; width: 12px; height: 12px; background: #24312C; border-right: 1px solid rgba(248, 201, 28, .6); border-bottom: 1px solid rgba(248, 201, 28, .6); transform: rotate(45deg) skew(8deg, 8deg); }
.chatb small { display: block; color: #F8C91C; font-size: 11px; font-weight: 800; letter-spacing: .2px; }
@keyframes chatpop { 0% { opacity: 0; transform: translate(-50%, -100%) scale(.7); } 8% { opacity: 1; transform: translate(-50%, -112%) scale(1.05); } 14% { transform: translate(-50%, -112%) scale(1); } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -126%) scale(1); } }

/* Panel del chat */
.panel.chat { width: min(340px, 88vw); gap: 10px; padding: 12px; background: linear-gradient(#24312C, #1c2622); border: 1px solid rgba(248, 201, 28, .28); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
#lobbyChat.chat { background: none; border: 0; box-shadow: none; padding: 0; }
.chathead { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chatdot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 3px rgba(47, 191, 113, .25); }
.chatlog { height: 230px; display: flex; flex-direction: column; gap: 7px; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 10px; scrollbar-width: thin; scrollbar-color: #5a6a60 transparent; }
.chatlog .msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 88%; }
.chatlog .who { font-size: 11px; font-weight: 800; margin: 0 4px 2px; color: hsl(var(--h, 48) 70% 72%); }
.chatlog .txt { background: #36423B; color: #f4f1dc; padding: 6px 11px; border-radius: 4px 14px 14px 14px; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.chatlog .msg.mine { align-self: flex-end; align-items: flex-end; }
.chatlog .msg.mine .who { color: #F8C91C; }
.chatlog .msg.mine .txt { background: #F8C91C; color: #1b1b1b; border-radius: 14px 4px 14px 14px; font-weight: 600; }
.chatlog .chatempty { margin: auto; text-align: center; opacity: .6; font-size: 13px; }
.chatform { grid-template-columns: 1fr 42px; align-items: center; }
.chatform input { border-radius: 999px; padding: 11px 15px; background: rgba(255, 255, 255, .07); font-size: 14px; color: inherit; }
.chatform input:focus { border-color: #F8C91C; }
.chatform .send { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #F8C91C; display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 #b08c06; }
.chatform .send svg { width: 20px; height: 20px; fill: #1b1b1b; }
.chatform .send:active { transform: translateY(2px); box-shadow: 0 1px 0 #b08c06; }

/* Panel de stickers */
#emoteList.stkpanel { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; width: min(300px, 88vw); background: linear-gradient(#24312C, #1c2622); border: 1px solid rgba(248, 201, 28, .28); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); max-height: 60vh; overflow: auto; }
#emoteList .stkbtn { background: none; border: 0; padding: 0; cursor: pointer; transition: transform .12s; }
#emoteList .stkbtn:hover { transform: translateY(-2px) scale(1.04); }
#emoteList .stkbtn:active { transform: scale(.96); }
#emoteList .stkbtn .stk { width: 100%; justify-content: center; }
.stk { display: inline-flex; align-items: center; gap: 8px; background: var(--c); color: var(--ink); border-radius: 14px; padding: 7px 13px 7px 9px; font: 800 14px/1 system-ui, "Segoe UI", sans-serif; letter-spacing: .1px; white-space: nowrap; box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.stk .stk-ic svg { width: 22px; height: 22px; display: block; }
.stk.face { padding: 6px; border-radius: 50%; }
.stk.face .stk-ic svg { width: 30px; height: 30px; }
.stk .stk-emoji { font-size: 22px; line-height: 1; }
.stk.big { gap: 12px; padding: 12px 22px 12px 14px; border-radius: 22px; font-size: 24px; box-shadow: 0 0 0 4px #fff, 0 16px 34px rgba(0, 0, 0, .5), inset 0 -5px 0 rgba(0, 0, 0, .14); }
.stk.big .stk-ic svg { width: 38px; height: 38px; }
.stk.big.face { padding: 12px; }
.stk.big.face .stk-ic svg { width: 66px; height: 66px; }
.stk.big .stk-emoji { font-size: 46px; }
/* El sticker que manda alguien: sale grande sobre él y rebota para llamar la atención */
.bubble.stkb { background: none; border: 0; padding: 0; font-family: inherit; transform: translate(-50%, -110%); animation: stkpop var(--ms, 2800ms) ease-out forwards; }
@keyframes stkpop { 0% { opacity: 0; transform: translate(-50%, -90%) scale(.3) rotate(-14deg); } 9% { opacity: 1; transform: translate(-50%, -112%) scale(1.22) rotate(7deg); } 16% { transform: translate(-50%, -110%) scale(.96) rotate(-4deg); } 23% { transform: translate(-50%, -110%) scale(1.04) rotate(2deg); } 30% { transform: translate(-50%, -110%) scale(1) rotate(0); } 88% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -126%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .bubble.stkb, .bubble.chatbub { animation-name: fxcalm; } }
#emoteList .stk.face { border-radius: 14px; padding: 7px 9px; } #emoteList .stk.face .stk-ic svg { width: 26px; height: 26px; }

/* ---------- Radio compacta: rejilla de banderas ---------- */
#radioPanel { width: min(300px, 90vw); padding: 12px; gap: 9px; }
#radioPanel .radiohead { font-size: 13px; }
#radioNow { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
#radioNow.live { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 34%, transparent), rgba(255, 255, 255, .05)); border-color: var(--c); }
#radioNow .rnt { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
#radioNow .rnt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#radioNow .rnt small { font-size: 11px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#radioNow .rnt.idle { font-size: 12px; opacity: .7; }
#radioNow .rstop { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #F8C91C; color: #1b1b1b; font-size: 11px; cursor: pointer; flex: none; }
#radioList { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-height: 214px; overflow-y: auto; padding: 2px; scrollbar-width: thin; scrollbar-color: #5a6a60 transparent; }
.rtile { display: grid; justify-items: center; gap: 3px; padding: 5px 0 4px; background: none; border: 1px solid transparent; border-radius: 10px; color: inherit; cursor: pointer; min-width: 0; }
.rtile:hover { background: rgba(255, 255, 255, .08); }
.rtile.on { background: color-mix(in srgb, var(--c) 28%, transparent); border-color: var(--c); }
.rtile small { font-size: 9px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.rflag { position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 2px rgba(255, 255, 255, .16), 0 3px 8px rgba(0, 0, 0, .4); font-size: 17px; }
.rflag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rtile.on .rflag { box-shadow: 0 0 0 2px var(--c), 0 3px 8px rgba(0, 0, 0, .4); }
.req { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 4px; background: rgba(0, 0, 0, .38); }
.req i { width: 3px; height: 4px; background: #fff; border-radius: 1px; animation: reqb 0.9s ease-in-out infinite; }
.req i:nth-child(2) { animation-delay: .2s; }
.req i:nth-child(3) { animation-delay: .4s; }
@keyframes reqb { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- Stickers: caritas brillantes y animadas (sustituyen a los cartelitos planos) ---------- */
.stk { display: grid; justify-items: center; gap: 3px; background: none; box-shadow: none; padding: 0; border-radius: 0; color: inherit; font: inherit; letter-spacing: 0; white-space: nowrap; }
.stk .ball { display: block; width: 54px; height: 54px; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .42)); transform-origin: 50% 92%; animation: ballBob 2.2s ease-in-out infinite; }
.stk .ball svg { width: 100%; height: 100%; display: block; overflow: visible; }
.stk .ball.emo { display: grid; place-items: center; width: auto; height: 54px; font-size: 40px; line-height: 1; }
.stk .ball.shake { animation: ballShake .26s ease-in-out infinite alternate; }
.stk b { font: 800 11px/1.1 system-ui, "Segoe UI", sans-serif; color: #f4f1dc; letter-spacing: .1px; }
#emoteList.stkpanel { grid-template-columns: repeat(3, 1fr); gap: 6px 4px; width: min(290px, 90vw); }
#emoteList .stkbtn { padding: 6px 0 4px; border-radius: 14px; }
#emoteList .stkbtn:hover { background: rgba(255, 255, 255, .08); transform: translateY(-2px); }
#emoteList .stkbtn:nth-child(3n+2) .ball { animation-delay: -.7s; }
#emoteList .stkbtn:nth-child(3n) .ball { animation-delay: -1.4s; }
/* El que sale sobre el jugador: grande, con rebote y su palabra en una pastilla */
.stk.big { gap: 6px; }
.stk.big .ball { width: 104px; height: 104px; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .5)); animation: ballBob 1s ease-in-out infinite; }
.stk.big .ball.emo { height: 104px; font-size: 84px; }
.stk.big .ball.shake { animation: ballShake .22s ease-in-out infinite alternate; }
.stk.big b { font-size: 16px; background: #24312C; border: 1px solid rgba(248, 201, 28, .7); border-radius: 999px; padding: 4px 14px; box-shadow: 0 6px 14px rgba(0, 0, 0, .45); }
.face, .face * { transform-box: fill-box; }
.face .eyes { transform-origin: center; animation: blink 3.6s infinite; }
.face .look { animation: lookAround 2.6s ease-in-out infinite; }
.face .tear { animation: tearDrip 1.1s ease-in infinite; }
.face .drop { animation: tearDrip 1.5s ease-in infinite; }
.face .star { transform-origin: center; animation: twinkle .9s ease-in-out infinite alternate; }
.face .heart { transform-origin: center; animation: heartbeat .75s ease-in-out infinite; }
.face .tongue { transform-origin: 50% 0; animation: wag .5s ease-in-out infinite alternate; }
.face .wink { transform-origin: center; animation: winkAnim 2.4s infinite; }
.face .qmark { transform-origin: center; animation: qpop 1.3s ease-in-out infinite; }
.face .vein { transform-origin: center; animation: heartbeat .45s ease-in-out infinite; }
.face .mouth { transform-origin: 50% 0; animation: laugh .32s ease-in-out infinite alternate; }
@keyframes ballBob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-4px) scale(1.04, .97); } }
@keyframes ballShake { from { transform: rotate(-5deg) translateX(-1px); } to { transform: rotate(5deg) translateX(1px); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
@keyframes lookAround { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-2.5px); } 65% { transform: translateX(2.5px); } }
@keyframes tearDrip { 0% { transform: translateY(-3px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes twinkle { from { transform: scale(.88) rotate(-6deg); } to { transform: scale(1.18) rotate(6deg); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes wag { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes winkAnim { 0%, 70%, 100% { transform: scaleY(1); } 80% { transform: scaleY(.5) translateY(2px); } }
@keyframes qpop { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-5px) rotate(8deg) scale(1.15); } }
@keyframes laugh { from { transform: scaleY(1); } to { transform: scaleY(.8); } }
@media (prefers-reduced-motion: reduce) { .stk .ball, .face, .face * { animation: none !important; } }
.stk.big, .stk.big.face { padding: 0; box-shadow: none; border-radius: 0; background: none; font-size: inherit; }
.bubble.chatbub { width: max-content; max-width: min(270px, 74vw); } .chatb { max-width: min(270px, 74vw); width: max-content; min-width: 90px; padding: 7px 13px 8px; border-radius: 16px 16px 16px 5px; } .chatb span { display: block; }

/* Chat: contador de mensajes sin leer, menciones y sugerencias */
#btnChat { position: relative; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font: 800 12px/21px system-ui, "Segoe UI", sans-serif; text-align: center; box-shadow: 0 0 0 2px #24312C, 0 3px 8px rgba(0, 0, 0, .5); pointer-events: none; }
.badge[hidden] { display: none; }
.badge.at { box-shadow: 0 0 0 2px #F8C91C, 0 0 14px rgba(248, 201, 28, .8); }
.badge.pop { animation: badgePop .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badgePop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
.tag { color: #F8C91C; font-weight: 800; background: rgba(248, 201, 28, .14); border-radius: 6px; padding: 0 3px; }
.chatlog .msg.mine .txt .tag { color: #5a3d00; background: rgba(0, 0, 0, .12); }
.chatlog .txt.mention { box-shadow: 0 0 0 2px #F8C91C; }
.bubble.mention .chatb { border-color: #F8C91C; box-shadow: 0 0 0 2px rgba(248, 201, 28, .55), 0 10px 24px rgba(0, 0, 0, .5); }
.chatform { position: relative; }
.mentionbox { position: absolute; left: 0; right: 48px; bottom: calc(100% + 6px); z-index: 3; display: grid; gap: 2px; padding: 5px; background: #1c2622; border: 1px solid rgba(248, 201, 28, .45); border-radius: 12px; box-shadow: 0 12px 26px rgba(0, 0, 0, .55); }
.mentionbox[hidden] { display: none; }
.mentionbox button { text-align: left; background: none; border: 0; color: #f4f1dc; font: 700 14px system-ui, "Segoe UI", sans-serif; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.mentionbox button.on, .mentionbox button:hover { background: #F8C91C; color: #1b1b1b; }

/* Recoger todas las fichas del paño de una vez */
#btnCollect { position: absolute; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; padding: 11px 24px; font-size: 16px; border-radius: 999px; box-shadow: 0 4px 0 #b08c06, 0 10px 24px rgba(0, 0, 0, .5); animation: collectIn .35s cubic-bezier(.3, 1.5, .5, 1); }
#btnCollect[hidden] { display: none; }
@keyframes collectIn { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.85); } }

/* ---------- Micrófono y auriculares: medallones de latón como los de las chapas ---------- */
.vbtn { position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; cursor: pointer; color: #f1e3b0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #36423B 0 56%, #1c2622 100%); box-shadow: 0 0 0 3px #d4a017, 0 0 0 5px #5a3d08, 0 6px 12px rgba(0, 0, 0, .55), inset 0 2px 5px rgba(0, 0, 0, .6), inset 0 -2px 3px rgba(255, 255, 255, .06); transition: transform .12s, box-shadow .2s, color .2s; }
.vbtn::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%); pointer-events: none; }
.vbtn svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.vbtn .slash { stroke: #ff6b5c; stroke-width: 2.4; opacity: 0; }
.vbtn:hover { transform: translateY(-1px) scale(1.05); }
.vbtn:active { transform: scale(.95); }
#btnVoice:not(.live) .slash { opacity: 1; }
#btnVoice:not(.live) { color: #b9b29a; }
#btnVoice.live { color: #b8f5cf; box-shadow: 0 0 0 3px #2fbf71, 0 0 0 5px #14633a, 0 0 16px rgba(47, 191, 113, .75), inset 0 2px 5px rgba(0, 0, 0, .6); animation: micLive 1.4s ease-in-out infinite; }
#btnVoice.wait { box-shadow: 0 0 0 3px #F8C91C, 0 0 0 5px #5a3d08, 0 6px 12px rgba(0, 0, 0, .55); }
#btnDeaf.off { color: #b9b29a; }
#btnDeaf.off .slash { opacity: 1; }
@keyframes micLive { 0%, 100% { box-shadow: 0 0 0 3px #2fbf71, 0 0 0 5px #14633a, 0 0 8px rgba(47, 191, 113, .5), inset 0 2px 5px rgba(0, 0, 0, .6); } 50% { box-shadow: 0 0 0 3px #2fbf71, 0 0 0 5px #14633a, 0 0 20px rgba(47, 191, 113, .95), inset 0 2px 5px rgba(0, 0, 0, .6); } }
#voiceBar.onplate { position: absolute; inset: 0; left: 0; bottom: auto; display: block; pointer-events: none; z-index: 5; }
#voiceBar.onplate .vbtn { position: absolute; pointer-events: auto; }
#voiceBar.onplate #voiceWho { position: absolute; pointer-events: none; transform: translateX(-20%); }
#voiceBar .vbtn { opacity: 1; background-color: transparent; border: 0; text-decoration: none; }

/* «Hablas tú»: arriba en el centro, lejos de las fichas */
#voiceBar #voiceWho, #voiceBar.onplate #voiceWho, #game.compact #voiceBar #voiceWho { position: fixed; left: 50%; top: 10px; bottom: auto; right: auto; transform: translateX(-50%); z-index: 7; pointer-events: none; }
@media (max-width: 700px) { #voiceBar #voiceWho, #voiceBar.onplate #voiceWho, #game.compact #voiceBar #voiceWho { left: 66px; transform: none; } }

/* Sobre mi chapa los botones son pequeños, con el aro fino, del tamaño de los tornillos que sustituyen */
#voiceBar.onplate .vbtn { box-shadow: 0 0 0 2px #d4a017, 0 0 0 3px #5a3d08, 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 3px rgba(0, 0, 0, .6); }
#voiceBar.onplate #btnVoice.live { box-shadow: 0 0 0 2px #2fbf71, 0 0 0 3px #14633a, 0 0 10px rgba(47, 191, 113, .8), inset 0 1px 3px rgba(0, 0, 0, .6); animation: none; }
#voiceBar.onplate .vbtn svg { width: 62%; height: 62%; stroke-width: 2.2; }

/* Jugadores en línea (solo administrador) */
.onlinebox { display: grid; gap: 10px; width: min(460px, calc(86vw - 28px)); box-sizing: border-box; overflow-x: hidden; }
.onltop { display: flex; align-items: baseline; gap: 10px; }
.onltop b { font-size: 20px; color: #2fbf71; }
.onltop small { opacity: .7; flex: 1; }
.onlchips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; }
.onlchip { display: inline-flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.onlchip img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.onlsearch { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 14px; color: inherit; outline: none; }
.onlsearch:focus { border-color: #F8C91C; }
.onllist { display: grid; gap: 4px; max-height: 46vh; overflow-y: auto; scrollbar-width: thin; }
.onlrow { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.onlrow.on { background: rgba(47, 191, 113, .1); }
.onldot { width: 10px; height: 10px; border-radius: 50%; background: #6b6f6a; }
.onlrow.on .onldot { background: #2fbf71; box-shadow: 0 0 0 3px rgba(47, 191, 113, .25); }
.onlwho { display: grid; min-width: 0; }
.onlwho b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onlwho small { font-size: 11.5px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onlwhere { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.onlwhere img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }

.onlroom { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; border-top: 1px dashed rgba(255, 255, 255, .15); }
.onlinfo { flex: 1 1 100%; font-size: 12px; opacity: .9; }
.onlinfo b { color: #F8C91C; letter-spacing: 2px; font-size: 14px; }
.onlroom .btn.small { padding: 5px 12px; font-size: 12.5px; }

.onlstamp { font-size: 11px; opacity: .55; margin-top: -4px; }

/* Fichas ganadas: «+N 💧» sobre el jugador */
.bubble.coinbub { background: none; border: 0; padding: 0; font-family: inherit; white-space: nowrap; transform: translate(-50%, -110%); animation: coinRise var(--ms, 1800ms) ease-out forwards; }
.coinb { display: grid; justify-items: center; gap: 1px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
.coinrow { display: flex; align-items: baseline; gap: 4px; font: 900 28px/1 Georgia, serif; color: #F8C91C; -webkit-text-stroke: 1.5px #24312C; paint-order: stroke fill; }
.coinrow i { font-style: normal; font-size: 22px; -webkit-text-stroke: 0; }
.coinb small { font: 800 11px/1 system-ui, sans-serif; color: #f4f1dc; background: #24312C; border: 1px solid rgba(248, 201, 28, .6); border-radius: 999px; padding: 3px 9px; }
@keyframes coinRise { 0% { opacity: 0; transform: translate(-50%, -80%) scale(.5); } 14% { opacity: 1; transform: translate(-50%, -115%) scale(1.25); } 26% { transform: translate(-50%, -112%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
#chipCoins.coinpulse { display: inline-block; animation: coinChip .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes coinChip { 0% { transform: scale(1); color: inherit; } 35% { transform: scale(1.5); color: #F8C91C; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .bubble.coinbub, #chipCoins.coinpulse { animation-name: fxcalm; } }

.guesthint { background: rgba(248, 201, 28, .12); border: 1px solid rgba(248, 201, 28, .4); border-radius: 12px; padding: 10px 12px; font-size: 13px; opacity: 1; text-align: left; }

.coinfly { position: absolute; font-style: normal; font-size: 36px; line-height: 1; pointer-events: none; z-index: 6; filter: drop-shadow(0 0 8px rgba(248, 201, 28, .95)) drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }

.coinb.neg .coinrow { color: #ff6b5c; }
#chipCoins.coinpulse.neg { color: #ff6b5c; }
