/* VENDIDO — estilos
   Identidad: piezas de juego de mesa. Tarjetas tipo "título de propiedad" con borde de tinta
   y sombra dura; el sello rojo "VENDIDO" es el momento memorable. */

:root {
  --ink: #1b1740;
  --ink-2: #4a4672;
  --paper: #ffffff;
  --paper-2: #f2f1fb;
  --gold: #ffc531;
  --gold-2: #ffdb73;
  --stamp: #e8333a;
  --cash: #17a35a;
  --debt: #e8333a;
  --line: 2.5px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --r: 14px;
  --r-sm: 10px;
  --display: "Bungee", "Archivo Black", Impact, system-ui, sans-serif;
  --ui: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1740; color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.4; }
body { overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
input, button, select { font: inherit; color: inherit; }
input { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); font-size: 0.875rem; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }

.screen { position: fixed; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }

/* ------------------------------------------------------------ piezas base */
.card {
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border: var(--line) solid var(--ink); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font-weight: 800; font-size: 1rem; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.15s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-big:disabled { opacity: 1; background: var(--paper-2); color: var(--ink-2); font-size: 1rem; }
.btn-gold { background: var(--gold); }
.btn-gold:hover:not(:disabled) { background: var(--gold-2); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-red { background: var(--stamp); color: #fff; }
.btn-green { background: var(--cash); color: #fff; }
.btn-ghost { background: var(--paper-2); }
.btn-big { min-height: 58px; font-family: var(--display); font-size: 1.25rem; font-weight: 400; letter-spacing: 0.02em; width: 100%; }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 0.9rem; border-radius: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: var(--line) solid var(--ink);
  background: var(--paper); box-shadow: var(--shadow-sm); font-size: 1.15rem; font-weight: 800; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.icon-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.link { background: none; border: 0; color: #fff; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; padding: 6px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: 0.9rem; }
.field input, .code-input {
  min-height: 48px; padding: 8px 12px; border: var(--line) solid var(--ink); border-radius: 12px; background: #fff; font-size: 1.05rem; font-weight: 600;
}
.code-input { font-family: var(--display); letter-spacing: 0.2em; text-transform: uppercase; text-align: center; width: 100%; font-size: 1.2rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: var(--line) solid var(--ink); cursor: pointer; position: relative; padding: 0; }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 3px solid #fff; }
.swatch:disabled { opacity: 0.25; cursor: not-allowed; }
.form-error { color: var(--stamp); font-weight: 700; min-height: 1.2em; margin: 0; font-size: 0.9rem; }

/* ------------------------------------------------------------ inicio */
#home { display: grid; place-items: center; overflow-y: auto; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: radial-gradient(ellipse at center, rgba(27, 23, 64, 0.1), rgba(27, 23, 64, 0.72)); }
.home-wrap { width: min(420px, 100%); display: grid; gap: 14px; justify-items: center; }
.logo { margin: 8px 0 0; }
.logo-stamp {
  display: inline-block; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 13vw, 4.4rem); line-height: 1;
  color: var(--stamp); background: #fff; padding: 0.18em 0.32em 0.12em;
  border: 6px solid var(--stamp); outline: 3px solid var(--stamp); outline-offset: -14px; border-radius: 10px;
  transform: rotate(-5deg); box-shadow: 6px 6px 0 var(--ink);
  animation: slam 0.55s cubic-bezier(.2, 1.4, .4, 1) both 0.15s;
}
@keyframes slam { 0% { transform: rotate(-12deg) scale(2.2); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: rotate(-5deg) scale(1); } }
.tagline { color: #fff; text-align: center; margin: 4px 0 0; font-weight: 600; max-width: 34ch; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.home-card { width: 100%; display: grid; gap: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 0.85rem; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--paper-2); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.home-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.mode-note { color: rgba(255, 255, 255, 0.75); font-size: 0.8rem; text-align: center; margin: 0; max-width: 40ch; }

/* ------------------------------------------------------------ sala de espera */
#lobby { display: flex; justify-content: flex-end; }
.lobby-wrap {
  width: min(460px, 100%); height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(18px + var(--safe-b)) 14px;
  display: grid; gap: 14px; align-content: start;
  background: linear-gradient(90deg, rgba(27, 23, 64, 0), rgba(27, 23, 64, 0.55) 30%);
}
@media (max-width: 759px) {
  .lobby-wrap { padding-top: calc(38vh + var(--safe-t)); background: linear-gradient(180deg, rgba(27, 23, 64, 0) 30vh, rgba(27, 23, 64, 0.7) 46vh); }
}
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.room-code { font-family: var(--display); font-size: 2.3rem; letter-spacing: 0.12em; line-height: 1.05; }
.code-actions { display: grid; gap: 8px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.players { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper-2); font-weight: 700; }
.players .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.players .tag { font-size: 0.75rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: #fff; }
.players .tag.gold { background: var(--gold); color: var(--ink); }
.players .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; }
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-opt {
  text-align: left; border: var(--line) solid var(--ink); border-radius: 12px; padding: 10px; cursor: pointer; background: #fff;
  display: grid; gap: 4px; min-height: 104px; position: relative; overflow: hidden;
}
.map-opt .strip { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.map-opt .strip i { flex: 1; }
.map-opt b { font-size: 1rem; }
.map-opt small { color: var(--ink-2); font-size: 0.78rem; line-height: 1.25; }
.map-opt[aria-checked="true"] { background: var(--gold); box-shadow: var(--shadow-sm); }
.premium-tag { justify-self: start; margin-top: 2px; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: #fff; }
.map-opt.locked { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f4f3fb 10px, #f4f3fb 20px); }
.map-opt.locked .premium-tag { background: var(--stamp); }
.unlock-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.unlock-hero .mini { border: 2px solid var(--ink); border-radius: 12px; padding: 10px; display: grid; gap: 4px; font-size: 0.85rem; }
.unlock-hero .mini b { font-size: 1rem; }
.unlock-price { font-family: var(--display); font-size: 2rem; line-height: 1; margin: 4px 0 10px; }
.unlock-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 0.92rem; }
.unlock-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.unlock-form input { min-height: 46px; border: var(--line) solid var(--ink); border-radius: 12px; padding: 6px 12px; font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; width: 100%; }
.paypal-btn { background: #ffc439; color: #003087; width: 100%; text-decoration: none; margin-bottom: 12px; }
.chip .sub.lap { color: var(--ink-2); }
.map-opt:disabled { cursor: default; }
.modes { display: grid; gap: 10px; }
.mode-opt { text-align: left; border: var(--line) solid var(--ink); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; display: grid; gap: 2px; }
.mode-opt[aria-checked="true"] { background: var(--gold); box-shadow: var(--shadow-sm); }
.mode-opt small { color: var(--ink-2); }
.settings summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary h2::after { content: " ▾"; }
.settings[open] summary h2::after { content: " ▴"; }
.settings-grid { display: grid; gap: 12px; margin-top: 12px; }
.set-row { display: grid; gap: 6px; }
.set-row > span { font-weight: 700; font-size: 0.9rem; }
.set-row small { color: var(--ink-2); font-size: 0.78rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 2px solid var(--ink); background: #fff; border-radius: 99px; padding: 5px 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button:disabled { cursor: default; }
.lobby-start { position: sticky; bottom: 0; padding-top: 6px; margin-top: 4px; }
.lobby-start .muted { color: #fff; text-align: center; background: rgba(27, 23, 64, 0.75); padding: 10px; border-radius: 12px; margin: 0; }
.is-guest .host-only { display: none !important; }
.is-host .guest-only { display: none !important; }

/* ------------------------------------------------------------ juego: HUD */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: flex-start;
  padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding: 2px 4px 6px 2px; scrollbar-width: none; touch-action: pan-x; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: grid; grid-template-columns: auto 1fr; column-gap: 7px; align-items: center;
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 5px 10px 5px 7px; min-width: 104px; cursor: pointer; position: relative; text-align: left;
}
.chip .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); grid-row: span 2; }
.chip .nm { font-weight: 800; font-size: 0.78rem; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.chip .mo { font-family: var(--display); font-size: 0.95rem; line-height: 1.1; }
.chip .mo.neg { color: var(--debt); }
.chip .sub { grid-column: 2; font-size: 0.66rem; font-weight: 800; color: var(--debt); line-height: 1.1; }
.chip.turn { background: var(--gold); }
.chip.me { border-width: 3px; }
.chip.me::after { content: "tú"; position: absolute; top: -9px; right: 8px; background: var(--ink); color: #fff; font-size: 0.65rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; }
.chip.off { opacity: 0.55; }
.chip.broke { opacity: 0.45; }
.chip.broke .mo { text-decoration: line-through; }
.chip .badges { position: absolute; bottom: -8px; right: 6px; font-size: 0.8rem; }

.view-tools { position: absolute; right: calc(10px + var(--safe-r)); top: calc(78px + var(--safe-t)); display: grid; gap: 8px; }
.view-tools .icon-btn { font-family: var(--display); font-size: 0.85rem; }

.dock {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(560px, 100%); padding: 0 calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
  display: grid; gap: 8px; pointer-events: none;
}
.dock > * { pointer-events: auto; }
.ticker {
  justify-self: center; max-width: 100%; background: rgba(27, 23, 64, 0.82); color: #fff; font-size: 0.82rem; font-weight: 600;
  padding: 5px 12px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; cursor: pointer;
}
.ticker:empty { display: none; }
.dock-card { padding: 12px; display: grid; gap: 10px; }
.dock-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.dock-title .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.dock-title .spacer { flex: 1; }
.dock-title .dice-mini { font-family: var(--display); font-size: 0.9rem; }
.dock-main { display: grid; gap: 8px; grid-template-columns: 1fr; }
.dock-main.two { grid-template-columns: 1fr 1fr; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tool {
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper-2);
  font-size: 0.72rem; font-weight: 800; cursor: pointer; min-height: 52px; position: relative;
}
.tool .ic { font-size: 1.2rem; line-height: 1.1; }
.tool:disabled { opacity: 0.4; cursor: default; }
.tool.on { background: var(--gold); }
.tool .badge { position: absolute; top: -7px; right: -5px; background: var(--stamp); color: #fff; border-radius: 99px; font-size: 0.7rem; padding: 0 6px; border: 2px solid var(--ink); }
.waiting { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-2); }
.waiting .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: pulse 1s infinite alternate; flex: none; }
@keyframes pulse { to { transform: scale(1.6); opacity: 0.5; } }

/* mini título de propiedad dentro del dock */
.deed-mini { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.deed-mini .band { grid-column: 1 / -1; padding: 6px 10px; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.deed-mini .info { padding: 0 10px 8px; font-size: 0.82rem; color: var(--ink-2); grid-column: 1 / -1; }

.side-log { position: absolute; right: calc(12px + var(--safe-r)); top: 84px; bottom: 16px; width: 300px; display: none; padding: 12px; overflow: hidden; }
.side-log ol { list-style: none; padding: 0; margin: 8px 0 0; overflow-y: auto; height: calc(100% - 28px); display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; touch-action: pan-y; }
.side-log li, .log-list li { padding-left: 10px; border-left: 3px solid var(--paper-2); }
.log-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.dock-card.busy .dock-main, .dock-card.busy [data-act="travelMode"] { opacity: 0.55; pointer-events: none; transition: opacity .15s; }
li.k-sold { border-left-color: var(--stamp) !important; font-weight: 700; }
li.k-debt, li.k-bankrupt { border-left-color: var(--debt) !important; color: var(--debt); font-weight: 700; }
li.k-turn { border-left-color: var(--gold) !important; color: var(--ink-2); }
li.k-big { border-left-color: var(--ink) !important; font-weight: 800; }
li.k-travel { border-left-color: #2f8cff !important; }
@media (min-width: 1100px) {
  .side-log { display: block; }
  .view-tools { right: calc(326px + var(--safe-r)); }
}

/* reacciones */
.emotes { position: absolute; left: calc(10px + var(--safe-l)); top: calc(78px + var(--safe-t)); display: grid; gap: 6px; }
.emote-bubble {
  position: absolute; left: 0; top: 0; background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; padding: 4px 10px; font-weight: 800;
  box-shadow: var(--shadow-sm); white-space: nowrap; animation: pop 0.25s ease both;
}
.emote-bubble .e { font-size: 1.4rem; vertical-align: middle; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

.float-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.money-float { position: absolute; font-family: var(--display); font-size: 1.1rem; animation: floatUp 1.4s ease-out forwards; text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff; }
.money-float.pos { color: var(--cash); }
.money-float.neg { color: var(--debt); }
@keyframes floatUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-46px); opacity: 0; } }

/* ------------------------------------------------------------ hojas (bottom sheet) */
.overlay { position: fixed; inset: 0; background: rgba(27, 23, 64, 0.45); z-index: 40; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 41;
  width: min(560px, 100%); max-height: 84vh; max-height: 84dvh; display: flex; flex-direction: column;
  background: var(--paper); border: var(--line) solid var(--ink); border-bottom: 0; border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 0 var(--ink); padding-bottom: var(--safe-b); animation: sheetIn 0.22s ease-out;
}
@keyframes sheetIn { from { transform: translate(-50%, 40px); opacity: 0; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 99px; background: var(--paper-2); margin: 8px auto 2px; flex: none; }
.sheet-body { overflow-y: auto; padding: 8px 16px 18px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet .close { border: 0; background: var(--paper-2); width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; font-weight: 800; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 20px; border-bottom: var(--line) solid var(--ink); box-shadow: var(--shadow); max-height: 86vh; }
  @keyframes sheetIn { from { transform: translate(-50%, -46%); opacity: 0; } }
}

.group-block { margin-bottom: 14px; }
.group-block h3 { font-size: 0.85rem; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.group-block h3 .sw { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); }
.prop-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; margin-bottom: 6px; }
.prop-row .nm { font-weight: 800; }
.prop-row .meta { font-size: 0.78rem; color: var(--ink-2); }
.prop-row .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.prop-row .acts .btn { min-height: 34px; padding: 3px 10px; font-size: 0.82rem; box-shadow: 2px 2px 0 var(--ink); }
.prop-row.mort { background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #fdeaea 8px, #fdeaea 16px); }
.houses-ind { letter-spacing: 1px; }
.empty { color: var(--ink-2); text-align: center; padding: 16px 8px; }

/* título de propiedad completo */
.deed { border: var(--line) solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.deed .head { padding: 12px; text-align: center; border-bottom: var(--line) solid var(--ink); }
.deed .head small { display: block; font-weight: 800; font-size: 0.72rem; opacity: 0.85; }
.deed .head b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; display: block; line-height: 1.15; }
.deed table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.deed td { padding: 5px 12px; }
.deed td:last-child { text-align: right; font-weight: 800; }
.deed tr.cur td { background: var(--gold); }
.deed .foot { padding: 8px 12px 12px; font-size: 0.82rem; color: var(--ink-2); border-top: 2px dashed var(--paper-2); }

/* tratos */
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-col { border: 2px solid var(--ink); border-radius: 12px; padding: 8px; display: grid; gap: 6px; align-content: start; }
.trade-col h3 { font-size: 0.85rem; }
.pick { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; padding: 6px; border-radius: 8px; background: var(--paper-2); cursor: pointer; }
.pick input { width: 18px; height: 18px; flex: none; accent-color: var(--ink); }
.pick .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; border: 1px solid var(--ink); }
.money-in { width: 100%; min-height: 38px; border: 2px solid var(--ink); border-radius: 8px; padding: 4px 8px; font-weight: 700; }
.trade-card { border: var(--line) solid var(--ink); border-radius: 12px; padding: 12px; display: grid; gap: 8px; margin-bottom: 10px; }
.trade-card .sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start; font-size: 0.85rem; }
.trade-card .arrow { font-family: var(--display); padding-top: 14px; }
.trade-card ul { margin: 4px 0 0; padding-left: 16px; }
.target-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.target-pick button { display: flex; gap: 6px; align-items: center; border: 2px solid var(--ink); border-radius: 99px; padding: 5px 12px; background: #fff; font-weight: 800; cursor: pointer; }
.target-pick button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.target-pick .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }

.menu-list { display: grid; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }
.rules h3 { margin: 14px 0 4px; font-size: 1rem; }
.rules p, .rules li { font-size: 0.92rem; }
.rules ul { padding-left: 18px; margin: 4px 0; }

/* ------------------------------------------------------------ subasta */
.auction {
  position: fixed; left: 50%; top: calc(76px + var(--safe-t)); transform: translateX(-50%); z-index: 30;
  width: min(420px, calc(100% - 20px)); background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  animation: pop 0.25s ease;
}
.auction .a-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-weight: 800; border-bottom: var(--line) solid var(--ink); }
.auction .a-head .gavel { font-family: var(--display); font-size: 0.95rem; }
.auction .a-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.auction .bid { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.auction .bid b { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; }
.auction .who { display: flex; gap: 6px; align-items: center; font-weight: 800; }
.auction .who .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.timer { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; border: 2px solid var(--ink); }
.timer i { display: block; height: 100%; background: var(--stamp); width: 100%; transform-origin: left; }
.bid-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bid-btns .btn { min-height: 42px; padding: 4px; }
.bid-custom { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.bid-custom input { min-height: 42px; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; font-weight: 800; width: 100%; }

/* ------------------------------------------------------------ carta */
.card-pop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(27, 23, 64, 0.35);
}
.fortune {
  width: min(320px, 90vw); min-height: 190px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink);
  padding: 16px; display: grid; gap: 10px; align-content: start; text-align: center; animation: flipIn 0.45s cubic-bezier(.2, 1.2, .4, 1);
}
.fortune .deck { font-family: var(--display); font-size: 1.05rem; display: flex; justify-content: center; gap: 8px; align-items: center; }
.fortune .deck .ic { font-size: 1.6rem; }
.fortune p { margin: 0; font-size: 1.1rem; font-weight: 700; }
.fortune .who { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; }
@keyframes flipIn { from { transform: perspective(600px) rotateY(80deg) scale(0.8); opacity: 0; } }

/* ------------------------------------------------------------ sello ¡VENDIDO! */
.stamp-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; display: grid; place-items: center; }
.stamp {
  display: grid; justify-items: center; gap: 2px; padding: 10px 22px 12px; border: 6px solid var(--stamp); outline: 3px solid var(--stamp); outline-offset: -13px;
  border-radius: 12px; color: var(--stamp); background: rgba(255, 255, 255, 0.94); transform: rotate(-8deg);
  animation: stampIn 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; box-shadow: 6px 6px 0 rgba(27, 23, 64, 0.85);
}
.stamp .big { font-family: var(--display); font-size: clamp(2.2rem, 11vw, 3.6rem); line-height: 1; }
.stamp .what { font-weight: 800; color: var(--ink); font-size: 1rem; max-width: 18em; text-align: center; }
.stamp .to { font-weight: 800; font-size: 0.9rem; display: flex; gap: 6px; align-items: center; color: var(--ink); }
.stamp .to i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
@keyframes stampIn {
  0% { transform: rotate(-16deg) scale(2.6); opacity: 0; filter: blur(4px); }
  18% { transform: rotate(-8deg) scale(0.94); opacity: 1; filter: blur(0); }
  26% { transform: rotate(-8deg) scale(1.03); }
  32%, 78% { transform: rotate(-8deg) scale(1); opacity: 1; }
  100% { transform: rotate(-8deg) scale(1); opacity: 0; }
}
.shake { animation: shake 0.28s linear; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-4px, 3px); } 50% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, -3px); } }

/* ------------------------------------------------------------ avisos */
.toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 0.92rem; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25); animation: pop 0.2s ease; }
.toast.warn { background: var(--stamp); }
.toast.good { background: var(--cash); }
.toast.gold { background: var(--gold); color: var(--ink); border: 2px solid var(--ink); }
.conn-banner { position: fixed; bottom: calc(10px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 80; background: var(--stamp); color: #fff; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 0.85rem; border: 2px solid var(--ink); }

/* final */
.podium { display: grid; gap: 8px; margin: 6px 0 14px; }
.podium li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 800; }
.podium li:first-child { background: var(--gold); }
.podium .pos { font-family: var(--display); font-size: 1.2rem; }
.podium ol { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }

@media (max-width: 380px) {
  .chip { min-width: 92px; padding: 4px 8px 4px 6px; }
  .tool { font-size: 0.66rem; }
  .btn-big { font-size: 1.08rem; min-height: 52px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .dock { left: auto; right: 0; transform: none; width: min(380px, 52vw); }
  .view-tools { right: auto; left: calc(10px + var(--safe-l)); }
  .emotes { top: auto; bottom: 14px; }
  .auction { left: auto; right: calc(10px + var(--safe-r)); transform: none; top: calc(62px + var(--safe-t)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
