:root {
  --ink: #23313A;
  --ink-2: #16212A;
  --muted: #4E5D66;
  --sky: #CFEFFB;
  --paper: #FFF8E1;
  --corner: #FFE08A;
  --white: #FFFFFF;
  --green: #3CC172;
  --yellow: #FFC83D;
  --red: #E8443A;
  --blue: #2F7FE0;
  --mint: #DFF5E7;
  --butter: #FFF0C2;
  --ice: #E3EEFC;
  --blush: #F9E1DE;
  --z1: #C9864E;
  --z2: #5DB8F7;
  --z3: #FF9A3D;
  --z4: #A97CF0;
  --display: 'Lilita One', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sky);
  color: var(--ink);
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 700;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
a { color: #1E6FB8; }
h1, h2, h3 { margin: 0; }
.display { font-family: var(--display); font-weight: 400; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Logo ---------- */
.logo {
  font-family: var(--display);
  color: var(--yellow);
  text-decoration: none;
  line-height: 1;
  text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 5px 0 var(--ink);
}
.logo.big {
  font-size: clamp(40px, 8vw, 68px);
  text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 0 8px 0 var(--ink);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 3px solid var(--ink); border-radius: 16px;
  background: var(--white); color: var(--ink);
  font-weight: 900; font-size: 16px; text-decoration: none;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible, .cell:focus-visible, .chip:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.btn.big { min-height: 56px; font-family: var(--display); font-weight: 400; font-size: 22px; padding: 0 26px; }
.btn.green { background: var(--green); }
.btn.yellow { background: var(--yellow); }
.btn.red { background: #FF8A80; }
.btn.blue { background: var(--blue); color: var(--white); }
.btn.round { width: 48px; padding: 0; font-family: var(--display); font-weight: 400; font-size: 26px; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 12px; box-shadow: 0 3px 0 var(--ink); border-radius: 12px; }
.btn.tile { flex-direction: column; min-height: 76px; gap: 2px; font-size: 15px; border-width: 4px; border-radius: 18px; }
.btn.tile .ico { font-family: var(--display); font-size: 24px; line-height: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 8px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--white); font-weight: 900; font-size: 15px;
  box-shadow: 0 3px 0 var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--green); }
.chip.ex[aria-pressed="true"] { background: var(--yellow); }
.chip .bar { width: 12px; height: 26px; border-radius: 4px; box-shadow: 0 0 0 2px var(--ink); flex: none; }
.chip .price { color: var(--muted); font-size: 13px; }
.chip:disabled { opacity: .45; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 8px; border: 3px solid var(--ink); border-radius: 999px; padding: 5px 14px; background: var(--white); font-weight: 900; font-size: 15px; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--ink); flex: none; display: inline-block; }

/* ---------- Tarjetas ---------- */
.card { background: var(--white); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); }
.card.paper { background: var(--paper); }
.card .band { border-bottom: 4px solid var(--ink); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 18px 18px 0 0; }
.card .body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tag { font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Fichas con caritas ---------- */
.token {
  --size: 22px;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--size) * .1);
  box-shadow: inset 0 calc(var(--size) * -.14) 0 rgba(0,0,0,.2), 0 0 0 2px var(--ink);
  flex: none;
}
.token .eye { width: calc(var(--size) * .28); height: calc(var(--size) * .28); border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.token .eye::after { content: ''; width: 50%; height: 50%; border-radius: 50%; background: var(--ink); }
.token.lg { --size: 44px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), 0 0 0 3px var(--ink); }
.token.md { --size: 36px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 0 0 3px var(--ink); }

