/* Generado por build.mjs a partir de client/. No lo edites aquí: edita client/ y se regenera solo. */
  :root {
    --tapete: #1a2b5d;
    --tapete-dark: #101c3f;
    --page: #0c142b;
    --panel: #131d3b;
    --panel-2: #192447;
    --line: #2a375e;
    --chalk: #f2efe4;
    --chalk-dim: #a9bfb1;
    --red: #d8343f;
    --blue: #2f6fd6;
    --brass: #f2c14e;
    --brass-ink: #3a2a05;
    --radius: 14px;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    background: var(--page);
    color: var(--chalk);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }
  button, input, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
  .hidden { display: none !important; }

  .btn {
    border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 600;
    background: var(--panel-2); color: var(--chalk);
    transition: transform .08s ease, filter .15s ease;
  }
  .btn:hover { filter: brightness(1.12); }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
  .btn.primary { background: var(--brass); color: var(--brass-ink); }
  .btn.small { padding: 7px 14px; font-size: 14px; }
  .field {
    width: 100%; background: var(--page); border: 2px solid var(--line); border-radius: 12px;
    padding: 12px 14px; outline: none;
  }
  .field:focus { border-color: var(--brass); }
  .muted { color: var(--chalk-dim); }

  /* ---------------- Portada ---------------- */
  .stack { display: grid; gap: 10px; }
  .or { display: flex; align-items: center; gap: 10px; color: var(--chalk-dim); font-size: 14px; margin: 14px 0; }
  .or::before, .or::after { content: ''; flex: 1; height: 2px; background: var(--line); }
  .join-row { display: flex; gap: 8px; }
  .join-row .field { text-transform: uppercase; letter-spacing: .12em; }
  .err { color: #ff9c9c; font-size: 14px; min-height: 20px; margin-top: 8px; }
  .lbl { font-size: 14px; color: var(--chalk-dim); }
  .menu { display: grid; gap: 10px; margin-top: 18px; }
  .mbtn {
    display: grid; gap: 2px; text-align: left; width: 100%; padding: 14px 18px; border-radius: 16px;
    border: 2px solid var(--line); background: var(--panel); color: var(--chalk);
    transition: border-color .15s, transform .08s;
  }
  .mbtn:hover:not(:disabled) { border-color: var(--brass); }
  .mbtn:active:not(:disabled) { transform: translateY(1px); }
  .mbtn.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
  .mbtn .mt { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
  .mbtn .ms { font-size: 14px; opacity: .8; }
  .mbtn:disabled { opacity: .55; cursor: not-allowed; }
  .soon { font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--chalk-dim); border-radius: 999px; padding: 2px 8px; }
  .menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .back { background: none; border: 0; color: var(--chalk-dim); padding: 4px 0; font-weight: 600; }
  .back:hover { color: var(--chalk); }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
  .form-grid label { display: grid; gap: 6px; font-size: 14px; color: var(--chalk-dim); }
  .form-grid label.wide { grid-column: 1 / -1; }
  .form-grid select, .opt select { background: var(--page); border: 2px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--chalk); }
  .opt { display: grid; gap: 8px; }
  .opt-row { display: flex; align-items: center; gap: 12px; }
  .opt-row input[type=range] { flex: 1; accent-color: var(--brass); }
  .opt-row output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
  .seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; }
  .seg button { border: 0; border-radius: 999px; padding: 7px 14px; background: none; color: var(--chalk-dim); font-weight: 600; }
  .seg button.on { background: var(--brass); color: var(--brass-ink); }

  /* ---------------- Modo Pro ---------------- */
  #pro { height: 100%; overflow: auto; padding: 24px 16px 60px; }
  #proMain { display: grid; gap: 16px; }
  #proCap { width: 96px; height: 96px; flex: none; }
  #proCreatePrev { width: 120px; height: 120px; }
  .tabs button { white-space: nowrap; }
  .stat-val { white-space: nowrap; }
  body.touch .trainbar { padding-top: 56px; }
  .ph { margin: 0 0 10px; font-size: 20px; font-weight: 800; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
  .ph .muted { font-size: 15px; font-weight: 600; }
  .pro-create { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin: 14px 0 4px; }
  .pro-hero { display: flex; gap: 18px; align-items: center; }
  .pro-hero-txt { flex: 1; min-width: 0; display: grid; gap: 6px; }
  .pro-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .lvl { font-size: 14px; font-weight: 800; background: var(--brass); color: var(--brass-ink); border-radius: 999px; padding: 2px 10px; }
  .xpbar, .statbar { height: 10px; background: var(--page); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
  .xpbar > div { height: 100%; background: var(--brass); width: 0; transition: width .4s ease; }
  .statbar { flex: 1; height: 12px; }
  .statbar > div { height: 100%; background: linear-gradient(90deg, #3aa86b, #9bd12a); width: 0; transition: width .3s ease; }
  .small-txt { font-size: 13px; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; }
  .tabp { display: none; gap: 16px; }
  .tabp.on { display: grid; }
  .stat-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
  .stat-name { width: 84px; font-weight: 600; }
  .stat-val { width: 92px; text-align: right; font-variant-numeric: tabular-nums; color: var(--chalk-dim); font-size: 14px; }
  .pro-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: var(--chalk-dim); font-size: 14px; }
  .pro-stats b { color: var(--chalk); font-size: 18px; display: block; }
  .mono-ish { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; text-transform: none !important; letter-spacing: 0 !important; }
  .train-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .tcard { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 8px; }
  .tcard h4 { margin: 0; font-size: 18px; font-weight: 800; }
  .tcard .stars { font-size: 22px; letter-spacing: 2px; color: var(--brass); }
  .tcard .stars .off { color: var(--line); }
  .tcard .times { font-size: 13px; color: var(--chalk-dim); }
  .tcard .btn { justify-self: start; }
  .club-card { display: flex; gap: 16px; align-items: center; }
  .club-badge {
    width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
    background: var(--cb, var(--red)); color: var(--cbt, #fff); flex: none;
  }
  .members { display: grid; gap: 6px; }
  .mrow { display: flex; align-items: center; gap: 10px; background: var(--page); border-radius: 12px; padding: 8px 12px; }
  .mrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mrow .tagc { font-weight: 800; font-size: 12px; border-radius: 6px; padding: 2px 6px; color: #fff; }
  .pro-result { display: grid; gap: 4px; }
  .pro-result .big { color: var(--brass); }
  .train-res { text-align: center; display: grid; gap: 4px; margin-bottom: 14px; }
  .stars-big { font-size: 44px; letter-spacing: 6px; color: var(--brass); }
  .stars-big .off { color: var(--line); }
  .big-time { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .trainbar { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 16px 6px; flex-wrap: wrap; }
  .tb-name { font-weight: 700; color: var(--chalk-dim); }
  .tb-stars { font-size: 14px; color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
  body.training .scorebar { display: none; }
  body.pro-room .normal-only, body.training .normal-only { display: none !important; }
  body:not(.pro-room) .pro-only { display: none !important; }
  @media (max-width: 560px) {
    .pro-create { grid-template-columns: 1fr; justify-items: center; }
    .stat-name { width: 70px; } .stat-val { width: auto; font-size: 12px; }
    .stat-row { gap: 8px; }
    .pro-name { font-size: 22px; }
    .tabs button { padding: 7px 4px; font-size: 14px; }
    #proCap { width: 72px; height: 72px; }
  }

  body.solo .online-only { display: none !important; }
  body:not(.solo) .solo-only { display: none !important; }
  body.solo #chat { display: none; }

  /* ---------------- Sala ---------------- */
  #room { height: 100%; overflow: auto; padding: 24px 16px 24px; }
  .room-wrap { max-width: 900px; margin: 0 auto; display: grid; gap: 20px; }
  .room-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .room-head h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
  .code-pill {
    font-weight: 800; letter-spacing: .14em; background: var(--panel); border: 2px dashed var(--line);
    border-radius: 10px; padding: 4px 12px; font-size: 22px;
  }
  .room-head .spacer { flex: 1; }
  .teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
  .team {
    border-radius: 18px; padding: 18px; min-height: 170px; display: flex; flex-direction: column; gap: 12px;
    background: var(--panel); border: 2px solid var(--line); position: relative; overflow: hidden;
  }
  .team::after {
    content: ''; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%;
    background: var(--tc); opacity: .18;
  }
  .team.red { --tc: var(--team-red, var(--red)); }
  .team.blue { --tc: var(--team-blue, var(--blue)); }
  .team .kit-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
  .team .kit-name { font-weight: 600; color: var(--chalk-dim); }
  .mini-caps { display: flex; gap: 4px; }
  .color-warn { color: var(--brass); font-size: 14px; margin: -6px 0 0; }
  /* ---------------- Editor de equipo ---------------- */
  dialog.kit {
    border: 2px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--chalk);
    padding: 22px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  }
  dialog.kit::backdrop { background: rgba(4, 7, 16, .7); }
  dialog.kit h3 { margin: 0 0 14px; font-size: 24px; font-weight: 800; }
  .kit-grid { display: grid; gap: 14px; }
  .swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .swatch {
    width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; padding: 0;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.25);
  }
  .swatch.on { border-color: var(--chalk); }
  .swatches input[type=color] { width: 40px; height: 34px; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: none; }
  .cap-rows { display: grid; grid-template-columns: auto 72px 1fr; gap: 8px 10px; align-items: center; }
  .cap-rows .field { padding: 8px 10px; }
  .cap-rows .lbl2 { font-size: 14px; color: var(--chalk-dim); white-space: nowrap; }
  #kitPreview { width: 100%; height: 100px; display: block; background: var(--page); border-radius: 12px; }
  .dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
  .team h3 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
  .team h3 .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); }
  .team .who { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; word-break: break-word; }
  .team .who.empty { color: var(--chalk-dim); font-weight: 400; font-size: 18px; }
  .team .btn { align-self: flex-start; margin-top: auto; position: relative; z-index: 1; }
  .vs { align-self: center; font-weight: 800; font-size: 22px; color: var(--chalk-dim); }
  .panel { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 18px; }
  .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
  .row select { background: var(--page); border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; }
  .row select:disabled { opacity: .7; }
  .specs { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip { background: var(--panel-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
  .result {
    border-radius: 18px; padding: 16px 20px; background: var(--panel-2); border: 2px solid var(--brass);
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  }
  .result .big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .help { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
  kbd {
    display: inline-block; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 6px;
    background: var(--page); border: 1px solid var(--line); border-bottom-width: 3px; font-family: inherit; font-size: 13px;
  }
  .pitch-preview { display: block; width: 100%; max-width: 560px; aspect-ratio: 2.1 / 1; margin-top: 12px; border-radius: 12px; }
  .start-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

  /* ---------------- Partido ---------------- */
  #game { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--page); }
  .scorebar {
    display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px 6px;
    font-variant-numeric: tabular-nums;
  }
  .sb-name { font-weight: 600; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chalk-dim); }
  .sb-name.red { text-align: right; }
  .sb-score { font-size: 32px; font-weight: 800; min-width: 44px; text-align: center; border-radius: 10px; padding: 0 8px; }
  .sb-score.red { background: var(--team-red, var(--red)); color: var(--team-red-text, #fff); }
  .sb-score.blue { background: var(--team-blue, var(--blue)); color: var(--team-blue-text, #fff); }
  .sb-time { font-size: 22px; font-weight: 800; min-width: 88px; text-align: center; }
  .sb-time.ot { color: var(--brass); font-size: 16px; }
  .game-tools { position: absolute; top: 10px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 6; }
  .ping { font-size: 13px; color: var(--chalk-dim); }
  #stage { flex: 1; position: relative; min-height: 0; }
  #cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .flash {
    position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
    font-size: clamp(56px, 12vw, 140px); font-weight: 800; letter-spacing: -0.04em; pointer-events: none;
    text-shadow: 0 8px 30px rgba(0,0,0,.45); opacity: 0;
  }
  .flash.show { animation: pop 2.2s ease forwards; }
  @keyframes pop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
    12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
    20% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; }
  }
  .hint { position: absolute; bottom: 10px; right: 14px; font-size: 13px; color: var(--chalk-dim); text-align: right; }

  /* ---------------- Chat (compartido) ---------------- */
  #chat {
    position: fixed; left: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); z-index: 5;
    display: flex; flex-direction: column; gap: 6px; pointer-events: none;
  }
  #chatLog {
    max-height: 170px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
    font-size: 14px; pointer-events: auto; scrollbar-width: thin;
  }
  #chatLog div { background: rgba(7, 12, 27, .72); padding: 3px 9px; border-radius: 8px; align-self: flex-start; max-width: 100%; word-wrap: break-word; }
  #chatLog .sys { color: var(--chalk-dim); font-style: italic; }
  #chatLog b.red { color: #ff8a93; } #chatLog b.blue { color: #8fb5ff; } #chatLog b.spec { color: var(--chalk-dim); }
  #chatInput { pointer-events: auto; background: rgba(7, 12, 27, .85); padding: 9px 12px; }
  body.playing #chatLog div { opacity: .9; }

  .toast {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 10;
    background: var(--panel-2); border: 2px solid var(--brass); border-radius: 14px; padding: 12px 16px;
    display: flex; gap: 12px; align-items: center;
  }

  /* ---------------- Controles táctiles ---------------- */
  #game { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  .touch-ui { position: absolute; inset: 0; pointer-events: none; display: none; }
  body.touch .touch-ui { display: block; }
  body.touch .hint, body.touch .ping { display: none; }
  .joy-zone { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; pointer-events: auto; }
  .touch-ui { --ts: 1.25; }
  body.btn-small .touch-ui { --ts: .8; }
  body.btn-normal .touch-ui { --ts: 1; }
  body.btn-large .touch-ui { --ts: 1.25; }
  .joy-base {
    position: absolute; width: calc(104px * var(--ts)); height: calc(104px * var(--ts));
    margin: calc(-52px * var(--ts)) 0 0 calc(-52px * var(--ts)); border-radius: 50%;
    border: 2px solid rgba(242,239,228,.4); background: rgba(12, 20, 43,.28); transition: opacity .15s;
  }
  .joy-base.idle { opacity: .5; transition: opacity .15s, left .15s, top .15s; }
  .joy-knob {
    position: absolute; left: 50%; top: 50%; width: calc(44px * var(--ts)); height: calc(44px * var(--ts));
    margin: calc(-22px * var(--ts)) 0 0 calc(-22px * var(--ts)); border-radius: 50%;
    background: rgba(242,239,228,.6); box-shadow: 0 2px 8px rgba(0,0,0,.3);
  }
  .tbtn {
    position: absolute; pointer-events: auto; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid rgba(242,239,228,.45); background: rgba(12, 20, 43,.35); color: var(--chalk);
    font-weight: 800; font-size: 13px; line-height: 1.05; text-align: center; padding: 0;
  }
  .tbtn.kick {
    width: calc(78px * var(--ts)); height: calc(78px * var(--ts)); right: calc(max(14px, env(safe-area-inset-right)) + 30px); bottom: 30px;
    font-size: calc(13px * var(--ts));
    border-color: rgba(242,193,78,.85); background: rgba(242,193,78,.28);
  }
  .tbtn.swap {
    width: calc(54px * var(--ts)); height: calc(54px * var(--ts)); font-size: calc(14px * var(--ts));
    right: calc(max(14px, env(safe-area-inset-right)) + 30px + 84px * var(--ts)); bottom: calc(66px * var(--ts));
  }
  .tbtn.swap.long { font-size: calc(11px * var(--ts)); }
  .ko-lbl {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%); pointer-events: none;
    background: rgba(12, 20, 43,.8); border: 1px solid var(--line); border-radius: 999px;
    padding: 3px 12px; font-size: 13px; font-weight: 600; white-space: nowrap;
  }
  .tbtn.pressed { background: rgba(242,193,78,.75); color: var(--brass-ink); transform: scale(.95); }
  body.portrait .tbtn.kick { bottom: calc(54px * var(--ts)); right: 26px; width: calc(86px * var(--ts)); height: calc(86px * var(--ts)); }
  body.portrait .tbtn.swap { bottom: calc(120px * var(--ts)); right: calc(26px + 98px * var(--ts)); }
  .fs-btn { display: none; }
  body.touch .fs-btn.can { display: inline-flex; }
  body.touch.playing #chat { top: 52px; bottom: auto; width: min(260px, 55vw); }
  body.playing #chatLog div { animation: chatfade 8s forwards; }
  @keyframes chatfade { 0%, 75% { opacity: .92; } 100% { opacity: 0; visibility: hidden; } }
  body.playing #chatLog { pointer-events: none; }
  .touch-only { display: none; }
  .kb-only { display: contents; }
  body.touch .touch-only { display: contents; }
  body.touch .kb-only { display: none; }
  @media (max-height: 500px) {
    .scorebar { padding: 4px 12px 2px; gap: 10px; }
    .sb-score { font-size: 22px; min-width: 34px; }
    .sb-time { font-size: 17px; min-width: 64px; }
    .game-tools { top: 4px; }
  }
  .fs-btn { padding: 8px 10px; align-items: center; }
  @media (max-width: 560px) {
    .game-tools { top: 8px; right: 10px; gap: 6px; }
    .game-tools .btn { padding: 7px 11px; font-size: 13px; }
    .sb-name { display: none; }
    .scorebar { justify-content: flex-start; padding-left: 14px; }
  }

  @media (max-width: 640px) {
    .teams { grid-template-columns: 1fr; }
    .vs { display: none; }
    .hint { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .flash.show { animation-duration: .01s; opacity: 1; }
  }
  /* ================= Diseño horizontal (primero) ================= */
  .room-grid, .room-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
  .team { min-height: 0; padding: 14px 16px; gap: 8px; }
  .team .who { font-size: 20px; }
  .pro-side, .pro-content { display: grid; gap: 16px; align-content: start; min-width: 0; }
  body.solo .room-chat-slot { display: none; }
  .room-chat-slot { padding: 10px; }
  #chat.in-slot { position: static; width: auto; pointer-events: auto; z-index: auto; }
  #chat.in-slot #chatLog { max-height: 110px; }
  #chat.in-slot #chatLog div { background: var(--page); }
  #chat.in-slot #chatInput { background: var(--page); }
  @media (min-width: 700px) {
    .room-wrap { max-width: 1120px; }
    .room-grid { grid-template-columns: minmax(280px, 1fr) minmax(330px, 1.2fr); gap: 16px; }
    .teams { grid-template-columns: 1fr; gap: 10px; }
    .vs { display: none; }
    #proMain { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
    .pro-side { position: sticky; top: 0; gap: 12px; }
    .pro-hero { flex-direction: column; text-align: center; }
    .pro-hero-txt { width: 100%; }
    .pro-hero .pro-name { justify-content: center; font-size: 22px; }
    .tabs { flex-direction: column; border-radius: 18px; }
    .tabs button { text-align: left; padding: 10px 14px; border-radius: 12px; }
    #kitDlg { width: min(860px, calc(100vw - 24px)); }
    #kitDlg .kit-grid { grid-template-columns: 1fr 1.15fr; column-gap: 20px; }
    #kitDlg .kit-grid > :nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
    #kitDlg .kit-grid > :nth-child(5) { grid-column: 1 / -1; }
  }
  /* Pantallas bajas (móvil en horizontal) */
  @media (max-height: 520px) {
    .menu { gap: 8px; }
    .mbtn { padding: 9px 14px; border-radius: 14px; }
    .mbtn .mt { font-size: 17px; }
    .mbtn .ms { font-size: 12.5px; }
    .form-grid { gap: 8px; margin-bottom: 10px; }
    .form-grid select { padding: 6px 8px; }
    .field { padding: 8px 12px; }
    .btn { padding: 9px 18px; }
    .or { margin: 8px 0; }
    #room, #pro { padding: 10px 12px 16px; }
    .room-wrap { gap: 12px; }
    .room-head h2 { font-size: 22px; }
    .code-pill { font-size: 16px; padding: 2px 10px; }
    .panel { padding: 12px 14px; border-radius: 14px; }
    .team { padding: 10px 14px; border-radius: 14px; }
    .team h3 { font-size: 15px; }
    .team .who { font-size: 17px; }
    .team::after { width: 90px; height: 90px; right: -30px; bottom: -30px; }
    .help { font-size: 13px; gap: 4px 12px; }
    .pitch-preview { max-width: 420px; }
    .result { padding: 10px 14px; }
    .result .big { font-size: 26px; }
    #proCap { width: 56px; height: 56px; }
    .pro-hero { padding: 12px; gap: 12px; }
    .pro-hero .pro-name { font-size: 18px; }
    .ph { font-size: 17px; margin-bottom: 6px; }
    .tabs button { padding: 7px 12px; }
    dialog.kit { padding: 14px 16px; max-height: calc(100dvh - 12px); }
    dialog.kit h3 { font-size: 20px; margin-bottom: 8px; }
    .kit-grid { gap: 10px; }
    #kitPreview { height: 76px; }
    .cap-rows { gap: 6px 8px; }
    .cap-rows .field { padding: 6px 8px; }
    .stars-big { font-size: 34px; }
    .big-time { font-size: 26px; }
  }
  @media (max-height: 520px) and (min-width: 700px) {
    .pro-hero { flex-direction: row; text-align: left; }
    .pro-hero .pro-name { justify-content: flex-start; }
  }
  /* Aviso de girar el móvil: el juego es horizontal */
  .rotate {
    display: none; position: fixed; inset: 0; z-index: 50; background: var(--page); color: var(--chalk);
    flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px;
  }
  .rotate strong { font-size: 26px; font-weight: 800; }
  .rotate span { color: var(--chalk-dim); }
  .rotate svg { animation: tilt 2.4s ease-in-out infinite; }
  @keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

  @media (prefers-reduced-motion: reduce) { .rotate svg { animation: none; } }


  /* Formulario contra la IA en 3 columnas cuando hay anchura */

  @media (max-height: 520px) {
    .form-grid label { font-size: 12.5px; gap: 3px; }
    .back { padding: 0; }
  }

  /* Ajustes de la sala en rejilla (etiqueta encima del selector) */
  #cfgPanel > .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
  #cfgPanel > .row label { display: grid; gap: 4px; font-size: 13px; color: var(--chalk-dim); }
  #cfgPanel > .row select { width: 100%; color: var(--chalk); }
  @media (max-height: 520px) and (min-width: 700px) {
    .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
    .tabs button { text-align: center; }
  }

  /* Barra del entrenamiento: deja sitio a los botones de la derecha */
  body:not(.touch) .trainbar { justify-content: flex-start; padding-right: 250px; }

  /* ================= Portada nueva (app con navegación) ================= */
  .i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
  .spacer { flex: 1; }
  .btn .i { width: 18px; height: 18px; margin-left: 4px; }
  .btn.wide { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .btn.big { padding: 14px 26px; font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
  .icon-btn {
    width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
    display: inline-grid; place-items: center; color: var(--chalk); padding: 0; flex: none;
  }
  .icon-btn:hover { border-color: var(--brass); }
  .icon-btn.gold { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand-caps { display: flex; }
  .brand-caps svg { width: 30px; height: 30px; }
  .brand-caps svg + svg { margin-left: -9px; }
  .brand-name { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }

  /* Monedas */
  .coin {
    width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-block;
    background: radial-gradient(circle at 35% 30%, #ffe9a3, #f2c14e 45%, #c48a1a 100%);
    box-shadow: inset 0 0 0 2px rgba(122, 78, 6, .55), 0 1px 2px rgba(0,0,0,.3);
  }
  .coin.big { width: 34px; height: 34px; box-shadow: inset 0 0 0 3px rgba(122, 78, 6, .55), 0 2px 6px rgba(0,0,0,.35); }
  .coin-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 10px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line); font-variant-numeric: tabular-nums; position: relative;
  }
  .coin-pill b { font-size: 16px; }
  .coin-pill .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--brass); color: var(--brass-ink); display: grid; place-items: center; font-weight: 800; }
  .coin-pill.gift::after, .rb-coins.gift .icon-btn::after {
    content: ''; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%;
    background: #ff5a5f; border: 2px solid var(--page);
  }
  .rb-coins .icon-btn { position: relative; }
  .coin-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--brass); }
  .coin-chip.big-chip { font-size: 28px; }
  .coin-chip.big-chip .coin { width: 26px; height: 26px; }
  .card.flash-card { animation: cardflash 1s ease; }
  @keyframes cardflash { 0%, 60% { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(242,193,78,.25); } 100% { border-color: var(--line); box-shadow: none; } }

  /* Estructura */
  #home.app {
    height: 100%; display: grid; grid-template-columns: 228px minmax(0, 1fr);
    background: radial-gradient(ellipse at 70% -10%, #1a2955 0%, transparent 55%), var(--page);
  }
  .side {
    display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; border-right: 1px solid var(--line);
    background: rgba(4, 8, 21, .35); min-height: 0; overflow: auto;
  }
  .side .brand { padding: 0 8px; }
  .side-nav { display: grid; gap: 4px; }
  .nav-btn {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 0;
    background: none; color: var(--chalk-dim); font-weight: 600; text-align: left; width: 100%;
  }
  .nav-btn:hover { color: var(--chalk); background: rgba(255,255,255,.04); }
  .nav-btn.on { color: var(--brass); background: rgba(242, 193, 78, .1); box-shadow: inset 3px 0 0 var(--brass); }
  .online-pill { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; color: var(--chalk-dim); }
  .online-pill b { color: var(--chalk); }
  .live-dot { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .18); flex: none; }
  .main-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 16px 28px 10px; }
  .brand-top { display: none; }
  .top-gear { display: none; }
  .avatar-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0; background: none; flex: none; }
  .avatar-btn canvas { width: 42px; height: 42px; display: block; }
  .av-lvl { position: absolute; right: -4px; bottom: -4px; background: var(--brass); color: var(--brass-ink); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 5px; line-height: 16px; border: 2px solid var(--page); }
  .main { flex: 1; min-height: 0; overflow: auto; padding: 4px 28px 32px; scrollbar-width: thin; }
  .page { display: none; max-width: 1040px; margin: 0 auto; }
  .page.on { display: block; animation: pagein .18s ease; }
  @keyframes pagein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .page-title { margin: 4px 0 16px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
  .page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
  .page-head .page-title { margin-bottom: 8px; }
  .sec-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; display: flex; gap: 8px; align-items: baseline; }
  .sec-title .muted { font-size: 14px; font-weight: 600; }
  .sub-title { margin: 14px 0 8px; font-size: 16px; font-weight: 800; }
  .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
  .sec-head .sub-title { margin: 0; }
  .page > .sec-title { margin: 26px 0 12px; }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; }
  .card-title { margin: 0 0 14px; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .rightbar { display: none; }

  /* Hero */
  .hero {
    position: relative; overflow: hidden; border-radius: 24px; border: 1px solid #2c3c6d;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 30px 32px; min-height: 250px;
    background:
      radial-gradient(circle at 72% 45%, rgba(255, 214, 120, .22), transparent 42%),
      repeating-conic-gradient(from 0deg at 72% 45%, rgba(255,255,255,.045) 0deg 7deg, transparent 7deg 18deg),
      linear-gradient(135deg, #17285d, #0d193d 60%, #0a1431);
  }
  .hero h1 { margin: 0 0 10px; font-size: clamp(38px, 5.2vw, 64px); line-height: .92; font-weight: 800; letter-spacing: -0.035em; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
  .hero h1 span { color: var(--brass); }
  .hero p { margin: 0 0 18px; color: #cfe0d4; max-width: 34ch; }
  .hero-sub { display: block; margin-top: 8px; font-size: 13px; color: var(--chalk-dim); }
  .hero-art { width: 100%; height: auto; max-height: 250px; display: block; filter: drop-shadow(0 12px 18px rgba(0,0,0,.25)); }

  /* Modos */
  .modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .mode-card {
    position: relative; display: grid; align-content: start; gap: 6px; text-align: left; padding: 16px; min-height: 150px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 18px; color: var(--chalk);
    transition: border-color .15s, transform .08s, background .15s;
  }
  .mode-card:hover:not(:disabled) { border-color: var(--brass); background: #162143; }
  .mode-card:active:not(:disabled) { transform: translateY(1px); }
  .mode-card:disabled { opacity: .6; cursor: default; }
  .mode-card b { font-size: 18px; font-weight: 800; margin-top: 6px; }
  .mode-card small { color: var(--chalk-dim); font-size: 13.5px; line-height: 1.35; padding-right: 22px; }
  .mc-arrow { position: absolute; right: 14px; bottom: 14px; color: var(--chalk-dim); }
  .mode-card:hover:not(:disabled) .mc-arrow { color: var(--brass); }
  .mc-ico {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
    background: color-mix(in srgb, var(--ic) 22%, transparent); color: var(--ic); border: 1px solid color-mix(in srgb, var(--ic) 45%, transparent);
  }
  .mc-ico .i { width: 24px; height: 24px; }
  .mc-ico.sm { width: 34px; height: 34px; border-radius: 11px; }
  .mc-ico.sm .i { width: 19px; height: 19px; }
  .badge-new, .badge-soon { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; }
  .badge-new { background: #7b4fd6; color: #fff; }
  .badge-soon { background: var(--panel-2); color: var(--chalk-dim); border: 1px solid var(--line); }
  .badge-new.inline, .badge-soon.inline { position: static; }
  .custom-card {
    margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px;
    background: linear-gradient(90deg, #131f44, var(--panel)); border: 1px solid var(--line); border-radius: 18px; color: var(--chalk);
  }
  .custom-card:hover { border-color: var(--brass); }
  .cc-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
  .cc-txt b { font-size: 17px; font-weight: 800; }
  .cc-txt small { color: var(--chalk-dim); font-size: 13.5px; }

  /* Partidas recientes */
  .recent { display: grid; gap: 8px; }
  .rec {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  }
  .rec-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
  .rec-badge.win { background: rgba(61, 220, 132, .16); color: #5ce39a; }
  .rec-badge.draw { background: rgba(169, 191, 177, .14); color: var(--chalk-dim); }
  .rec-badge.loss { background: rgba(255, 99, 99, .14); color: #ff8a8a; }
  .rec-main { min-width: 0; }
  .rec-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rec-sub { font-size: 13px; color: var(--chalk-dim); }
  .rec-side { text-align: right; display: grid; gap: 2px; justify-items: end; }
  .rec-score { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .rec-coins { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--brass); }
  .rec-coins .coin { width: 13px; height: 13px; }
  .empty-box { border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--chalk-dim); text-align: center; }

  /* En línea */
  .online-list { display: grid; gap: 6px; }
  .ol-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
  .ol-row .grow { flex: 1; min-width: 0; display: grid; }
  .ol-row .grow b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ol-row .grow span { font-size: 12.5px; color: var(--chalk-dim); }
  .st-dot { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; flex: none; }
  .st-dot.jugando, .st-dot.entrenando { background: var(--brass); }
  .st-dot.sala, .st-dot.pro { background: #6ea0ff; }
  .narrow-only .online-list { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }

  /* Jugar */
  .play-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .play-grid .form-grid { grid-template-columns: 1fr 1fr; }
  .online-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
  .act-tile {
    display: grid; justify-items: center; align-content: center; gap: 4px; padding: 10px 18px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--panel-2); color: var(--chalk); font-weight: 800;
  }
  .act-tile.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
  .act-tile .i { width: 24px; height: 24px; }
  .act-join { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .code-field { text-transform: uppercase; letter-spacing: .1em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
  .check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; color: var(--chalk-dim); cursor: pointer; }
  .check input { width: 18px; height: 18px; accent-color: var(--brass); margin: 1px 0 0; flex: none; }
  .lobby-list { display: grid; gap: 8px; }
  .lob { display: flex; align-items: center; gap: 10px; background: var(--page); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
  .lob .grow { flex: 1; min-width: 0; display: grid; }
  .lob .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lob .grow span { font-size: 12.5px; color: var(--chalk-dim); }
  .lob .btn { flex: none; }
  .soon-card { opacity: .75; }

  /* Ranking */
  .rank-list { display: grid; gap: 6px; }
  .rk { display: grid; grid-template-columns: 34px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
  .rk.me { border-color: var(--brass); background: #182343; }
  .rk-pos { font-weight: 800; font-size: 17px; text-align: center; color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
  .rk:nth-child(1) .rk-pos { color: #f2c14e; } .rk:nth-child(2) .rk-pos { color: #d7dde3; } .rk:nth-child(3) .rk-pos { color: #e09a5a; }
  .rk .grow { min-width: 0; display: grid; }
  .rk .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rk .grow span { font-size: 12.5px; color: var(--chalk-dim); }
  .rk-right { display: flex; align-items: center; gap: 10px; }

  /* Perfil */
  .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .profile-big { display: flex; gap: 18px; align-items: center; grid-column: 1 / -1; }
  #pfCap { width: 110px; height: 110px; flex: none; }
  .pf-txt { flex: 1; min-width: 0; display: grid; gap: 6px; }
  .stat-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .stat-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 2px; }
  .stat-box b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
  .stat-box span { font-size: 13px; color: var(--chalk-dim); }
  .row-card { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

  /* Columna derecha */
  .rightbar { flex-direction: column; gap: 14px; padding: 18px 18px 18px 0; min-height: 0; overflow: auto; }
  .rb-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
  .rb-profile { display: flex; gap: 14px; align-items: center; }
  .rb-avatar { border: 0; background: none; padding: 0; flex: none; }
  .rb-avatar canvas { width: 64px; height: 64px; display: block; }
  .rb-ptxt { flex: 1; min-width: 0; display: grid; gap: 4px; }
  .rb-ptxt b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rb-coins { display: flex; align-items: center; gap: 12px; }
  .rb-ctxt { flex: 1; display: grid; }
  .rb-ctxt b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
  .rb-online .sec-head { margin: 0 0 8px; }
  .rb-online .sec-title { font-size: 16px; }

  /* Navegación inferior (móvil en vertical) */
  .bottomnav { display: none; }

  /* Diálogo de monedas */
  .coins-big { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .daily-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
  .dday { border: 1px solid var(--line); border-radius: 12px; padding: 7px 2px; display: grid; justify-items: center; gap: 3px; font-size: 12px; color: var(--chalk-dim); background: var(--page); }
  .dday b { color: var(--chalk); font-size: 13px; }
  .dday.done { opacity: .55; }
  .dday.done::after { content: '✓'; color: #5ce39a; font-weight: 800; }
  .dday.today { border-color: var(--brass); background: rgba(242, 193, 78, .12); color: var(--brass); }
  .dday .coin { width: 14px; height: 14px; }
  .earn-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
  @keyframes coinpop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
  .pop { animation: coinpop .45s ease; }

  /* Bienvenida */
  #welcome { height: 100%; overflow: auto; display: grid; place-items: center; padding: 18px;
    background: radial-gradient(ellipse at 30% 0%, #1a2955, transparent 60%), var(--page); }
  .welcome-card {
    width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center;
    background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--line); border-radius: 26px; padding: 26px 28px;
    box-shadow: 0 30px 60px rgba(0,0,0,.35);
  }
  .welcome-art { display: grid; gap: 10px; justify-items: center; text-align: center; }
  .welcome-art .brand-name { font-size: 44px; }
  .welcome-art .brand-caps svg { width: 42px; height: 42px; }
  .welcome-art .hero-art { max-width: 360px; }
  .welcome-form h2 { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
  .welcome-form > .muted { margin: 0 0 14px; font-size: 14.5px; }
  .pc-row { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
  #pcPrev { width: 96px; height: 96px; flex: none; }
  .welcome-form .swatches { margin-bottom: 14px; }

  /* --- Escritorio ancho: columna derecha con perfil, monedas y gente en línea --- */
  @media (min-width: 1180px) and (min-height: 521px) {
    #home.app { grid-template-columns: 228px minmax(0, 1fr) 300px; }
    .rightbar { display: flex; }
    .topbar .coin-pill, .topbar .avatar-btn { display: none; }
    .topbar { padding-top: 10px; padding-bottom: 0; min-height: 10px; }
    .narrow-only { display: none; }
  }
  @media (max-width: 1000px) {
    .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mode-card { min-height: 0; }
  }
  @media (max-width: 900px) {
    .play-grid, .profile-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* --- Móvil en vertical: barra inferior --- */
  @media (max-width: 759px) and (min-height: 521px) {
    #home.app { grid-template-columns: minmax(0, 1fr); }
    .side { display: none; }
    .brand-top { display: flex; }
    .brand-top .brand-name { font-size: 24px; }
    .top-gear { display: inline-grid; }
    .topbar { padding: 10px 16px 8px; gap: 8px; }
    .main { padding: 4px 16px calc(92px + env(safe-area-inset-bottom)); }
    .bottomnav {
      display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
      background: rgba(9, 15, 33, .96); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
      backdrop-filter: blur(8px);
    }
    .bottomnav .nav-btn { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 12px; justify-content: center; align-items: center; text-align: center; }
    .bottomnav .nav-btn .i { width: 22px; height: 22px; }
    .bottomnav .nav-btn.on { box-shadow: none; background: none; }
    .hero { grid-template-columns: 1fr; padding: 22px 20px 20px; min-height: 0; }
    .hero-art { order: -1; max-height: 170px; margin: -6px auto -4px; width: min(100%, 300px); }
    .hero h1 { font-size: 44px; }
    .hero p { font-size: 15px; }
    .btn.big { width: 100%; justify-content: center; }
    .hero-sub { text-align: center; }
    .page-title { font-size: 26px; }
    .mode-card { padding: 14px; }
    .mode-card b { font-size: 16px; }
    .mode-card small { font-size: 12.5px; }
    .mc-ico { width: 38px; height: 38px; }
    .custom-card .mini-caps { display: none; }
    .welcome-card { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
    .welcome-art .hero-art { max-width: 250px; }
    .welcome-art .brand-name { font-size: 36px; }
    .stat-box b { font-size: 20px; }
    .profile-big { flex-direction: column; text-align: center; }
    .profile-big .pro-name { justify-content: center; }
    .online-actions { grid-template-columns: 1fr; }
    .act-tile { grid-auto-flow: column; justify-content: center; padding: 12px; }
  }


  /* --- Móvil en horizontal (pantalla baja): barra lateral de iconos --- */
  @media (max-height: 520px) {
    #home.app { grid-template-columns: 76px minmax(0, 1fr); }
    .side { padding: 10px 8px; gap: 10px; align-items: center; }
    .side .brand { padding: 0; }
    .side .brand-name { display: none; }
    .side .brand-caps svg { width: 24px; height: 24px; }
    .side-nav { gap: 2px; width: 100%; }
    .side .nav-btn { flex-direction: column; gap: 0; padding: 4px 2px; font-size: 10.5px; line-height: 1.2; align-items: center; text-align: center; }
    .side .nav-btn .i { width: 19px; height: 19px; }
    .side .nav-btn.on { box-shadow: none; }
    .online-pill { flex-direction: row; justify-content: center; gap: 6px; padding: 5px 4px; font-size: 12px; width: 100%; }
    .online-pill .ol-txt { display: none; }
    .topbar { padding: 8px 16px 4px; }
    .main { padding: 2px 16px 18px; }
    .hero { min-height: 0; padding: 16px 22px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .hero h1 { font-size: 38px; }
    .hero p { margin-bottom: 10px; font-size: 14px; }
    .hero-art { max-height: 170px; }
    .btn.big { padding: 10px 20px; font-size: 16px; }
    .page-title { font-size: 22px; margin-bottom: 10px; }
    .sec-head { margin: 16px 0 8px; }
    .mode-card { min-height: 0; padding: 12px; }
    .mode-card b { font-size: 16px; margin-top: 2px; }
    .mc-ico { width: 34px; height: 34px; border-radius: 11px; }
    .mc-ico .i { width: 19px; height: 19px; }
    .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .card { padding: 14px; border-radius: 16px; }
    .card-title { margin-bottom: 10px; font-size: 17px; }
    #welcome { padding: 10px; }
    .welcome-card { padding: 16px 20px; gap: 18px; }
    .welcome-art .hero-art { max-width: 240px; }
    .welcome-art .brand-name { font-size: 30px; }
    .welcome-form h2 { font-size: 22px; }
    .welcome-form > .muted { font-size: 13px; margin-bottom: 8px; }
    #pcPrev { width: 64px; height: 64px; }
    .pc-row { margin-bottom: 8px; }
    .welcome-form .or { margin: 6px 0; }
    .profile-big { padding: 12px; }
    #pfCap { width: 80px; height: 80px; }
  }

  /* ================= Tienda de pegatinas ================= */
  .bottomnav { grid-template-columns: repeat(5, 1fr) !important; }
  .coin-pill.static { padding: 0 14px 0 10px; }
  .shop-top { display: flex; gap: 22px; align-items: center; }
  #shopCap { width: 180px; height: 180px; flex: none; }
  .shop-side { flex: 1; min-width: 0; }
  .shop-side .card-title { margin-bottom: 4px; }
  #shopHint { margin: 0 0 12px; }
  .slots { display: grid; gap: 6px; }
  .slot { display: flex; align-items: center; gap: 10px; background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px 6px 12px; min-height: 42px; }
  .slot .z { width: 46px; font-size: 13px; color: var(--chalk-dim); font-weight: 600; }
  .slot .v { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .slot .v.none { color: var(--chalk-dim); font-weight: 400; }
  .slot.trying { border-color: var(--brass); }
  .try-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
  .try-name { font-weight: 800; color: var(--brass); margin-right: auto; }
  .shop-seg { margin: 16px 0 12px; }
  .shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .stk-card {
    position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 8px 10px; text-align: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px; color: var(--chalk);
    transition: border-color .15s, transform .08s;
  }
  .stk-card:hover { border-color: #3c4c7d; }
  .stk-card.sel { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(242,193,78,.25); }
  .stk-card canvas { width: 88px; height: 88px; }
  .stk-card b { font-size: 14.5px; }
  .stk-price { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; color: var(--brass); }
  .stk-price .coin { width: 14px; height: 14px; }
  .stk-price.short { color: var(--chalk-dim); }
  .stk-tag { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 9px; background: var(--panel-2); color: var(--chalk-dim); }
  .stk-tag.on { background: rgba(61,220,132,.16); color: #5ce39a; }
  .stk-zone { position: absolute; top: 8px; left: 10px; font-size: 11px; color: var(--chalk-dim); }
  .shop-peek { display: flex; gap: 2px; }
  .shop-peek canvas { width: 40px; height: 40px; }
  .cap-cv { flex: none; }
  @media (max-width: 759px) and (min-height: 521px) {
    .shop-top { gap: 12px; align-items: flex-start; padding: 14px; }
    #shopCap { width: 104px; height: 104px; }
    #shopHint { display: none; }
    .shop-side .card-title { font-size: 16px; margin-bottom: 8px; }
    .slot { min-height: 34px; padding: 3px 6px 3px 10px; gap: 6px; font-size: 14px; }
    .slot .z { width: 40px; font-size: 12px; }
    .slot .btn { padding: 4px 10px; font-size: 12.5px; }
    .try-bar { margin-top: 10px; }
    .try-name { width: 100%; margin: 0; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
    .stk-card canvas { width: 72px; height: 72px; }
    .shop-peek { display: none; }
    .bottomnav .nav-btn { font-size: 11px; }
  }
  @media (max-height: 520px) {
    #shopCap { width: 120px; height: 120px; }
    .stk-card canvas { width: 64px; height: 64px; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  }

  /* ================= Amigos, chat e invitaciones ================= */
  .bottomnav { grid-template-columns: repeat(6, 1fr) !important; }
  .nav-btn { position: relative; }
  .nbadge {
    min-width: 18px; height: 18px; border-radius: 999px; background: #ff5a5f; color: #fff; font-size: 11px; font-weight: 800;
    display: inline-grid; place-items: center; padding: 0 5px; line-height: 1; margin-left: auto;
  }
  .nbadge.dot { min-width: 9px; width: 9px; height: 9px; padding: 0; margin-left: 4px; }
  .seg .nbadge { margin-left: 4px; vertical-align: 1px; }
  .bottomnav .nbadge, .side .nav-btn .nbadge { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; }
  .side-nav .nav-btn .nbadge { position: static; }
  .link-btn { background: none; border: 0; color: var(--brass); font-weight: 700; font-size: 13.5px; padding: 2px 0; }
  .add-card { display: grid; gap: 12px; }
  .add-card .err:empty { display: none; }
  .add-card .err { margin: 0; }
  .my-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .code-big { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .08em; color: var(--brass); }
  .req-box { margin-top: 14px; display: grid; gap: 8px; }
  .req-box .sub-title { margin: 6px 0 2px; }
  .friend-list { display: grid; gap: 8px; }
  .fr { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
  .fr .av { position: relative; flex: none; }
  .fr .av .st-dot { position: absolute; right: -1px; bottom: 0; width: 11px; height: 11px; border: 2px solid var(--panel); }
  .st-dot.off { background: #5b6b63; }
  .fr .grow { flex: 1; min-width: 0; display: grid; }
  .fr .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fr .grow span { font-size: 12.5px; color: var(--chalk-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fr .acts { display: flex; gap: 6px; align-items: center; flex: none; }
  .fr.off { opacity: .62; }
  .fr .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
  .fr .icon-btn .i { width: 16px; height: 16px; }
  .friend-list.compact .fr { background: var(--page); padding: 6px 8px; }
  .friend-list.compact .fr .rm { display: none; }
  .online-list .btn.small { padding: 5px 11px; font-size: 13px; }
  .online-list.big .ol-row { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
  /* chat */
  .chat-card { display: flex; flex-direction: column; gap: 10px; height: min(60vh, 520px); }
  .chat-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; padding-right: 2px; }
  .cm { display: flex; gap: 8px; align-items: flex-start; }
  .cm .cap-cv { margin-top: 1px; }
  .cm .bub { background: var(--page); border-radius: 4px 12px 12px 12px; padding: 5px 10px; min-width: 0; max-width: 100%; }
  .cm .bub b { font-size: 13px; margin-right: 6px; }
  .cm .bub time { font-size: 11px; color: var(--chalk-dim); }
  .cm .bub p { margin: 1px 0 0; font-size: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
  .cm.mine .bub { background: rgba(242,193,78,.12); }
  .chat-form { display: flex; gap: 8px; }
  .chat-form .field { padding: 9px 12px; }
  .chat-form .btn { padding: 0 14px; flex: none; }
  .chat-empty { color: var(--chalk-dim); font-size: 13.5px; text-align: center; margin: auto 0; }
  .rb-friends .sec-head, .rb-chat .sec-head { margin: 0 0 10px; }
  .rb-friends .sec-title, .rb-chat .sec-title { font-size: 16px; }
  .rb-friends .friend-list { max-height: 240px; overflow-y: auto; }
  .rb-chat { flex: 1; min-height: 260px; display: flex; flex-direction: column; }
  .rb-chat .chat-msgs { margin-bottom: 10px; }
  /* avisos (invitaciones, solicitudes) */
  .notices { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
  .notice {
    pointer-events: auto; display: flex; gap: 12px; align-items: center; background: #192447; border: 2px solid var(--brass);
    border-radius: 16px; padding: 10px 12px; box-shadow: 0 14px 30px rgba(0,0,0,.4); animation: noticein .25s ease;
  }
  .notice .grow { flex: 1; min-width: 0; font-size: 14.5px; }
  .notice .grow small { display: block; color: var(--chalk-dim); font-size: 12.5px; }
  .notice .acts { display: flex; gap: 6px; flex: none; }
  .notice.plain { border-color: var(--line); }
  @keyframes noticein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  body.playing .notice { padding: 6px 10px; }
  @media (max-width: 759px) and (min-height: 521px) {
    .bottomnav .nav-btn { font-size: 10.5px; padding: 7px 0; }
    .bottomnav .nav-btn .i { width: 21px; height: 21px; }
    .chat-card { height: calc(100dvh - 300px); min-height: 280px; }
    #socSeg button { padding: 7px 11px; }
  }
  @media (max-height: 520px) {
    .side .nav-btn { padding: 3px 2px; }
    .side-nav .nav-btn .nbadge { position: absolute; top: 0; right: 8px; }
    .side-nav [data-act="opts"] { display: none; }
    .top-gear { display: inline-grid; }
    .chat-card { height: calc(100dvh - 140px); }
  }

  /* ================= Torneos ================= */
  body:not(.tour-room) .tour-only { display: none !important; }
  body.tour-room .not-tour { display: none !important; }
  .tour-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .tour-grid .form-grid { grid-template-columns: 1fr 1fr; }
  .prize-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--chalk-dim); margin: 12px 0; }
  .prize-line b { color: var(--brass); }
  .tour-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .tour-head .card-title { margin-bottom: 8px; }
  .th-code { display: grid; justify-items: end; }
  .chips { display: flex; gap: 6px; flex-wrap: wrap; }
  .chips .chip { font-size: 13px; }
  .chip.gold { background: rgba(242,193,78,.16); color: var(--brass); font-weight: 700; }
  .tour-banner { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 18px;
    background: linear-gradient(90deg, rgba(242,193,78,.16), rgba(242,193,78,.04)); border: 1px solid rgba(242,193,78,.45); }
  .tour-banner .grow { flex: 1; min-width: 200px; }
  .tour-banner b.big { display: block; font-size: 19px; font-weight: 800; }
  .tour-banner .muted { font-size: 14px; }
  .tour-banner.calm { background: var(--panel); border-color: var(--line); }
  .tour-banner.champ { background: linear-gradient(90deg, rgba(242,193,78,.3), rgba(242,193,78,.06)); }
  .tour-banner .trophy { width: 46px; height: 46px; color: var(--brass); flex: none; }
  .slots-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tslot { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 60px; }
  .tslot .grow { min-width: 0; display: grid; }
  .tslot .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tslot .grow span { font-size: 12.5px; color: var(--chalk-dim); }
  .tslot.free { border-style: dashed; color: var(--chalk-dim); justify-content: center; font-size: 14px; }
  .tslot.me { border-color: var(--brass); }
  .bracket-wrap { margin-top: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .bracket { display: flex; gap: 18px; min-width: min-content; }
  .bcol { display: flex; flex-direction: column; min-width: 190px; }
  .bcol h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--chalk-dim); text-align: center; }
  .bcol .bms { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
  .bm { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .bm.mine { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(242,193,78,.18); }
  .bm.cur:not(.done) { border-style: dashed; }
  .bm-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
  .bm-row + .bm-row { border-top: 1px solid var(--line); }
  .bm-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .bm-row .sc { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 16px; text-align: right; }
  .bm-row.win .nm { font-weight: 800; }
  .bm-row.lose { opacity: .55; }
  .bm-row.tbd .nm { color: var(--chalk-dim); font-style: italic; }
  .bm small { display: block; padding: 3px 10px 5px; font-size: 11.5px; color: var(--chalk-dim); background: rgba(0,0,0,.15); }
  .bcol.champ .bms { justify-content: center; }
  .champ-box { text-align: center; padding: 14px 10px; border-radius: 14px; border: 1px solid rgba(242,193,78,.5); background: rgba(242,193,78,.1); display: grid; gap: 6px; justify-items: center; }
  .champ-box b { font-size: 16px; }
  .champ-box .trophy { width: 34px; height: 34px; color: var(--brass); }
  @media (max-width: 900px) { .tour-grid { grid-template-columns: 1fr; } }
  @media (max-width: 759px) and (min-height: 521px) {
    .bcol { min-width: 160px; }
    .tour-grid .form-grid { grid-template-columns: 1fr 1fr; }
  }

  /* ================= iPhone: notch, isla y barra de inicio (zonas seguras) ================= */
  #home, #welcome {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  #pro, #room {
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  @media (max-height: 520px) {
    #pro, #room { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  }
  #game {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .game-tools { top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
  .toast { top: calc(16px + env(safe-area-inset-top, 0px)); width: min(440px, calc(100vw - 24px)); }
  .toast span { flex: 1; }
  #chat { left: calc(12px + env(safe-area-inset-left, 0px)); }

  /* ======================= Portada nueva (lobby) ======================= */
  @font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lilita-one.woff2) format('woff2'); }
  :root {
    --disp: 'Lilita One', 'Bricolage Grotesque', system-ui, sans-serif;
    --gold: #ffc829;
    --gold-lip: #a86400;
    --gold-ink: #3b2400;
    --glass: rgba(3, 10, 31, .62);
    --glass-line: rgba(255, 255, 255, .14);
    --outline: 0 2px 0 #030c25, 0 0 8px rgba(0, 0, 0, .45);
    /* Color base de todos los iconos de menú (solo «Jugar» va en dorado) */
    --ico: #2f74d8;
    --ico-lip: #17408a;
  }
  html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* iOS hace zoom al escribir si la letra es menor de 16 px */
  input, select, textarea { font-size: 16px !important; }

  #home.lobby {
    --px: calc(18px + env(safe-area-inset-left, 0px));
    position: fixed; inset: 0; overflow: hidden; isolation: isolate;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top top top" "side stage ghost" "dock dock dock";
    gap: 10px 16px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px)) 0 var(--px);
  }
  #home.lobby.hidden { display: none !important; }
  .lb-bg {
    position: absolute; inset: 0; z-index: -1;
    background:
      linear-gradient(180deg, rgba(1, 6, 21, .55) 0%, rgba(1, 6, 21, 0) 22%, rgba(1, 6, 21, 0) 70%, rgba(1, 6, 21, .5) 100%),
      url(/img/lobby.jpg) center 62% / cover no-repeat, #071d60;
  }


  /* Barra superior */
  .lb-top { grid-area: top; display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; z-index: 8; }
  .lb-top .spacer { flex: 1; }
  .lb-profile {
    display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; flex: 0 1 auto;
    background: var(--glass); border: 2px solid var(--glass-line); border-radius: 999px;
    padding: 4px 18px 4px 4px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .lb-av { position: relative; width: 48px; height: 48px; flex: none; }
  .lb-av canvas { width: 48px; height: 48px; display: block; }
  .lb-lvl {
    position: absolute; right: -7px; bottom: -5px; min-width: 24px; height: 24px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 9px; border: 2px solid #030c25;
    background: var(--gold); color: var(--gold-ink); font: 14px/1 var(--disp);
  }
  .lb-ptxt { display: grid; gap: 5px; min-width: 0; text-align: left; }
  .lb-ptxt b { font: 19px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .lb-xp { display: block; width: 116px; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .5); overflow: hidden; }
  .lb-xp span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7ef0a6, #3ddc84); }
  .lb-coins.coin-pill {
    height: 48px; padding: 0 5px 0 10px; gap: 8px; border-radius: 999px;
    background: var(--glass); border: 2px solid rgba(255, 200, 41, .4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .lb-coins.coin-pill b { font: 20px/1 var(--disp); text-shadow: var(--outline); min-width: 3ch; text-align: left; }
  .lb-coins .coin { width: 28px; height: 28px; }
  .lb-coins .plus { width: 34px; height: 34px; font: 22px/1 var(--disp); box-shadow: 0 3px 0 var(--gold-lip); }
  .lb-round {
    width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px;
    background: var(--glass); border: 2px solid var(--glass-line); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .lb-round .i { width: 24px; height: 24px; }
  .lb-round:active { transform: translateY(2px); }
  .lb-more { position: relative; }
  .more-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 250px;
    background: #0c183d; border: 2px solid var(--glass-line); border-radius: 18px; padding: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5); display: grid; gap: 2px; animation: pagein .14s ease;
  }
  .more-menu button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px;
    background: none; color: var(--chalk); font-weight: 600; text-align: left;
  }
  .more-menu button:hover, .more-menu button:focus-visible { background: rgba(255, 255, 255, .08); }
  .more-menu .i { width: 20px; height: 20px; color: var(--gold); flex: none; }
  .more-menu .mini-caps { margin-left: auto; }

  /* Botones pequeños del lateral (Ranking, Torneos, Más) */
  .lb-side, .lb-dock { --t: var(--ico); --td: var(--ico-lip); }
  .lb-side { grid-area: side; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; position: relative; z-index: 6; }
  .side-btn { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: #fff; }
  .side-face {
    width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center;
    background: linear-gradient(180deg, color-mix(in srgb, var(--t) 70%, #fff) 0%, var(--t) 52%, color-mix(in srgb, var(--t) 85%, #000) 100%);
    border: 2px solid rgba(255, 255, 255, .28);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 5px 0 var(--td), 0 10px 16px rgba(0, 0, 0, .4);
    transition: transform .08s ease, box-shadow .08s ease;
  }
  .side-face .i { width: 27px; height: 27px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3)); }
  .side-btn:active .side-face { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 var(--td), 0 3px 8px rgba(0, 0, 0, .4); }
  .side-btn .nbadge { position: absolute; top: -6px; right: -6px; margin: 0; border: 2px solid #030c25; }
  .side-name { font: 13.5px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .lb-side .more-menu { left: calc(100% + 12px); right: auto; top: auto; bottom: 0; max-height: calc(100dvh - 40px); overflow: auto; }

  /* La chapa del jugador, de pie en el círculo central */
  .lb-stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding-bottom: 2vh; }
  .lb-cap { position: relative; border: 0; padding: 0; background: none; width: min(38vh, 30vw, 300px); aspect-ratio: 1; flex: none; }
  .lb-cap canvas { position: relative; width: 100%; height: 100%; display: block; animation: lbfloat 4.2s ease-in-out infinite; }
  .lb-cap-shadow { position: absolute; left: 14%; right: 14%; bottom: -6%; height: 16%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); animation: lbshadow 4.2s ease-in-out infinite; }
  .lb-cap:active canvas { animation: lbtap .35s ease; }
  @keyframes lbfloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
  @keyframes lbshadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .7; } }
  @keyframes lbtap { 0% { transform: scale(1); } 40% { transform: scale(.9) rotate(-8deg); } 100% { transform: scale(1); } }
  .lb-plate { margin-top: 14px; display: grid; justify-items: center; gap: 2px; text-align: center; }
  .lb-plate b { font: 26px/1.05 var(--disp); text-shadow: var(--outline); }
  .lb-plate span { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }

  .lb-online {
    grid-area: top; justify-self: center; align-self: center; z-index: 6;
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--glass-line);
    background: var(--glass); color: var(--chalk); font-size: 14px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .lb-online b { font: 16px/1 var(--disp); }

  /* Barra de abajo (estilo Clash Royale) */
  .lb-dock {
    grid-area: dock; position: relative; z-index: 5;
    margin: 0 calc(-18px - env(safe-area-inset-right, 0px)) 0 calc(-1 * var(--px));
    padding: 8px calc(12px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
    display: grid; grid-template-columns: repeat(2, minmax(0, 132px)) minmax(0, 210px) repeat(2, minmax(0, 132px));
    justify-content: center; align-items: end; column-gap: 6px;
    background: linear-gradient(180deg, #13224d 0%, #091331 55%, #050b1e 100%);
    border-top: 3px solid #2b407e;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 -10px 30px rgba(0, 0, 0, .45);
  }
  .lb-dock::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 6px; background: linear-gradient(90deg, transparent, rgba(255, 200, 41, .5), transparent); filter: blur(4px); pointer-events: none; }
  .dock-btn {
    position: relative; display: grid; justify-items: center; align-content: end; gap: 4px; min-width: 0;
    padding: 4px 2px 2px; border: 0; border-radius: 16px; background: none; color: #fff;
  }
  .dock-btn + .dock-btn::before, .dock-play + .dock-btn::before { content: none; }
  .dock-ico {
    position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--t) 65%, #fff) 0%, var(--t) 50%, color-mix(in srgb, var(--t) 70%, #000) 100%);
    border: 2px solid rgba(255, 255, 255, .3);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 4px 0 color-mix(in srgb, var(--t) 45%, #000), 0 8px 14px rgba(0, 0, 0, .35);
    transition: transform .08s ease, box-shadow .08s ease;
  }
  .dock-ico .i { width: 28px; height: 28px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3)); }
  .dock-ico canvas { width: 44px; height: 44px; display: block; }
  .dock-btn:active .dock-ico { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 1px 0 color-mix(in srgb, var(--t) 45%, #000), 0 3px 6px rgba(0, 0, 0, .35); }
  .dock-btn:hover .dock-ico { filter: brightness(1.08); }
  .dock-name { font: 14px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); white-space: nowrap; }
  .dock-btn .nbadge { position: absolute; top: -4px; right: calc(50% - 34px); margin: 0; border: 2px solid #030c25; }
  .dock-btn .shop-peek { display: none; }
  /* JUGAR: el botón grande del centro, que sobresale de la barra */
  .dock-play {
    position: relative; align-self: end; margin-top: -34px; height: 92px; padding: 0; min-width: 0;
    border-radius: 26px; border: 3px solid #fff2a8; color: var(--gold-ink);
    background: linear-gradient(180deg, #ffe774 0%, #ffcb2e 46%, #f5a400 100%);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .65), inset 0 -6px 0 rgba(168, 100, 0, .35), 0 7px 0 var(--gold-lip), 0 14px 26px rgba(0, 0, 0, .55);
    transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  }
  .dock-play-in { display: grid; justify-items: center; gap: 2px; }
  .dock-play b { font: 40px/1 var(--disp); letter-spacing: .02em; text-shadow: 0 2px 0 rgba(255, 255, 255, .5); }
  .dock-play-sub { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: rgba(59, 36, 0, .16); font: 14px/1.2 var(--disp); letter-spacing: .03em; text-transform: uppercase; }
  .dock-play-sub .i { width: 15px; height: 15px; }
  .dock-play:hover { filter: brightness(1.05); }
  .dock-play:active { transform: translateY(5px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .65), inset 0 -6px 0 rgba(168, 100, 0, .35), 0 2px 0 var(--gold-lip), 0 6px 14px rgba(0, 0, 0, .5); }
  .dock-play::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 0 rgba(255, 220, 90, .55); animation: playpulse 2.4s ease-out infinite; }
  @keyframes playpulse { 0% { box-shadow: 0 0 0 0 rgba(255, 220, 90, .5); } 70%, 100% { box-shadow: 0 0 0 14px rgba(255, 220, 90, 0); } }

  /* Móvil en vertical */



  /* Móvil en horizontal (poca altura) */
  @media (orientation: landscape) and (max-height: 560px) {
    #home.lobby { gap: 6px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
    .lb-profile { padding-right: 14px; }
    .lb-av, .lb-av canvas { width: 40px; height: 40px; }
    .lb-lvl { min-width: 20px; height: 20px; font-size: 12px; border-radius: 7px; }
    .lb-ptxt b { font-size: 16px; }
    .lb-xp { width: 90px; height: 6px; }
    .lb-coins.coin-pill, .lb-round { height: 42px; }
    .lb-round { width: 42px; border-radius: 14px; }
    .lb-coins .plus { width: 30px; height: 30px; font-size: 19px; }
    .lb-coins.coin-pill b { font-size: 17px; }
    #home.lobby { grid-template-columns: 104px minmax(0, 1fr) 104px; }
    .lb-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; justify-items: center; gap: 10px 6px; }
    .side-btn { gap: 3px; }
    .side-face { width: 36px; height: 36px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 3px 0 var(--td), 0 6px 10px rgba(0, 0, 0, .4); }
    .side-face .i { width: 20px; height: 20px; }
    .side-name { font-size: 11px; }
    .lb-dock { padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)); grid-template-columns: repeat(2, minmax(0, 104px)) minmax(0, 200px) repeat(2, minmax(0, 104px)); }
    .lb-dock .dock-btn { gap: 3px; padding-top: 2px; }
    .dock-ico { width: 38px; height: 38px; border-radius: 12px; }
    .dock-ico .i { width: 21px; height: 21px; }
    .dock-ico canvas { width: 32px; height: 32px; }
    .dock-name { font-size: 12.5px; }
    .dock-btn .nbadge { right: calc(50% - 26px); }
    .dock-play { height: 62px; margin-top: -18px; border-radius: 20px; }
    .dock-play-in { grid-auto-flow: column; align-items: center; gap: 10px; }
    .dock-play b { font-size: 30px; }
    .dock-play-sub { font-size: 12px; }
    .lb-cap { width: min(38vh, 24vw, 200px); }
    .lb-plate { margin-top: 6px; }
    .lb-plate b { font-size: 18px; }
    .lb-plate span { display: none; }
    .lb-stage { padding-bottom: 6px; }
    .lb-online { padding: 6px 12px; font-size: 13px; }
  }
  @media (orientation: landscape) and (max-height: 560px) and (max-width: 720px) {
    .lb-online span:last-child { display: none; }
    .dock-name { font-size: 11.5px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .lb-cap canvas, .lb-cap-shadow, .dock-play::after { animation: none; }
  }

  /* Anfitrión de la sala */
  .host-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 200, 41, .14); border: 1.5px solid rgba(255, 200, 41, .45); color: var(--gold); font-weight: 700; font-size: 14px; white-space: nowrap; }
  .host-pill.me { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
  .host-pill .i { width: 18px; height: 18px; }
  .i.crown { width: 1.05em; height: 1.05em; vertical-align: -0.15em; color: var(--gold); display: inline-block; }

  /* Las demás pantallas de menú usan el mismo fondo, más oscuro */
  #welcome, #pro, #room { background: linear-gradient(rgba(2, 8, 25, .84), rgba(2, 8, 25, .84)), url(/img/lobby-sm.jpg) center / cover no-repeat, var(--page); }
  @media (min-width: 900px) { #welcome, #pro, #room { background-image: linear-gradient(rgba(2, 8, 25, .84), rgba(2, 8, 25, .84)), url(/img/lobby.jpg); } }

  .more-sep { display: block; padding: 10px 14px 4px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .55); border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 4px; }
  .more-sep.first { border-top: 0; margin-top: 0; padding-top: 6px; }

  /* ---------- Piel «estadio de noche» (v43): azul marino, brillos y separadores ---------- */
  #home.lobby {
    --glass: rgba(8, 16, 44, .72);
    --glass-line: rgba(120, 160, 255, .22);
    --navy: #0b1638;
    --navy-2: #12224f;
    --glow: #3d8bff;
  }
  #home .lb-profile, #home .lb-coins.coin-pill, #home .lb-round, #home .lb-online {
    background: linear-gradient(180deg, rgba(22, 36, 82, .82), rgba(8, 15, 40, .86));
    border-color: rgba(120, 160, 255, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .35);
  }
  #home .lb-profile { border-color: rgba(150, 120, 255, .45); }
  #home .lb-coins.coin-pill { border-color: rgba(255, 200, 41, .45); }
  /* «+» verde de las monedas */
  /* «+» verde de las monedas (en todas las pantallas) */
  .coin-pill .plus, #home .lb-coins .plus { background: linear-gradient(180deg, hsl(128 80% 69%), hsl(138 68% 41%)); color: #fff; box-shadow: 0 3px 0 hsl(138 74% 28%); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
  /* Experiencia con números */
  .lb-xprow { display: flex; align-items: center; gap: 7px; }
  .lb-xp { border: 1px solid rgba(255, 255, 255, .12); }
  .lb-xp span { background: linear-gradient(180deg, #8dff9e, #2fcf55); }
  .lb-xpn { font: 13px/1 var(--disp); color: #fff; text-shadow: var(--outline); white-space: nowrap; }
  .lb-xpn:empty { display: none; }
  /* Jugadores en línea */
  .lb-online .i { width: 17px; height: 17px; color: #cfe0ff; }
  /* Botones laterales sobre una placa oscura */
  .side-btn { padding: 6px 6px 7px; border-radius: 20px; background: linear-gradient(180deg, rgba(14, 26, 64, .78), rgba(6, 12, 32, .78)); border: 1.5px solid rgba(120, 160, 255, .2); box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
  .lb-side { gap: 10px; }
  /* Foco de luz detrás de tu chapa */
  .lb-stage { position: relative; }
  .lb-stage::before {
    content: ''; position: absolute; left: 50%; top: 46%; width: min(70vh, 54vw, 560px); aspect-ratio: 1; transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(255, 236, 170, .28), rgba(255, 220, 120, .1) 45%, transparent 72%);
    pointer-events: none; z-index: -1;
  }
  .lb-cap-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); }

  /* Barra de abajo: azul marino con línea de luz y separadores inclinados */
  .lb-dock {
    background: linear-gradient(180deg, #17295e 0%, #0d1940 45%, #070e28 100%);
    border-top: 2px solid #3a6fe0;
    box-shadow: inset 0 1px 0 rgba(160, 200, 255, .35), 0 -12px 34px rgba(0, 0, 0, .5), 0 -2px 18px rgba(61, 139, 255, .35);
  }
  .lb-dock::before { top: -4px; height: 3px; background: linear-gradient(90deg, transparent 0%, rgba(110, 170, 255, .9) 30%, rgba(255, 220, 110, .95) 50%, rgba(110, 170, 255, .9) 70%, transparent 100%); filter: blur(2px); }
  .dock-btn::after {
    content: ''; position: absolute; right: -4px; top: 10%; bottom: 10%; width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, transparent, rgba(140, 180, 255, .35), transparent); transform: skewX(-14deg); pointer-events: none;
  }
  .dock-btn:last-child::after, .lb-dock > .dock-btn:nth-child(2)::after { content: none; }
  .dock-name { text-shadow: 0 2px 0 #050b22, 0 0 8px rgba(0, 0, 0, .5); }
  /* JUGAR con triángulo y halo dorado */
  .dock-play { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .65), inset 0 -6px 0 rgba(168, 100, 0, .35), 0 7px 0 var(--gold-lip), 0 0 28px rgba(255, 196, 40, .45), 0 14px 26px rgba(0, 0, 0, .55); }
  .dock-play-in { grid-template-columns: auto auto; align-items: center; column-gap: 10px; }
  .dock-play-in .dock-play-sub { grid-column: 1 / -1; justify-self: center; }
  .dock-play .play-tri { width: 30px; height: 30px; color: #2a1800; filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .45)); }
  @media (orientation: landscape) and (max-height: 560px) {
    .dock-play-in { grid-auto-flow: column; grid-template-columns: none; }
    .dock-play-in .dock-play-sub { grid-column: auto; }
    .dock-play .play-tri { width: 22px; height: 22px; }
    .dock-play-in { gap: 8px; }
    .dock-play b { font-size: 27px; }
    .dock-play-sub { font-size: 11px; padding: 2px 8px; }
    .side-btn { padding: 4px 4px 5px; border-radius: 16px; }
    .lb-side { gap: 6px; }
  }



  /* Ranking dentro del perfil */
  .pf-rank {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
    padding: 10px 14px 10px 10px; border-radius: 16px; border: 1.5px solid rgba(255, 200, 41, .45); color: #fff; text-align: left;
    background: linear-gradient(180deg, rgba(255, 200, 41, .16), rgba(255, 200, 41, .05));
  }
  .pf-rank-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(180deg, #ffe774, #f5a400); color: var(--gold-ink); box-shadow: 0 3px 0 var(--gold-lip); }
  .pf-rank-ico .i { width: 24px; height: 24px; }
  .pf-rank-txt { display: grid; gap: 2px; min-width: 0; }
  .pf-rank-txt span { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .7); }
  .pf-rank-txt b { font: 20px/1.05 var(--disp); }
  .pf-rank-go { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
  .pf-rank-go .i { width: 16px; height: 16px; }
  .pf-rank:active { transform: translateY(2px); }

  /* ---------- Arte ilustrado (v45): estadio de fondo, iconos y chapa con relieve ---------- */
  .lb-bg {
    background:
      linear-gradient(180deg, rgba(5, 10, 32, .55) 0%, rgba(5, 10, 32, 0) 20%, rgba(5, 10, 32, 0) 72%, rgba(5, 10, 32, .55) 100%),
      url(/img/estadio.jpg) center 70% / cover no-repeat, #0a1430;
  }

  #welcome, #pro, #room { background: linear-gradient(rgba(6, 12, 34, .86), rgba(6, 12, 34, .9)), url(/img/estadio-v.jpg) center / cover no-repeat, #0a1430; }
  @media (min-width: 900px), (orientation: landscape) { #welcome, #pro, #room { background-image: linear-gradient(rgba(6, 12, 34, .86), rgba(6, 12, 34, .9)), url(/img/estadio.jpg); } }
  /* Iconos ilustrados: sin baldosa, con su propia sombra */
  .dock-ico, #dockCap .dock-ico, .side-face {
    background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible;
  }
  .dock-ico img, .side-face img {
    width: 122%; height: 122%; object-fit: contain; display: block; pointer-events: none;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .45));
    transition: transform .1s ease;
  }
  .dock-btn:active .dock-ico, .side-btn:active .side-face { transform: none; box-shadow: none; }
  .dock-btn:active .dock-ico img, .side-btn:active .side-face img { transform: scale(.9); }
  .dock-btn:hover .dock-ico { filter: none; }
  .dock-btn:hover .dock-ico img { transform: translateY(-2px); }
  .lb-gear img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
  .lb-gear:active img { transform: rotate(30deg); }
  .pf-rank-ico { background: none; box-shadow: none; }
  .pf-rank-ico img { width: 46px; height: 46px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
  .dock-play-sub img { width: 16px; height: 16px; }
  /* La chapa grande ya trae su sombra y su brillo */
  .lb-cap-shadow { left: 18%; right: 18%; bottom: -2%; height: 12%; }
  .dock-ico img { width: 120%; height: 120%; translate: 0 -14%; }



  /* ---------- Mi chapa: pegatinas que tienes (v46) ---------- */
  .mc-zones { display: grid; gap: 12px; }
  .mc-zone { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 10px; }
  .mc-zname { font: 15px/1 var(--disp); color: rgba(255, 255, 255, .85); }
  .mc-list { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; align-items: center; }
  .mc-list::-webkit-scrollbar { display: none; }
  .mc-opt {
    flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; padding: 0;
    background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .12); color: #fff;
  }
  .mc-opt.on { border-color: var(--gold); background: rgba(255, 200, 41, .14); box-shadow: 0 0 0 3px rgba(255, 200, 41, .2); }
  .mc-opt:active { transform: scale(.94); }
  .mc-none { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .7); }
  .mc-empty { padding-left: 4px; }
  #pro .sec-title { margin: 14px 0 8px; font: 18px/1.1 var(--disp); }
  /* Modos que aún no están (Ligas) */
  .tile-soon { filter: saturate(.55); position: relative; }
  .soon-badge {
    position: absolute; top: -9px; right: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px;
    background: var(--gold); color: var(--gold-ink); font: 12px/1.1 var(--disp); letter-spacing: .02em;
    border: 2px solid #050b22; box-shadow: 0 2px 0 var(--gold-lip); white-space: nowrap;
  }
  .club-modes { margin-bottom: 14px; }
  #proTabs.hidden { display: none !important; }
  /* ======================= Paneles (encima de la portada) ======================= */
  .sheet {
    position: absolute; inset: 0; z-index: 20; display: none;
    background: rgba(2, 8, 25, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  }
  #home.sheet-open .sheet { display: flex; animation: sheetin .2s ease; }
  @keyframes sheetin { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
  .sheet-in { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; min-height: 0; }
  .sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; flex: none; }
  .sheet-head h2 { margin: 0; font: 32px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .sheet-head .spacer { flex: 1; }
  .back-btn .i { transform: rotate(180deg); }
  .sheet-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
  .sheet-body .page { display: none; max-width: none; margin: 0; }
  .sheet-body .page.on { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
  .sheet-body .seg { flex: none; align-self: flex-start; background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .12); }
  .sheet-body .seg button { padding: 8px 16px; }
  .sheet-body .seg button.on { box-shadow: 0 3px 0 var(--gold-lip); }
  .pgrid { flex: 1; min-height: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .sheet-body .pgrid > .pp { display: flex; flex-direction: column; min-height: 0; }
  .sheet-body .pgrid > .pp:not(.on) { display: none; }
  .pgrid > .soc-pane { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
  .sheet-body .card {
    display: flex; flex-direction: column; min-height: 0;
    background: linear-gradient(180deg, rgba(25, 39, 81, .94), rgba(13, 23, 54, .94));
    border: 2px solid rgba(255, 255, 255, .09); border-radius: 22px; padding: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
  }
  .sheet-body .card-title { font: 22px/1.1 var(--disp); letter-spacing: .01em; font-weight: 400; margin-bottom: 14px; }
  .sheet-body .sec-head { margin: 14px 0 8px; }
  .sheet-body .sec-title, .sheet-body .sub-title { font-family: var(--disp); font-weight: 400; letter-spacing: .01em; }
  .sheet-body .sec-title { margin: 6px 0 0; font-size: 19px; }
  .scroll { flex: 1 1 auto; min-height: 64px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; align-content: start; }
  .card-note { margin: 0 0 12px; }
  /* Dentro de los paneles solo encogen las listas; el resto mantiene su tamaño */
  .sheet-body .pp > *:not(.scroll), .sheet-body .card > *:not(.scroll), .sheet-body .soc-pane > *:not(.scroll), .shop-cat > *:not(.scroll), .tour-none > *, .tour-on > *:not(.scroll) { flex-shrink: 0; }
  .pane-note { margin: 0; }
  .btn.chunky {
    font: 22px/1 var(--disp); letter-spacing: .01em; padding: 16px 20px; border-radius: 18px; color: var(--gold-ink);
    background: linear-gradient(180deg, #ffe774 0%, #ffcb2e 50%, #f5a400 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 5px 0 var(--gold-lip), 0 10px 18px rgba(0, 0, 0, .3);
    margin-top: auto;
  }
  .btn.chunky:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 1px 0 var(--gold-lip); }
  .form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.g3 label.wide { grid-column: span 2; }
  .sheet-body .form-grid select, .sheet-body .field { background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .12); }
  .sheet-body .check { margin: 0 0 4px; }
  .sheet-body .form-grid select, .sheet-body .form-grid .field { width: 100%; min-width: 0; }
  .sheet-body .scroll .empty-box { padding: 14px; font-size: 14px; }
  .lb-play { margin-top: 6px; }
  .sheet-body .err:empty { min-height: 0; margin: 0; }

  /* Tienda */
  .shop-layout { flex: 1; min-height: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .shop-cat { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
  .sheet-body .shop-top { flex-direction: row; align-items: center; }
  .sheet-body .shop-grid { grid-auto-rows: max-content; }
  /* Ranking */
  .rank-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex: none; }
  .rank-head p { margin: 0; }
  /* Perfil */
  .pf-sum { gap: 12px; }
  .sheet-body .profile-big { flex-direction: row; text-align: left; }
  .sheet-body .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .acct-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
  .sheet-body #proLogout { margin-top: auto; align-self: flex-start; }
  /* Torneos */
  .tour-none, .tour-on { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
  .tour-none.hidden, .tour-on.hidden { display: none !important; }
  .tour-scroll { display: flex; flex-direction: column; }
  .sheet-body #tActions { flex: none; margin: 0; }
  details.how { margin-top: 10px; flex: none; }
  details.how summary { cursor: pointer; font-weight: 700; color: var(--gold); }
  details.how .earn-list { margin: 8px 0 0; font-size: 14px; }
  .sheet-body #cardOnline .online-actions { flex: none; }

  /* Pantallas grandes: todas las columnas a la vez, sin pestañas */
  @media (min-width: 980px) and (min-height: 600px) {
    .sheet-body .ptabs { display: none; }
    .pgrid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pgrid.g3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
    .sheet-body .pgrid > .pp:not(.on) { display: flex; }
    .shop-layout { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .sheet-body .shop-top { flex-direction: column; justify-content: center; text-align: center; }
    .sheet-body .shop-top .slots { justify-content: center; }
    .soc-grid { grid-template-columns: minmax(0, 1fr); }
  }
  /* Apaisado bajo (móvil en horizontal) */
  @media (orientation: landscape) and (max-height: 560px) {
    .sheet { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
    .sheet-head { padding-bottom: 8px; }
    .sheet-head h2 { font-size: 24px; }
    .sheet-head .lb-round, .sheet-head .lb-coins.coin-pill { height: 40px; }
    .sheet-head .lb-round { width: 40px; }
    .sheet-body .page.on { gap: 8px; }
    .sheet-body .card { padding: 12px 14px; border-radius: 18px; }
    .sheet-body .card-title { font-size: 18px; margin-bottom: 8px; }
    .sheet-body .seg button { padding: 6px 12px; }
    .btn.chunky { font-size: 18px; padding: 11px 16px; }
    .form-grid.g3 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .form-grid.g3 label.wide { grid-column: span 2; }
    .card-note { margin-bottom: 8px; }
    .shop-layout { grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .sheet-body .shop-top { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
    .sheet-body .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sheet-body .profile-big { padding: 10px 12px; }
    .sheet-body .card-title { font-size: 16px; margin-bottom: 6px; }
    .sheet-body .card-title .mc-ico { display: none; }
    .sheet-body .form-grid { gap: 6px 8px; margin-bottom: 8px; }
    .sheet-body .form-grid label { font-size: 12px; gap: 2px; }
    .sheet-body .form-grid select { padding: 5px 8px; }
    .sheet-body .card-note { display: none; }
    .sheet-body .check { font-size: 13px; margin: 0; }
    .sheet-body .prize-line { margin: 4px 0 6px; font-size: 13px; }
    .sheet-body .sec-head { margin: 8px 0 6px; }
    #shopHint { display: none; }
    .sheet-body #shopCap { width: 110px; height: 110px; }
    .sheet-body .shop-top .slots { width: 100%; }
    .sheet-body .pgrid > .pf-sum.on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); gap: 8px 12px; align-content: start; }
    .pf-sum .profile-big { grid-column: 1; }
    .pf-sum .stat-grid { grid-column: 2; grid-row: 1; gap: 6px; }
    .pf-sum .stat-grid > * { padding: 6px 10px; }
    .pf-sum .sec-title, .pf-sum .recent { grid-column: 1 / -1; }
    .sheet-body .pf-sum .sec-title { margin: 0; }
  }
  @media (orientation: landscape) and (max-height: 560px) and (min-width: 700px) {
    .pgrid.g2:not(.solo-pane) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sheet-body .pgrid.g2 > .pp:not(.on) { display: flex; }
    .sheet-body [data-page="jugar"] .ptabs, .sheet-body [data-page="torneo"] .ptabs { display: none; }
    .sheet-body [data-page="jugar"] .form-grid.g3, .sheet-body [data-page="torneo"] .form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  /* Vertical estrecho */


  /* =====================================================================
     Piel de juego para el resto de pantallas (sala, modo Pro, diálogos…)
     ===================================================================== */
  /* Botones con relieve */
  .btn {
    font-family: var(--disp); font-weight: 400; letter-spacing: .01em; border-radius: 16px;
    background: linear-gradient(180deg, #29396b 0%, #1b284e 100%); color: #fff;
    border: 2px solid rgba(255, 255, 255, .12);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), 0 4px 0 #091128, 0 8px 14px rgba(0, 0, 0, .25);
    transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  }
  .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), 0 1px 0 #091128, 0 3px 6px rgba(0, 0, 0, .25); }
  .btn.primary {
    background: linear-gradient(180deg, #ffe774 0%, #ffcb2e 50%, #f5a400 100%); color: var(--gold-ink); border-color: #fff2a8;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--gold-lip), 0 8px 14px rgba(0, 0, 0, .25);
  }
  .btn.primary:active:not(:disabled) { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 1px 0 var(--gold-lip); }
  .btn.small { padding: 8px 15px; font-size: 15.5px; border-radius: 13px; }
  .btn.wide { padding-top: 14px; padding-bottom: 14px; font-size: 19px; }
  .btn:disabled { filter: saturate(.4); }

  /* Pestañas */
  .seg { background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 255, 255, .08); border-radius: 16px; padding: 4px; gap: 4px; }
  .seg button { font-family: var(--disp); font-weight: 400; font-size: 15.5px; letter-spacing: .01em; border-radius: 12px; color: rgba(255, 255, 255, .72); }
  .seg button.on { background: linear-gradient(180deg, #ffe774, #ffc829 60%, #f5a400); color: var(--gold-ink); box-shadow: 0 3px 0 var(--gold-lip); }

  /* Campos */
  .field, .form-grid select, .row select, .opt select, #cfgPanel select, dialog select {
    background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 255, 255, .1); border-radius: 12px; color: #fff; font-weight: 600;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3);
  }
  .field:focus, select:focus { border-color: var(--gold); outline: none; }

  /* Tarjetas */
  .panel, .tcard, dialog.kit, .welcome-card {
    background: linear-gradient(180deg, rgba(25, 39, 81, .95), rgba(12, 22, 52, .95));
    border: 2px solid rgba(255, 255, 255, .09); border-radius: 22px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
  }
  .ph, .card-title, .pro-name, .tcard h4, dialog.kit h3, .welcome-form h2, .team h3, .team .who, .result .big, .vs {
    font-family: var(--disp); font-weight: 400; letter-spacing: .01em;
  }
  .lvl { font-family: var(--disp); font-weight: 400; box-shadow: 0 2px 0 var(--gold-lip); }
  .xpbar, .statbar { height: 12px; background: rgba(0, 0, 0, .4); border: 0; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4); }
  .xpbar > div { background: linear-gradient(180deg, #ffe774, #f5a400); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4); }
  .statbar { height: 14px; }
  .statbar > div { background: linear-gradient(180deg, #8ff0a8, #2fbf63); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
  .chip { background: rgba(0, 0, 0, .28); border: 1.5px solid rgba(255, 255, 255, .1); font-weight: 600; }
  .mrow { background: rgba(0, 0, 0, .25); border: 1.5px solid rgba(255, 255, 255, .06); border-radius: 14px; }

  /* Filas y casillas de las listas */
  .rk, .lob, .fr, .stat-box, .stk-card, .ol-row, .rec, .tl {
    background: linear-gradient(180deg, rgba(31, 46, 91, .9), rgba(16, 27, 60, .9));
    border: 2px solid rgba(255, 255, 255, .08); border-radius: 16px;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), 0 3px 0 rgba(0, 0, 0, .3);
  }
  .rk.me { border-color: var(--gold); background: linear-gradient(180deg, rgba(92, 78, 20, .9), rgba(52, 46, 14, .9)); }
  .rk-pos { font-family: var(--disp); font-weight: 400; font-size: 20px; }
  .stat-box b { font-family: var(--disp); font-weight: 400; font-size: 26px; }
  .stk-card { border-radius: 18px; }
  .stk-card b { font-family: var(--disp); font-weight: 400; font-size: 15.5px; letter-spacing: .01em; }
  .stk-card.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 41, .3), 0 3px 0 rgba(0, 0, 0, .3); }
  .stk-card:active { transform: translateY(2px); }
  .act-tile {
    font-family: var(--disp); font-weight: 400; letter-spacing: .01em; font-size: 17px; border-radius: 18px;
    background: linear-gradient(180deg, #29396b, #1b284e); border: 2px solid rgba(255, 255, 255, .12); box-shadow: 0 4px 0 #091128;
  }
  .act-tile.primary { background: linear-gradient(180deg, #ffe774, #ffcb2e 50%, #f5a400); border-color: #fff2a8; color: var(--gold-ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--gold-lip); }
  .act-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-lip); }
  .empty-box { border-radius: 16px; }

  /* Diálogos */
  dialog.kit { border: 3px solid rgba(255, 255, 255, .14); border-radius: 26px; color: var(--chalk); }
  dialog.kit::backdrop { background: rgba(1, 6, 19, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  dialog.kit h3 { font-size: 27px; text-shadow: var(--outline); }

  /* Bienvenida */
  .welcome-card { border-radius: 28px; }
  /* La bienvenida cabe sin scroll: en el móvil, el dibujo se hace pequeño */


  @media (orientation: landscape) and (max-height: 560px) {
    #welcome { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
    .welcome-card { padding: 12px 18px; gap: 16px; }
    .welcome-art > .muted, .welcome-form > .muted { display: none; }
    .welcome-art .hero-art { max-width: 190px; }
    .welcome-form h2 { font-size: 23px; margin-bottom: 8px; }
    .welcome-form .pc-row canvas { width: 64px; height: 64px; }
    .welcome-form .form-grid label { font-size: 12px; gap: 2px; }
    .welcome-form .field { padding-top: 6px; padding-bottom: 6px; }
    .welcome-form .swatches { gap: 6px; margin: 8px 0; flex-wrap: nowrap; }
    .welcome-form .swatches > * { width: 26px; height: 26px; flex: none; }
    .welcome-form .btn.wide { padding-top: 10px; padding-bottom: 10px; font-size: 17px; }
    .welcome-form .or { display: none; }
    .welcome-form .join-row { margin-top: 10px; }
  }
  .welcome-form h2 { font-size: 32px; text-shadow: var(--outline); }
  .brand-name { font-family: var(--disp); font-weight: 400; letter-spacing: .01em; }

  /* ---------- Pantallas de sala y modo Pro: a pantalla completa, sin scroll ---------- */
  #pro, #room {
    position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column;
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  }
  #pro.hidden, #room.hidden { display: none !important; }
  #pro > .room-wrap, #room > .room-wrap { flex: 1; min-height: 0; width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
  .scr-head { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
  .scr-head h2 { margin: 0; font: 30px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); white-space: nowrap; }
  .scr-head .spacer { flex: 1; min-width: 0; }
  .code-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; position: relative;
    font: 21px/1 var(--disp); letter-spacing: .14em; color: var(--gold);
    background: rgba(0, 0, 0, .3); border: 2px dashed rgba(255, 200, 41, .55); border-radius: 14px;
  }
  .code-pill .i { width: 18px; height: 18px; color: rgba(255, 255, 255, .75); }
  .code-pill .copied { display: none; position: absolute; inset: 0; border-radius: 12px; place-items: center; background: var(--gold); color: var(--gold-ink); letter-spacing: .02em; font-size: 16px; }
  .code-pill.ok .copied { display: grid; }
  .hbtn {
    height: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; flex: none;
    border-radius: 16px; border: 2px solid var(--glass-line); background: var(--glass); color: #fff;
    font: 17px/1 var(--disp); letter-spacing: .01em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .hbtn .i { width: 22px; height: 22px; }
  .hbtn.gold { background: linear-gradient(180deg, #ffe774, #ffc829 55%, #f5a400); color: var(--gold-ink); border-color: #fff2a8; box-shadow: 0 4px 0 var(--gold-lip); }
  .hbtn:active { transform: translateY(3px); }
  .hbtn.gold:active { box-shadow: 0 1px 0 var(--gold-lip); }
  .host-pill { height: 36px; }

  /* Sala */
  #room .room-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: 14px; }
  #room .room-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
  #room .room-col > * { flex-shrink: 0; }
  #room .teams { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; }
  #room .vs { display: block; font-size: 24px; color: var(--gold); text-shadow: var(--outline); }
  .team {
    border-radius: 22px; padding: 14px 16px; gap: 8px;
    background: linear-gradient(165deg, color-mix(in srgb, var(--tc) 48%, #0b173c) 0%, #0e193c 75%);
    border: 2px solid color-mix(in srgb, var(--tc) 65%, #fff 10%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 5px 0 color-mix(in srgb, var(--tc) 40%, #000), 0 12px 24px rgba(0, 0, 0, .3);
  }
  .team::after { opacity: .35; }
  .team h3 { font-size: 18px; text-shadow: var(--outline); }
  .team .who { font-size: 21px; text-shadow: var(--outline); }
  .team .who.empty { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 15px; text-shadow: none; }
  #room .room-chat-slot { flex: 1 1 auto; min-height: 96px; display: flex; flex-direction: column; padding: 10px; }
  #chat.in-slot { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  #chat.in-slot #chatLog { max-height: none; flex: 1; min-height: 0; overflow: auto; }
  #chat.in-slot #chatLog div, #chat.in-slot #chatInput { background: rgba(0, 0, 0, .28); }
  #room #cfgPanel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  #room #cfgPanel > * { flex-shrink: 0; }
  #room #cfgPanel > .row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #room #cfgPanel > .row label { font-weight: 600; }
  #room #cfgPanel > .row label:first-child { grid-column: span 2; }
  #room .pitch-preview { flex: 1 1 0; min-height: 0; max-height: 300px; width: 100%; max-width: none; aspect-ratio: auto; margin-top: 10px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .1); }
  #room .start-bar { margin-top: 12px !important; flex-wrap: nowrap; }
  #room #startBtn { font-size: 21px; padding: 14px 26px; border-radius: 18px; flex: none; }
  #room #startNote { font-size: 14px; }
  #room .panel.online-only .row { flex-wrap: nowrap; }
  #room .specs { flex-wrap: nowrap; overflow: hidden; }
  .result { border-radius: 22px; }

  /* Modo Pro */
  #pro #proMain:not(.hidden) { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: 16px; }
  #pro .pro-side { position: static; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
  #pro .pro-content { min-height: 0; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #pro .tabp.on { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
  #pro .tabp.on > * { flex-shrink: 0; }
  #pro #trainList { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; align-content: start; }
  .pro-hero { padding: 16px; }
  .pro-hero .pro-name { text-shadow: var(--outline); }
  .tabs { background: none; border: 0; padding: 0; gap: 8px; }
  .tabs button {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
    background: var(--glass); border: 2px solid var(--glass-line); color: #fff; font-size: 18px;
  }
  .tabs button .i { width: 22px; height: 22px; flex: none; }
  .tabs button.on { background: linear-gradient(180deg, #ffe774, #ffc829 55%, #f5a400); color: var(--gold-ink); border-color: #fff2a8; box-shadow: 0 4px 0 var(--gold-lip); }
  #pro .menu { margin-top: 0; gap: 12px; }
  .mbtn.gtile {
    display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "ico mt" "ico ms"; column-gap: 14px; row-gap: 2px; align-items: center;
    padding: 12px 16px 12px 12px; border-radius: 22px; color: #fff; text-align: left;
    background: linear-gradient(160deg, color-mix(in srgb, var(--t) 75%, #fff) 0%, var(--t) 40%, var(--td) 100%);
    border: 2px solid rgba(255, 255, 255, .24);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 6px 0 color-mix(in srgb, var(--td) 70%, #000), 0 14px 24px rgba(0, 0, 0, .35);
    transition: transform .08s ease, box-shadow .08s ease;
  }
  .mbtn.gtile.primary { color: var(--gold-ink); border-color: #fff2a8; }
  .mbtn.gtile:hover:not(:disabled) { border-color: rgba(255, 255, 255, .4); filter: brightness(1.05); }
  .mbtn.gtile:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 1px 0 color-mix(in srgb, var(--td) 70%, #000); }
  .gt-ico { grid-area: ico; width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: rgba(0, 0, 0, .18); }
  .mbtn.gtile.primary .gt-ico { background: rgba(255, 255, 255, .35); }
  .gt-ico .i { width: 30px; height: 30px; }
  .mbtn.gtile .mt { grid-area: mt; font: 23px/1.05 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .mbtn.gtile.primary .mt { text-shadow: 0 2px 0 rgba(255, 255, 255, .5); }
  .mbtn.gtile .ms { grid-area: ms; font-size: 14px; font-weight: 600; opacity: .9; }
  .tcard { gap: 6px; }
  .tcard h4 { font-size: 20px; text-shadow: var(--outline); }

  /* Club: crear o unirse (pestañas; en pantallas grandes, los dos a la vez) */
  #clubNone:not(.hidden), #clubMine:not(.hidden) { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
  #clubNone > *, #clubMine > * { flex-shrink: 0; }
  .club-seg { align-self: flex-start; }
  .club-panes { flex: 1 1 auto !important; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .cpane { display: none; flex-direction: column; min-height: 0; min-width: 0; }
  #clubList, #clubMembers { overflow-x: hidden; }
  .mrow { min-width: 0; }
  .mrow .btn { flex: none; }
  .cpane.on { display: flex; }
  .cpane > * { flex-shrink: 0; }
  #clubList, #clubMembers { flex: 1 1 auto; min-height: 40px; overflow: auto; overscroll-behavior: contain; margin-top: 12px; align-content: start; }
  #clubMine > .panel:last-child { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  #clubMine > .panel:last-child > * { flex-shrink: 0; }
  #clubMine > .panel:last-child > #clubMembers { flex: 1 1 auto; }
  @media (min-width: 980px) and (min-height: 600px) {
    .club-seg { display: none; }
    .club-panes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .cpane { display: flex; }
  }
  #pro .tabp[data-tab="jugar"] .panel { padding: 12px 14px; }
  #pro .tabp[data-tab="jugar"] .panel .join-row { margin-top: 6px !important; }

  /* Vertical (móvil) */


  /* Horizontal (móvil) */
  @media (orientation: landscape) and (max-height: 560px) {
    #pro, #room { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
    #pro > .room-wrap, #room > .room-wrap { gap: 8px; }
    .scr-head h2 { font-size: 23px; }
    .scr-head .lb-round, .hbtn { height: 40px; }
    .scr-head .lb-round { width: 40px; border-radius: 13px; }
    .scr-head .lb-coins.coin-pill { height: 40px; }
    .hbtn { padding: 0 12px; font-size: 15px; border-radius: 13px; }
    .code-pill { height: 38px; font-size: 18px; }
    .host-pill { height: 32px; font-size: 13px; }
    #room .room-grid { gap: 10px; }
    #room .room-col { gap: 8px; }
    #room .team { padding: 8px 12px; border-radius: 16px; gap: 4px; }
    #room .team h3 { font-size: 14px; }
    #room .team .who { font-size: 16px; }
    #room .team .btn { font-size: 13px; padding: 5px 10px; }
    #room .team .kit-line { display: none; }
    #room .vs { font-size: 17px; }
    #room .panel { padding: 8px 12px; border-radius: 16px; }
    #room #cfgPanel > .row { gap: 4px 8px; }
    #room #cfgPanel > .row label { font-size: 11.5px; gap: 1px; }
    #room #cfgPanel select { padding: 4px 8px; }
    #room #modeNote { display: none; }
    #room .pitch-preview { margin-top: 6px; }
    #room .start-bar { margin-top: 8px !important; }
    #room #startBtn { font-size: 17px; padding: 9px 18px; border-radius: 14px; }
    #room #startNote { font-size: 12px; }
    #room .room-chat-slot { min-height: 70px; padding: 6px; }
    #room .panel.online-only { padding: 4px 10px; }
    #room .panel.online-only .btn { padding: 4px 10px; font-size: 13px; }
    #room .panel.online-only .muted { font-size: 13px; }
    #room .team .btn { margin-top: 2px; }
    #pro #proMain:not(.hidden) { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 12px; }
    #pro .pro-hero { padding: 8px 10px; gap: 10px; flex-direction: row; text-align: left; }
    #pro .pro-hero canvas { width: 52px; height: 52px; }
    #pro .pro-hero .pro-name { font-size: 17px; justify-content: flex-start; }
    #pro .pro-hero .muted { font-size: 12px; }
    #pro .pro-hero .xpbar + .muted { display: none; }
    .tabs { gap: 6px; }
    .tabs button { padding: 7px 12px; font-size: 15px; border-radius: 13px; }
    .tabs button .i { width: 19px; height: 19px; }
    #pro .menu { gap: 10px; }
    .mbtn.gtile { grid-template-columns: 40px minmax(0, 1fr); padding: 7px 12px 7px 8px; border-radius: 16px; column-gap: 10px; }
    .gt-ico { width: 40px; height: 40px; border-radius: 12px; }
    .gt-ico .i { width: 22px; height: 22px; }
    .mbtn.gtile .mt { font-size: 18px; }
    .mbtn.gtile .ms { font-size: 12px; }
  }

  /* Medidor de conexión (opcional) */
  .net-stats {
    position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); white-space: nowrap;
    padding: 4px 10px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600;
    pointer-events: none; font-variant-numeric: tabular-nums;
  }

  /* ==================== Pulido v47: revisión a fondo de todas las pantallas ==================== */

  /* ---------- Menú «Más»: fijo y colocado por JS dentro de la pantalla (placeMore) ---------- */
  .lb-side .more-menu, .more-menu {
    position: fixed; right: auto; bottom: auto; min-width: 0; overflow: auto; overscroll-behavior: contain;
    container-type: inline-size; align-content: start;
  }
  .more-grp { display: grid; gap: 2px; align-content: start; min-width: 0; }
  .more-menu.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 6px; }
  .more-menu.wide .more-sep { border-top: 0; margin-top: 0; padding-top: 6px; }
  .more-menu button { font-size: 15.5px; line-height: 1.2; padding: 7px 10px; min-height: 50px; gap: 11px; }
  @container (max-width: 270px) { .more-menu .mini-caps { display: none; } }
  /* Iconos de los submenús en baldosa azul, como el resto de iconos del juego */
  .more-menu .i, .gt-ico, .card-title .mc-ico {
    color: #fff;
    background: linear-gradient(180deg, #6aa6ff 0%, var(--ico) 55%, #1d52aa 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 var(--ico-lip);
  }
  .more-menu .i { width: 34px; height: 34px; padding: 7px; border-radius: 11px; }
  .gt-ico .i { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }

  /* ---------- Paneles: no se transparenta lo de debajo (barra, botones, chapa) ---------- */
  #home.sheet-open > :not(.sheet):not(.lb-bg) { visibility: hidden; }

  /* ---------- Cabeceras iguales en todas las pantallas ---------- */
  .scr-head .lb-round, .sheet-head .lb-round {
    background: linear-gradient(180deg, rgba(22, 36, 82, .82), rgba(8, 15, 40, .86));
    border: 2px solid rgba(120, 160, 255, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .35);
  }
  .scr-head .lb-coins.coin-pill, .sheet-head .lb-coins.coin-pill {
    background: linear-gradient(180deg, rgba(22, 36, 82, .82), rgba(8, 15, 40, .86));
    border: 2px solid rgba(255, 200, 41, .45); height: 48px; padding: 0 5px 0 10px; gap: 8px;
  }
  .scr-head .lb-coins .plus, .sheet-head .lb-coins .plus { display: grid; width: 34px; height: 34px; font: 22px/1 var(--disp); }


  @media (orientation: landscape) and (max-height: 560px) {
    .scr-head .lb-coins.coin-pill, .sheet-head .lb-coins.coin-pill { height: 40px; }
    .scr-head .lb-coins .plus, .sheet-head .lb-coins .plus { width: 28px; height: 28px; font-size: 18px; }
  }

  /* ---------- Portada: experiencia con números también en vertical ---------- */


  /* Horizontal: el triángulo de «Jugar» pegado al texto */
  @media (orientation: landscape) and (max-height: 560px) {
    .dock-play-in { justify-content: center; justify-items: center; }
  }
  .dock-play-in { justify-content: center; }

  /* ---------- Diálogos ---------- */
  dialog.kit { overflow-x: hidden; }
  dialog.kit .seg { display: flex; flex-wrap: wrap; width: 100%; }
  dialog.kit .seg button { flex: 1 1 auto; min-height: 42px; padding: 6px 10px; }
  /* Los botones de abajo siempre a la vista aunque el diálogo tenga que desplazarse */
  dialog.kit .dlg-actions {
    position: sticky; bottom: -22px; z-index: 3; margin: 6px -22px -22px; padding: 14px 22px 18px;
    background: linear-gradient(180deg, rgba(12, 22, 52, 0) 0%, rgba(13, 23, 54, .97) 32%);
  }
  @media (max-height: 520px) {
    dialog.kit .dlg-actions { bottom: -14px; margin: 4px -16px -14px; padding: 10px 16px 12px; }
  }
  #kitDlg h3, #optsDlg h3 { line-height: 1.05; }

  #kitPreview { background: rgba(0, 0, 0, .28); }

  /* ---------- Campos de código: el texto entero y el ejemplo en letra normal ---------- */
  .code-field { letter-spacing: .05em; min-width: 0; }
  .code-field::placeholder { letter-spacing: 0; text-transform: none; font-family: 'Bricolage Grotesque', system-ui, sans-serif; }
  #proToken { text-overflow: clip; }


  /* ---------- Botones al tamaño del dedo (mínimo ~40 px) ---------- */
  .swatch { width: 38px; height: 38px; }
  .swatches { gap: 8px; }
  .sheet-body .seg button, .seg button { min-height: 40px; }
  #proLogout { padding: 10px 4px; min-height: 44px; }
  #fsBtn { min-width: 44px; min-height: 44px; }
  .icon-btn { min-width: 42px; min-height: 42px; }


  /* ---------- Bienvenida: cabe entera en móviles pequeños ---------- */


  /* ---------- Sala en móviles estrechos ---------- */



  /* ---------- Pantalla de Mi chapa / Entrenar / Club / Sala privada ---------- */
  /* La ficha con tu chapa solo en «Mi chapa», donde sirve de vista previa grande */
  #pro:not([data-tab="chapa"]) .pro-side { display: none; }
  #pro:not([data-tab="chapa"]) #proMain:not(.hidden) { display: flex; flex-direction: column; }
  #pro:not([data-tab="chapa"]) .pro-content { flex: 1; min-height: 0; }
  /* Mi chapa en vertical: se desplaza todo junto (la chapa grande también) */

  #pro[data-tab="chapa"] .pro-hero { flex-direction: column; text-align: center; gap: 8px; padding: 16px 14px 14px; }
  #pro[data-tab="chapa"] .pro-hero canvas { width: 132px; height: 132px; }
  #pro[data-tab="chapa"] .pro-hero .pro-name { justify-content: center; }
  #pro[data-tab="chapa"] .pro-hero-txt { width: 100%; }
  #pro[data-tab="chapa"] .pro-hero .xpbar + .muted { display: block; }

  @media (orientation: landscape) and (max-height: 560px) {
    #pro[data-tab="chapa"] .pro-hero { padding: 10px; gap: 6px; }
    #pro[data-tab="chapa"] .pro-hero canvas { width: 96px; height: 96px; }
  }
  #pro .start-bar { margin-top: 14px; }
  #proPoints { font: 600 13px/1.3 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: 0; color: rgba(255, 255, 255, .7); }
  #pro [data-tab="entrenar"] .ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .stat-name { width: 84px !important; }
  /* Partido de clubes sin club: se ve disponible, con aviso */
  #pjClub.need-club { opacity: .92; }
  #pjClub.need-club .mt::after {
    content: 'Necesitas club'; margin-left: 8px; vertical-align: 3px; padding: 2px 8px; border-radius: 999px;
    font: 11px/1.2 var(--disp); letter-spacing: .02em; background: rgba(255, 255, 255, .16); color: #fff;
  }
  .tile-soon { filter: none; }
  .tile-soon .gt-ico { filter: saturate(.6); }

  /* ---------- Tienda ---------- */
  .stk-card b { min-height: 2.3em; display: grid; place-items: center; line-height: 1.15; }
  @media (max-width: 759px) and (min-height: 521px) {
    #shopHint { display: block; margin: 0; font-size: 13px; }
    .shop-top { align-items: center; }
  }

  /* ---------- Listas: chapas pequeñas ilustradas ---------- */
  canvas.mini-cap { width: 28px; height: 28px; flex: none; display: block; }
  .mini-caps { align-items: center; }
  .mini-caps canvas.mini-cap { width: 24px; height: 24px; }

  /* ---------- Segunda vuelta ---------- */
  /* «Necesitas club» como etiqueta en la esquina, igual que «Próximamente» */
  #pjClub.need-club .mt::after { content: none; }
  #pjClub.need-club::after {
    content: 'Necesitas club'; position: absolute; top: -9px; right: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px;
    font: 12px/1.1 var(--disp); letter-spacing: .02em; background: #e8eefc; color: #1a2c5c; border: 2px solid #050b22; white-space: nowrap;
  }
  #pjClub { position: relative; overflow: visible; }
  /* Estadísticas de Entrenar siempre en una fila */
  .pro-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .pro-stats > div { min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  /* Mejoras en móviles estrechos: la barra debajo del nombre */

  /* Menú «Más» en dos columnas (horizontal): más compacto para que quepa entero */
  .more-menu.wide button { min-height: 42px; padding: 5px 10px; font-size: 14.5px; }
  .more-menu.wide .i { width: 30px; height: 30px; padding: 6px; }
  .more-menu.wide .more-sep { padding: 6px 12px 2px; }
  /* Botón de abajo de los diálogos: barra sólida */
  dialog.kit .dlg-actions { background: linear-gradient(180deg, rgba(13, 23, 54, 0) 0%, rgba(13, 23, 54, .98) 22px); }
  /* Ficha de la portada en vertical: el número de XP no se corta */


  /* ---------- Tercera vuelta ---------- */
  /* Bienvenida: el dorsal solo necesita dos cifras */
  .pc-row .form-grid { grid-template-columns: minmax(0, 1fr) 78px; }
  /* Código de recuperación entero */
  #proToken { font-size: 14px !important; letter-spacing: 0; }

  /* Perfil en vertical: se desplaza la página entera, sin recortar la tarjeta */



  /* Etiquetas de esquina sin recortar arriba */
  .club-modes { padding-top: 10px; }
  /* Tienda en horizontal: la explicación también se ve */
  @media (orientation: landscape) and (max-height: 560px) {
    #shopHint { display: block; font-size: 12px; margin: 0; line-height: 1.3; }
  }
  /* Barra de botones de los diálogos: sólida, del color del fondo del diálogo */
  dialog.kit .dlg-actions {
    background: #0e1838;
    box-shadow: -60px 0 0 #0e1838, 60px 0 0 #0e1838, 0 -16px 14px -6px #0e1838;
    border-top: 1px solid rgba(255, 255, 255, .06);
  }
  /* Color libre del equipo: redondo, como los demás */
  .swatches input[type=color] { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .45); background: none; overflow: hidden; }
  .swatches input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
  .swatches input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
  .swatches input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
  /* Recompensa diaria en móviles estrechos */


  /* ---------- Desplazamiento como en una app: una sola zona que se mueve con el dedo por pantalla ---------- */
  #pro #trainList { flex: none; overflow: visible; min-height: 0; }
  #room .room-grid { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

  @media (orientation: landscape) {
    #room .room-col { overflow-y: auto; overscroll-behavior: contain; }
    #room .room-grid { overflow: visible; }
  }
  /* Dentro de la zona que se desplaza, cada bloque ocupa lo que necesita (nada se aplasta ni se sale de su tarjeta) */
  #pro .tabp.on { flex: none; min-height: auto; }
  #clubNone:not(.hidden), #clubMine:not(.hidden) { flex: none; min-height: auto; }
  .club-panes { flex: none !important; min-height: auto; grid-template-rows: auto; }
  .cpane { min-height: auto; }

  /* ==================== v48: la app es solo horizontal ==================== */
  /* En vertical, un aviso a pantalla completa pide girar el móvil (en la app instalada la orientación va fija) */
  .rotate {
    background: linear-gradient(rgba(6, 12, 34, .88), rgba(6, 12, 34, .94)), url(/img/estadio-v.jpg) center / cover no-repeat, #0a1430;
    z-index: 200; color: #fff; gap: 12px;
  }
  .rotate strong { font: 30px/1.1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .rotate span { color: rgba(255, 255, 255, .8); font-size: 16px; }
  .rotate svg { color: var(--gold); width: 84px; height: 84px; }
  .rotate .rot-desk { display: none; }
  @media (orientation: portrait) {
    .rotate { display: flex; }
    body:not(.touch) .rotate .rot-touch { display: none; }
    body:not(.touch) .rotate .rot-desk { display: inline; }
  }
  /* Botones pequeños: al menos 38 px de alto para el dedo */
  .btn.small { min-height: 38px; }
  /* Sala en móviles bajos o estrechos: cabecera con iconos solos */
  @media (max-width: 760px) {
    #room .room-head { gap: 6px; }
    #room .room-head h2 { display: none; }
    #room .room-head .hbtn span { display: none; }
    #room .room-head .hbtn { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
    #room .host-pill { display: none !important; }
    #room .code-pill { font-size: 16px; padding: 4px 10px; }
  }

  /* ---------- v48: diseño horizontal afinado ---------- */
  /* Diálogos anchos en horizontal: dos columnas en vez de una tira larga */
  @media (min-width: 640px) {
    #optsDlg, #dailyDlg { width: min(900px, calc(100vw - 24px)); }
    #optsDlg .kit-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: start; }
    #optsDlg .kit-grid > p, #optsDlg .kit-grid > .dlg-actions { grid-column: 1 / -1; }
    .daily-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
    .daily-r > .sub-title:first-child { margin-top: 0; }
  }
  /* Diálogos en móviles bajos: casi toda la pantalla */
  @media (max-height: 560px) {
    dialog.kit { max-height: calc(100dvh - 12px); width: min(900px, calc(100vw - 16px)); }
    #dailyDlg .coins-big { margin: 2px 0 6px; }
  }

  /* Menú «Más» en dos columnas: sin las chapas pequeñas (no caben) */
  .more-menu.wide .mini-caps { display: none; }

  /* Bienvenida: los colores en dos filas si no caben */
  .welcome-form .swatches { flex-wrap: wrap; }
  @media (max-height: 560px) {
    .welcome-form .swatch { width: 30px; height: 30px; }
    .welcome-form .swatches { gap: 6px; margin-bottom: 8px; }
  }

  /* Perfil en móviles en horizontal: pestañas, y el resumen en dos columnas */
  @media (max-height: 560px) {
    .sheet-body [data-page="perfil"] .ptabs { display: inline-flex; }
    .sheet-body [data-page="perfil"] .pgrid.g2 { grid-template-columns: minmax(0, 1fr) !important; }
    .sheet-body [data-page="perfil"] .pgrid.g2 > .pp:not(.on) { display: none !important; }
    .sheet-body [data-page="perfil"].on { height: auto; }
    .sheet-body [data-page="perfil"] .pgrid { flex: none; grid-template-rows: auto; }
    .sheet-body .pgrid > .pf-sum.on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto; gap: 10px 12px; }
    .pf-sum .profile-big { grid-column: 1; grid-row: 1; }
    .pf-sum .pf-rank { grid-column: 1; grid-row: 2; }
    .pf-sum .stat-grid { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; align-content: stretch; }
    .pf-sum .stat-grid > * { padding: 8px 12px; }
    .pf-sum .sec-title { grid-column: 1 / -1; grid-row: 3; }
    .pf-sum .recent { grid-column: 1 / -1; grid-row: 4; flex: none; overflow: visible; }
    .sheet-body [data-page="perfil"] [data-pp="cuenta"] { min-height: auto; }
    .sheet-body [data-page="perfil"] #proLogout { margin-top: 14px; }
  }

  /* Entrenar: mejoras a la izquierda y entrenamientos a la derecha */
  @media (min-width: 560px) {
    #pro .tabp[data-tab="entrenar"].on { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; gap: 12px 14px; align-items: start; }
    #pro .tabp[data-tab="entrenar"] > .panel { grid-column: 1; grid-row: 1 / span 2; }
    #pro .tabp[data-tab="entrenar"] > .sec-title { grid-column: 2; grid-row: 1; margin: 0; }
    #pro .tabp[data-tab="entrenar"] > #trainList { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; }
    #pro .tabp[data-tab="entrenar"] .pro-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
    #pro .tabp[data-tab="entrenar"] .stat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "n v b" "s s b"; gap: 6px 10px; align-items: center; }
    #pro .tabp[data-tab="entrenar"] .stat-row .stat-name { grid-area: n; width: auto !important; }
    #pro .tabp[data-tab="entrenar"] .stat-row .stat-val { grid-area: v; width: auto; }
    #pro .tabp[data-tab="entrenar"] .stat-row .statbar { grid-area: s; }
    #pro .tabp[data-tab="entrenar"] .stat-row .btn { grid-area: b; }
  }
  @media (min-width: 1000px) and (min-height: 600px) {
    #pro .tabp[data-tab="entrenar"] > #trainList { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* Tienda: la vista previa se desplaza si no cabe y el probador va centrado */
  .sheet-body .shop-top { overflow-y: auto; }
  @media (max-height: 560px), (min-width: 980px) and (min-height: 600px) {
    .sheet-body .shop-top { justify-content: flex-start; }
    .sheet-body .shop-top .try-bar { flex-direction: column; align-items: center; }
    .sheet-body .shop-top .try-name { margin: 0; }
  }
  @media (max-height: 420px) { .sheet-body #shopCap { width: 92px; height: 92px; } }

  /* Contra la IA en móviles estrechos: modo y dificultad arriba, el resto debajo */
  @media (max-height: 560px) and (max-width: 699px) {
    .form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .form-grid.g3 label.wide { grid-column: span 2; }
  }

  /* Sala en móviles estrechos */
  @media (max-width: 700px) {
    #room #cfgPanel > .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #room #cfgPanel > .row > label:first-child { grid-column: 1 / -1; }
    #room #startNote { display: none; }
  }
  /* Marcador del partido: los nombres no se meten debajo de los botones */
  @media (max-width: 700px) { .sb-name { max-width: 16vw; } }
  /* Monedas en móviles bajos: el saldo junto al título para que «Recoger» se vea sin desplazar */
  @media (max-height: 560px) {
    #dailyDlg { position: fixed; }
    #dailyDlg .coins-big { position: absolute; top: 12px; right: 18px; margin: 0; }
    #dailyDlg .coins-big b { font-size: 26px; }
    #dailyDlg .coins-big .coin { width: 26px; height: 26px; }
    #dailyDlg h3 { margin-bottom: 6px; }
    #dailyDlg .daily-l > .sub-title { margin: 0 0 6px; }
    #dailyDlg #dailyNote { display: none; }
  }
  /* Perfil en el iPhone SE: chapa y textos algo más pequeños */
  @media (max-height: 340px) {
    .sheet-body .profile-big #pfCap { width: 64px; height: 64px; }
    .sheet-body .profile-big .pro-name { font-size: 18px; }
    .pf-sum .stat-grid b { font-size: 20px; }
  }
  .stat-row .stat-name { white-space: nowrap; }
  @media (max-width: 600px) { .stat-row .stat-val { font-size: 12px; } }
  .welcome-form .swatch { width: 34px; height: 34px; }
  @media (max-height: 340px) { #room .pitch-preview { display: none; } }
  /* Bienvenida en móviles en horizontal: cabe entera sin desplazar */
  @media (max-height: 440px) {
    #welcome { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    .welcome-card { padding: 12px 16px; }
    .welcome-form h2 { font-size: 22px; margin: 0 0 6px; }
    .welcome-form .pc-row { gap: 10px; margin-bottom: 6px; }
    #pcPrev { width: 56px; height: 56px; }
    .welcome-form .form-grid label { gap: 2px; font-size: 12px; }
    .welcome-form .field { padding-top: 7px; padding-bottom: 7px; }
    .welcome-form .swatch { width: 28px; height: 28px; border-width: 2px; }
    .welcome-form .swatches { gap: 5px; margin-bottom: 8px; }
    #pcCreate { padding-top: 10px; padding-bottom: 10px; }
    .welcome-form .join-row { margin-top: 6px; }
    .welcome-form .join-row .btn, .welcome-form .join-row .field { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
  }
  /* Móviles muy bajos (iPhone SE): sin el dibujo, el formulario a todo el ancho y los colores en una fila */
  @media (max-height: 340px) {
    .welcome-card { grid-template-columns: minmax(0, 1fr) !important; }
    .welcome-art { display: none; }
    .welcome-form .swatch { width: 32px; height: 32px; }
  }
  @media (max-height: 560px) {
    #dailyDlg .dlg-actions { position: static; box-shadow: none; background: none; border: 0; margin: 8px 0 0; padding: 0; }
  }
  /* ==================== v51: grupo en la portada, elegir modo y buscar partido ==================== */
  /* Tu chapa en el centro y un hueco (o un amigo) a cada lado, en la misma fila: se coloca solo al girar */
  .lb-stage { position: relative; --capw: min(38vh, 30vw, 300px); }
  @media (orientation: landscape) and (max-height: 560px) { .lb-stage { --capw: min(38vh, 24vw, 200px); } }
  .lb-cap { width: var(--capw); }
  .lb-row { display: flex; align-items: flex-end; justify-content: center; gap: calc(var(--capw) * .2); z-index: 3; position: relative; }
  .pside { width: calc(var(--capw) * .66); flex: none; display: flex; }
  .pslot {
    position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; color: #fff;
    display: block; animation: pslotIn .25s ease;
  }
  .pslot .pcap { width: 100%; height: 100%; display: block; animation: lbfloat 4.6s ease-in-out infinite; animation-delay: -1.3s; }
  #partyR .pslot .pcap { animation-delay: -2.6s; }
  .pslot::before {
    content: ''; position: absolute; left: 16%; right: 16%; bottom: -5%; height: 12%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  }
  .pslot.off .pcap { filter: grayscale(.8) brightness(.7); }
  .pslot .pplate {
    position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; display: grid; justify-items: center;
    white-space: nowrap; text-align: center; gap: 1px;
  }
  .pslot .pplate b { font: 15px/1.05 var(--disp); text-shadow: var(--outline); display: inline-flex; align-items: center; gap: 3px; }
  .pslot .pplate span { font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
  .pslot.empty .pplus {
    position: absolute; inset: 14%; display: grid; place-items: center; border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, .55); background: rgba(5, 12, 36, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    font: 34px/1 var(--disp); color: #fff; text-shadow: var(--outline); transition: transform .1s ease, border-color .1s ease;
  }
  .pslot.empty:hover .pplus { border-color: var(--gold); }
  .pslot.empty:active .pplus { transform: scale(.92); }
  .pslot.empty .pplate b { font-size: 13px; color: rgba(255, 255, 255, .85); }
  .party-leave {
    margin-top: 6px; padding: 5px 12px; min-height: 30px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .25);
    background: rgba(5, 12, 36, .6); color: #fff; font-size: 12.5px; font-weight: 700;
  }
  .dock-play.wait { filter: saturate(.55) brightness(.92); }
  @media (orientation: landscape) and (max-height: 560px) {
    .pslot .pplate b { font-size: 12.5px; }
    .pslot .pplate span { font-size: 10.5px; }
    .pslot.empty .pplus { font-size: 26px; border-width: 2px; }
    .pslot .pplate { margin-top: 3px; }
    .party-leave { margin-top: 2px; padding: 3px 10px; min-height: 26px; font-size: 11.5px; }
  }

  /* Elegir modo */
  .mode-dlg { width: min(760px, calc(100vw - 24px)); }
  .mode-dlg h3 { text-align: center; }
  .mode-sub { text-align: center; margin: -6px 0 14px; font-size: 14px; }
  .mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .mode-pick {
    position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 10px 14px; border-radius: 20px; color: #fff;
    border: 2px solid rgba(120, 160, 255, .35);
    background: linear-gradient(180deg, #2a5fd0 0%, #1c3f97 60%, #142c6c 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 5px 0 #0c1d4a, 0 12px 22px rgba(0, 0, 0, .35);
    transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  }
  .mode-pick b { font: 22px/1.05 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .mode-pick .mp-note { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .78); min-height: 1.2em; }
  .mode-pick:hover:not(:disabled) { filter: brightness(1.1); }
  .mode-pick:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 1px 0 #0c1d4a; }
  .mode-pick:disabled { filter: grayscale(.85) brightness(.7); cursor: not-allowed; }
  .mode-pick.busy { filter: brightness(1.15); border-color: var(--gold); }
  .mode-pick.busy .mp-note::after { content: ' · buscando…'; color: var(--gold); }
  .mp-caps { display: flex; align-items: center; gap: 10px; height: 46px; }
  .mp-side { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 64px; }
  .mp-side i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .35); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
  .mp-side.red i { background: #e2434e; } .mp-side.blue i { background: #4a86ea; }
  .mp-side i.you { outline: 2px solid var(--gold); outline-offset: 1px; }
  @media (max-height: 560px) {
    .mode-sub { margin-bottom: 8px; font-size: 13px; }
    .mode-pick { padding: 10px 8px 10px; gap: 4px; }
    .mode-pick b { font-size: 19px; }
    .mp-caps { height: 36px; }
  }

  /* Partido emparejado: buscando rivales y resultado (sustituye a la sala normal) */
  body.mm-room #room .room-grid, body.mm-room #room .room-head > :not(#leaveBtn) { display: none !important; }
  body.mm-room #room .room-head::after { content: 'Partido online'; font: 22px/1 var(--disp); text-shadow: var(--outline); }
  .mm-box { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 4px 12px; }
  .mm-box.hidden { display: none; }
  .mm-head { display: grid; justify-items: center; gap: 2px; text-align: center; }
  .mm-head b { font: 32px/1 var(--disp); letter-spacing: .01em; text-shadow: var(--outline); }
  .mm-head span { font-size: 14px; font-weight: 700; }
  .mm-status { font: 20px/1.1 var(--disp); color: var(--gold); text-shadow: var(--outline); text-align: center; min-height: 1.2em; }
  .mm-status:not(.win):not(.loss):not(.draw)::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; border: 3px solid rgba(255, 200, 41, .3); border-top-color: var(--gold); vertical-align: -1px; animation: mmspin .8s linear infinite; }
  @keyframes mmspin { to { transform: rotate(360deg); } }
  .mm-status.win { color: #7dff9a; font-size: 30px; } .mm-status.loss { color: #ff8a8a; font-size: 30px; } .mm-status.draw { color: #fff; font-size: 30px; }
  .mm-score { font: 44px/1 var(--disp); text-shadow: var(--outline); }
  .mm-teams { width: min(760px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
  .mm-vs { align-self: center; font: 26px/1 var(--disp); color: rgba(255, 255, 255, .7); }
  .mm-team { display: grid; gap: 8px; padding: 12px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .1); }
  .mm-team.red { background: linear-gradient(180deg, rgba(216, 52, 63, .32), rgba(216, 52, 63, .12)); }
  .mm-team.blue { background: linear-gradient(180deg, rgba(47, 111, 214, .34), rgba(47, 111, 214, .12)); }
  .mm-tname { font: 17px/1 var(--disp); text-shadow: var(--outline); }
  .mm-list { display: grid; gap: 6px; }
  .mm-p { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(4, 10, 30, .45); min-width: 0; }
  .mm-p canvas.mini-cap { width: 40px; height: 40px; }
  .mm-p .grow { display: grid; min-width: 0; }
  .mm-p b { font: 15.5px/1.15 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mm-p span { font-size: 12px; color: rgba(255, 255, 255, .7); }
  .mm-p.me { box-shadow: inset 0 0 0 2px var(--gold); }
  .mm-p.bot { opacity: .65; }
  .mm-p.bot canvas { filter: grayscale(1); }
  #mmResultSlot .pro-result { margin: 0; }
  #mmBack { width: min(360px, 100%); margin-top: 4px; }
  @media (max-height: 560px) {
    .mm-box { gap: 6px; }
    .mm-head b { font-size: 24px; }
    .mm-status { font-size: 17px; }
    .mm-status.win, .mm-status.loss, .mm-status.draw { font-size: 24px; }
    .mm-score { font-size: 32px; }
    .mm-team { padding: 8px; gap: 6px; border-radius: 16px; }
    .mm-p { padding: 4px 8px 4px 4px; }
    .mm-p canvas.mini-cap { width: 32px; height: 32px; }
    .mm-p b { font-size: 14px; }
  }
  .mm-hint { font-size: 13px; font-weight: 700; text-align: center; margin-top: -4px; min-height: 1em; }

  /* ==================== v55: arte ilustrado (modos, túnel, entrenos, resultados, logo e iconos) ==================== */
  /* Elegir modo: tarjetas con ilustración */
  .mode-pick { padding: 0 0 12px; overflow: hidden; gap: 4px; }
  .mode-pick .mp-art { width: 100%; height: min(200px, 38vh); object-fit: cover; object-position: 50% 50%; display: block; margin-bottom: 4px; }
  @media (max-height: 560px) {
    .mode-dlg { padding-top: 10px; }
    .mode-dlg h3 { margin-bottom: 2px; }
    .mode-pick { padding-bottom: 8px; gap: 2px; border-radius: 16px; }
    .mode-pick .mp-art { height: 30vh; }
    .mode-pick b { font-size: 18px; }
    .mode-pick .mp-note { font-size: 11.5px; }
  }
  /* Buscando rivales: el túnel de vestuarios de fondo */
  body.mm-room #room { background: linear-gradient(rgba(6, 12, 34, .45), rgba(6, 12, 34, .78)), url(/img/tunel.webp) center 40% / cover no-repeat, #0a1430; }
  /* Resultado con su ilustración */
  .mm-resimg { width: min(150px, 22vh); height: auto; border-radius: 16px; box-shadow: 0 10px 26px rgba(0, 0, 0, .5); animation: pslotIn .35s ease; }
  .mm-resimg.hidden { display: none; }
  /* Entrenamientos con su ilustración */
  .tcard { position: relative; padding-left: 96px; min-height: 104px; }
  .tcard .tc-art { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 86px; height: 86px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); }
  /* Iconos ilustrados en menús y botones */
  .more-menu .ii { width: 36px; height: 36px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
  .more-menu.wide .ii { width: 32px; height: 32px; }
  .card-title .tico { width: 34px; height: 34px; vertical-align: -9px; margin-right: 8px; object-fit: contain; }
  .gt-ico.art { background: none !important; box-shadow: none !important; }
  .gt-ico.art img { width: 125%; height: 125%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
  .room-head .ii { width: 26px; height: 26px; object-fit: contain; }
  .hbtn .ii { width: 24px; height: 24px; }
  /* Logo en la bienvenida */
  .brand-logo { margin: 0; line-height: 0; }
  .brand-logo img { width: min(100%, 340px); height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .4)); }
  #modeDlg { width: min(760px, calc(100vw - 24px)) !important; }

  /* Repetición del gol */
  .replay-tag {
    position: absolute; left: 50%; top: calc(54px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 7;
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
    background: rgba(5, 10, 30, .78); border: 2px solid rgba(255, 255, 255, .25); color: #fff;
    font: 17px/1 var(--disp); letter-spacing: .08em; cursor: pointer; pointer-events: auto;
  }
  .replay-tag.hidden { display: none; }
  .replay-tag small { font: 600 11px/1 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: 0; color: rgba(255, 255, 255, .65); margin-left: 4px; }
  .replay-tag .rec { flex: none; display: block; width: 10px !important; height: 10px !important; padding: 0; margin: 0; border-radius: 50%; background: #ff3b4a; animation: recblink 1s steps(2) infinite; }
  @keyframes recblink { 50% { opacity: .2; } }
  body.replaying #cv { filter: saturate(.85) contrast(1.05); }
  body.replaying #koLbl { display: none; }
  /* v58: skins */
  .sw-label { font-size: 13px; margin: 10px 0 6px; }
  #peSwatches2 .swatch { width: 30px; height: 30px; }

  /* ================= v61: tienda al estilo Rocket League ================= */
  .shop2 { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
  .shop2, .sh-feat, .sh-card, .shop-dlg { --rc: #9aa7c0; }
  .rar-rara { --rc: #3fa9ff; } .rar-epica { --rc: #c07bff; } .rar-legendaria { --rc: #ffbe2e; }
  .cat-stk { --cat: #3a63c8; } .cat-patron { --cat: #178f86; } .cat-decal { --cat: #d0612a; } .cat-anim { --cat: #c8323f; } .cat-cele { --cat: #7a3fd0; }
  .sh-head { display: flex; align-items: center; gap: 14px; flex: none; }
  .sh-head h3 {
    margin: 0; padding: 6px 26px 6px 12px; font: 19px/1 var(--disp); font-weight: 400; letter-spacing: .05em; text-transform: uppercase; color: #cfe6ff;
    background: linear-gradient(90deg, rgba(45, 120, 230, .6), rgba(45, 120, 230, .08)); border-left: 3px solid #5cc0ff;
    clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  }
  .sh-timer { display: inline-flex; align-items: center; gap: 6px; color: #ffd34d; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
  .sh-hg { width: 12px; height: 15px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 15'%3E%3Cpath d='M1 0h10v2H10c0 3-3 4-3 5.5S10 10 10 13h1v2H1v-2h1c0-3 3-4 3-5.5S2 5 2 2H1z' fill='%23ffd34d'/%3E%3C/svg%3E"); }
  .sh-price {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 10px; font-weight: 800; font-size: 15px; color: #fff;
    background: rgba(4, 10, 32, .78); border: 1px solid rgba(255, 255, 255, .14); transform: skewX(-12deg); border-radius: 3px;
  }
  .sh-price > * { transform: skewX(12deg); }
  .sh-price .coin { width: 15px; height: 15px; }
  .sh-price.short { color: #9fb0cf; }
  .sh-price.owned { color: #5ce39a; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
  /* destacados */
  .sh-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sh-feat {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-height: 132px; padding: 10px 16px 10px 10px;
    border-radius: 6px; border: 2px solid rgba(255, 255, 255, .2); color: #fff; text-align: right; cursor: pointer;
    background: linear-gradient(115deg, #45619f, #24396d); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 10px 22px rgba(0, 0, 0, .35);
    transition: transform .1s, border-color .15s;
  }
  .sh-feat.rar-rara { background: linear-gradient(115deg, #2b86de, #173f8e); }
  .sh-feat.rar-epica { background: linear-gradient(115deg, #9446e8, #3f1b88); }
  .sh-feat.rar-legendaria { background: linear-gradient(115deg, #e88d22, #8a2f10); }
  .sh-feat:hover, .sh-feat:focus-visible { border-color: #fff; }
  .sh-feat:active, .sh-card:active { transform: scale(.98); }
  .sf-deco { position: absolute; right: -40px; top: 50%; width: 210px; height: 210px; margin-top: -105px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, .07); pointer-events: none; }
  .sf-deco::after { content: ''; position: absolute; inset: 34px; border-radius: 50%; border: 12px solid rgba(255, 255, 255, .05); }
  .sh-feat.rar-legendaria::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 240, 200, .25) 48%, transparent 60%); background-size: 260% 100%; animation: stkshine 3.4s ease-in-out infinite;
  }
  @keyframes stkshine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
  .sf-art { position: relative; flex: none; width: 112px; height: 112px; }
  .sf-art canvas { width: 100% !important; height: 100% !important; }
  .sf-info { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .sf-name { font: 27px/1 var(--disp); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); overflow-wrap: anywhere; }
  .sf-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
  .sf-info .sh-price { margin-top: 8px; }
  /* diarios */
  .sh-daily { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .sh-card {
    position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 4px 9px; overflow: hidden; cursor: pointer;
    border-radius: 4px; border: 2px solid rgba(255, 255, 255, .16); border-bottom: 4px solid var(--rc); color: #fff;
    background: linear-gradient(180deg, #4567bd 0%, #2b4690 55%, #1e3270 100%); box-shadow: 0 8px 16px rgba(0, 0, 0, .3);
    transition: transform .1s, border-color .15s;
  }
  .sh-card:hover, .sh-card:focus-visible { border-color: #fff; border-bottom-color: var(--rc); }
  .sc-cat { align-self: stretch; margin: 0 -4px; padding: 4px 4px 5px; font-size: 11.5px; font-weight: 800; text-align: center; background: var(--cat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sc-name { max-width: 100%; padding: 4px 2px 0; font-size: 12px; font-weight: 700; color: var(--rc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rar-comun .sc-name { color: #d5dcea; }
  .sc-art { width: 82%; aspect-ratio: 1; margin: 2px 0 6px; }
  .sc-art canvas { width: 100% !important; height: 100% !important; }
  .sc-art { display: grid; place-items: center; }
  .sc-stk { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); transform: rotate(-4deg); }
  .sh-card:nth-child(even) .sc-stk { transform: rotate(4deg); }
  /* vista previa */
  dialog.shop-dlg { width: min(720px, calc(100vw - 24px)); padding: 18px; background: linear-gradient(140deg, #22397a, #0e1a44); }
  dialog.shop-dlg.rar-epica { background: linear-gradient(140deg, #4f2491, #150b3d); }
  dialog.shop-dlg.rar-legendaria { background: linear-gradient(140deg, #8a3d12, #2a0f05); }
  dialog.shop-dlg.rar-rara { background: linear-gradient(140deg, #1d5fb0, #0b1d4a); }
  .sd-wrap { display: flex; gap: 22px; align-items: center; }
  .sd-art { flex: none; width: 240px; height: 240px; border-radius: 18px; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .14), rgba(0, 0, 0, .25) 70%); border: 2px solid rgba(255, 255, 255, .1); }
  dialog.shop-dlg #shopCap { width: 100%; height: 100%; display: block; }
  .sd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
  .sd-kind { padding: 3px 10px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--cat); border-radius: 4px; }
  dialog.shop-dlg h3 { margin: 2px 0 0; font: 32px/1 var(--disp); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
  .sd-rar { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rc); }
  .sd-desc { margin: 4px 0 6px; font-size: 14px; color: rgba(255, 255, 255, .78); }
  .sd-info .btn.chunky { margin-top: 4px; align-self: stretch; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
  .sd-info .btn.chunky .coin { width: 20px; height: 20px; }
  .sd-close { align-self: stretch; }
  .sd-info .err:empty { display: none; }
  @media (orientation: landscape) and (max-height: 560px) {
    .shop2 { gap: 7px; }
    .sh-head h3 { font-size: 15px; padding: 4px 22px 4px 10px; }
    .sh-timer { font-size: 12.5px; }
    .sh-feat { min-height: 0; height: 92px; padding: 4px 12px 4px 6px; }
    .sf-art { width: 82px; height: 82px; }
    .sf-name { font-size: 20px; }
    .sf-kind { font-size: 9.5px; letter-spacing: .14em; }
    .sf-info .sh-price { margin-top: 4px; }
    .sh-price { font-size: 13px; padding: 2px 10px 2px 8px; }
    .sh-price .coin { width: 13px; height: 13px; }
    .sh-daily { gap: 6px; }
    .sc-cat { font-size: 10px; padding: 3px 2px 4px; }
    .sc-name { font-size: 10.5px; }
    .sc-art { width: auto; height: 62px; margin: 1px 0 4px; }
    .sh-card { padding-bottom: 6px; }
    dialog.shop-dlg { padding: 12px 14px; }
    .sd-art { width: 190px; height: 190px; }
    dialog.shop-dlg h3 { font-size: 24px; }
    .sd-desc { font-size: 12.5px; margin: 2px 0 4px; }
  }
  @media (max-width: 640px) {
    .sh-feats { grid-template-columns: minmax(0, 1fr); }
    .sh-daily { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sd-wrap { flex-direction: column; }
  }
  /* ================= v62: sobres ================= */
  .pack-btn .side-face { overflow: visible; }
  .pack-btn .side-face img { width: auto !important; height: 44px !important; max-width: none !important; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
  .pack-btn.has .side-face img { animation: packbob 2.4s ease-in-out infinite; }
  @keyframes packbob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-3px); } }

  .pack-view {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--rc, #e8eef8) 22%, #101a44) 0%, #070c24 70%);
    transition: background .4s; overflow: hidden; user-select: none; -webkit-user-select: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .pack-view.hidden { display: none; }
  .pv-flash { position: absolute; inset: 0; z-index: 3; background: #fff; pointer-events: none; animation: pvflash .45s ease-out forwards; }
  @keyframes pvflash { from { opacity: .85; } to { opacity: 0; } }
  .pv-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .pv-top { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
  .pv-count { font: 18px/1 var(--disp); color: #fff; text-shadow: var(--outline); padding: 8px 14px; background: rgba(0, 0, 0, .3); border-radius: 999px; }
  .pv-x { font-size: 20px; font-weight: 800; color: #fff; }
  .pv-pack {
    position: relative; z-index: 1; height: min(58vh, 420px); aspect-ratio: 429 / 640; padding: 0; background: none; border: 0; cursor: pointer;
    --glow: transparent; --gl: 10;
    filter: drop-shadow(0 0 calc(var(--gl) * 1px) var(--glow)) drop-shadow(0 14px 24px rgba(0, 0, 0, .5));
    transition: opacity .25s;
  }
  .pv-pack img { width: 100%; height: 100%; display: block; pointer-events: none; }
  .pv-pack.burst { animation: pvburst .3s ease-in forwards; }
  @keyframes pvburst { to { transform: scale(1.35); opacity: 0; } }
  .pv-pack.gone { visibility: hidden; position: absolute; }
  .pv-hint { position: relative; z-index: 1; margin: 16px 0 0; font: 20px/1 var(--disp); color: #fff; text-shadow: var(--outline); animation: pvhint 1.4s ease-in-out infinite; }
  .pv-hint.hidden { display: none; }
  @keyframes pvhint { 50% { opacity: .55; } }

  .pv-res { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: pvres .45s cubic-bezier(.2, 1.4, .4, 1) both; }
  .pv-res.hidden { display: none; }
  @keyframes pvres { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
  .pv-res { --rc: #e8eef8; } .pv-res.rar-rara { --rc: #3fa9ff; } .pv-res.rar-epica { --rc: #c07bff; } .pv-res.rar-legendaria { --rc: #ffbe2e; }
  .pv-kind { padding: 3px 12px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #0b1330; background: var(--rc); border-radius: 4px; }
  .pv-art { width: min(34vh, 230px); height: min(34vh, 230px); animation: pvspin .9s cubic-bezier(.2, .9, .3, 1) both; }
  .pv-art canvas { width: 100%; height: 100%; display: block; }
  @keyframes pvspin { from { transform: rotateY(540deg) scale(.6); } to { transform: none; } }
  .pv-name { font: 34px/1 var(--disp); font-weight: 400; color: #fff; text-transform: uppercase; letter-spacing: .03em; text-shadow: 0 0 18px var(--rc), var(--outline); }
  .pv-rar { font-size: 14px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--rc); }
  .pv-coins { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 0; }
  .pv-dup, .pv-bonus { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; font-weight: 700; font-size: 14px; animation: pvres .4s .5s both; }
  .pv-bonus { background: rgba(255, 190, 46, .2); animation-delay: .7s; }
  .pv-acts { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
  .pv-acts .btn.chunky { margin: 0; }
  .pv-acts .hidden { display: none !important; }
  .rar-legendaria .pv-name { animation: pvleg 1.6s ease-in-out infinite; }
  @keyframes pvleg { 50% { text-shadow: 0 0 34px var(--rc), var(--outline); } }
  @media (orientation: landscape) and (max-height: 560px) {
    .pv-pack { height: min(62vh, 300px); }
    .pv-art { width: min(36vh, 150px); height: min(36vh, 150px); }
    .pv-name { font-size: 24px; }
    .pv-res { gap: 3px; }
    .pv-acts { margin-top: 4px; }
    .pv-acts .btn.chunky { font-size: 16px; padding: 9px 16px; }
  }
  /* sobre ganado en el resultado del partido y en los avisos */
  .pack-won { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 12px; border-radius: 14px; background: linear-gradient(90deg, rgba(255, 190, 46, .22), rgba(255, 190, 46, .06)); border: 2px solid rgba(255, 190, 46, .5); }
  .pack-won img { height: 52px; width: auto; transform: rotate(-8deg); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
  .pack-won b { display: block; font: 18px/1.1 var(--disp); font-weight: 400; color: #ffd34d; }
  .pack-won span { font-size: 13px; opacity: .8; }
  .notice-pack { height: 40px; width: auto; flex: none; }
  /* ================= v63: el campo ocupa toda la pantalla ================= */
  /* Sin márgenes por la muesca ni banda del marcador: el lienzo va de borde a borde y el marcador flota encima */
  #game { padding: 0 !important; background: #0b1430; }
  #game .scorebar, #game .trainbar {
    position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 5;
    padding: 4px 12px; border-radius: 16px; background: rgba(6, 12, 34, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3); pointer-events: none; max-width: calc(100vw - 260px);
  }
  #game .scorebar .sb-name { color: #e6ecff; }
  #game .game-tools { top: calc(6px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); }
  #game #stage { position: absolute; inset: 0; }
  @media (max-width: 560px) { #game .scorebar { left: calc(10px + env(safe-area-inset-left, 0px)); transform: none; max-width: calc(100vw - 150px); } }
  /* ================= v64: sin barras de desplazamiento y sin zoom ================= */
  /* Todo sigue deslizándose (dedo, rueda, arrastrar); solo se ocultan las barras, como en una app */
  *, *::before, *::after { scrollbar-width: none !important; -ms-overflow-style: none; }
  *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; background: transparent; }
  /* Sin zoom con doble toque ni al tocar un campo de texto (iPhone amplía si la letra es menor de 16 px) */
  html, body { touch-action: manipulation; overscroll-behavior: none; }
  @media (pointer: coarse) {
    input, select, textarea { font-size: max(16px, 1em) !important; }
  }
  /* ================= v65: selector de color desplegable y nombre/dorsal en el perfil ================= */
  .tabp[data-tab="chapa"] .panel { position: relative; }
  .col-rows { display: grid; gap: 10px; }
  .col-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px 8px 14px; border-radius: 14px; background: rgba(0, 0, 0, .22); }
  .col-lbl { display: flex; flex-direction: column; font-weight: 800; font-size: 15px; }
  .col-lbl small { font-weight: 600; font-size: 12px; color: var(--chalk-dim); }
  .col-pick {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .18); color: #fff; transition: border-color .15s, background .15s;
  }
  .col-pick:hover, .col-pick.open { border-color: var(--gold); background: rgba(255, 200, 41, .1); }
  .col-sq { width: 38px; height: 38px; border-radius: 9px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 2px 6px rgba(0, 0, 0, .35); }
  .col-car { width: 12px; height: 8px; transition: transform .15s; }
  .col-pick.open .col-car { transform: rotate(180deg); }
  .col-pop {
    position: absolute; z-index: 30; display: grid; grid-template-columns: repeat(6, 40px); gap: 8px; padding: 12px;
    border-radius: 16px; background: #15214d; border: 2px solid rgba(255, 255, 255, .16); box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
    animation: colpop .14s ease-out;
  }
  .col-pop.hidden { display: none; }
  @keyframes colpop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
  .col-pop .swatch { width: 40px; height: 40px; border-radius: 10px; }
  .col-pop .swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold); }
  /* Perfil: nombre y dorsal */
  .pf-form { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: end; margin: 0 !important; }
  .pf-form label { display: grid; gap: 4px; font-size: 13px; color: var(--chalk-dim); }
  .pf-form .btn { height: 42px; }
  #pfMsg:empty { display: none; }
  .pf-code-title { margin-top: 16px !important; }
  .sheet-body .pf-form { margin-bottom: 4px !important; }
  @media (orientation: landscape) and (max-height: 560px) {
    .col-sq { width: 30px; height: 30px; }
    .col-row { padding: 5px 8px 5px 12px; }
    .col-pop { grid-template-columns: repeat(6, 34px); gap: 6px; padding: 10px; }
    .col-pop .swatch { width: 34px; height: 34px; }
  }
  /* ================= v66: Mi chapa (chapa + mejoras + colores a la izquierda, ventana con pestañas a la derecha) ================= */
  #pro .pro-hero { position: relative; display: flex !important; flex-direction: column !important; align-items: stretch; gap: 8px !important; text-align: left; }
  #pro .pro-hero > canvas { align-self: center; width: 96px !important; height: 96px !important; }
  #pro .pro-hero .pro-name { justify-content: center !important; text-align: center; font-size: 20px; }
  #pro .pro-hero-txt { gap: 8px; }
  .up-box { display: grid; gap: 6px; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .24); }
  .up-head { display: flex; align-items: center; justify-content: space-between; font: 14px/1 var(--disp); letter-spacing: .02em; color: rgba(255, 255, 255, .85); }
  .up-pts { font: 12px/1 var(--body, inherit); font-weight: 800; color: #2a1a00 !important; background: var(--gold); padding: 3px 8px; border-radius: 999px; animation: uppulse 1.6s ease-in-out infinite; }
  @keyframes uppulse { 50% { transform: scale(1.08); } }
  .up-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 28px; align-items: center; gap: 8px; }
  .up-name { text-align: left; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
  .up-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 12px; }
  .up-bar i { border-radius: 2px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
  .up-bar i.on { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 0 6px rgba(0, 0, 0, .2); }
  .up-btn { width: 28px; height: 28px; border-radius: 9px; border: 0; font: 20px/1 var(--disp); color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); cursor: pointer; }
  .up-btn.ready { color: #0b1330; background: linear-gradient(180deg, #8bf08f, #2fbf4e); box-shadow: 0 3px 0 #17803a; }
  .up-btn.ready:active { transform: translateY(2px); box-shadow: 0 1px 0 #17803a; }
  .up-btn:disabled { cursor: default; }
  /* colores compactos, solo en Mi chapa */
  .hero-cols { display: grid; grid-template-columns: auto auto auto auto; align-items: center; justify-content: space-between; gap: 6px 8px; }
  #pro:not([data-tab="chapa"]) .hero-cols, #pro:not([data-tab="chapa"]) #colPop { display: none; }
  .hc-lbl { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
  .hero-cols .col-pick { padding: 3px 6px 3px 3px; gap: 5px; border-radius: 10px; }
  .hero-cols .col-sq { width: 26px; height: 26px; border-radius: 7px; }
  #peMsg:empty { display: none; }
  /* ventana con pestañas */
  #pro .mc-win { display: flex !important; flex-direction: column; gap: 10px; min-height: 0; }
  .mc-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .3); overflow-x: auto; flex: none; }
  .mc-tabs button {
    flex: 1 0 auto; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: rgba(255, 255, 255, .7);
    font: 15px/1 var(--disp); letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  }
  .mc-tabs button.on { color: var(--gold-ink, #3a2600); background: linear-gradient(180deg, #ffe774, #f5b400); box-shadow: 0 3px 0 var(--gold-lip, #b97800); }
  #mcZones { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
  .mc-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .mc-opt { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; width: 74px; height: 78px; padding: 4px 4px 3px; }
  .mc-zone .mc-opt { width: 64px; height: 64px; padding: 3px; }
  .mc-zone .mc-opt .mc-oname { display: none; }
  .mc-opt .mc-oname { max-width: 72px; font-size: 10.5px; font-weight: 700; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mc-opt.rar-rara { box-shadow: inset 0 -3px 0 #3fa9ff; } .mc-opt.rar-epica { box-shadow: inset 0 -3px 0 #c07bff; } .mc-opt.rar-legendaria { box-shadow: inset 0 -3px 0 #ffbe2e; }
  .mc-opt.on { box-shadow: 0 0 0 3px rgba(255, 200, 41, .35) !important; }
  .mc-empty { padding: 4px 2px; }
  .mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
  .mc-foot .btn { margin: 0 !important; }
  @media (orientation: landscape) and (max-height: 560px) {
    #pro #proMain:not(.hidden) { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); }
    #pro .pro-hero { padding: 8px 10px !important; gap: 6px !important; }
    #pro .pro-hero > canvas { width: 64px !important; height: 64px !important; }
    #pro .pro-hero .pro-name { font-size: 16px; }
    .up-box { padding: 6px 8px; gap: 4px; }
    .up-row { grid-template-columns: 58px minmax(0, 1fr) 26px; }
    .up-btn { width: 26px; height: 26px; font-size: 18px; }
    .up-bar { height: 10px; }
    .mc-tabs button { padding: 6px 10px; font-size: 13.5px; }
    .mc-opt { width: 64px; height: 66px; }
    .mc-opt canvas { width: 44px !important; height: 44px !important; }
    .mc-zone .mc-opt { width: 50px; height: 50px; border-radius: 12px; }
    .mc-zone .mc-opt canvas { width: 40px !important; height: 40px !important; }
    .mc-zone .mc-opt .mc-oname { display: none; }
    .mc-zone { grid-template-columns: 52px minmax(0, 1fr); gap: 6px; }
    .mc-zone .mc-list { padding: 2px; }
    #mcZones { gap: 4px; }
    .mc-win { gap: 6px; }
  }
  /* la ventana ocupa el alto disponible y desliza por dentro */
  #pro[data-tab="chapa"] .pro-content { overflow: hidden; }
  #pro[data-tab="chapa"] .tabp.on { flex: 1 1 auto !important; min-height: 0 !important; }
  #pro .tabp[data-tab="chapa"] > .mc-win { flex: 1 1 auto; flex-shrink: 1; min-height: 0; }
  #pro .mc-win .err:empty { display: none; }
  #pro .mc-win { height: 100%; }
  /* v67: tres mejoras con − y +, y la ventana de la chapa igual de alta que la de las skins */
  .up-row { grid-template-columns: 62px 24px minmax(0, 1fr) 26px !important; gap: 6px !important; }
  .up-btn.minus { width: 24px; height: 24px; font-size: 18px; color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .1); box-shadow: none; }
  .up-btn.minus:disabled { color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .04); }
  .up-btn.minus:not(:disabled):active { transform: translateY(1px); }
  #pro[data-tab="chapa"] #proMain:not(.hidden) { align-items: stretch; }
  #pro[data-tab="chapa"] .pro-side { align-self: stretch; height: 100%; min-height: 0; }
  #pro[data-tab="chapa"] .pro-hero { flex: 1 1 auto; justify-content: space-between; min-height: 0; }
  #pro[data-tab="chapa"] .pro-hero-txt { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
  @media (orientation: landscape) and (max-height: 560px) {
    .up-row { grid-template-columns: 54px 22px minmax(0, 1fr) 24px !important; gap: 5px !important; }
    .up-btn { width: 24px; height: 24px; font-size: 17px; }
    .up-btn.minus { width: 22px; height: 22px; font-size: 16px; }
    .up-name { font-size: 12px; }
  }
  /* ================= v68: Entrenar en 2 × 2, a pantalla completa y sin scroll ================= */
  #pro[data-tab="entrenar"] .pro-content { overflow: hidden; }
  #pro .tabp[data-tab="entrenar"].on { display: flex !important; flex-direction: column; flex: 1 1 auto !important; min-height: 0 !important; height: 100%; }
  #pro .tabp[data-tab="entrenar"] > .sec-title { display: none; }
  #pro .tabp[data-tab="entrenar"] > #trainList {
    flex: 1 1 auto; min-height: 0; display: grid; gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  #trainList .tcard {
    position: relative; min-height: 0; overflow: hidden; cursor: pointer;
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; column-gap: 14px; row-gap: 6px;
    align-items: center; padding: 12px 14px; transition: transform .08s ease, border-color .15s;
  }
  #trainList .tcard:hover { border-color: rgba(255, 200, 41, .6); }
  #trainList .tcard:active { transform: scale(.985); }
  #trainList .tc-art { position: static !important; transform: none !important; grid-row: 1 / span 2; width: clamp(64px, 16vh, 120px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
  #trainList .tc-txt { display: grid; gap: 3px; align-content: center; min-width: 0; }
  #trainList .tcard h4 { font-size: 19px; line-height: 1.05; }
  #trainList .tcard .stars { font-size: 20px; line-height: 1; }
  #trainList .tc-desc { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #trainList .times { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .7); }
  #trainList .tcard .btn { padding: 7px 16px; }
  @media (orientation: landscape) and (max-height: 560px) {
    #pro .tabp[data-tab="entrenar"] > #trainList { gap: 8px; }
    #trainList .tcard { padding: 8px 10px; column-gap: 10px; row-gap: 2px; border-radius: 16px; }
    #trainList .tcard h4 { font-size: 16px; }
    #trainList .tcard .stars { font-size: 16px; }
    #trainList .tc-desc { font-size: 11.5px; }
    #trainList .times { font-size: 11px; }
    #trainList .tcard .btn { padding: 5px 12px; font-size: 14px; }
  }
  #trainList .tcard { padding-left: 14px !important; }
  #pro[data-tab="entrenar"] #proMain:not(.hidden) { grid-template-columns: minmax(0, 1fr) !important; }
  /* El récord y el botón comparten la fila de abajo del texto */
  #trainList .tcard { grid-template-rows: minmax(0, 1fr); }
  #trainList .tc-art { grid-row: 1; }
  #trainList .tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
  #trainList .tc-foot .times { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #trainList .tc-foot .btn { flex: none; margin: 0; }
  /* En pantallas grandes todo crece para llenar la tarjeta */
  @media (min-height: 700px) and (min-width: 1000px) {
    #trainList .tc-art { width: clamp(120px, 18vh, 190px) !important; }
    #trainList .tcard { column-gap: 22px !important; padding: 18px 22px !important; }
    #trainList .tcard h4 { font-size: 26px !important; }
    #trainList .tcard .stars { font-size: 26px !important; }
    #trainList .tc-desc { font-size: 16px !important; }
    #trainList .times { font-size: 15px !important; }
    #trainList .tc-foot .btn { padding: 10px 24px; font-size: 18px; }
  }
  /* ================= v69: tutorial con el míster ================= */
  #tutoDlg[open] {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 16px;
    width: min(560px, calc(100vw - 24px)); padding: 18px 22px 18px 12px; overflow: hidden;
  }
  #tutoDlg.with-demo[open] { width: min(860px, calc(100vw - 20px)); height: min(440px, calc(100dvh - 16px)); align-items: stretch; }
  .tuto-coach { width: clamp(110px, 24vh, 190px); height: auto; align-self: end; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); pointer-events: none; user-select: none; }
  #tutoDlg.with-demo .tuto-coach { width: clamp(80px, 20vw, 170px); align-self: end; }
  .tuto-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
  .tuto-step { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #3a2400; background: #ffc829; padding: 2px 9px; border-radius: 999px; }
  #tutoDlg h3 { margin: 0; }
  .tuto-text { font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, .92); }
  .tuto-text b { color: #ffd23f; }
  .tuto-text kbd { margin: 0 1px; }
  .tuto-note { display: block; margin-top: 6px; font-size: 13.5px; color: rgba(255, 255, 255, .72); }
  .tuto-note.gift { font-size: 15px; color: #fff; }
  .tuto-demo { flex: 1 1 auto; min-height: 90px; border-radius: 14px; overflow: hidden; background: #3f8a26; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); }
  .tuto-demo canvas { display: block; width: 100%; height: 100%; }
  .tuto-actions { margin-top: 4px; justify-content: flex-end; flex-wrap: nowrap; }
  #tutoSkip { background: transparent; box-shadow: none; border: 2px solid rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .8); }
  @media (orientation: landscape) and (max-height: 560px) {
    #tutoDlg[open] { padding: 10px 14px 10px 8px; gap: 2px 10px; }
    #tutoDlg.with-demo[open] { height: calc(100dvh - 12px); max-height: none; }
    #tutoDlg h3 { font-size: 20px; }
    .tuto-text { font-size: 12.5px; line-height: 1.3; }
    .tuto-note { font-size: 11.5px; margin-top: 3px; }
    .tuto-step { font-size: 10px; }
    .tuto-body { gap: 4px; }
    .tuto-actions .btn { padding: 6px 14px; font-size: 14px; }
  }
  /* Consejo del míster durante el tutorial */
  .tuto-tip {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; pointer-events: none;
    display: flex; align-items: center; gap: 8px; padding: 5px 16px 5px 6px; border-radius: 999px;
    background: rgba(10, 18, 40, .82); border: 2px solid rgba(255, 200, 41, .55); color: #fff; font-weight: 800; font-size: 15px; white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  }
  .tuto-tip img { width: 40px; height: 40px; object-fit: contain; object-position: top; margin-top: -14px; }
  @media (orientation: landscape) and (max-height: 560px) { .tuto-tip { font-size: 12.5px; bottom: 8px; } .tuto-tip img { width: 32px; height: 32px; } }
  .tb-max { color: #ffd23f; font-weight: 800; font-size: 13px; }
  /* Botón «Tutorial» de Entrenar */
  .tuto-btn { display: none; align-items: center; gap: 6px; padding: 4px 12px 4px 6px !important; margin-right: 10px; }
  #pro[data-tab="entrenar"] .tuto-btn { display: inline-flex; }
  .tuto-btn img { width: 28px; height: 28px; object-fit: contain; object-position: top; margin-top: -6px; }
  .tuto-gift { font-size: 11px; background: #3ddc84; color: #06321a; padding: 1px 7px; border-radius: 999px; font-family: system-ui, sans-serif; font-weight: 800; }
  #tutoDlg .dlg-actions { position: static !important; box-shadow: none !important; background: none !important; border: 0 !important; margin: 4px 0 0 !important; padding: 0 !important; }
  #tutoDlg:not(.with-demo) .tuto-coach { width: clamp(120px, 30vh, 200px); margin-bottom: -18px; }
  /* ================= v70: saque de 10 s y ausentes ================= */
  /* El aviso de saque va abajo en el centro (arriba lo tapaba el marcador) y más grande */
  #koLbl { top: auto; bottom: 16px; z-index: 6; padding: 6px 18px; font-size: 16px; font-weight: 800; border: 2px solid rgba(255, 255, 255, .2); background: rgba(10, 18, 40, .82); }
  @media (orientation: landscape) and (max-height: 560px) { #koLbl { bottom: 10px; font-size: 13.5px; padding: 4px 14px; } }
  .ko-lbl.hurry { color: #ffd23f; }
  .ko-lbl.open { color: #3a2400; background: #ffc829 !important; border-color: #ffe27a !important; animation: koOpen .5s ease; }
  @keyframes koOpen { 0% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
  .afk-box {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; pointer-events: none;
    display: grid; gap: 4px; text-align: center; padding: 14px 22px; border-radius: 18px; max-width: min(440px, 80vw);
    background: rgba(10, 18, 40, .9); border: 3px solid #ffc829; color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  }
  .afk-box b { font-family: var(--disp); font-weight: 400; font-size: 26px; color: #ffd23f; }
  .afk-box span { font-size: 15px; font-weight: 700; }
  .afk-box.away { border-color: #ff6b6b; }
  .afk-box.away b { color: #ff8a8a; }
  @media (orientation: landscape) and (max-height: 560px) { .afk-box { padding: 10px 16px; } .afk-box b { font-size: 20px; } .afk-box span { font-size: 13px; } }
  /* ================= v71: presentación «chapa vs chapa» ================= */
  .vs-box {
    position: absolute; inset: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; overflow: hidden; background: #0a1228; color: #fff; user-select: none;
  }
  .vs-side { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 18px 26px; min-width: 0; z-index: 1; }
  .vs-side::before { content: ''; position: absolute; inset: 0 -40px; z-index: -1; }
  .vs-side.red::before { background: linear-gradient(105deg, color-mix(in srgb, var(--team-red, #d8343f) 70%, #000) 0%, color-mix(in srgb, var(--team-red, #d8343f) 28%, #0a1228) 100%); clip-path: polygon(0 0, 100% 0, calc(100% - 60px) 100%, 0 100%); }
  .vs-side.blue::before { background: linear-gradient(255deg, color-mix(in srgb, var(--team-blue, #2f6fd6) 70%, #000) 0%, color-mix(in srgb, var(--team-blue, #2f6fd6) 28%, #0a1228) 100%); clip-path: polygon(60px 0, 100% 0, 100% 100%, 0 100%); }
  .vs-side.blue { align-items: flex-end; text-align: right; }
  .vs-team { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 24px; text-shadow: var(--outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .vs-list { display: grid; gap: 8px; width: 100%; }
  .vs-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 6px 10px; border-radius: 14px; background: rgba(0, 0, 0, .22); }
  .vs-side.blue .vs-card { flex-direction: row-reverse; }
  .vs-card.me { box-shadow: inset 0 0 0 2px #ffc829; }
  .vs-card .cap-cv { flex: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
  .vs-card.big { flex-direction: column; align-items: center; background: none; padding: 10px 14px; gap: 6px; text-align: center; }
  .vs-side.blue .vs-card.big { flex-direction: column; align-items: center; }
  .vs-side.blue .vs-card.big .vs-txt, .vs-card.big .vs-txt { justify-items: center; }
  .vs-card.big .vs-stats { width: 100%; text-align: left; }
  .vs-side.blue .vs-card.big .vs-stats { text-align: right; }
  .vs-list.n1 { justify-items: center; }
  .vs-side.blue .vs-team, .vs-side.red .vs-team { align-self: center; }
  .vs-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .vs-card.big .vs-txt { width: auto; }
  .vs-card.big .vs-txt:has(.vs-stats) { width: min(340px, 40vw); }
  .vs-card.big { min-width: min(220px, 36vw); }
  .vs-card.big .vs-stats { justify-self: stretch; }
  .vs-name { font-family: var(--disp); font-weight: 400; font-size: 20px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--outline); }
  .vs-card.big .vs-name { font-size: 30px; }
  .vs-sub { font-size: 12.5px; font-weight: 800; color: #ffd23f; }
  .vs-stats { display: grid; gap: 4px; margin-top: 4px; }
  .vs-st { display: grid; grid-template-columns: 70px minmax(0, 1fr) 22px; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .85); }
  /* En el lado azul todo va en espejo: número, barra (que se llena desde la derecha) y nombre */
  .vs-side.blue .vs-st { grid-template-columns: 22px minmax(0, 1fr) 70px; }
  .vs-side.blue .vs-st > span { order: 3; text-align: right; }
  .vs-side.blue .vs-st > .up-bar { order: 2; transform: scaleX(-1); }
  .vs-side.blue .vs-st > b { order: 1; }
  .vs-st b { font-size: 13px; color: #fff; text-align: center; }
  .vs-st .up-bar { height: 9px; }
  .vs-st .up-bar i { transition: background .25s; }
  .vs-list.n2 .vs-st, .vs-list.n3 .vs-st, .vs-list.n4 .vs-st, .vs-list.n5 .vs-st { grid-template-columns: 52px minmax(0, 1fr) 18px; font-size: 10.5px; }
  .vs-side.blue .vs-list:not(.n1) .vs-st { grid-template-columns: 18px minmax(0, 1fr) 52px; }
  .vs-note { margin-top: 6px; max-width: 150px; text-align: center; font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .6); }
  .vs-box.show .vs-note { animation: vsFade .4s .7s both; }
  .vs-mid { position: relative; z-index: 2; display: grid; justify-items: center; gap: 2px; padding: 0 4px; }
  .vs-vs { font-family: var(--disp); font-weight: 400; font-size: 88px; line-height: .9; color: #ffd23f; text-shadow: 0 4px 0 #b36b00, 0 8px 22px rgba(0, 0, 0, .6); }
  .vs-ctx { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
  .vs-mode { font-size: 14px; font-weight: 800; background: rgba(0, 0, 0, .35); padding: 2px 12px; border-radius: 999px; white-space: nowrap; }
  .vs-skip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); animation: vsBlink 1.4s ease-in-out infinite; z-index: 3; }
  @keyframes vsBlink { 50% { opacity: .35; } }
  /* Entrada: cada equipo llega desde su lado y el VS cae con un golpe */
  .vs-box.show .vs-side.red { animation: vsInL .5s cubic-bezier(.2, .9, .3, 1.15) both; }
  .vs-box.show .vs-side.blue { animation: vsInR .5s cubic-bezier(.2, .9, .3, 1.15) both; }
  .vs-box.show .vs-vs { animation: vsPop .45s .35s cubic-bezier(.3, 1.6, .5, 1) both; }
  .vs-box.show .vs-ctx, .vs-box.show .vs-mode { animation: vsFade .4s .6s both; }
  .vs-box.out { opacity: 0; transform: scale(1.04); transition: opacity .35s, transform .35s; }
  @keyframes vsInL { from { transform: translateX(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes vsInR { from { transform: translateX(60%); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes vsPop { from { transform: scale(2.6); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes vsFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @media (orientation: landscape) and (max-height: 560px) {
    .vs-side { padding: 10px 16px; gap: 6px; }
    .vs-team { font-size: 18px; }
    .vs-vs { font-size: 60px; }
    .vs-card.big .vs-name { font-size: 22px; }
    .vs-card.big .cap-cv { width: 76px !important; height: 76px !important; }
    .vs-name { font-size: 15px; }
    .vs-card { padding: 4px 8px; gap: 8px; }
    .vs-card .cap-cv { width: 36px !important; height: 36px !important; }
    .vs-list { gap: 5px; }
    .vs-sub { font-size: 11px; }
    .vs-st { font-size: 10.5px; grid-template-columns: 58px minmax(0, 1fr) 18px; gap: 6px; }
    .vs-side.blue .vs-st { grid-template-columns: 18px minmax(0, 1fr) 58px; }
    .vs-list:not(.n1) .vs-stats { gap: 2px; margin-top: 2px; }
  }
  /* Mientras se ve la presentación, el chat y los avisos del partido no se ven */
  body.vs-on #chat, body.vs-on #koLbl, body.vs-on .chat-feed { visibility: hidden; }
  .vs-l i { font-style: normal; }
  .vs-l .short { display: none; }
  /* Varias chapas por equipo: las mejoras en tres pastillas (Vel 14 · Tiro 9 · Efe 17), sin barras */
  .vs-list:not(.n1) .vs-stats { display: flex !important; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
  .vs-side.blue .vs-list:not(.n1) .vs-stats { justify-content: flex-end; }
  .vs-list:not(.n1) .vs-st { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); font-size: 11px; }
  .vs-list:not(.n1) .vs-st .up-bar { display: none; }
  .vs-list:not(.n1) .vs-l .full { display: none; }
  .vs-list:not(.n1) .vs-l .short { display: inline; }
  .vs-list:not(.n1) .vs-st b { color: var(--sc, #fff); font-size: 12px; }
  .vs-side.blue .vs-list:not(.n1) .vs-st > span { order: 0; }
  .vs-side.blue .vs-list:not(.n1) .vs-st > b { order: 1; }
  .vs-list:not(.n1) .vs-stats { flex-wrap: nowrap; }
  @media (orientation: landscape) and (max-height: 560px) {
    .vs-list:not(.n1) .vs-stats { gap: 3px; margin-top: 2px; }
    .vs-list:not(.n1) .vs-st { padding: 0 5px; font-size: 9.5px; gap: 3px; }
    .vs-list:not(.n1) .vs-st b { font-size: 10.5px; }
    .vs-list:not(.n1) .vs-sub { font-size: 10.5px; }
  }
  /* ================= v72: competitivo (divisiones y ELO) ================= */
  .div-badge-w { display: inline-flex; flex: none; line-height: 0; }
  .div-badge { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
  .div-bar { position: relative; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .4); overflow: hidden; width: 100%; }
  .div-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(180deg, #ffe774, #f5a400); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45); }
  .div-bar.big { height: 16px; }
  /* Perfil → Competitivo */
  .pf-compe.on { display: flex; flex-direction: column; gap: 10px; }
  .rk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .rk-card {
    display: grid; justify-items: center; gap: 5px; padding: 12px 14px 14px; border-radius: 20px; text-align: center;
    background: linear-gradient(180deg, rgba(25, 39, 81, .95), rgba(12, 22, 52, .95)); border: 2px solid rgba(255, 255, 255, .09);
  }
  .rk-card.t-oro { border-color: rgba(242, 184, 30, .45); }
  .rk-card.t-diamante { border-color: rgba(76, 195, 240, .5); }
  .rk-card.t-leyenda { border-color: rgba(181, 108, 255, .6); box-shadow: 0 0 24px rgba(181, 108, 255, .25); }
  .rk-mode { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
  .rk-div { font-family: var(--disp); font-weight: 400; font-size: 22px; text-shadow: var(--outline); }
  .rk-pts { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .78); }
  .rk-elo { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
  .rk-elo span { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #ffd23f; }
  .rk-elo b { font-family: var(--disp); font-weight: 400; font-size: 26px; line-height: 1; }
  .rk-rec { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); }
  .rk-best { font-size: 11px; font-weight: 800; color: #ffd23f; }
  .rk-rules { margin: 0; }
  @media (orientation: landscape) and (max-height: 560px) {
    .rk-grid { gap: 8px; }
    .rk-card { padding: 8px 10px 10px; gap: 3px; }
    .rk-card .div-badge { height: 52px; width: 36px; }
    .rk-div { font-size: 17px; }
    .rk-elo b { font-size: 20px; }
    .rk-pts, .rk-rec { font-size: 11px; }
  }
  /* Elegir modo: tu división en cada uno */
  .mp-rank { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 2px 10px 2px 4px; border-radius: 999px; background: rgba(0, 0, 0, .35); font-size: 12px; font-weight: 800; }
  /* Pantalla VS: escudo junto a la división */
  .vs-sub { display: inline-flex; align-items: center; gap: 5px; }
  .vs-side.blue .vs-sub { flex-direction: row-reverse; }
  .vs-card.big .vs-sub { justify-content: center; }
  /* Resultado */
  .rank-dlg[open] { display: grid; justify-items: center; gap: 4px; text-align: center; width: min(420px, calc(100vw - 24px)); }
  .rank-dlg h3 { margin: 0 !important; }
  .rank-dlg.up h3 { color: #ffd23f; }
  .rank-dlg.down h3 { color: #ff8a8a; }
  .rk-mode-lbl { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
  .rk-badge { margin: 4px 0; }
  .rk-badge.rk-flash { animation: rkFlash .8s ease; }
  .rk-badge.rk-shake { animation: rkShake .5s ease; }
  @keyframes rkFlash { 0% { transform: scale(.6); filter: brightness(3); } 60% { transform: scale(1.15); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
  @keyframes rkShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
  .rk-div-name { font-family: var(--disp); font-weight: 400; font-size: 26px; text-shadow: var(--outline); }
  .rk-delta { font-size: 18px; font-weight: 900; }
  .rk-delta.pos { color: #3ddc84; }
  .rk-delta.neg { color: #ff6b6b; }
  .rank-dlg .div-bar { width: 80%; margin-top: 4px; }
  .rk-pts-lbl { font-size: 13px; font-weight: 800; }
  .rk-elo-lbl { font-size: 14px; font-weight: 800; color: #ffd23f; }
  .rank-dlg p { margin: 2px 0 0; }
  @media (orientation: landscape) and (max-height: 560px) {
    .rank-dlg[open] { grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; text-align: left; justify-items: start; width: min(560px, calc(100vw - 24px)); }
    .rank-dlg .rk-badge { grid-column: 1; grid-row: 1 / span 8; align-self: center; justify-self: center; }
    .rank-dlg .rk-badge .div-badge { height: 110px; width: 75px; }
    .rank-dlg > :not(.rk-badge) { grid-column: 2; }
    .rank-dlg .div-bar { width: 100%; }
    .rk-div-name { font-size: 21px; }
  }
  @media (orientation: landscape) and (max-height: 400px) {
    .rk-card .div-badge { height: 40px; width: 27px; }
    .rk-card { padding: 6px 8px 8px; gap: 2px; }
    .rk-mode { font-size: 10.5px; }
    .rk-div { font-size: 15px; }
    .rk-elo b { font-size: 17px; }
    .rk-best { display: none; }
    .rk-rules { font-size: 11px; }
  }
  /* ================= v74: escudo de la división delante de tu nombre en el lobby ================= */
  .lb-name { display: inline-flex; align-items: center; gap: 6px; }
  #lbRank { display: inline-flex; }
  #lbRank:empty { display: none; }
  .pslot .pplate b .div-badge-w { margin-right: 2px; }
  @media (orientation: landscape) and (max-height: 560px) { #lbRank .div-badge { height: 24px; width: 16px; } }
  /* Dentro del nombre van el escudo y el nombre (spans): que no les afecten las reglas de la línea del club */
  .lb-plate .lb-name span { display: inline-flex !important; font: inherit !important; color: inherit !important; text-shadow: inherit !important; }
  /* ================= v77: pantalla de después del partido («Jugar») sin scroll ================= */
  /* Izquierda: imagen, resultado, marcador y volver. Derecha: equipos y lo que has ganado. */
  .mm-box.done {
    display: grid; overflow: hidden; align-content: center; justify-content: center; column-gap: 28px; row-gap: 6px;
    grid-template-columns: minmax(0, 300px) minmax(0, 560px);
    grid-template-areas: "head teams" "img teams" "status teams" "score res" "back res";
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }
  .mm-box.done .mm-head { grid-area: head; }
  .mm-box.done .mm-resimg { grid-area: img; justify-self: center; align-self: center; width: auto; height: 100%; max-height: 30vh; min-height: 0; object-fit: contain; }
  .mm-box.done .mm-status { grid-area: status; justify-self: center; }
  .mm-box.done .mm-score { grid-area: score; justify-self: center; }
  .mm-box.done #mmBack { grid-area: back; justify-self: center; }
  .mm-box.done .mm-hint { display: none; }
  .mm-box.done .mm-teams { grid-area: teams; align-self: end; width: 100%; gap: 8px; }
  .mm-box.done .mm-teams .mm-vs { font-size: 20px; }
  .mm-box.done #mmResultSlot { grid-area: res; align-self: start; width: 100%; }
  .mm-box.done #mmResultSlot .result { margin: 0; }
  .mm-box.done .mm-p { padding: 3px 8px 3px 3px; gap: 8px; }
  .mm-box.done .mm-p canvas.mini-cap, .mm-box.done .mm-p img.mini-cap { width: 30px !important; height: 30px !important; }
  .mm-box.done .mm-p b { font-size: 13.5px; }
  .mm-box.done .mm-p span { font-size: 11px; }
  .mm-box.done .mm-list { gap: 4px; }
  .mm-box.done .mm-team { padding: 8px 10px; }
  @media (orientation: landscape) and (max-height: 560px) {
    .mm-box.done { column-gap: 16px; row-gap: 4px; padding: 0 4px 4px; grid-template-columns: minmax(0, 220px) minmax(0, 520px); }
    .mm-box.done .mm-head b { font-size: 20px; }
    .mm-box.done .mm-head span { font-size: 12px; }
    .mm-box.done .mm-resimg { max-height: 34vh; }
    .mm-box.done .mm-status.win, .mm-box.done .mm-status.loss, .mm-box.done .mm-status.draw { font-size: 22px; }
    .mm-box.done .mm-score { font-size: 28px; }
    .mm-box.done #mmBack { min-height: 0; padding: 8px 18px; font-size: 16px; }
    .mm-box.done .mm-tname { font-size: 13px; }
    .mm-box.done .mm-team { padding: 6px 8px; }
    .mm-box.done .mm-p canvas.mini-cap, .mm-box.done .mm-p img.mini-cap { width: 24px !important; height: 24px !important; }
    .mm-box.done .mm-p b { font-size: 12px; }
    .mm-box.done .mm-p span { font-size: 10px; }
    .mm-box.done #mmResultSlot .result { padding: 8px 10px; gap: 8px; }
    .mm-box.done #mmResultSlot .result .big { font-size: 22px; }
    .mm-box.done #mmResultSlot .result strong { font-size: 13px; }
    .mm-box.done #mmResultSlot .result .muted { font-size: 11px; }
  }
  /* Diálogo del competitivo: los botones no tapan el texto */
  #rankDlg .dlg-actions { position: static !important; box-shadow: none !important; background: none !important; border: 0 !important; margin: 6px 0 0 !important; padding: 0 !important; }
  /* Lo ganado: XP, monedas y el sobre en una tarjeta compacta (el sobre en una fila debajo) */
  .mm-box.done #mmResultSlot .result { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 6px; }
  .mm-box.done #mmResultSlot .pack-won { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; margin: 0; padding: 4px 8px; min-height: 0; }
  .mm-box.done #mmResultSlot .pack-won img { width: 26px !important; height: auto !important; }
  .mm-box.done #mmResultSlot .pack-won .grow { display: flex; align-items: center; }
  .mm-box.done #mmResultSlot .pack-won .grow b { font-size: 16px; }
  .mm-box.done #mmResultSlot .pack-won .grow span { display: none; }
  .mm-box.done #mmResultSlot .pack-won .btn { padding: 5px 12px; font-size: 14px; min-height: 0; white-space: nowrap; }
  .mm-box.done #mmResultSlot .big-chip { font-size: 22px; }
  @media (orientation: landscape) and (max-height: 560px) {
    .mm-box.done #mmResultSlot .big-chip { font-size: 18px; }
    .mm-box.done #mmResultSlot .big-chip .coin { width: 20px; height: 20px; }
    .mm-box.done #mmResultSlot .pack-won .grow b { font-size: 14px; }
    .mm-box.done #mmResultSlot .pack-won .btn { padding: 4px 10px; font-size: 13px; }
  }
  .mm-box.done .mm-resimg { height: 30vh !important; max-height: none; }
  .mm-box.done #mmResultSlot .result { flex-direction: row !important; text-align: left; }
  .mm-box.done #mmResultSlot .result > div:not(.pack-won) { flex: 1 1 0; min-width: 0; }
  .mm-box.done #mmResultSlot .result .big { white-space: nowrap; }
  .mm-box.done #mmResultSlot .pack-won > img { height: 30px !important; width: auto !important; }
  @media (orientation: landscape) and (max-height: 560px) {
    .mm-box.done .mm-resimg { height: 24vh !important; }
    .mm-box.done #mmResultSlot .result .big { font-size: 20px; }
  }
  @media (orientation: landscape) and (max-height: 560px) {
    /* En móvil, cada jugador en una línea (sin el nivel) para que quepan 3 por equipo */
    .mm-box.done .mm-p { padding: 2px 8px 2px 2px; }
    .mm-box.done .mm-p span { display: none; }
    .mm-box.done .mm-p canvas.mini-cap, .mm-box.done .mm-p img.mini-cap { width: 22px !important; height: 22px !important; }
    .mm-box.done .mm-list { gap: 3px; }
    .mm-box.done .mm-tname { display: none; }
    .mm-box.done .mm-team { padding: 5px 6px; }
    .mm-box.done #mmResultSlot .result strong { font-size: 12.5px; }
  }
  /* ================= v78: retos diarios, anuncios y clubes «próximamente» ================= */
  .js-club { display: none !important; }
  #questDlg[open] { display: grid; gap: 8px; width: min(560px, calc(100vw - 24px)); }
  .qd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .qd-head h3 { margin: 0 !important; }
  .qd-reset { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .65); }
  .qd-list, .qd-ads { display: grid; gap: 6px; }
  .qd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1.5px solid rgba(255, 255, 255, .07); }
  .qd-row.done { border-color: rgba(61, 220, 132, .6); background: rgba(61, 220, 132, .1); }
  .qd-row.claimed { opacity: .6; }
  .qd-row.bonus { border-color: rgba(255, 200, 41, .35); }
  .qd-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
  .qd-txt b { font-size: 14.5px; }
  .qd-sub { font-size: 12px; color: rgba(255, 255, 255, .65); }
  .qd-bar { position: relative; height: 14px; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; }
  .qd-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #7dffa8, #26b862); border-radius: inherit; }
  .qd-bar span { position: relative; display: block; text-align: center; font-size: 10.5px; font-weight: 800; line-height: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
  .qd-row .btn { flex: none; min-width: 84px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
  .qd-row .btn.ghost { opacity: .75; }
  .qd-row .btn.ok { background: #26b862; color: #fff; }
  .qd-rew { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; }
  .qd-rew .coin { width: 16px; height: 16px; }
  .qd-rew img { height: 20px; width: auto; margin-left: 2px; }
  .qd-sep { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-top: 4px; }
  .ad-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .25); font-size: 9px; margin-right: 2px; }
  #questDlg .dlg-actions { position: static !important; box-shadow: none !important; background: none !important; border: 0 !important; margin: 0 !important; padding: 0 !important; }
  @media (orientation: landscape) and (max-height: 560px) {
    #questDlg[open] { gap: 4px; padding: 10px 14px; width: min(640px, calc(100vw - 16px)); }
    #questDlg h3 { font-size: 19px; }
    .qd-list, .qd-ads { gap: 4px; }
    .qd-ads { grid-template-columns: 1fr 1fr; }
    .qd-ads .qd-sep { grid-column: 1 / -1; margin-top: 0; }
    .qd-row { padding: 4px 8px; gap: 8px; }
    .qd-txt { gap: 2px; }
    .qd-txt b { font-size: 12.5px; }
    .qd-sub { font-size: 10.5px; }
    .qd-bar { height: 11px; } .qd-bar span { line-height: 11px; font-size: 9px; }
    .qd-row .btn { padding: 4px 8px; min-width: 70px; font-size: 13px; min-height: 0; }
    #questDlg .dlg-actions .btn { padding: 4px 12px; min-height: 0; }
  }
  /* Anuncio de prueba */
  .ad-view[open] { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .94); color: #fff; }
  .ad-view::backdrop { background: rgba(0, 0, 0, .6); }
  .ad-box { display: grid; gap: 10px; justify-items: center; width: min(520px, 90vw); }
  .ad-tag { justify-self: start; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 4px; background: #ffc829; color: #3a2400; }
  .ad-fake { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
    background: repeating-linear-gradient(45deg, #1a2550 0 18px, #16204a 18px 36px); border: 2px dashed rgba(255, 255, 255, .25); }
  .ad-fake img { height: 56px; width: auto; }
  .ad-fake b { font-size: 18px; } .ad-fake span { font-size: 12px; color: rgba(255, 255, 255, .6); }
  .ad-bar { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
  .ad-bar i { display: block; height: 100%; width: 0; background: #ffc829; }
  @media (orientation: landscape) and (max-height: 560px) { .ad-box { width: min(420px, 70vw); gap: 6px; } .ad-fake { aspect-ratio: 2 / 1; } }
  .pv-acts .ad-btn { display: inline-flex; align-items: center; gap: 4px; }
  .qd-head { flex-wrap: nowrap; align-items: center; }
  .qd-head h3 { flex: 1; }
  .qd-x { width: 36px; height: 36px; flex: none; font-size: 16px; display: grid; place-items: center; padding: 0; }
  @media (orientation: landscape) and (max-height: 560px) {
    /* en el móvil, cada reto en una línea: texto, barra y botón */
    .qd-txt:has(.qd-bar) { display: flex; align-items: center; gap: 8px; }
    .qd-txt:has(.qd-bar) b { flex: 1; min-width: 0; }
    .qd-txt .qd-bar { width: 26%; flex: none; }
    .qd-row.bonus .qd-sub { display: none; }
    .qd-x { width: 30px; height: 30px; font-size: 14px; }
  }
  @media (orientation: landscape) and (max-height: 560px) {
    .qd-row { padding: 3px 6px 3px 10px; min-height: 0; }
    .qd-row .btn { padding: 2px 8px; height: 30px; }
    .qd-rew img { height: 16px; }
    .qd-ads .qd-sub { font-size: 10px; }
  }
  /* ================= v79: moderación, cuenta y legal ================= */
  .who-tap { cursor: pointer; text-decoration: underline dotted rgba(255, 255, 255, .35); text-underline-offset: 3px; }
  .legal-note { margin: 6px 0 0; font-size: 11.5px; color: rgba(255, 255, 255, .6); text-align: center; }
  .legal-note a, .acct-legal a { color: #9fd0ff; }
  .acct-legal { margin-top: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .6); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .link-danger { background: none; border: 0; padding: 0; font: inherit; color: #ff8a8a; text-decoration: underline; cursor: pointer; }
  .btn.danger { background: linear-gradient(180deg, #ff6b6b, #d63a3a); color: #fff; box-shadow: 0 4px 0 #8f1f1f; }
  .del-lbl { display: flex; align-items: center; gap: 10px; font-size: 14px; }
  .del-lbl span { flex: none; }
  .del-lbl .field { flex: 1; min-width: 0; }
  #delDlg p { margin: 6px 0; }
  #delDlg .err:empty { display: none; }
  #delDlg[open], #repDlg[open] { width: min(440px, calc(100vw - 24px)); }
  #delDlg .dlg-actions, #repDlg .dlg-actions { position: static !important; box-shadow: none !important; background: none !important; border: 0 !important; margin: 8px 0 0 !important; padding: 0 !important; }
  .rep-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  /* móviles en horizontal: la nota legal sube junto al título «Crea tu chapa» para no añadir altura */
  @media (max-height: 500px) {
    .welcome-form { position: relative; }
    .legal-note { position: absolute; top: 2px; right: 0; max-width: 50%; margin: 0; text-align: right; font-size: 10.5px; line-height: 1.35; }
  }
  /* ================= v80: app de Android y «Entrar con Google» ================= */
  .g-ico { width: 18px; height: 18px; flex: none; }
  .g-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff !important; color: #1f1f1f !important;
    box-shadow: 0 4px 0 #b8bccb !important; border-color: #dadce0 !important; }
  .g-btn.hidden, .g-web.hidden { display: none !important; }
  .join-row .g-btn { padding-inline: 14px; }
  .g-web { display: flex; align-items: center; min-height: 40px; }
  .g-acct-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
  .g-state { font: 700 12px/1 var(--ui, system-ui); padding: 4px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
    background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
  .g-state.on { background: rgba(80, 200, 120, .2); color: #8ef0b0; }
  .link-btn { background: none; border: 0; padding: 0; font: inherit; color: #9fd0ff; text-decoration: underline; cursor: pointer; }
  .acct-legal .hidden { display: none; }
  #gUnlink { font-size: 13px; }
  /* bienvenida en móviles en horizontal: los 12 colores en una fila, así cabe también el aviso de error */
  @media (max-height: 440px) {
    .welcome-form .swatches { flex-wrap: nowrap; gap: 4px; }
    .welcome-form .swatch { width: 25px; height: 25px; flex: none; border-width: 2px; }
  }
  /* botón de ajustes de la portada: el engranaje centrado (antes el relleno lateral lo empujaba a la derecha) */
  .lb-gear { padding: 0 !important; display: grid; place-items: center; }
  .lb-gear img { margin: 0; display: block; }
