:root {
  --bg: #fbf3e4;
  --card: #fffaf2;
  --ink: #2b2320;
  --muted: #8a7a6c;
  --line: #eadcc5;
  --red: #e1463b;
  --red-d: #b8322a;
  --teal: #4fa3a5;
  --wood: #f2c66d;
  --ok: #3f9a5b;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .08);
  --head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --topbar: 52px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, #ffe6c2 0, transparent 40%),
    radial-gradient(circle at 110% 10%, #fde0d6 0, transparent 35%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.45;
}
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--red-d); }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
code, .code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.loading { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(.8rem, 3vw, 1.6rem);
  background: rgba(251, 243, 228, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 1.35rem; }
.usermenu { position: relative; }
.avatar-btn { display: flex; align-items: center; gap: .5rem; border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--ink); padding: .25rem .4rem; border-radius: 99px; }
.avatar-btn:hover { background: #f3e6cf; }
.uname { font-weight: 700; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .35rem; min-width: 180px; display: flex; flex-direction: column; z-index: 100; }
.menu[hidden] { display: none; }
.menu a, .menu button { text-align: left; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: #f6ead6; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; flex: none; box-shadow: 0 0 0 2px #fff; }

/* ---------- Layout ---------- */
.app { padding: clamp(1rem, 3vw, 2rem) clamp(.8rem, 3vw, 1.6rem) 4rem; max-width: 1280px; margin: 0 auto; }
.page { max-width: 1000px; margin: 0 auto; }
.page.narrow { max-width: 560px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1.2rem; }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-weight: 700; margin-bottom: .8rem; }
.back:hover { color: var(--ink); }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.1rem; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 800; text-decoration: none;
  cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
  box-shadow: 0 2px 0 #e6d6bb;
}
.btn:hover { background: #fff7ea; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #e6d6bb; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--red); border-color: var(--red-d); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.btn.primary:hover { background: #ea5246; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: #f6ead6; }
.btn.small { padding: .4rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn.big { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn small { font-weight: 600; opacity: .7; }

label { display: block; font-weight: 700; margin-bottom: .9rem; font-size: .95rem; }
input {
  display: block; width: 100%; margin-top: .35rem; padding: .75rem .9rem;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink);
}
input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #4fa3a533; }
.form-error { background: #fde7e4; color: #9c2a21; border-radius: 10px; padding: .6rem .8rem; font-weight: 700; font-size: .9rem; }

/* ---------- Auth ---------- */
.auth { display: flex; flex-direction: column; align-items: center; padding-top: 1rem; }
.auth-art { margin-bottom: -26px; z-index: 1; animation: bob 3.2s ease-in-out infinite; }
.auth-card { width: 100%; max-width: 400px; padding-top: 2rem; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }

/* ---------- Inicio ---------- */
.hello { margin: .5rem 0 1.5rem; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.game-tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
a.game-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(60, 40, 20, .14); }
.tile-art { position: relative; height: 170px; background: linear-gradient(135deg, #cfe9e5, #e9f5f2); overflow: hidden; }
.tile-card { position: absolute; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.tile-card.c1 { left: 18px; top: 26px; transform: rotate(-10deg); }
.tile-card.c2 { right: 18px; top: 42px; transform: rotate(12deg); }
.tile-sango { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); }
.tile-body { padding: 1rem 1.2rem 1.2rem; }
.tile-body p { color: var(--muted); margin-bottom: .6rem; }
.tile-meta { font-size: .8rem; font-weight: 800; color: var(--teal); text-transform: uppercase; letter-spacing: .04em; }
.game-tile.soon { opacity: .6; }
.soon-art { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, #f3e7d2, #f3e7d2 12px, #efe0c6 12px, #efe0c6 24px); }
.soon-art span { font-family: var(--head); font-size: 3.5rem; color: #d2bf9d; }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.4rem; }
.list-row { display: flex; align-items: center; gap: .7rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .8rem; flex-wrap: wrap; }
a.list-row { text-decoration: none; color: var(--ink); transition: background .15s; }
a.list-row:hover { background: #fff3e0; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.code { background: #f3e6cf; padding: .2rem .55rem; border-radius: 8px; font-weight: 700; letter-spacing: .08em; }
.code.big { font-size: 1.6rem; padding: .35rem .9rem; }
.pill { font-size: .72rem; font-weight: 800; text-transform: uppercase; background: #fde3c0; color: #9a5b12; padding: .15rem .5rem; border-radius: 99px; }
.empty { text-align: center; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #cfc3b3; display: inline-block; flex: none; }
.dot.on { background: #45b36b; box-shadow: 0 0 0 3px #45b36b33; }

/* ---------- Ramen Ink: sala ---------- */
.ri-hero { display: flex; align-items: center; gap: 1.5rem; background: linear-gradient(135deg, #d4ece8, #eef7f4); border: 1px solid #c6e2dd; border-radius: 26px; padding: 1rem 1.6rem; margin-bottom: 1.6rem; box-shadow: var(--shadow); }
.ri-hero-art { flex: none; animation: bob 3.4s ease-in-out infinite; }
.ri-hero-body { flex: 1; }
.ri-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; color: var(--muted); }
.ri-stats b { color: var(--ink); font-size: 1.15rem; }
.ri-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.join-form { display: flex; gap: .4rem; }
.join-form input { margin: 0; width: 120px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.game-row .btn { pointer-events: none; }
.rules summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.rules summary::after { content: '＋'; font-size: 1.3rem; color: var(--muted); }
.rules[open] summary::after { content: '－'; }
.rules summary h2 { margin: 0; }
.rules ol, .drawer-body ol { padding-left: 1.2rem; }
.rules li, .drawer-body li { margin-bottom: .55rem; }
.rules-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.rules-orders > div { display: flex; gap: .6rem; align-items: center; }
.rules-orders p { margin: 0; font-size: .9rem; }
.ing-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: 1rem; }
.ing-legend span { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Sala de espera ---------- */
.lobby-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.lobby-head .sango { flex: none; }
.share { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.lobby-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

/* ---------- Sango animado ---------- */
.sango .arm, .table-svg .arm { animation: sway 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); transform-box: view-box; }
.table-svg .arm { animation-name: tableSway; animation-duration: 4.5s; }
@keyframes tableSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.sango-head { animation: headbob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.sango-eyes { animation: blink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sway { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
@keyframes headbob { 50% { transform: translateY(-4px) rotate(1.5deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ---------- Partida a pantalla completa ---------- */
body.fs { height: 100dvh; overflow: hidden; }
body.fs .app { padding: 0; max-width: none; height: calc(100dvh - var(--topbar)); }
body.fs .toasts { top: calc(var(--topbar) + 64px); bottom: auto; }

.g-screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; }

.hud { flex: none; display: flex; align-items: center; gap: .8rem; padding: .45rem .8rem; }
.hud-exit { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 1.2rem; font-weight: 800; }
.hud-exit:hover { color: var(--ink); }
.hud-rounds { display: flex; gap: .25rem; flex: none; }
.round { display: flex; flex-direction: column; align-items: center; min-width: 30px; }
.round b { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--line); font-family: var(--head); font-size: .9rem; }
.round i { font-style: normal; font-size: .6rem; color: var(--muted); font-weight: 800; white-space: nowrap; line-height: 1.2; }
.round.done b { background: #e7dccb; color: #9b8b76; border-color: #e7dccb; }
.round.current b { background: var(--red); color: #fff; border-color: var(--red-d); box-shadow: 0 0 0 4px #e1463b2e; }
.hud-players { flex: 1; display: flex; gap: .5rem; justify-content: center; min-width: 0; }
.hud-player { position: relative; display: flex; align-items: center; gap: .5rem; min-width: 0; max-width: 270px; flex: 0 1 auto; padding: .3rem .65rem .3rem .35rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font: inherit; color: var(--ink); text-align: left; }
button.hud-player { cursor: pointer; transition: border-color .15s, transform .15s; }
button.hud-player:hover { border-color: var(--teal); transform: translateY(-1px); }
.hud-player.me { border-color: #f1b3ac; background: #fff6f3; }
.hud-player.active::before { content: '🎴'; position: absolute; top: -9px; left: -7px; font-size: .9rem; }
.av { position: relative; display: flex; flex: none; }
.av .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid #fff; width: 11px; height: 11px; }
.hud-player .pinfo { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.hud-player .pinfo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.hud-player .pinfo small { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.hud-player .busy { color: var(--red-d); font-weight: 800; }
.pscore { font-family: var(--head); font-size: 1.35rem; font-weight: 700; margin-left: .15rem; }
.peek { font-size: .85rem; opacity: .55; }
.bubble { position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .78rem; font-weight: 700; padding: .35rem .65rem; border-radius: 10px; white-space: nowrap; z-index: 25; pointer-events: none; animation: bubbleIn .3s ease-out; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.bubble::before { content: ''; position: absolute; top: -5px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, -6px); } }
.hud-tools { flex: none; display: flex; gap: .35rem; }
.hud-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 800; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hud-btn:hover { background: #fff3e0; }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 33fr) minmax(0, 67fr); gap: .7rem; padding: 0 .7rem .7rem; }
.zone { position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.side-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.side-tray { padding: .8rem .9rem; border-bottom: 1px solid var(--line); }
.side-tray:empty { display: none; }
.side-tray:has(.your-turn) { background: #fff2ee; }
.side-tray .tray-row { flex-direction: column; align-items: stretch; gap: .75rem; }
.side-tray .minis { justify-content: center; gap: 1.2rem; }
.side-tray .mini { font-size: .76rem; }
.side-tray .tray-main { min-width: 0; }
.side-tray .tray-text b { font-size: 1.05rem; }
.side-tray .chips { flex-direction: column; }
.side-tray .chip { width: 100%; padding: .45rem .7rem .45rem .45rem; }
.side-tray .tray-actions { justify-content: space-between; }
.side-tray .tray-actions .btn.primary { flex: 1; padding: .7rem 1rem; }
.side-tray .tray-msg { flex-direction: column; padding: .8rem 0; }
.side-tray .bonus-pending { align-items: center; text-align: center; }
.bonus-panel { display: flex; flex-direction: column; gap: .6rem; }
.side-tray .bonus-grid { grid-template-columns: repeat(3, 1fr); margin: 0; }
.tray .bonus-grid { margin: 0; }
.tray .bonus-opt { padding: .35rem .1rem; }
.tray .bonus-opt .ico { width: 30px; height: 30px; }
.tray .bonus-opt .plus3 { font-size: 1.3rem; line-height: 30px; }
.bonus-next { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: 14px; background: #fff; border: 1.5px dashed #e3cfae; }
.bonus-next svg { flex: none; border-radius: 50%; }
.bonus-next span { display: flex; flex-direction: column; line-height: 1.25; }
.bonus-next small { color: var(--muted); font-weight: 700; }
.side-body::after { content: ''; flex: 1; }
.side-foot { flex: none; padding: .6rem .8rem; border-top: 1px solid var(--line); }
.zone-board .tray:empty { display: none; }
.drawer.wide { width: min(820px, 96vw); }
.table-host { position: relative; display: flex; flex-direction: column; padding: .5rem; overflow: hidden; }
.table-host .table-box { flex: 1; min-height: 0; }

.info-bar { flex: none; display: flex; align-items: center; gap: .45rem; padding: .45rem .8rem; min-height: 46px; font-size: .84rem; line-height: 1.25; background: rgba(255, 255, 255, .65); border-bottom: 1px solid #cfe5e0; }
.info-bar .num, .bowl-top .num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fffaf0; border: 2px solid var(--red); display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: .78rem; }
.table-box { position: relative; flex: 1; min-height: 0; }
.table-svg { position: absolute; inset: .35rem; width: calc(100% - .7rem); height: calc(100% - .7rem); display: block; }
.table-slot { cursor: help; }
.slot-glow { fill: none; stroke: #ffcf4d; stroke-width: 9; opacity: 0; transition: opacity .2s; }
.slot-zoom { position: absolute; z-index: 8; pointer-events: none; display: flex; flex-direction: column; align-items: center; animation: zoomIn .22s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: center 40%; }
.slot-zoom .order-card { display: block; filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .35)); }
.zoom-cap { margin-top: -.6rem; width: max(100%, 240px); padding: .5rem .7rem; border-radius: 14px; background: #fffaf2; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-size: .82rem; line-height: 1.3; text-align: center; }
.zoom-cap b { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .95rem; }
.zoom-cap span:not(.num) { display: block; color: #5d4f45; }
.zoom-cap i { display: block; font-style: normal; font-weight: 800; color: var(--ok); }
.zoom-cap .num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fffaf0; border: 2px solid var(--red); display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-size: .78rem; }
@keyframes zoomIn { from { transform: scale(.45); opacity: 0; } }
.order.flip-in { animation: cardFlip .8s cubic-bezier(.3, 1.4, .5, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes cardFlip { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }

.pick-layer { flex: none; container-type: inline-size; border-bottom: 1px solid var(--line); animation: slideUp .4s ease-out; }
.pick-layer:empty { display: none; }
.pick-panel { --cmax: 200px; display: flex; flex-direction: column; gap: .5rem; padding: .7rem .8rem .8rem; }
.pick-panel.mine { background: #fff2ee; }
.pick-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pick-text { flex: 1; min-width: 0; }
.pick-title { font-family: var(--head); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.pick-panel.mine .pick-title { color: var(--red-d); }
.pick-cards { --cols: 2; --card: min(var(--cmax), calc((100cqi - 1.6rem - (var(--cols) - 1) * .8rem) / var(--cols))); display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; perspective: 1000px; padding-top: .3rem; }
.flip-card { display: flex; flex-direction: column; align-items: center; gap: .3rem; border: 0; padding: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.flip-card:disabled { cursor: default; }
.flip-inner { position: relative; display: block; width: var(--card); height: var(--card); transform-style: preserve-3d; transition: transform .25s; }
.flip-card.new .flip-inner { animation: flipIn .9s cubic-bezier(.3, .7, .3, 1.15) both; animation-delay: calc(var(--k) * .2s); }
.face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 50%; }
.face svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35)); }
.face.back { transform: rotateY(180deg); }
@keyframes flipIn { 0% { transform: translateY(-50px) rotateY(180deg) scale(.6); } 55% { transform: translateY(6px) rotateY(-12deg) scale(1.06); } 100% { transform: none; } }
.flip-card:not(:disabled):hover .flip-inner { transform: translateY(-8px) rotate(-4deg); }
.flip-card.sel .flip-inner { transform: translateY(-10px) scale(1.07); }
.flip-card.sel .face.front { box-shadow: 0 0 0 5px #fff, 0 0 0 10px var(--red), 0 14px 30px rgba(0, 0, 0, .4); }
.flip-card.taken .flip-inner { transform: scale(.82); filter: grayscale(.5) brightness(.85); }
.flip-card.flying { pointer-events: none; z-index: 10; }
.card-tag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 99px; background: #efe3cf; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.card-tag .avatar { box-shadow: none; }
.pick-order { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .76rem; margin-top: .15rem; }
.pick-order span { padding: .05rem .5rem; border-radius: 99px; background: #efe3cf; font-weight: 700; }
.pick-order span.now { background: var(--red); color: #fff; }
.pick-order span.done { background: #3f9a5b; color: #fff; }
.pick-order i { font-style: normal; opacity: .6; }
.pick-order em { font-style: normal; color: var(--muted); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-3deg) scale(1.04); } 20% { transform: rotate(3deg) scale(1.04); } 30% { transform: rotate(0); } }
@keyframes fadeIn { from { opacity: 0; } }

/* Bandeja de acciones */
.tray { flex: none; display: flex; align-items: center; min-height: 58px; padding: .5rem .7rem; background: #fffdf8; border-bottom: 1px solid var(--line); transition: background .3s; }
.tray > * { width: 100%; }
.tray:has(.your-turn) { background: #fff2ee; box-shadow: inset 0 -3px 0 #f2b2a9; }
.tray-msg { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; text-align: center; }
.tray-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.tray-main { flex: 1; min-width: 210px; display: flex; flex-direction: column; gap: .35rem; }
.tray-text { display: flex; flex-direction: column; line-height: 1.2; }
.tray-text small { color: var(--muted); font-size: .78rem; }
.tray-err { color: #9c2a21; font-size: .8rem; font-weight: 700; }
.tray-actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.minis { display: flex; gap: .4rem; flex: none; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; font-weight: 800; color: var(--muted); opacity: .5; }
.mini svg { border-radius: 50%; }
.mini.now { opacity: 1; color: var(--red-d); }
.mini.now svg { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); }
.mini.done { opacity: .8; color: var(--ok); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: .4rem; padding: .3rem .65rem .3rem .35rem; border-radius: 14px; border: 2px dashed #e3cfae; background: #fff; cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: transform .12s; }
.chip:hover { transform: translateY(-2px); }
.chip span { display: flex; flex-direction: column; line-height: 1.1; }
.chip b { font-size: .88rem; }
.chip small { color: var(--muted); font-weight: 700; font-size: .74rem; }
.chip.assigned { border-style: solid; border-color: #bfdcc6; background: #f3faf4; }
.chip.assigned small { color: var(--ok); }
.chip.sel { border-style: solid; border-color: var(--red); background: #fff4f2; box-shadow: 0 0 0 3px #e1463b33; }
.chip.sel small { color: var(--red-d); }
.chip.sel .ico { animation: bounce .9s ease-in-out infinite; }
.bonus-pending .ico { animation: bounce .9s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-4px); } }
.only-mobile { display: none; }

/* Tablero */
.board-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .6rem; }
.board { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .5rem; }
.bowls {
  position: relative; flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px;
  align-items: center; justify-items: center;
  padding: .5rem 1.2rem;
  background: radial-gradient(ellipse at center, #e5f2ef 0, #d3e9e4 60%, #c3dfd8 100%);
  border-radius: 120px; border: 7px solid #6b5243;
  box-shadow: inset 0 0 0 3px #8a6b58, inset 0 12px 30px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.bowl-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 4px; border: 0; background: none; border-radius: 16px; font: inherit; color: var(--ink); min-width: 0; }
.board.mine .bowl-cell { cursor: pointer; }
.bowl-top { display: flex; align-items: center; gap: 3px; max-width: 100%; }
.bowl-svg { width: var(--bowl, 110px); height: var(--bowl, 110px); display: block; transition: transform .15s, filter .2s; }
.bowl-pts { font-size: .74rem; color: #4f625e; white-space: nowrap; }
.bowl-pts .up { color: var(--ok); }
.bowl-cell.target .bowl-svg { filter: drop-shadow(0 0 6px #e1463b88); }
.bowl-cell.target:hover .bowl-svg { filter: drop-shadow(0 0 10px #e1463bdd); }
.bowl-cell.full .bowl-svg { filter: drop-shadow(0 0 7px #ffcf4d); }
.bowl-cell.shake { animation: shake .4s; }
.bowl-svg .pop { animation: popIn .55s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i, 0) * .09s); transform-box: fill-box; transform-origin: center; }
.bowl-svg .staged { animation: stagedPulse 1.2s ease-in-out infinite; }
.bowl-svg .staged.fresh { animation: appear .15s .48s both, stagedPulse 1.2s .65s ease-in-out infinite; }
.bowl-svg .score-pop { animation: popIn .7s .2s cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes popIn { 0% { transform: translateY(-14px) scale(0); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes appear { from { opacity: 0; } }
@keyframes stagedPulse { 50% { opacity: .55; } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.g-screen[data-hl="1"] .table-slot[data-bowl="1"] .slot-glow, .g-screen[data-hl="2"] .table-slot[data-bowl="2"] .slot-glow,
.g-screen[data-hl="3"] .table-slot[data-bowl="3"] .slot-glow, .g-screen[data-hl="4"] .table-slot[data-bowl="4"] .slot-glow,
.g-screen[data-hl="5"] .table-slot[data-bowl="5"] .slot-glow, .g-screen[data-hl="6"] .table-slot[data-bowl="6"] .slot-glow,
.g-screen[data-hl="7"] .table-slot[data-bowl="7"] .slot-glow, .g-screen[data-hl="8"] .table-slot[data-bowl="8"] .slot-glow { opacity: 1; }
.g-screen[data-hl="1"] .zone-board .bowl-cell[data-bowl="1"], .g-screen[data-hl="2"] .zone-board .bowl-cell[data-bowl="2"],
.g-screen[data-hl="3"] .zone-board .bowl-cell[data-bowl="3"], .g-screen[data-hl="4"] .zone-board .bowl-cell[data-bowl="4"],
.g-screen[data-hl="5"] .zone-board .bowl-cell[data-bowl="5"], .g-screen[data-hl="6"] .zone-board .bowl-cell[data-bowl="6"],
.g-screen[data-hl="7"] .zone-board .bowl-cell[data-bowl="7"], .g-screen[data-hl="8"] .zone-board .bowl-cell[data-bowl="8"] { background: #ffffff8c; box-shadow: 0 0 0 2px #ffcf4d; }

.order-chip { display: inline-flex; align-items: center; gap: 1px; padding: 2px 6px 2px 3px; border-radius: 99px; background: #3a2a22; color: #fff; font-size: .74rem; white-space: nowrap; flex: none; }
.order-chip .price { font-family: var(--head); font-weight: 700; margin-right: 3px; background: #ffffff1f; border-radius: 99px; padding: 0 5px; }
.order-chip b { font-weight: 800; margin-left: 2px; }
.order-chip .ico { display: block; }

.board-foot { flex: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; padding-top: .7rem; }
.foot-block { display: flex; align-items: center; gap: .45rem; }
.foot-label { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.bonus-row, .bin-row { display: flex; gap: 3px; }
.bonus-box { position: relative; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: .78rem; color: var(--teal); }
.bonus-box.used { opacity: .35; }
.bonus-box.used::after, .bin-box.x::after { content: ''; position: absolute; inset: 3px; background: linear-gradient(45deg, transparent 45%, var(--red) 45%, var(--red) 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--red) 45%, var(--red) 55%, transparent 55%); }
.bin-box { position: relative; width: 19px; height: 21px; border-radius: 5px; border: 1.5px solid #cdbfa9; background: #fff; }
.bin-box i { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .6rem; font-weight: 800; color: var(--red-d); }
.bin-box.pending { background: #fde7e4; border-color: var(--red); border-style: dashed; }
.totals { gap: .8rem; font-size: .82rem; color: var(--muted); margin-left: auto; }
.totals b { color: var(--ink); }
.totals .grand { font-family: var(--head); font-size: 1.2rem; font-weight: 700; color: var(--red-d); }

/* Panel lateral del rival y de ayuda */
.drawer-back { position: absolute; inset: 0; z-index: 39; background: rgba(30, 20, 15, .32); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 40; width: min(560px, 94vw); display: flex; flex-direction: column; background: var(--card); border-radius: 22px 0 0 22px; box-shadow: -12px 0 40px rgba(0, 0, 0, .22); transform: translateX(105%); transition: transform .35s cubic-bezier(.3, .8, .3, 1); }
.drawer-open .drawer-back { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: none; }
.drawer-head { flex: none; display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; margin: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 1rem; }
.drawer .tabs { display: flex; gap: .3rem; padding: .6rem 1rem 0; }
.tab { border: 1px solid var(--line); background: #f5ead8; padding: .4rem .85rem; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab.on { background: #fff; color: var(--ink); border-color: var(--teal); }
.drawer .bowls { flex: none; grid-template-rows: auto auto; --bowl: min(96px, calc((94vw - 110px) / 4)); padding: .6rem; border-radius: 60px; }
.log { margin: 0 0 1rem; padding-left: 1.1rem; font-size: .88rem; color: var(--muted); }

/* Ventanas emergentes */
.modal-layer { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 4.5rem 1rem 1rem; background: rgba(30, 20, 15, .48); backdrop-filter: blur(2px); animation: fadeIn .25s; overflow: auto; }
.modal-layer:empty { display: none; }
.modal { position: relative; width: min(540px, 100%); padding: 3.4rem 1.4rem 1.4rem; text-align: center; background: var(--card); border-radius: 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .32); }
.modal h2 { font-size: 1.6rem; }
.modal h2 small { font-size: .9rem; color: var(--muted); }
.modal-sango { position: absolute; top: -66px; left: 50%; transform: translateX(-50%); }
.pop-in { animation: modalIn .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes modalIn { from { transform: scale(.6) translateY(30px); opacity: 0; } }
.bonus-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-top: .6rem; }
.bonus-opt { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .7rem .2rem; border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--ink); transition: transform .15s, border-color .15s; }
.bonus-opt small { font-size: .74rem; font-weight: 800; color: var(--muted); }
.bonus-opt:not(:disabled):hover { border-color: var(--teal); transform: translateY(-4px) rotate(-2deg); }
.bonus-opt:disabled { opacity: .35; cursor: not-allowed; }
.plus3 { font-family: var(--head); font-weight: 700; font-size: 1.7rem; line-height: 46px; color: var(--teal); }
.podium { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0 1.1rem; text-align: left; }
.result { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.result.winner { background: linear-gradient(135deg, #fff4d6, #ffe9b8); border-color: #f1cf7a; }
.result.me b::after { content: ' (vos)'; color: var(--muted); font-weight: 600; }
.result small { display: block; color: var(--muted); font-size: .78rem; }
.result .medal { width: 2rem; text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--muted); }
.result .total { font-family: var(--head); font-size: 1.8rem; font-weight: 700; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }

.tabbar { display: none; }

/* Efectos */
.flyer { position: fixed; z-index: 90; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); }
.flyer .ico { display: block; }
.confetti { position: fixed; z-index: 95; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 70; width: min(92vw, 480px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); font-weight: 700; animation: toastIn .25s ease-out; transition: opacity .4s, transform .4s; text-align: center; }
.toast.ok { background: #2f7d4a; }
.toast.err { background: #b8322a; }
.toast.serve { background: #6b5243; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Celular y pantallas angostas ---------- */
@media (max-width: 860px) {
  .hud { gap: .4rem; padding: .35rem .45rem; }
  .hud-exit, .hud-btn { width: 32px; height: 32px; }
  .round { min-width: 0; }
  .round b { width: 22px; height: 22px; font-size: .74rem; border-width: 1.5px; }
  .round i { display: none; }
  .hud-rounds { gap: 2px; }
  .hud-player { padding: .2rem .4rem .2rem .2rem; gap: .25rem; }
  .hud-player .pinfo, .peek { display: none; }
  .hud-player .avatar { width: 28px !important; height: 28px !important; font-size: 13px !important; }
  .pscore { font-size: 1.1rem; }
  .bubble { left: auto; right: -10px; transform: none; max-width: 70vw; white-space: normal; }
  .bubble::before { left: auto; right: 22px; }

  .stage { display: block; position: relative; padding: 0; }
  .zone { position: absolute; inset: 0 .4rem .4rem; display: none; border-radius: 18px; }
  .g-screen[data-tab="table"] .zone-side, .g-screen[data-tab="board"] .zone-board { display: flex; }
  .tabbar { display: flex; flex: none; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbtn { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; padding: .3rem 0 .35rem; border: 0; background: none; font: inherit; font-size: 1.15rem; color: var(--muted); cursor: pointer; }
  .tabbtn span { font-size: .7rem; font-weight: 800; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbtn.on { color: var(--red-d); }
  .tabbtn .alert { position: absolute; top: 5px; left: calc(50% + 10px); width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
  .only-mobile { display: inline-flex; }

  .pick-panel { --cmax: 140px; padding: .45rem .5rem .5rem; }
  .pick-title { font-size: 1.02rem; }
  .pick-order em { display: none; }
  .pick-cards { gap: .5rem; }
  .info-bar { font-size: .76rem; min-height: 40px; }

  .tray { padding: .4rem .5rem; }
  .tray-row { gap: .45rem; }
  .minis .mini svg { width: 40px; height: 40px; }
  .tray-main { min-width: 0; flex-basis: calc(100% - 100px); }
  .tray-text small { display: none; }
  .chip { padding: .2rem .5rem .2rem .25rem; }
  .chip .ico { width: 26px; height: 26px; }
  .tray-actions { width: 100%; justify-content: flex-end; }
  .board-wrap { padding: .4rem; }
  .bowls { padding: .4rem .35rem; border-radius: 50px; border-width: 5px; gap: 2px; }
  .bowl-top { flex-direction: column; gap: 1px; }
  .order-chip { font-size: .6rem; padding: 1px 4px 1px 2px; }
  .order-chip .ico { width: 11px; height: 11px; }
  .bowl-pts { font-size: .62rem; }
  .board-foot { gap: .4rem .8rem; padding-top: .4rem; }
  .totals { margin-left: 0; font-size: .74rem; gap: .5rem; }
  .bonus-grid { grid-template-columns: repeat(3, 1fr); }
  .drawer { border-radius: 18px 0 0 18px; }
}
@media (max-width: 640px) {
  .app { padding-left: .6rem; padding-right: .6rem; }
  .uname { display: none; }
  .ri-hero { flex-direction: column; text-align: center; padding: 1rem; }
  .ri-actions, .ri-stats { justify-content: center; }
}

/* ---------- Cubirds ---------- */
.cb-tile-art { background: linear-gradient(135deg, #bfe8e3, #e4f6f1); }
.cb-tile-card { position: absolute; width: 92px; border-radius: 8px; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.cb-tile-card.k1 { left: calc(50% - 130px); top: 34px; transform: rotate(-12deg); }
.cb-tile-card.k2 { left: calc(50% - 46px); top: 18px; z-index: 1; }
.cb-tile-card.k3 { left: calc(50% + 38px); top: 34px; transform: rotate(12deg); }

.cb-hero { background: linear-gradient(135deg, #c7ebe5, #edf8f4); }
.cb-hero-art { position: relative; flex: none; width: 190px; height: 150px; }
.cb-hero-art .cb-card { position: absolute; width: 84px; top: 14px; }
.cb-hero-art .h1 { left: 0; transform: rotate(-12deg); }
.cb-hero-art .h2 { left: 53px; top: 0; z-index: 1; }
.cb-hero-art .h3 { left: 106px; transform: rotate(12deg); }
.cb-lobby-art { position: relative; flex: none; width: 92px; height: 78px; }
.cb-lobby-art .cb-card { position: absolute; width: 50px; }
.cb-lobby-art .cb-card:first-child { left: 0; top: 4px; transform: rotate(-10deg); }
.cb-lobby-art .cb-card:last-child { left: 38px; top: 0; transform: rotate(8deg); }

.cb-card { display: block; width: var(--cw, 80px); aspect-ratio: 400 / 572; border-radius: 7%/5%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); user-select: none; -webkit-user-drag: none; }
.cb-card.mini { width: 44px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.cb-flyer { position: fixed; z-index: 90; aspect-ratio: 400 / 572; border-radius: 7%/5%; pointer-events: none; box-shadow: 0 10px 22px rgba(0, 0, 0, .3); }

.cb-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.cb-legend > div { display: flex; align-items: center; gap: .6rem; }
.cb-legend span { display: flex; flex-direction: column; line-height: 1.2; }
.cb-legend small { color: var(--muted); font-size: .76rem; }

.cb-round b { font-family: var(--head); font-size: .95rem; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: .3rem .7rem; white-space: nowrap; }
.cb-screen .hud-player.active::before { content: '🐦'; }
.cb-screen .pscore small { font-size: .8rem; margin-left: 1px; }

.cb-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: .7rem; padding: 0 .7rem .7rem; }
.cb-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.info-bar .go { color: var(--ink); }
.cb-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: radial-gradient(circle at 30% 0, #d5f3ee, #a9ddd5 70%); }
.cb-row { flex: 1; min-height: 0; display: flex; align-items: center; gap: 8px; border-radius: 14px; background: rgba(255, 255, 255, .28); padding: 0 4px; }
.cb-cards { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.cb-cards .cb-card { flex: none; transition: transform .18s, box-shadow .18s; }
.cb-cards .cb-card + .cb-card { margin-left: calc(var(--step, 86px) - var(--cw)); }
.cb-cards .cb-card.enter { animation: cbIn .45s cubic-bezier(.3, .8, .3, 1) backwards; }
.cb-cards .cb-card.late { animation-delay: .45s; }
@keyframes cbIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
.cb-row.hov-L .cap-L, .cb-row.hov-R .cap-R { transform: translateY(-7px); box-shadow: 0 0 0 3px #ffd23f, 0 6px 12px rgba(0, 0, 0, .2); }

.cb-drop { flex: none; width: 50px; height: 72%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; border: 2px dashed transparent; background: none; font: inherit; color: transparent; }
button.cb-drop { cursor: pointer; border-color: #ffffffcc; background: rgba(255, 255, 255, .45); color: #2f6f69; transition: background .15s, transform .15s; }
button.cb-drop b { font-family: var(--head); font-size: 1.05rem; }
button.cb-drop.gain { background: #fff6c9; border-color: #f2b705; color: #8a5a00; }
button.cb-drop:hover { background: #fff; transform: scale(1.06); }

.cb-hand { flex: none; padding: .45rem .7rem .6rem; border-top: 1px solid var(--line); background: var(--card); --hw: 74px; }
.cb-hand-head { display: flex; align-items: center; gap: .6rem; font-size: .85rem; margin-bottom: .35rem; }
.cb-hand-body { display: flex; align-items: flex-end; gap: .8rem; }
.cb-hand-cards { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: .9rem; overflow-x: auto; padding: 10px 2px 2px; }
.cb-hand-msg { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: .8rem; flex-wrap: wrap; }
.cb-group { flex: none; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.cb-stack { position: relative; width: calc(var(--hw) + (var(--n) - 1) * 11px); height: calc(var(--hw) * 1.43); padding: 0; border: 0; background: none; cursor: default; transition: transform .18s; }
.cb-stack .cb-card { position: absolute; top: 0; left: calc(var(--k) * 11px); width: var(--hw); }
.cb-group.pickable .cb-stack { cursor: pointer; }
.cb-group.pickable .cb-stack:hover { transform: translateY(-5px); }
.cb-group.sel .cb-stack { transform: translateY(-9px); }
.cb-group.sel .cb-stack .cb-card { box-shadow: 0 0 0 3px var(--red), 0 8px 14px rgba(0, 0, 0, .2); }
.cb-count { position: absolute; right: -7px; top: -7px; z-index: 2; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: var(--ink); color: #fff; font-family: var(--head); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.cb-gname { font-size: .76rem; font-weight: 800; white-space: nowrap; }
.cb-gname small { color: var(--muted); font-weight: 700; }
.cb-flock { padding: .2rem .55rem; font-size: .76rem; }
.cb-actions { flex: none; display: flex; flex-direction: column; gap: .4rem; padding-bottom: 4px; }

.cb-side { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: .6rem; }
.cb-piles { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; font-size: .85rem; }
.cb-deck { display: flex; align-items: center; gap: .55rem; }
.cb-deck .cb-card { width: 34px; box-shadow: 2px 2px 0 #fff, 3px 3px 0 #b9ddd7, 0 3px 6px rgba(0, 0, 0, .2); }
.cb-piles b { font-family: var(--head); font-size: 1.15rem; }
.cb-discard { color: var(--muted); }
.cb-coll { padding: .6rem .7rem .7rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.cb-coll.me { border-color: #f1b3ac; background: #fff6f3; }
.cb-coll-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; font-size: .88rem; }
.cb-coll-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-goal { font-size: .72rem; font-weight: 800; color: var(--teal); white-space: nowrap; }
.cb-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.cb-slot { position: relative; display: flex; justify-content: center; }
.cb-slot .cb-card.mini { width: 100%; max-width: 58px; filter: grayscale(1); opacity: .28; }
.cb-slot.has .cb-card.mini { filter: none; opacity: 1; }
.cb-slot b { position: absolute; right: -4px; top: -6px; min-width: 21px; height: 21px; border-radius: 11px; background: var(--teal); color: #fff; font-family: var(--head); font-size: .8rem; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.cb-slot.three b { background: #e8a200; }
.drawer-body.cb-side { overflow: auto; }

.cb-modal-art { position: absolute; top: -64px; left: 50%; transform: translateX(-50%) rotate(-6deg); }
.cb-modal-art .cb-card { width: 82px; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }

@media (max-width: 860px) {
  .cb-stage { display: flex; padding: 0 .4rem .4rem; }
  .cb-stage > .cb-side { display: none; }
  .cb-main { flex: 1; border-radius: 18px; }
  .cb-round b { font-size: .8rem; padding: .2rem .5rem; }
  .cb-rows { gap: 5px; padding: 5px; }
  .cb-row { gap: 4px; padding: 0 2px; border-radius: 10px; }
  .cb-drop { width: 34px; height: 80%; }
  button.cb-drop b { font-size: .9rem; }
  .cb-hand { --hw: 50px; padding: .35rem .45rem .45rem; }
  .cb-hand-head { margin-bottom: 0; font-size: .78rem; }
  .cb-hand-body { flex-direction: column; align-items: stretch; gap: .35rem; }
  .cb-hand-cards { gap: .7rem; }
  .cb-actions { flex-direction: row; justify-content: flex-end; }
  .cb-gname { font-size: .68rem; }
}

/* Partidas de prueba contra bots */
.bot-form { display: flex; align-items: center; gap: .45rem; flex-basis: 100%; margin-top: .2rem; padding: .4rem .6rem; border: 1px dashed #b9ccd0; border-radius: 12px; background: rgba(255, 255, 255, .55); width: fit-content; font-size: .85rem; font-weight: 800; color: var(--muted); }
.bot-form select { font: inherit; font-weight: 700; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.test-pill { flex: none; background: #e3eef0; color: #3b6c72; }
@media (max-width: 860px) { .test-pill { display: none; } }