/* ---------- Escena ilustrada ---------- */
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Lobby ---------- */
.hero { position: relative; height: 300px; overflow: hidden; }
.hero .inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 34px; gap: 12px; text-align: center; }
.hero .slogan { background: var(--white); border-radius: 999px; padding: 6px 14px; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
.lobby { max-width: 1180px; margin: -40px auto 0; padding: 0 20px 56px; position: relative; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.lobby > .card { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.lobby > aside { flex: 1 1 320px; min-width: 0; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--white); border: 3px solid var(--ink); border-radius: 16px; }
.prow .field { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prow label { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.prow input { border: none; background: transparent; font-size: 19px; font-weight: 900; padding: 2px 0; min-width: 0; }
.prow input:focus { outline: none; }
.prow:focus-within { box-shadow: 0 0 0 4px var(--blue); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--ink); }
.rules { display: flex; flex-wrap: wrap; gap: 10px; }
.rule { flex: 1 1 190px; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 16px; }
.rule label { font-size: 13px; font-weight: 800; }
.rule input { font-family: var(--display); font-size: 24px; border: none; background: transparent; padding: 0; min-width: 0; width: 100%; }
.resume { background: var(--blue); color: var(--white); padding: 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Orden ---------- */
.order-wrap { max-width: 640px; margin: 24px auto; padding: 0 20px 48px; }
.order-wrap .card { background: var(--blue); color: var(--white); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.orow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--white); color: var(--ink); border: 3px solid var(--ink); }
.orow.lead { background: var(--yellow); }
.orow.tie { background: #FFE3DF; }
.orow .pos { font-family: var(--display); font-size: 26px; width: 34px; text-align: center; }

/* ---------- Dados ---------- */
.die {
  --s: clamp(40px, 8vw, 64px);
  width: var(--s); height: var(--s); background: var(--white);
  border: 4px solid var(--ink); border-radius: calc(var(--s) * .22);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: calc(var(--s) * .11); box-shadow: 0 6px 0 var(--ink);
}
.die.sm { --s: 44px; border-width: 3px; box-shadow: 0 3px 0 var(--ink); }
.die span { display: flex; align-items: center; justify-content: center; }
.die span.on::after { content: ''; width: calc(var(--s) * .16); height: calc(var(--s) * .16); border-radius: 50%; background: var(--ink); }
.die.empty span.on::after { background: #C9D2D8; }
.dice { display: flex; gap: 16px; justify-content: center; }

/* ---------- Juego ---------- */
.topbar { max-width: 1300px; margin: 0 auto; padding: 16px 20px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar .logo { font-size: 34px; }
.topbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.game { max-width: 1300px; margin: 0 auto; padding: 14px 20px 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.board-wrap { flex: 999 1 560px; min-width: 0; display: flex; justify-content: center; }
.board {
  width: 100%; max-width: 820px; aspect-ratio: 1 / 1;
  background: var(--ink); padding: 6px; border-radius: 26px; box-shadow: 0 10px 0 var(--ink-2);
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 4px;
}
.cell {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--paper); border-radius: 4px; border: none; padding: 0; text-align: center; cursor: default;
}
button.cell { cursor: pointer; }
button.cell:hover { filter: brightness(1.04); }
.cell.corner { background: var(--corner); }
.cell.mortgaged { background: #E5E1D6; }
.cell.here { background: var(--white); z-index: 2; animation: latido 1.3s ease-out infinite; }
.cell .zband { height: 22%; min-height: 14px; display: flex; align-items: center; justify-content: center; gap: 1px; border-bottom: 3px solid var(--ink); flex: none; }
.cell .zband svg { width: clamp(8px, 1.3vw, 13px); height: auto; }
.cell .inner { flex: 1; padding: 3px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; line-height: 1.1; min-height: 0; }
.cell .nm { font-size: clamp(8px, 1.15vw, 11.5px); font-weight: 900; overflow-wrap: anywhere; }
.cell.corner .nm { font-family: var(--display); font-weight: 400; font-size: clamp(10px, 1.6vw, 16px); }
.cell .sb { font-size: clamp(8px, 1.05vw, 11px); font-weight: 800; color: var(--muted); }
.cell .ic { width: clamp(16px, 3vw, 30px); height: auto; }
.cell .q { font-family: var(--display); font-size: clamp(18px, 3.6vw, 34px); line-height: 1; color: #8E5CE0; text-shadow: 0 3px 0 var(--ink); }
.cell .taxcoin { width: clamp(16px, 2.6vw, 26px); height: clamp(16px, 2.6vw, 26px); border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: clamp(9px, 1.4vw, 14px); }
.cell .bars { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(35,49,58,.5) 0 4px, transparent 4px 14px); pointer-events: none; }
.cell .owner { position: absolute; right: 4px; bottom: 4px; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.cell .owner.mort { background-image: repeating-linear-gradient(45deg, transparent 0 2px, rgba(255,255,255,.8) 2px 4px) !important; }
.cell .exm { position: absolute; right: 3px; top: 3px; font-family: var(--display); font-size: 11px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 6px; padding: 0 3px; line-height: 1.3; }
.cell .tokens { position: absolute; left: 3px; bottom: 3px; display: flex; flex-wrap: wrap; gap: 1px; max-width: 70%; z-index: 3; }
.cell .tokens .token { --size: clamp(13px, 2.2vw, 22px); }

.center { grid-row: 2 / 7; grid-column: 2 / 7; position: relative; border-radius: 12px; overflow: hidden; min-width: 0; min-height: 0; }
.center .inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; padding: 7% 12px 0; gap: 14px; text-align: center; }
.center .status { background: var(--white); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; font-weight: 900; max-width: 90%; }

.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--white); border: 3px solid #E4E0D2; }
.player.turn { background: var(--butter); border-color: var(--ink); }
.player.out { opacity: .5; }
.player .info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.player .money { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 20px; }
.log { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); line-height: 1.35; max-height: 220px; overflow: auto; }

/* ---------- Modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(22,33,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow: auto; z-index: 50; }
.modal { width: 100%; max-width: 760px; margin: auto 0; animation: pop .45s cubic-bezier(.3,1.5,.5,1) both; }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ladder { display: flex; flex-direction: column; gap: 6px; }
.ladder .row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--white); border: 3px solid #E4E0D2; }
.ladder .row.now { background: var(--yellow); border-color: var(--ink); }
.ladder .row .rent { font-family: var(--display); font-size: 18px; width: 64px; text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 180px; }
.sides { display: flex; flex-wrap: wrap; gap: 18px; }
.tside { flex: 1 1 360px; min-width: 0; background: var(--paper); border: 4px solid var(--ink); border-radius: 20px; overflow: hidden; }
.tside .band { padding: 10px 18px; border-bottom: 4px solid var(--ink); }
.tside .body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .val { flex: 1; text-align: center; font-family: var(--display); font-size: 28px; background: var(--white); border: 3px solid var(--ink); border-radius: 14px; padding: 4px 0; min-width: 90px; }
.stepper input.val { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.exbox { background: var(--butter); border: 3px dashed var(--ink); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.summary { background: var(--blue); color: var(--white); border: 4px solid var(--ink); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.summary p { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.45; }
.handoff { background: var(--yellow); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-weight: 900; display: flex; align-items: center; gap: 10px; }

.luckcard { max-width: 420px; background: #D9C6FA; animation: voltear .6s cubic-bezier(.3,1.4,.5,1) both; text-align: center; }
.luckcard .body { align-items: center; padding: 28px; }
.luckcard .q { font-family: var(--display); font-size: 64px; line-height: 1; color: #8E5CE0; text-shadow: 0 4px 0 var(--ink); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(92vw, 520px); }
.toast { background: var(--white); border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; font-weight: 900; box-shadow: 0 5px 0 var(--ink); animation: pop .4s cubic-bezier(.3,1.5,.5,1) both; }
.toast.err { background: #FFE3DF; animation: pop .4s cubic-bezier(.3,1.5,.5,1) both, tembleque .4s .1s; }

/* ---------- Ganador ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: caer linear infinite; }

/* ---------- Animaciones ---------- */
@keyframes nube { from { transform: translateX(-140px); } to { transform: translateX(940px); } }
.nube { animation: nube 40s linear infinite; }
.nube2 { animation: nube 58s linear infinite; animation-delay: -25s; }
@keyframes piedra { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.piedra { transform-box: fill-box; transform-origin: 50% 100%; animation: piedra 3.2s ease-in-out infinite; }
@keyframes sol { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.sol { transform-box: fill-box; transform-origin: center; animation: sol 4s ease-in-out infinite; }
@keyframes salto { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.salto { animation: salto .85s ease-in-out infinite; }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14px) scale(1.15); } 100% { transform: translateY(0) scale(1); } }
.hop { animation: hop .2s ease-out; }
@keyframes rodar { 0% { transform: rotate(0) scale(1); } 35% { transform: rotate(220deg) scale(1.25); } 70% { transform: rotate(330deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }
.rodando { animation: rodar .6s cubic-bezier(.3,1.4,.5,1) infinite; }
.rodo { animation: rodar .6s cubic-bezier(.3,1.4,.5,1); }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 70% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
.pop { animation: pop .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes latido { 0%, 100% { box-shadow: inset 0 0 0 4px #FF6B3D, 0 0 0 0 rgba(255,107,61,.7); } 50% { box-shadow: inset 0 0 0 4px #FF6B3D, 0 0 0 10px rgba(255,107,61,0); } }
@keyframes sirena { 0%, 49% { fill: var(--red); } 50%, 100% { fill: var(--blue); } }
.sirena { animation: sirena .9s steps(1) infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
.wiggle { display: inline-block; animation: wiggle 1.6s ease-in-out infinite; }
@keyframes flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.flota { animation: flota 2.4s ease-in-out infinite; }
@keyframes tembleque { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes voltear { 0% { transform: perspective(600px) rotateY(90deg) scale(.8); opacity: 0; } 100% { transform: perspective(600px) rotateY(0) scale(1); opacity: 1; } }
@keyframes caer { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes plata { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
.delta { position: absolute; right: 8px; top: -6px; font-family: var(--display); font-size: 18px; animation: plata 1.4s ease-out both; pointer-events: none; }
.delta.up { color: #1B8A4C; }
.delta.down { color: #C8281E; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ajustes para celular ---------- */
.cell .short, .cell .obar, .mbar { display: none; }
.nubeW { animation: nubeW 60s linear infinite; }
.nubeW2 { animation: nubeW 84s linear infinite; animation-delay: -40s; }
@keyframes nubeW { from { transform: translateX(-160px); } to { transform: translateX(1760px); } }
@keyframes subir { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 760px) {
  body:has(.mbar) { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

  /* Portada */
  .hero { height: 230px; }
  .hero .inner { padding-top: 18px; gap: 8px; }
  .hero .slogan { font-size: 13px; }
  .logo.big { font-size: 40px; }
  .lobby { margin-top: -30px; padding: 0 12px 40px; gap: 18px; }
  .lobby > .card { padding: 18px; gap: 18px; }
  .prow { flex-wrap: wrap; row-gap: 10px; }
  .prow .swatches { order: 3; width: 100%; justify-content: space-between; }
  .swatch { width: 34px; height: 34px; }
  .rule { flex: 1 1 130px; }
  .rule input { font-size: 22px; }
  .resume { padding: 18px; }

  /* Barra superior */
  .topbar { padding: 10px 12px 2px; }
  .topbar .logo { font-size: 24px; text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 3px 0 var(--ink); }
  .topbar .game-id { display: none; }

  /* Tablero a todo el ancho */
  .game { padding: 8px 6px 24px; gap: 16px; }
  .board { padding: 3px; gap: 2px; border-radius: 14px; box-shadow: 0 5px 0 var(--ink-2); }
  .cell { border-radius: 3px; }
  .cell .zband { height: 18%; min-height: 9px; border-bottom-width: 2px; }
  .cell .zband svg { width: 7px; }
  .cell .inner { padding: 1px; gap: 0; justify-content: flex-start; padding-top: 3px; }
  .cell .full, .cell .owner, .cell.corner .sb { display: none; }
  .cell .sb { display: block; font-size: 7.5px; margin-top: 1px; }
  .cell .short { display: inline; }
  .cell .nm { font-size: 8.5px; line-height: 1.05; letter-spacing: -0.01em; }
  .cell.corner .nm { font-size: 10px; }
  .cell.corner .inner { justify-content: center; }
  .cell .ic { width: 15px; }
  .cell.corner .ic { width: 22px !important; }
  .cell .q { font-size: 17px; text-shadow: 0 2px 0 var(--ink); }
  .cell .taxcoin { width: 15px; height: 15px; border-width: 2px; font-size: 9px; }
  .cell .obar { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; }
  .cell .obar.mort { background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255,255,255,.85) 3px 6px) !important; }
  .cell .tokens { bottom: 7px; left: 2px; max-width: 100%; }
  .cell .tokens .token { --size: 14px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2), 0 0 0 1.5px var(--ink); }
  .cell .exm { font-size: 9px; padding: 0 2px; right: 1px; top: 1px; }
  .cell .bars { background: repeating-linear-gradient(90deg, rgba(35,49,58,.4) 0 3px, transparent 3px 10px); }
  .center .inner { justify-content: center; padding: 0 8px 18%; }
  .center .btn, .center .status { display: none; }
  .die { --s: 52px; }

  /* Panel: la acción principal va en la barra fija */
  .side { gap: 14px; }
  .side .action-card { display: none; }
  .tiles { gap: 10px; }
  .btn.tile { min-height: 60px; font-size: 14px; }
  .player { padding: 8px 10px; }
  .player .money { font-size: 18px; }

  .mbar {
    display: flex; flex-direction: column; gap: 6px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--paper); border-top: 4px solid var(--ink);
    border-radius: 20px 20px 0 0; box-shadow: 0 -4px 0 rgba(35,49,58,.15);
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    animation: subir .3s ease-out both;
  }
  .mbar-top { display: flex; align-items: center; gap: 8px; }
  .mbar-name { flex: 1; font-weight: 900; font-size: 16px; }
  .mbar .money { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 20px; }
  .mbar-note { font-size: 13px; color: var(--muted); line-height: 1.3; min-height: 17px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mbar-btns { display: flex; gap: 8px; }
  .mbar-btns .btn { min-height: 50px; padding: 0 12px; font-size: 15px; }
  .mbar-btns .btn.grow { flex: 1; font-family: var(--display); font-weight: 400; font-size: 20px; }

  /* Modales como hoja que sube desde abajo */
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; margin: 0; max-height: 94vh; overflow: auto; border-radius: 22px 22px 0 0; animation: subir .3s ease-out both; }
  .modal > .card { border-radius: 22px 22px 0 0; box-shadow: none; border-bottom: none; }
  .modal > .card > .band { border-radius: 18px 18px 0 0; position: sticky; top: 0; z-index: 2; }
  .summary .btn.big { font-size: 18px; padding: 0 12px; white-space: nowrap; }
  .summary { gap: 8px; }
  .summary .display { font-size: 17px !important; }
  .summary .actions .btn { flex: 1 1 120px; }
  .modal .body { padding: 14px; }
  .luckcard { max-width: none; }
  .tside { flex-basis: 100%; }
  .tside .body { padding: 12px; }
  .stepper .val { font-size: 24px; min-width: 70px; }
  .summary { position: sticky; bottom: 0; padding: 14px; }
  .summary p { font-size: 16px; }
  .actions .btn { flex: 1 1 140px; }
  #toasts { bottom: calc(160px + env(safe-area-inset-bottom)); }

  .order-wrap { margin: 12px auto; padding: 0 12px 40px; }
  .order-wrap .card { padding: 18px; }
}
