/* Cacho · Millo Games — estilo cartoon neón (coherente con millogames.online). Responsive: teléfono vertical/horizontal, tablet, escritorio; safe-area. */
@font-face { font-family: "Lilita One"; src: url(../assets/LilitaOne.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(../assets/Fredoka.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
:root {
  --bg1: #0d0524; --bg2: #1a0840; --bg3: #2a0f5e; --cyan: #29e7ff; --pink: #ff3ea5; --yellow: #ffd23f; --green: #3dff8b; --orange: #ff7a18; --purple: #7b2ff7;
  --txt: #f4efff; --muted: #bfb3e6; --out: #120026; --red: #ff4d6d;
  --st: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px);
  --u: clamp(13px, calc(min(100vw, 170vh) / 70), 21px);
  --head: "Lilita One", "Fredoka", system-ui, sans-serif;
  --tool: 42px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg1); color: var(--txt); overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 500; font-size: var(--u); line-height: 1.25; }
body { position: fixed; inset: 0; background:
  radial-gradient(60vmax 50vmax at 15% 10%, rgba(123,47,247,.45), transparent 60%), radial-gradient(55vmax 45vmax at 90% 90%, rgba(255,62,165,.28), transparent 60%),
  radial-gradient(40vmax 40vmax at 85% 8%, rgba(41,231,255,.18), transparent 60%), linear-gradient(180deg, var(--bg1), var(--bg2)); }
body.booting #app { opacity: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
b { font-weight: 700; }
a { color: var(--cyan); }
::selection { background: transparent; }
input { -webkit-user-select: text; user-select: text; }

#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; padding: calc(var(--st) + var(--tool) + 10px) calc(var(--sr) + 10px) calc(var(--sb) + 8px) calc(var(--sl) + 10px); }
.screen.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- herramientas globales ---------- */
#tools { position: fixed; z-index: 70; top: calc(var(--st) + 6px); right: calc(var(--sr) + 8px); display: flex; gap: 6px; }
.ib { width: var(--tool); height: var(--tool); border-radius: 14px; border: 2.5px solid var(--out); background: linear-gradient(180deg, #4a1d99, #2d1066); color: #fff; font-size: 20px; line-height: 1; padding: 0; display: grid; place-items: center;
  box-shadow: 0 3px 0 var(--out), 0 0 12px rgba(41,231,255,.25); }
.ib:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--out); }
.ib.on { background: linear-gradient(180deg, #1aa5c4, #0e6f93); }
.ib.nofs { opacity: .55; }
body.muted #t-snd { background: linear-gradient(180deg, #7a1d3d, #4a0f26); }

/* ---------- botones ---------- */
.btn { --c1: #6b35d6; --c2: #43189c; display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .45em 1em; border-radius: 16px; border: 3px solid var(--out);
  background: linear-gradient(180deg, var(--c1), var(--c2)); color: #fff; font-family: var(--head); font-weight: 400; font-size: 1.05em; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(18,0,38,.6);
  box-shadow: 0 4px 0 var(--out), 0 0 14px rgba(123,47,247,.35); transition: transform .08s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--out); }
.btn:disabled { filter: grayscale(.8) brightness(.6); box-shadow: 0 2px 0 var(--out); }
.btn.pri { --c1: #29c9ff; --c2: #1177d6; box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(41,231,255,.45); }
.btn.sec { --c1: #ff5db4; --c2: #c91c7f; box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(255,62,165,.4); }
.btn.ter { --c1: #ffc83a; --c2: #ee7d12; color: #2a0f00; text-shadow: 0 1px 0 rgba(255,255,255,.4); box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(255,210,63,.4); }
.btn.red { --c1: #ff5a72; --c2: #c81d3e; box-shadow: 0 4px 0 var(--out), 0 0 16px rgba(255,77,109,.4); }
.btn.go { --c1: #3dff8b; --c2: #12a851; color: #04260f; text-shadow: 0 1px 0 rgba(255,255,255,.35); box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(61,255,139,.4); }
.btn.gold { --c1: #ffd23f; --c2: #e59a0a; color: #2a1a00; text-shadow: 0 1px 0 rgba(255,255,255,.4); box-shadow: 0 4px 0 var(--out), 0 0 16px rgba(255,210,63,.45); }
.btn.big { min-height: 56px; width: 100%; justify-content: flex-start; text-align: left; padding: .35em .9em; font-size: 1.2em; }
.btn.big .ic { font-size: 1.6em; line-height: 1; filter: drop-shadow(0 2px 0 rgba(18,0,38,.5)); }
.btn.big small { display: block; font-family: "Fredoka", sans-serif; font-weight: 500; font-size: .62em; opacity: .92; letter-spacing: 0; text-shadow: none; }
.btn.go.big, .btn.pri.big.go { justify-content: center; }
.row2 { display: flex; gap: 8px; } .row2 > * { flex: 1; }
.hint { color: var(--muted); font-size: .8em; font-weight: 500; }
.warn { background: rgba(255,122,24,.15); border: 2px solid var(--orange); border-radius: 12px; padding: .5em .8em; margin: .5em 0; }

/* ---------- menú ---------- */
#s-menu { overflow-y: auto; }
.menu-wrap { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding-bottom: 4px; }
.brand-top { display: flex; align-items: center; gap: 8px; font-family: var(--head); letter-spacing: .14em; font-size: .8em; color: var(--cyan); text-shadow: 0 0 10px rgba(41,231,255,.6); }
.mg-logo { width: 1.7em; height: 1.7em; border-radius: 8px; border: 2px solid var(--out); background: conic-gradient(from 45deg, var(--cyan), var(--purple), var(--pink), var(--yellow), var(--cyan)); box-shadow: 0 0 10px rgba(41,231,255,.6); }
.logo { margin: 0; font-family: var(--head); font-weight: 400; font-size: clamp(54px, min(17vw, 20vh), 140px); line-height: .95; letter-spacing: .02em; display: flex; }
.logo span { display: inline-block; color: #fff; -webkit-text-stroke: .06em var(--out); paint-order: stroke fill; text-shadow: 0 .06em 0 var(--out), 0 0 .35em var(--cyan); animation: bob 3s ease-in-out infinite; }
.logo span:nth-child(2n) { color: var(--yellow); text-shadow: 0 .06em 0 var(--out), 0 0 .35em var(--pink); animation-delay: -.5s; }
.logo span:nth-child(3) { color: var(--pink); animation-delay: -1s; } .logo span:nth-child(1) { transform: rotate(-6deg); } .logo span:nth-child(5) { transform: rotate(6deg); }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -.07em; } }
.tag { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .06em; font-size: .95em; }
.menu-dice { display: flex; gap: .5em; margin: 4px 0 8px; height: calc(var(--u) * 3.4); align-items: center; }
.menu-dice .die { --ds: calc(var(--u) * 2.6); animation: dfloat 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
@keyframes dfloat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-9px) rotate(5deg); } }
.menu-btns { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.stats { margin: 2px 0 0; color: var(--yellow); font-size: .85em; text-align: center; }
.foot { color: var(--muted); font-size: .72em; margin-top: 2px; text-align: center; }
@media (orientation: landscape) and (max-height: 540px) {
  .menu-wrap { max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto 1fr auto; column-gap: 24px; align-content: center; justify-items: center; }
  .brand-top, .logo, .tag, .menu-dice { grid-column: 1; } .menu-btns { grid-column: 2; grid-row: 1 / 6; align-self: center; } .stats, .foot { grid-column: 1; }
  .logo { font-size: clamp(48px, 22vh, 110px); } .menu-dice { margin: 0; }
}

/* ---------- paneles de configuración ---------- */
.screen:not(#s-game):not(#s-menu) { overflow-y: auto; }
.panel { position: relative; max-width: 560px; margin: 0 auto; padding: 14px 16px 16px; border-radius: 22px; border: 3px solid var(--out); background: linear-gradient(180deg, rgba(58,22,128,.92), rgba(30,10,72,.94)); box-shadow: 0 6px 0 var(--out), 0 0 28px rgba(123,47,247,.45); display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.6em; color: var(--yellow); text-shadow: 0 2px 0 var(--out), 0 0 14px rgba(255,210,63,.5); text-align: center; }
.panel h3 { margin: 0 0 4px; font-family: var(--head); font-weight: 400; color: var(--cyan); }
.back { align-self: flex-start; background: none; border: 0; color: var(--cyan); font-weight: 700; padding: 4px 10px 4px 4px; min-height: 44px; min-width: 64px; text-align: left; }
.fld { display: flex; flex-direction: column; gap: 5px; font-weight: 600; color: var(--muted); }
.fld > span { font-size: .85em; letter-spacing: .05em; }
input[type=text], input:not([type]), .fld input, #on-code { background: rgba(10,2,30,.7); border: 2.5px solid rgba(255,255,255,.28); border-radius: 12px; padding: .5em .7em; color: #fff; font-weight: 600; min-height: 44px; width: 100%; outline: none; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(41,231,255,.5); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 44px; min-height: 44px; border-radius: 14px; border: 2.5px solid var(--out); background: rgba(255,255,255,.1); font-family: var(--head); font-size: 1.1em; box-shadow: 0 3px 0 var(--out); }
.seg button.sel { background: linear-gradient(180deg, #29c9ff, #1177d6); box-shadow: 0 3px 0 var(--out), 0 0 14px rgba(41,231,255,.55); }
.names { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.fld.nm { flex-direction: row; align-items: center; } .fld.nm span { font-size: 1.5em; }
.on-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.16); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; } .card p { margin: 0; font-size: .85em; color: var(--muted); }
#on-code { text-align: center; letter-spacing: .3em; font-family: var(--head); font-size: 1.5em; text-transform: uppercase; }
.msg { min-height: 1.3em; text-align: center; font-weight: 600; color: var(--cyan); } .msg.bad { color: var(--red); }
.room-code { text-align: center; color: var(--muted); font-weight: 600; } .room-code b { display: block; font-family: var(--head); font-weight: 400; font-size: 3em; letter-spacing: .18em; color: var(--yellow); text-shadow: 0 3px 0 var(--out), 0 0 18px rgba(255,210,63,.6); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.plist li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.14); border-radius: 12px; min-height: 42px; min-width: 0; }
.plist li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .plist li .av { font-size: 1.5em; }
.plist li em { font-style: normal; font-size: .68em; background: var(--purple); border-radius: 99px; padding: 1px 7px; } .plist li em.you { background: var(--pink); }
.plist li.empty { opacity: .45; font-size: .85em; border-style: dashed; }
@media (max-width: 460px) { .on-cols { grid-template-columns: 1fr; } .plist { grid-template-columns: 1fr; } }
@media (orientation: landscape) and (max-height: 520px) { .panel { gap: 8px; padding: 10px 14px 12px; } .panel h2 { font-size: 1.3em; } .on-cols { grid-template-columns: 1fr 1fr; } .plist { grid-template-columns: repeat(3, 1fr); } .room-code b { font-size: 2em; } }

/* ---------- dados 3D ---------- */
.die { --ds: 56px; width: var(--ds); height: var(--ds); position: relative; display: inline-block; perspective: calc(var(--ds) * 7); flex: none; }
.die .cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.die .face { position: absolute; inset: 0; border-radius: 22%; border: calc(var(--ds) * .06) solid var(--out); display: grid; place-items: center; backface-visibility: hidden;
  background: linear-gradient(150deg, #ffffff 0%, #f1e8ff 50%, #cdbcf7 100%); box-shadow: inset 0 calc(var(--ds) * -.07) 0 rgba(95,45,175,.25), inset 0 calc(var(--ds) * .05) 0 #fff; }
.die .f1 { transform: translateZ(calc(var(--ds) / 2)); } .die .f6 { transform: rotateY(180deg) translateZ(calc(var(--ds) / 2)); }
.die .f2 { transform: rotateY(90deg) translateZ(calc(var(--ds) / 2)); } .die .f5 { transform: rotateY(-90deg) translateZ(calc(var(--ds) / 2)); }
.die .f3 { transform: rotateX(90deg) translateZ(calc(var(--ds) / 2)); } .die .f4 { transform: rotateX(-90deg) translateZ(calc(var(--ds) / 2)); }
.pf { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 74%; height: 74%; }
.pf i { place-self: center; width: 72%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7af3ff, #1593c9 62%, #0a5a90); box-shadow: 0 0 0 1.5px var(--out); }
.face.ace .pf i, .dflat.ace .pf i { width: 98%; background: radial-gradient(circle at 35% 30%, #ffb3dc, #ff3ea5 58%, #bd1573); box-shadow: 0 0 0 1.5px var(--out), 0 0 8px rgba(255,62,165,.7); }
.face.ace { background: linear-gradient(150deg, #fff, #ffe8f6 55%, #f7c2e2); }
.dflat { --fs: 1.7em; display: inline-grid; place-items: center; width: var(--fs); height: var(--fs); flex: none; border-radius: 22%; border: calc(var(--fs) * .07) solid var(--out); background: linear-gradient(150deg, #fff, #f1e8ff 55%, #cdbcf7); vertical-align: middle; box-shadow: 0 2px 0 var(--out); }
.dflat.ace { background: linear-gradient(150deg, #fff, #ffe8f6 55%, #f7c2e2); }
.dflat.tiny { --fs: 1.35em; box-shadow: 0 1px 0 var(--out); } .dflat.big { --fs: calc(var(--u) * 4.4); box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(41,231,255,.5); }
.pp { display: inline-block; width: .62em; height: .62em; border-radius: 28%; background: linear-gradient(150deg, #fff, #cdbcf7); border: 1.5px solid var(--out); box-shadow: 0 1px 0 var(--out); }
.die.mine.hit { filter: drop-shadow(0 0 7px var(--cyan)); }

/* ---------- juego: cuadrícula ---------- */
#s-game { padding: calc(var(--st) + 6px) calc(var(--sr) + 8px) calc(var(--sb) + 6px) calc(var(--sl) + 8px); max-width: 1680px; margin: 0 auto; }
#s-game.active { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "opps" "center" "me" "act"; gap: 6px; }
#g-top { grid-area: top; display: flex; align-items: center; gap: 8px; min-height: var(--tool); padding-right: calc(var(--tool) * 4 + 26px); }
#g-menu { flex: none; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }
.chip { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2); border-radius: 99px; padding: 1px 9px; font-size: .8em; font-weight: 600; white-space: nowrap; } .chip b { color: var(--yellow); font-family: var(--head); font-weight: 400; }
.chip.obl { background: rgba(255,122,24,.3); border-color: var(--orange); color: #ffd9b0; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 14px var(--orange); } }
#g-opps { grid-area: opps; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-content: flex-start; }
.seat { position: relative; display: flex; align-items: center; gap: 7px; padding: 5px 9px 7px 6px; min-width: 0; flex: 1 1 calc(var(--u) * 7.6); max-width: calc(var(--u) * 13); border-radius: 15px; border: 2.5px solid var(--out); background: linear-gradient(180deg, rgba(74,29,153,.9), rgba(40,14,95,.92)); box-shadow: 0 3px 0 var(--out); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.seat .av { font-size: 1.7em; line-height: 1; filter: drop-shadow(0 2px 0 rgba(18,0,38,.6)); }
.seat .si { min-width: 0; display: flex; flex-direction: column; gap: 2px; } .seat .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }
.seat .pips { display: flex; gap: 3px; font-size: .82em; flex-wrap: wrap; }
.seat .sb { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-family: var(--head); background: var(--yellow); color: #2a1a00; border: 2px solid var(--out); border-radius: 10px; padding: 0 6px; font-size: .95em; white-space: nowrap; }
.seat .sb .mini { display: inline-flex; font-size: .78em; }
.seat .tagl { position: absolute; right: 4px; top: 2px; font-size: .62em; background: var(--red); border-radius: 6px; padding: 0 4px; }
.seat .tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform .12s linear; }
.seat.urgent .tbar { background: var(--red); }
.seat.turn { box-shadow: 0 3px 0 var(--out), 0 0 0 3px var(--cyan), 0 0 22px rgba(41,231,255,.7); transform: translateY(-2px); }
.seat.out { filter: grayscale(1); opacity: .5; } .seat.left { opacity: .65; }
#g-opps.shaking .pp { animation: jig .12s infinite alternate; } @keyframes jig { from { transform: translate(-1px,-2px) rotate(-12deg); } to { transform: translate(1px,2px) rotate(12deg); } }
#g-center { grid-area: center; min-height: 0; display: flex; }
.felt { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 26px; border: 3px solid var(--out);
  background: radial-gradient(120% 120% at 50% 40%, rgba(40,160,150,.32), rgba(20,70,90,.28) 55%, rgba(30,10,72,.5)), linear-gradient(180deg, rgba(30,10,72,.6), rgba(20,5,50,.7)); box-shadow: inset 0 0 40px rgba(0,0,0,.35), inset 0 0 0 3px rgba(41,231,255,.18), 0 5px 0 var(--out); position: relative; overflow: hidden; }
.felt::before { content: ""; position: absolute; inset: 7px; border-radius: 20px; border: 2px dashed rgba(255,255,255,.12); pointer-events: none; }
.status { font-family: var(--head); font-size: 1.1em; color: var(--cyan); text-shadow: 0 2px 0 var(--out); text-align: center; min-height: 1.3em; } .status.mine { color: var(--green); text-shadow: 0 2px 0 var(--out), 0 0 12px var(--green); animation: pulse2 1.1s infinite; }
@keyframes pulse2 { 50% { transform: scale(1.05); } }
.betbox { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bet-empty { color: var(--muted); font-weight: 600; font-size: 1.05em; padding: .6em; text-align: center; }
.bet-main { display: flex; align-items: center; gap: .3em; } .bet-main.pop { animation: popIn .4s cubic-bezier(.3,1.6,.5,1); } @keyframes popIn { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bq { font-family: var(--head); font-size: calc(var(--u) * 4.6); line-height: 1; color: #fff; -webkit-text-stroke: .05em var(--out); paint-order: stroke fill; text-shadow: 0 .05em 0 var(--out), 0 0 .3em var(--pink); }
.bx { font-family: var(--head); font-size: calc(var(--u) * 2.4); color: var(--yellow); }
.bet-sub { text-align: center; font-size: .95em; color: var(--txt); } .bet-sub i { color: var(--muted); font-style: normal; font-size: .85em; }
.log { display: flex; gap: 5px; max-width: 100%; overflow-x: auto; padding: 2px 4px; scrollbar-width: none; min-height: 1.9em; } .log::-webkit-scrollbar { display: none; }
.lg { display: inline-flex; align-items: center; gap: 2px; flex: none; background: rgba(0,0,0,.28); border-radius: 99px; padding: 1px 7px 1px 4px; font-size: .78em; border: 1.5px solid rgba(255,255,255,.14); } .lg i { font-style: normal; } .lg b { font-family: var(--head); font-weight: 400; color: var(--yellow); }
#g-me { grid-area: me; container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.me-name { display: flex; align-items: center; gap: 7px; font-size: .95em; max-width: 100%; } .me-name #me-av { font-size: 1.5em; } .me-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; } .me-name .pips { display: inline-flex; gap: 3px; font-size: .8em; }
body.my-turn .me-name b, #s-game.my-turn .me-name b { color: var(--green); text-shadow: 0 0 10px var(--green); }
.timer { font-family: var(--head); background: var(--green); color: #04260f; border: 2px solid var(--out); border-radius: 99px; padding: 0 10px; min-width: 3.2em; text-align: center; box-shadow: 0 0 12px rgba(61,255,139,.7); } .timer.urgent { background: var(--red); color: #fff; animation: pulse2 .5s infinite; }
.tray { --ds: clamp(28px, min(13.2cqw, 12.5vh), 88px); position: relative; width: 100%; min-height: calc(var(--ds) * 1.85); display: flex; align-items: flex-end; justify-content: center; padding-left: calc(var(--ds) * 1.1); }
.hand { display: flex; gap: calc(var(--ds) * .2); align-items: center; justify-content: center; min-height: var(--ds); margin-bottom: calc(var(--ds) * .2); }
.hand .die { --ds: inherit; width: var(--ds); height: var(--ds); }
.tray .die { --ds: clamp(28px, min(13.2cqw, 12.5vh), 88px); }
.cup { position: absolute; left: calc(var(--ds) * .1); bottom: 0; width: calc(var(--ds) * 1.1); transform-origin: 50% 90%; transform: rotate(-22deg); transition: left .45s cubic-bezier(.3,1.3,.5,1), width .45s, transform .45s cubic-bezier(.3,1.3,.5,1); z-index: 3; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); }
.cup svg { display: block; width: 100%; height: auto; overflow: visible; }
.tray.covering .cup { left: calc(50% - var(--ds) * .95); width: calc(var(--ds) * 1.9); transform: rotate(0); }
.tray.covering .hand { visibility: hidden; }
.tray.shaking .cup-in { animation: cshake .14s linear infinite alternate; }
@keyframes cshake { 0% { transform: translate(-5px, -9px) rotate(-9deg); } 33% { transform: translate(6px, 3px) rotate(8deg); } 66% { transform: translate(-4px, 2px) rotate(-6deg); } 100% { transform: translate(5px, -10px) rotate(10deg); } }
#g-act { grid-area: act; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 6px; border-radius: 20px; border: 3px solid var(--out); background: linear-gradient(180deg, rgba(58,22,128,.9), rgba(30,10,72,.92)); box-shadow: 0 4px 0 var(--out); transition: opacity .2s; }
#g-act.wait .pick, #g-act.wait .btns { opacity: .38; pointer-events: none; }
.pick { display: flex; gap: 8px; align-items: stretch; }
@media (max-width: 479px) and (orientation: portrait) { .pick { flex-direction: column; align-items: stretch; gap: 5px; } .qty { justify-content: center; } .qv { min-width: 3em; } #c-dice .lbl { display: none; } .chip { padding: 0 7px; } }
.qty { display: flex; align-items: center; gap: 4px; flex: none; }
.qty button { width: 44px; height: 48px; border-radius: 14px; border: 2.5px solid var(--out); background: linear-gradient(180deg, #ffc83a, #ee7d12); color: #2a1a00; font-family: var(--head); font-size: 1.6em; line-height: 1; box-shadow: 0 3px 0 var(--out); padding: 0; }
.qty button:disabled { filter: grayscale(1) brightness(.6); } .qty button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--out); }
.qv { display: flex; flex-direction: column; align-items: center; min-width: 2.4em; } .qv output { font-family: var(--head); font-size: 2.2em; line-height: 1; color: #fff; text-shadow: 0 3px 0 var(--out), 0 0 12px var(--cyan); } .qv small { font-size: .62em; color: var(--muted); }
.faces { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; min-width: 0; }
.fb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; padding: 3px 0 2px; border-radius: 12px; border: 2.5px solid var(--out); background: rgba(255,255,255,.1); box-shadow: 0 3px 0 var(--out); min-width: 0; }
.fb .dflat { --fs: clamp(24px, 3.2vmin + 10px, 40px); box-shadow: 0 1px 0 var(--out); } .fb small { font-size: .6em; line-height: 1; opacity: .85; }
.fb.sel { background: linear-gradient(180deg, #29c9ff, #1177d6); box-shadow: 0 3px 0 var(--out), 0 0 14px rgba(41,231,255,.7); transform: translateY(-2px); } .fb:disabled { opacity: .3; }
.btns { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 6px; } .btns .btn { min-height: 48px; padding: .3em .5em; font-size: 1em; line-height: 1.05; flex-direction: column; gap: 0; } .btns .btn b { font-size: .95em; color: inherit; }
.ahint { font-size: .72em; color: var(--muted); min-height: 1.1em; text-align: center; line-height: 1.2; }

/* retrato: teléfonos y tablets verticales */
@media (min-width: 700px) and (orientation: portrait) { #g-act, #g-me, #g-opps { max-width: 760px; width: 100%; margin-inline: auto; } .btns .btn { min-height: 56px; font-size: 1.1em; } .fb { min-height: 58px; } }
@media (max-height: 640px) and (orientation: portrait) { .fb small { display: none; } .fb { min-height: 42px; } .ahint { display: none; } .felt { gap: 3px; } .bq { font-size: calc(var(--u) * 3.6); } }

/* horizontal: 3 columnas (rivales | mesa + mis dados | jugada) */
@media (min-aspect-ratio: 11/10) {
  #s-game.active { grid-template-columns: minmax(150px, 22%) minmax(0, 1fr) minmax(220px, 31%); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top top" "opps center act" "opps me act"; gap: 6px 10px; }
  #g-opps { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; overflow-y: auto; scrollbar-width: none; gap: 5px; }
  .seat { flex: 0 0 auto; max-width: none; width: 100%; padding: 4px 8px 6px 5px; } .seat .av { font-size: 1.45em; }
  #g-act { align-self: stretch; justify-content: center; gap: 8px; min-height: 0; overflow: hidden; }
  .pick { flex-direction: column; gap: 6px; } .qty { justify-content: center; } .faces { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .fb { min-height: 52px; } .btns { grid-template-columns: 1fr 1fr; } .btns #b-bet { grid-column: 1 / 3; }
  #g-top { padding-right: calc(var(--tool) * 4 + 24px); }
}
@media (min-aspect-ratio: 11/10) and (max-height: 460px) {
  .fb { min-height: 40px; flex-direction: row; gap: 3px; padding: 2px; } .fb small { display: none; } .fb .dflat { --fs: 28px; } .qty button { height: 40px; } .qv output { font-size: 1.7em; } .qv small { display: none; }
  .btns .btn { min-height: 42px; } .ahint { display: none; } #g-act { padding: 6px; gap: 5px; } .bq { font-size: calc(var(--u) * 3.4); } .bet-sub { font-size: .8em; } .felt { gap: 2px; padding: 4px; }
  .seat .pips { font-size: .7em; } .seat { padding: 3px 7px 5px 5px; } .status { font-size: .95em; min-height: 1.1em; }
  .tray { min-height: calc(var(--ds) * 1.6); } .me-name { font-size: .85em; }
}
@media (min-aspect-ratio: 11/10) and (min-height: 700px) { .btns .btn { min-height: 58px; font-size: 1.15em; } .fb { min-height: 64px; } .qty button { height: 56px; width: 52px; } }
#s-game.urgent { box-shadow: inset 0 0 0 4px rgba(255,77,109,.55); }

/* ---------- superposiciones ---------- */
.ov { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: calc(var(--st) + 8px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px); background: rgba(8,0,22,.72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.ov.show { opacity: 1; }
.sheet { position: relative; width: min(100%, 640px); max-height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 24px; border: 3px solid var(--out); background: linear-gradient(180deg, #3a1680, #1f0a4d); box-shadow: 0 6px 0 var(--out), 0 0 34px rgba(123,47,247,.6); animation: popIn .3s cubic-bezier(.3,1.4,.5,1); }
.sheet.small { width: min(100%, 380px); text-align: center; } .sheet h3, .sheet h2 { margin: 0; font-family: var(--head); font-weight: 400; color: var(--yellow); text-shadow: 0 2px 0 var(--out); }
.sheet .x { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--out); background: var(--red); color: #fff; z-index: 2; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 4px; max-height: calc(100dvh - 60px - var(--st) - var(--sb)); -webkit-user-select: text; user-select: text; }
.rules { padding-left: 1.3em; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; font-size: .92em; } .rules li::marker { color: var(--cyan); font-family: var(--head); } .rules b { color: var(--yellow); }
#rules-body h2 { padding-right: 40px; font-size: 1.3em; } #rules-body h2 small { font-size: .55em; color: var(--muted); font-family: "Fredoka"; } .rnote { font-size: .8em; color: var(--muted); }
#ov-menu .sheet, .curtain .sheet, .endcard { align-items: stretch; } .sheet.small .btn { width: 100%; }
.tut { text-align: center; width: min(100%, 520px); } .tut h3 { font-size: 1.5em; } .tut p { margin: 6px 0; font-size: 1.02em; } .tut-dice { display: flex; gap: 8px; justify-content: center; padding: 10px 0; flex-wrap: wrap; }
.td .dflat { --fs: clamp(34px, 8vmin, 58px); } .td.hl .dflat { box-shadow: 0 0 0 3px var(--yellow), 0 0 18px var(--yellow); transform: translateY(-4px); }
.tut-dots { display: flex; gap: 6px; justify-content: center; } .tut-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.25); } .tut-dots i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.chk { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 600; min-height: 36px; } .chk input { width: 22px; height: 22px; min-height: 0; accent-color: var(--pink); }
.tut .row2 .btn:nth-child(2) { flex: 0 0 56px; }
.curtain { background: radial-gradient(circle at 50% 40%, #2a0f5e, #0d0524); backdrop-filter: none; } .big-av { font-size: 4.5em; line-height: 1; filter: drop-shadow(0 6px 0 rgba(18,0,38,.7)); animation: bob 2s ease-in-out infinite; }
.endcard .trophy { font-size: 4.4em; line-height: 1; animation: bob 1.6s ease-in-out infinite; } .endcard h2 { font-size: 1.8em; }

/* ---------- revelación ---------- */
.reveal { background: rgba(8,0,22,.82); }
.rv-card { width: min(100%, 980px); max-height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 24px; border: 3px solid var(--out); background: linear-gradient(180deg, #3a1680, #1f0a4d); box-shadow: 0 6px 0 var(--out), 0 0 34px rgba(123,47,247,.6); overflow: auto; animation: popIn .3s cubic-bezier(.3,1.4,.5,1); }
.rv-head { text-align: center; font-size: 1.05em; } .rv-head .r { color: var(--red); font-family: var(--head); font-weight: 400; } .rv-head .g { color: var(--green); font-family: var(--head); font-weight: 400; } .rv-head .av { font-size: 1.3em; }
.rv-head .bigbet { display: inline-flex; align-items: center; gap: 2px; background: var(--yellow); color: #2a1a00; border: 2px solid var(--out); border-radius: 10px; padding: 0 8px; font-family: var(--head); }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 6px 10px; --ds: clamp(24px, min(7vw, 8.5vh), 50px); }
.rv-grid[data-n="5"], .rv-grid[data-n="6"] { --ds: clamp(20px, min(5.6vw, 6.6vh), 42px); }
.rv-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 14px; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.1); min-width: 0; }
.rv-row.caller { border-color: var(--red); } .rv-row.bettor { border-color: var(--yellow); } .rv-row.dead { opacity: .4; }
.rv-row .av { font-size: 1.5em; } .rv-row .nm { flex: 0 1 5.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }
.rv-dice { display: flex; gap: calc(var(--ds) * .16); flex: 1; justify-content: flex-end; flex-wrap: nowrap; }
.rv-dice .die { --ds: inherit; width: var(--ds); height: var(--ds); } .rv-grid .die { --ds: clamp(24px, min(7vw, 8.5vh), 50px); } .rv-grid[data-n="5"] .die, .rv-grid[data-n="6"] .die { --ds: clamp(20px, min(5.6vw, 6.6vh), 42px); }
.die.dim { opacity: .35; filter: grayscale(.7); transition: opacity .3s; } .die.counted.match { filter: drop-shadow(0 0 8px var(--green)); transform: translateY(-5px) scale(1.12); transition: transform .2s; }
.die.counted.wild { filter: drop-shadow(0 0 9px var(--pink)); transform: translateY(-5px) scale(1.12); transition: transform .2s; }
.rv-count { text-align: center; font-family: var(--head); font-size: 1.15em; color: var(--cyan); } .rv-count b { color: var(--yellow); font-size: 1.3em; }
.rv-verdict { text-align: center; min-height: 2.6em; padding: 6px 10px; border-radius: 14px; font-size: 1.05em; opacity: 0; transform: scale(.7); transition: all .3s cubic-bezier(.3,1.6,.5,1); }
.rv-verdict.show { opacity: 1; transform: none; } .rv-verdict.good { background: rgba(61,255,139,.2); border: 2px solid var(--green); } .rv-verdict.bad { background: rgba(255,77,109,.2); border: 2px solid var(--red); } .rv-verdict.neutral { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.3); }
.elim { color: var(--red); font-weight: 700; }
.rv-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
@media (max-height: 480px) { .rv-card { padding: 8px 10px; gap: 5px; } .rv-head { font-size: .88em; } .rv-verdict { min-height: 0; padding: 3px 8px; font-size: .9em; } .rv-count { font-size: .95em; } .rv-grid { gap: 4px 8px; } .rv-row { padding: 3px 6px; } .rv-foot .btn { min-height: 42px; } .rv-grid, .rv-grid[data-n="5"], .rv-grid[data-n="6"] { --ds: clamp(18px, min(5vw, 7vh), 34px); } .rv-grid .die, .rv-grid[data-n="5"] .die, .rv-grid[data-n="6"] .die { --ds: clamp(18px, min(5vw, 7vh), 34px); } }

/* ---------- avisos ---------- */
#toast { position: fixed; z-index: 120; left: 50%; bottom: calc(var(--sb) + 18px); transform: translate(-50%, 30px); max-width: min(92vw, 560px); padding: .55em 1em; border-radius: 16px; border: 3px solid var(--out); background: #2a0f5e; box-shadow: 0 4px 0 var(--out), 0 0 18px rgba(41,231,255,.5); font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.fsbar { position: fixed; z-index: 110; left: 50%; bottom: calc(var(--sb) + 12px); transform: translate(-50%, 140%); display: flex; align-items: center; gap: 10px; padding: .5em .8em; border-radius: 16px; border: 3px solid var(--out); background: #2a0f5e; box-shadow: 0 4px 0 var(--out), 0 0 20px rgba(41,231,255,.5); max-width: min(94vw, 560px); transition: transform .3s; }
.fsbar.show { transform: translate(-50%, 0); } .fsbar .x { background: none; border: 0; font-size: 1.2em; min-width: 36px; min-height: 36px; }
@media (max-height: 480px) { .sheet { overflow-y: auto; padding: 12px; gap: 8px; } #ov-menu .sheet { width: min(100%, 520px); display: grid; grid-template-columns: 1fr 1fr; } #ov-menu .sheet h3 { grid-column: 1 / 3; } #ov-menu .sheet .btn { min-height: 42px; }
  .curtain .sheet .big-av { font-size: 3em; } .endcard .trophy { font-size: 3em; } .tut p { font-size: .92em; } .td .dflat { --fs: 30px; } .tut-dice { padding: 2px 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }
