/* ═══════════════════════════════════════════════════════════════════════
   Menús: tienda, clasificación, perfil, ligas, sala, torneo, ajustes y
   ventanas (ranura de sobre, misiones, diario, subida de nivel, modos).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tienda ── */
.shop { flex: 1; min-height: 0; padding: .4rem var(--gutter) 1.2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.shop-sec { display: flex; flex-direction: column; gap: .6rem; }
.sec-title { display: flex; align-items: center; gap: 1.4rem; margin: .4rem 0 0; padding-left: 1rem; flex-wrap: wrap; }
.sec-title .ribbon { font-size: 1.75rem; padding: 0 .15em .08em; }
.sec-note { font-weight: 800; font-size: .88rem; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.7); }
.offer-row { display: flex; gap: .8rem; overflow-x: auto; overflow-y: visible; padding: .5rem .2rem .8rem; scrollbar-width: none; }
.offer-row::-webkit-scrollbar { display: none; }
.shop-loading { align-self: center; color: var(--text-dim); font-weight: 700; padding: 1rem; }
.offer {
  --rc: #6f8cff; --rd: #185566; --kit: #1f6a7c;
  position: relative; flex: 0 0 auto; width: 9.4rem; display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .55rem .55rem .7rem; border-radius: 18px; border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, var(--card-top), var(--card-bot));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1), inset 0 -5px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink), 0 10px 18px rgba(0,0,0,.3);
  animation: rise-in .4s cubic-bezier(.2,1.2,.4,1) both;
}
.offer-art { position: relative; width: 100%; aspect-ratio: 1.05; display: grid; place-items: center; border-radius: 12px; padding: 0; border: 0; background: rgba(172, 206, 220, .2); box-shadow: inset 0 2px 5px rgba(0,0,0,.35); }
.offer-art::after { content: ''; position: absolute; left: .45rem; top: .35rem; width: .7rem; height: .38rem; border-radius: 50%; background: rgba(255,255,255,.55); transform: rotate(-35deg); pointer-events: none; }
.offer-art .pack-art { height: 92%; width: auto; filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)); transition: transform .2s; }
.pack-offer-art:hover .pack-art { transform: rotate(-4deg) scale(1.05); }
.offer-info { position: absolute; right: 4px; top: 4px; width: 1.6rem; height: 1.6rem; }
.offer-info .ico { width: 100%; height: 100%; }
.offer-name { font-family: var(--font-title); font-size: 1rem; line-height: 1.05; text-align: center; min-height: 2.1em; display: flex; align-items: center;
  --sc: var(--ink); -webkit-text-stroke: .2em var(--sc); paint-order: stroke fill; text-shadow: 0 .07em 0 var(--sc); }
.offer-coins .offer-name { font-size: 1.4rem; min-height: 0; color: #fff; }
.offer-sub, .offer-rarity { font-size: max(11px, .78rem); font-weight: 800; }
.offer-buy { width: 100%; margin-top: auto; }
.offer-buy .amount .ico { width: 1.3em; height: 1.3em; }
.offer-deal { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 40%, var(--card-top)), var(--card-bot)); box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--rc) 80%, #fff), inset 0 -5px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink), 0 10px 18px rgba(0,0,0,.3); }
.deal-art { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--kit) 50%, #fff) 0%, var(--kit) 45%, color-mix(in srgb, var(--kit) 45%, #000) 100%); overflow: hidden; }
.deal-art canvas { width: 90%; height: 90%; }
.deal-count { position: absolute; right: .3rem; bottom: .1rem; font-size: 1.7rem; color: #fff; }
.deal-new { position: absolute; top: .3rem; left: .2rem; font-size: max(11px, .7rem); }
.offer-deal.r-legendaria { animation: rise-in .4s both, legend-offer 1.6s ease-in-out .4s infinite; }
@keyframes legend-offer { 50% { box-shadow: inset 0 0 0 3px var(--rc), inset 0 -6px 0 rgba(10,8,7,.3), 0 5px 0 rgba(10,8,7,.8), 0 0 22px rgba(255,200,60,.7); } }
.offer.is-bought { filter: grayscale(.7) brightness(.75); }
.offer-sold { margin-top: auto; display: inline-flex; align-items: center; gap: .3rem; font-size: 1rem; min-height: 44px; }
.offer-sold .ico { width: 1.2em; height: 1.2em; }
.offer-free { background: linear-gradient(180deg, #2f9a3c, #1b6427); box-shadow: inset 0 0 0 1.5px rgba(210,255,170,.3), inset 0 -5px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink); }
.offer-free.is-ready .offer-art .pack-art { animation: pack-bob 1.1s ease-in-out infinite; }
.offer-timer { margin-top: auto; min-height: 44px; display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-title); font-size: 1.1rem; color: #e2ffd6; -webkit-text-stroke: .2em var(--ink); paint-order: stroke fill; }
.offer-timer .ico { width: 1.1em; height: 1.1em; }
.coins-art { overflow: hidden; }
.coin-pile { position: relative; width: 80%; height: 80%; }
.cp-coin { position: absolute; width: 46%; aspect-ratio: 1;
  left: calc(27% + (var(--i) - (var(--n) - 1) / 2) * 11%); bottom: calc(6% + var(--i) * 7%);
  transform: rotate(calc((var(--i) - 2) * 9deg)); filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.cp-coin .ico { width: 100%; height: 100%; }
.pack-info-mini { display: flex; gap: 1rem; align-items: center; text-align: left; }
.pack-info-mini .pack-art { width: 7rem; flex: none; }

/* Contenido de un sobre (tienda y ranura) */
.pack-contents { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pack-contents li { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.pack-contents .pc-ico { width: 2rem; height: 2rem; flex: none; }
.pack-contents .pc-ico .ico { width: 100%; height: 100%; }
.pack-contents b { font-size: 1.15rem; }
.pack-guaranteed { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-weight: 700; font-size: .9rem; margin-top: .4rem; }
.pack-odds { margin-top: .5rem; font-weight: 700; font-size: max(11px, .88rem); }
.pack-odds summary { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; cursor: pointer; color: #bfe6ff; list-style: none; }
.pack-odds summary::-webkit-details-marker { display: none; }
.pack-odds summary .ico { width: 1.3em; height: 1.3em; }
.pack-odds[open] summary { color: #fff; }
.odds-note { margin: .1rem 0 .35rem; color: var(--text-dim); line-height: 1.3; }
.odds-note b { color: #fff; }
.odds-list { list-style: none; margin: 0 0 .35rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .7rem; }
.odds-list li { display: inline-flex; align-items: center; gap: .3rem; }
.odds-list b { font-size: 1rem; }

/* ── Ventana de ranura de sobre ── */
.packslot { display: grid; grid-template-columns: 11rem 1fr; gap: 1.2rem; align-items: center; }
.packslot-art { position: relative; display: grid; place-items: center; }
.packslot-art::before { content: ''; position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--pk) 60%, transparent), transparent 65%); animation: glow-breathe 1.8s ease-in-out infinite; }
.packslot-art .pack-art { position: relative; width: 100%; animation: pack-bob 2s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
.packslot-info { display: flex; flex-direction: column; gap: .7rem; }
.packslot-msg { margin: 0; font-weight: 700; font-size: 1.02rem; }
.packslot-time { display: inline-flex; align-items: center; gap: .3rem; font-size: 1.3rem; color: #ffcf7a; }
.packslot-time .ico { width: 1.1em; height: 1.1em; }
.packslot-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ── Misiones ── */
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.quest {
  display: grid; grid-template-columns: 2.6rem 1fr auto auto; align-items: center; gap: .7rem; padding: .55rem .7rem;
  border-radius: 14px; background: var(--well); border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1), inset 0 3px 7px rgba(0,0,0,.45);
}
.quest-ico { width: 2.6rem; height: 2.6rem; }
.quest-ico .ico { width: 100%; height: 100%; }
.quest-main { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.quest-text { font-weight: 800; }
.quest-reward { display: flex; gap: .4rem; font-family: var(--font-title); font-size: 1.05rem; }
.quest-reward .ico { width: 1.3em; height: 1.3em; }
.quest.is-done { box-shadow: inset 0 0 0 2px rgba(195,251,14,.7), inset 0 3px 7px rgba(0,0,0,.45), 0 0 .6rem rgba(150,255,60,.35); }
.quest.is-claimed { opacity: .6; }
.quest-claimed { color: #c3fb0e; --sc: #173f00; font-size: 1.05rem; }

/* ── Diario ── */
.daily-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.daily-day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .45rem .2rem .55rem;
  border-radius: 14px; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); border: 2.5px solid var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1), 0 3px 0 var(--ink);
  animation: rise-in .4s cubic-bezier(.2,1.2,.4,1) backwards; animation-delay: calc(var(--i) * 50ms);
}
.dd-label { font-family: var(--font-title); font-size: .88rem; color: #fff; -webkit-text-stroke: .2em var(--ink); paint-order: stroke fill; }
.dr-art { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; }
.dr-art .ico { width: 100%; height: 100%; }
.dr-pack .pack-art { height: 100%; width: auto; }
.dr-amount { font-family: var(--font-title); font-size: 1rem; --sc: var(--ink); -webkit-text-stroke: .2em var(--sc); paint-order: stroke fill; text-shadow: 0 .07em 0 var(--sc); }
.daily-day.is-big { background: linear-gradient(180deg, #ffe24a 0 50%, #ffae0a 50% 100%); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), inset 0 -4px 0 #cc7400, 0 3px 0 var(--ink); }
.daily-day.is-big .dd-label { color: #fff3d0; }
.daily-day.is-today { background: linear-gradient(180deg, #c3fb0e 0 50%, #63dc05 50% 100%); transform: translateY(-6px) scale(1.06); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), inset 0 -4px 0 #3aa000, 0 4px 0 var(--ink), 0 0 22px rgba(170,255,60,.6); animation: rise-in .4s both, today-bob 1.2s ease-in-out .5s infinite; }
.daily-day.is-today .dd-label { color: #fff; }
@keyframes today-bob { 0%, 100% { transform: translateY(-6px) scale(1.06); } 50% { transform: translateY(-9px) scale(1.09); } }
.daily-day.is-claimed { filter: saturate(.3) brightness(.7); }
.dd-check { position: absolute; inset: 0; display: grid; place-items: center; }
.dd-check .ico { width: 2.4rem; height: 2.4rem; }
.daily-wait { margin: 0; font-weight: 700; }

/* ── Subida de nivel ── */
.levelup { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.levelup-star { animation: pop-big .9s .1s cubic-bezier(.2,1.6,.4,1) both, glow-pulse 1.6s ease-in-out 1s infinite; --glow: #8fe0ff; }
.levelup-text { margin: 0; font-size: 1.2rem; font-weight: 800; }
.levelup-text b { font-size: 1.6rem; }
.levelup-rewards { display: flex; gap: .7rem; }

/* ── Modos sin conexión ── */
.diff-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.diff-grid .btn { padding-left: .4em; padding-right: .4em; }
.diff-grid .sub { color: #fff6a8; letter-spacing: .1em; }
.controls-2p { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; }
.ctl-card { padding: .7rem .9rem; border-radius: 16px; border: 2.5px solid var(--ink); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.4), 0 3px 0 var(--ink); }
.ctl-card.p1 { background: linear-gradient(180deg, #1a8df2, #0b5fc0); }
.ctl-card.p2 { background: linear-gradient(180deg, #ef3b2f, #b01d14); }
.ctl-card h3 { margin: 0 0 .4rem; font-size: 1.2rem; text-align: center; }
.ctl-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem .6rem; align-items: center; }
.ctl-card dt { font-weight: 800; font-size: .88rem; }
.ctl-card dd { margin: 0; text-align: right; }
.ctl-vs { font-size: 2rem; }
/* 2 jugadores en pantalla táctil: la pantalla partida en dos y, abajo, la franja de cada uno con su
   joystick hacia su lado y sus botones hacia el centro (el jugador 2, en espejo) */
.touch-2p { display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; overflow: hidden; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.t2p-half { position: relative; display: flex; flex-direction: column; gap: .4rem; min-height: 8.5rem; padding: .5rem .6rem .6rem; }
.t2p-p1 { background: linear-gradient(180deg, #1a8df2, #0b5fc0); }
.t2p-p2 { background: linear-gradient(180deg, #ef3b2f, #b01d14); border-left: 3px dashed rgba(255,255,255,.55); }
.t2p-name { font-size: 1.1rem; text-align: center; }
.t2p-pad {
  margin: auto -.6rem -.6rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .45rem .6rem;
  background: linear-gradient(180deg, #2c231f 0%, #241c19 55%, #1d1714 100%); box-shadow: inset 0 2px 0 #120a05;
}
.t2p-pad .act-row { padding: 0; background: none; box-shadow: none; }
.t2p-pad .act-row .act-chip { width: 1.85rem; height: 1.85rem; }
.keys-2p { margin-top: .7rem; }
.keys-2p summary { cursor: pointer; font-weight: 800; color: var(--text-dim); text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.keys-2p[open] summary { margin-bottom: .4rem; }
.how-note {
  display: flex; align-items: center; justify-content: center; gap: .45rem; margin: .8rem auto 0; max-width: 34rem;
  font-size: .88rem; font-weight: 700; color: var(--gold-2); text-align: left;
}
.how-note .ico { flex: none; width: 1.3rem; height: 1.3rem; }

/* Gira el móvil (antes de un partido online) */
.rotate-ask-art { width: 5.5rem; height: 5.5rem; display: grid; place-items: center; }
.rotate-ask-phone { width: 2.6rem; height: 4.4rem; border-radius: 10px; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink); background: linear-gradient(180deg, var(--card-top), var(--card-bot)); animation: rotate-ask 1.8s ease-in-out infinite; }
@keyframes rotate-ask { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.rotate-ask-note { margin: -.4rem 0 0; font-weight: 700; }

/* Ranuras llenas (antes de jugar) */
.slots-full-art { display: flex; gap: .4rem; justify-content: center; }
.slots-full-art span { width: 2.6rem; }
.slots-full-art .pack-art { width: 100%; height: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.slots-full-tip { margin: -.4rem 0 0; font-weight: 700; }
.check-row { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 700; color: var(--text-dim); cursor: pointer; }
.check-row input { width: 1.3rem; height: 1.3rem; accent-color: #3fbd1c; }

/* ── Clasificación ── */
.lb { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .5rem; padding: .6rem var(--gutter) .8rem; }
.lb-head { display: flex; align-items: center; gap: 1.4rem; padding-left: 1rem; flex-wrap: wrap; }
.lb-head .ribbon { font-size: 2rem; }
.lb-head > span { font-weight: 700; }
.lb-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .5rem; width: min(100%, 52rem); align-self: center; }
.lb-list, .lb-list-me { list-style: none; margin: 0; padding: .1rem .2rem; }
.lb-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .35rem; }
.lb-loading { padding: 2rem; text-align: center; font-weight: 700; }
.lb-row {
  --kit: #1f6a7c;
  display: grid; grid-template-columns: 2.8rem 2.8rem minmax(0, 1fr) auto auto 6.6rem; align-items: center; gap: .6rem;
  min-height: 3.2rem; padding: .25rem .7rem .25rem .4rem; border-radius: 14px;
  background: rgba(24, 20, 19, .82); border: 1.5px solid var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12);
}
.lb-rank { text-align: center; font-size: 1.2rem; }
.lb-medal { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 2.5px solid var(--ink); font-size: 1.15rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 0 var(--ink); }
.rank-1 .lb-medal { background: radial-gradient(circle at 35% 30%, #fff6b8, #ffc83a 55%, #d98a00); }
.rank-2 .lb-medal { background: radial-gradient(circle at 35% 30%, #fff, #c8d2ea 55%, #8190b4); }
.rank-3 .lb-medal { background: radial-gradient(circle at 35% 30%, #ffe0bf, #e0914a 55%, #a0561c); }
.rank-1 { background: linear-gradient(90deg, rgba(200,140,20,.92), rgba(24,20,19,.85)); }
.lb-avatar { width: 2.8rem; height: 2.8rem; border-radius: 12px; overflow: hidden; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--kit) 50%, #fff), var(--kit) 50%, color-mix(in srgb, var(--kit) 50%, #000)); }
.lb-avatar canvas { width: 100%; height: 100%; }
.lb-who { display: flex; flex-direction: column; min-width: 0; }
.lb-nick { font-family: var(--font-title); font-size: 1.05rem; -webkit-text-stroke: .2em var(--ink); paint-order: stroke fill; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-you { font-style: normal; font-family: var(--font-title); font-size: max(11px, .75rem); padding: 0 .4rem; border-radius: 6px; background: linear-gradient(180deg, #c3fb0e 0 50%, #63dc05 50% 100%); border: 1.5px solid var(--ink); margin-left: .3rem; -webkit-text-stroke: .2em #173f00; paint-order: stroke fill; }
.lb-league { font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-flag { width: 1.9rem; }
.lb-cups { justify-content: flex-end; font-size: 1.15rem; }
.lb-cups .ico { width: 1.4em; height: 1.4em; }
.lb-row.is-me { background: linear-gradient(180deg, #63c90a 0 50%, #3f9e05 50% 100%); border-color: var(--ink); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), 0 0 0 2px #c3fb0e, 0 0 .8rem rgba(170,255,60,.4); }
.lb-me { border-top: 3px dashed rgba(190,232,242,.35); margin-top: .4rem; padding-top: .4rem; }

/* ── Perfil ── */
/* Dos columnas que apilan cada una lo suyo (ficha + liga | estadísticas + botones): con poca
   altura los botones Ligas y Ajustes quedaban medio tapados por la navegación inferior. */
.prof { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .9rem 1.1rem; padding: .8rem var(--gutter) 1rem; align-content: start; align-items: start; }
.prof-col { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.prof-card { display: flex; gap: 1rem; padding: .9rem; align-items: center; }
.prof-avatar { --kit: #1f6a7c; width: 8.5rem; aspect-ratio: 1; flex: none; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--kit) 50%, #fff), var(--kit) 48%, color-mix(in srgb, var(--kit) 45%, #000)); box-shadow: 0 4px 0 rgba(0,0,0,.4); }
.prof-canvas { width: 100%; height: 100%; }
.prof-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.prof-nick-row { display: flex; align-items: center; gap: .5rem; }
.prof-nick { margin: 0; font-size: 2.1rem; line-height: 1.05; color: var(--title); --sc: var(--title-ink); --sw: .2em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-flag { display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; min-height: 44px; padding: .2rem .8rem .2rem .4rem; border-radius: 12px; background: rgba(10,8,7,.5); border: 2px solid rgba(0,0,0,.5); font-weight: 800; }
.prof-flag .flag-canvas { width: 2.4rem; }
.prof-flag .ico { width: 1.2rem; height: 1.2rem; opacity: .7; }
.prof-level { display: flex; align-items: center; gap: .6rem; }
.prof-xp { flex: 1; display: flex; flex-direction: column; gap: .2rem; font-weight: 800; font-size: .85rem; }
.prof-league { display: grid; grid-template-columns: 9rem 1fr auto; gap: .9rem; align-items: center; padding: .8rem; cursor: pointer; }
.prof-stadium { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; border: 3px solid var(--ink); }
.prof-league-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; font-weight: 700; font-size: .85rem; }
.prof-league-info > b { font-size: 1.35rem; }
.prof-cups { display: flex; align-items: center; gap: .9rem; }
.prof-cups .amount { font-size: 1.4rem; }
.prof-cups .amount .ico { width: 1.3em; height: 1.3em; }
.prof-go { width: 2rem; height: 2rem; }
.prof-go .ico { width: 100%; height: 100%; }
.prof-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: .7rem; align-content: start; }
.st-tile { display: grid; grid-template-columns: 2.2rem 1fr; grid-template-rows: auto auto; column-gap: .5rem; align-items: center; padding: .45rem .6rem; border-radius: 12px; background: var(--well); border: 1.5px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0,0,0,.45); }
.st-ico { grid-row: span 2; width: 2.2rem; height: 2.2rem; }
.st-ico .ico { width: 100%; height: 100%; }
.st-tile b { font-size: 1.35rem; line-height: 1; }
.st-tile small { font-weight: 700; color: var(--text-dim); font-size: max(11px, .78rem); }
.prof-actions { display: flex; justify-content: center; gap: .8rem; }
.nick-form { display: flex; flex-direction: column; gap: .8rem; }
.welcome-form { gap: .55rem; }
.welcome-q { font-size: 1.2rem; text-align: center; }
.welcome-flags { max-height: min(11rem, 32vh); padding: .2rem; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); }
.nick-help { margin: 0; font-size: .85rem; font-weight: 600; text-align: center; }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .5rem; }
.flag-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 44px; padding: .5rem .3rem; border-radius: 12px; border: 2px solid rgba(0,0,0,.5); background: rgba(10,8,7,.45); font-weight: 800; font-size: .82rem; color: #fff; }
.flag-opt .flag-canvas { width: 3.4rem; }
.flag-opt.active { background: linear-gradient(180deg, #1ac4e4 0%, #0e9fc4 55%, #0a82a6 100%); border-color: var(--ink); box-shadow: inset 0 2px 0 #7cf1ff, 0 3px 0 var(--ink); }

/* ── Camino de ligas ── */
.lg-path-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lg-path { list-style: none; margin: 0; padding: 2rem var(--gutter) 1.2rem; flex: 1; min-height: 0; display: flex; align-items: center; gap: 1.6rem; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
.lg-node {
  position: relative; flex: 0 0 13.5rem; scroll-snap-align: center; display: flex; flex-direction: column; border-radius: 18px; border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12), 0 3px 0 var(--ink), 0 12px 20px rgba(0,0,0,.3);
  animation: rise-in .45s cubic-bezier(.2,1.2,.4,1) backwards; animation-delay: calc(var(--i) * 60ms);
}
.lg-node:not(:last-child)::after { content: ''; position: absolute; right: -1.6rem; top: 34%; width: 1.6rem; height: .5rem; background: repeating-linear-gradient(90deg, #fff3a0 0 .5rem, transparent .5rem .8rem); opacity: .5; }
.lg-node-art { position: relative; aspect-ratio: 16 / 9; border-radius: 15px 15px 0 0; overflow: hidden; border-bottom: 3px solid var(--ink); }
.lg-node-art canvas { width: 100%; height: 100%; }
.lg-node-num { position: absolute; left: .4rem; top: .3rem; font-size: 1.4rem; }
.lg-node-lock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,8,7,.6); }
.lg-node-lock .ico { width: 2.6rem; height: 2.6rem; }
.lg-node-body { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .5rem .5rem .6rem; text-align: center; }
.lg-node-body > b { font-size: 1.1rem; line-height: 1.05; }
.lg-node-cups { font-size: 1.1rem; color: #fff; }
.lg-node-meta { display: flex; flex-direction: column; gap: .1rem; font-size: .78rem; font-weight: 700; color: var(--text-dim); }
.lg-node-meta .amount { color: #fff; font-size: .9rem; }
.lg-node-packs { display: flex; gap: .2rem; justify-content: center; }
.mini-pack { width: 1.9rem; display: flex; flex-direction: column; align-items: center; gap: .05rem; }
.mini-pack .pack-art { width: 1.4rem; height: auto; }
.mini-pack small { font-size: max(10.5px, .68rem); line-height: 1; white-space: nowrap; }
.lg-node.is-locked { filter: saturate(.45) brightness(.8); }
.lg-node.is-here { transform: scale(1.06); border-color: var(--hk-select); box-shadow: 0 0 0 1.5px var(--ink), 0 0 .9rem rgba(45, 227, 245, .75), inset 0 0 0 2px rgba(45, 227, 245, .6), 0 3px 0 var(--ink); }
.lg-here { position: absolute; top: -1.5rem; left: 0; right: 0; margin-inline: auto; width: fit-content; z-index: 2; white-space: nowrap; padding: .1rem .8rem; border-radius: 999px; background: linear-gradient(180deg, #a4f25a, #3fbd1c); border: 3px solid #0c3a04; font-size: .95rem; animation: pulse 1.2s ease-in-out infinite; }

/* ── Sala con amigo ── */
.room { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.room-menu { flex: 1; display: flex; align-items: stretch; align-content: center; justify-content: center; gap: 1.4rem; padding: .8rem var(--gutter) 1.2rem; flex-wrap: wrap; }
.room-card { width: min(100%, 21rem); justify-content: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.2rem 1.1rem; text-align: center; }
.room-card h3 { margin: 0; font-size: 1.8rem; color: var(--title); --sc: var(--title-ink); --sw: .2em; }
.room-card p { margin: 0; font-weight: 700; }
.room-card-ico { width: 4rem; height: 4rem; }
.room-card-ico .ico { width: 100%; height: 100%; }
.room-join { display: flex; gap: .6rem; width: 100%; }
.room-code-input { text-align: center; text-transform: uppercase; letter-spacing: .4em; font-size: 1.6rem; padding-left: 1em; }
.room-lobby { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: .4rem var(--gutter) 1.2rem; }
.room-code-box { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.1rem; font-weight: 700; flex-wrap: wrap; justify-content: center; }
.room-code { display: flex; gap: .4rem; }
.room-letter { display: grid; place-items: center; width: 3.2rem; height: 3.8rem; border-radius: 12px; font-size: 2.4rem; background: linear-gradient(180deg, #fff, #d6def5); color: var(--ink); text-shadow: none; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); animation: pop-in .45s cubic-bezier(.2,1.5,.4,1) both; animation-delay: calc(var(--i) * 80ms); }
.room-players { display: flex; align-items: center; gap: 1.2rem; }
.room-players .pcard { width: 11rem; }
.room-vs { font-size: 2.8rem; color: var(--title); --sc: var(--title-ink); --sw: .18em; }
.room-wait .pcard-art { display: grid; place-items: center; background: rgba(10,8,7,.5); }
.room-wait-q { font-size: 4rem; color: rgba(255,255,255,.3); text-shadow: none; animation: pulse 1.4s ease-in-out infinite; }
.dots i { font-style: normal; animation: dot-blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot-blink { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
.room-status { font-weight: 700; text-align: center; min-height: 1.6rem; }
.room-starts { font-size: 1.7rem; color: #c3fb0e; --sc: #173f00; }

/* ── Torneo ── */
.tr { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.tr-body { flex: 1; display: grid; grid-template-columns: minmax(14rem, 30%) 1fr; gap: 1.2rem; padding: .5rem var(--gutter) 1rem; align-items: start; }
.tr-league { display: grid; grid-template-columns: auto 1fr auto; gap: .4rem; align-items: center; padding: .6rem .45rem; }
.tr-league-view { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; min-width: 0; }
.tr-league-view canvas { width: 100%; aspect-ratio: 16 / 8; border-radius: 12px; border: 3px solid var(--ink); }
.tr-league-view > b { font-size: 1.2rem; }
.tr-entry { font-weight: 700; color: var(--text-dim); }
.tr-entry .amount { color: #fff; font-size: 1.1rem; }
.tr-locked { font-family: var(--font-title); display: inline-flex; align-items: center; gap: .2rem; color: #ffcf7a; }
.tr-main { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.tr-bracket { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 0; }
.tr-link { width: 2rem; height: .5rem; background: rgba(190,232,242,.35); border-block: 2px solid var(--ink); }
.tr-round {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 8.2rem; padding: .7rem .4rem; border-radius: 16px; border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12), 0 3px 0 var(--ink);
  animation: rise-in .4s cubic-bezier(.2,1.2,.4,1) backwards; animation-delay: calc(var(--i) * 90ms);
}
.tr-round-name { font-size: 1.05rem; }
.tr-round-ico { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: rgba(10,8,7,.5); border: 2px solid rgba(0,0,0,.5); }
.tr-round-ico .ico { width: 70%; height: 70%; }
.tr-prize { display: flex; align-items: center; gap: .3rem; font-family: var(--font-title); }
.tr-pack { width: 1.5rem; }
.tr-pack .pack-art { width: 100%; height: auto; }
.tr-won { background: linear-gradient(180deg, #c3fb0e 0 50%, #63dc05 50% 100%); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), inset 0 -4px 0 #3aa000, 0 3px 0 var(--ink); }
.tr-won .tr-round-ico { background: #0c3a04; }
.tr-current, .tr-next-on { background: linear-gradient(180deg, #ffb14a 0 50%, #ff7417 50% 100%); transform: scale(1.08); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.7), inset 0 -4px 0 #c24a06, 0 3px 0 var(--ink), 0 0 22px rgba(255,170,60,.55); }
.tr-lost { background: linear-gradient(180deg, #ff7666 0 50%, #ef3b2f 50% 100%); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.6), inset 0 -4px 0 #b01d14, 0 3px 0 var(--ink); }
.tr-off, .tr-next-off { filter: saturate(.4) brightness(.8); }
.tr-banner { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem 1.2rem; border-radius: 14px; background: var(--slate); border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 1.5px var(--panel-ring); font-weight: 800; }
.tr-banner b { font-size: 1.3rem; }
.tr-banner .ico { width: 1.2em; height: 1.2em; vertical-align: -.25em; }
.tr-champ b { font-size: 2.4rem; color: var(--title); --sc: var(--title-ink); }
.tr-cup { width: 4rem; height: 4rem; animation: pop-big 1s cubic-bezier(.2,1.6,.4,1) both, glow-pulse 1.8s ease-in-out 1s infinite; --glow: #ffd23a; }
.tr-cup .ico { width: 100%; height: 100%; }
.tr-out b { color: #ffb0a8; }
.tr-actions { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.tr-note { margin: 0; font-weight: 800; font-size: .88rem; text-align: center; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 0 5px rgba(0,0,0,.45); }

/* ── Ajustes ── */
.settings { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.settings-body { flex: 1; min-height: 0; padding: .4rem var(--gutter) 1.2rem; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.set-panel { width: min(100%, 50rem); padding: .6rem 1rem; }
.set-row { display: grid; grid-template-columns: 2.4rem 9rem 1fr 4.2rem; align-items: center; gap: .7rem; min-height: 3.4rem; border-bottom: 1.5px solid rgba(255,255,255,.08); }
.set-row:last-child { border-bottom: 0; }
.set-row .toggle { justify-self: start; }
.set-ico { width: 2.1rem; height: 2.1rem; }
.set-ico .ico { width: 100%; height: 100%; }
.set-label { font-weight: 800; font-size: 1.02rem; }
.set-val { text-align: right; }
/* Vista previa del tamaño de los botones táctiles (controls-help.js touchPreviewHTML): un móvil
   apaisado de 780 × 360 con la franja de controles abajo, la pista del joystick a la izquierda y la
   fila de botones a la derecha, todo en % de la pantalla. */
.set-preview { display: flex; align-items: center; gap: 1rem; padding: .4rem 0 .7rem 3.1rem; border-bottom: 1.5px solid rgba(255,255,255,.08); }
.set-preview p { margin: 0; font-size: .84rem; font-weight: 600; line-height: 1.3; }
.touch-preview {
  position: relative; flex: none; width: min(17rem, 60%); aspect-ratio: 780 / 360; overflow: hidden;
  border-radius: 10px; border: 3px solid #0d1117; box-shadow: 0 0 0 1.5px rgba(255,255,255,.25), 0 3px 8px rgba(0,0,0,.35);
  background: linear-gradient(180deg, #13244a 0%, #1c3a6e 30%, #2b4d86 44%, #4f9a3a 56%, #5fb046 100%);
}
.touch-preview i { position: absolute; display: block; }
.touch-preview .tp-strip { background: linear-gradient(180deg, #2c231f 0%, #241c19 55%, #1d1714 100%); box-shadow: inset 0 2px 0 #120a05; transition: top .1s, height .1s; }
.touch-preview .tp-hint { display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); transition: all .1s; }
.touch-preview .tp-hint b { width: 16%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); }
.touch-preview .tp-btn { border-radius: 50%; border: 1.5px solid var(--rim); background: radial-gradient(circle at 50% 32%, var(--hi) 0 36%, var(--lo) 100%); transition: all .1s; }
.set-title { margin: .3rem 0 .6rem; font-size: 1.5rem; color: var(--title); --sc: var(--title-ink); --sw: .2em; }
.howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.howto-col { padding: .7rem .8rem; border-radius: 14px; background: var(--well); border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1), inset 0 3px 7px rgba(0,0,0,.45); }
.howto h4 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: 1.05rem; font-weight: 400; }
.howto h4 .ico { width: 1.5rem; height: 1.5rem; }
.howto-keys { display: grid; grid-template-columns: auto 1fr; gap: .45rem .6rem; margin: 0; align-items: center; font-size: .88rem; }
.howto-keys dt { font-weight: 800; }
.howto-keys dd { margin: 0; line-height: 2.1; }
.kgrp { white-space: nowrap; }
.howto ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.howto-touch { list-style: none; padding: 0 !important; }
.howto-touch li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.howto-touch li > span:last-child { flex: 1 1 9rem; }   /* en una columna estrecha, el texto baja bajo el dibujo */
/* «Cuatro botones»: saltar, tiro alto, tiro bajo y superpoder, a lo ancho de toda la guía. */
.howto-acts {
  grid-column: 1 / -1; padding: .7rem .9rem .8rem; border-radius: 14px;
  background: linear-gradient(100deg, rgba(255,200,58,.2), rgba(91,209,46,.14));
  border: 2px solid rgba(255,226,122,.55); box-shadow: inset 0 2px 6px rgba(0,0,0,.3);
}
.howto-acts h4 { color: var(--gold-2); }
.howto .ha-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem .9rem; }
.ha-item { display: flex; align-items: center; gap: .55rem; }
.ha-txt { display: grid; gap: .05rem; font-size: .84rem; font-weight: 600; line-height: 1.25; }
.ha-txt b { font-size: .95rem; font-weight: 800; }
/* Botón de una acción en pequeño: el color y el glifo del botón táctil del partido (game.css):
   saltar verde, tiro alto azul, tiro bajo naranja y superpoder morado */
.act-chip {
  --hi: var(--hk-teal-hi); --lo: var(--hk-teal-lo); --lip: var(--hk-teal-lip); --rim: #043546;
  position: relative; flex: none; display: inline-grid; place-items: center; width: 2.7rem; height: 2.7rem;
  border-radius: 50%; border: 2px solid var(--rim);
  background: radial-gradient(ellipse 72% 58% at 50% 30%, var(--hi) 0%, var(--hi) 40%, var(--lo) 100%);
  box-shadow: inset 0 -.22rem 0 var(--lip), inset 0 2px 1px rgba(255,255,255,.5), 0 .12rem 0 var(--rim);
}
.act-chip > svg { width: 64%; height: 64%; margin-top: -6%; }
.act-jump  { --hi: var(--hk-green-hi); --lo: var(--hk-green-lo); --lip: var(--hk-green-lip); --rim: #174a00; }
.act-high  { --hi: var(--hk-blue-hi); --lo: var(--hk-blue-lo); --lip: var(--hk-blue-lip); --rim: #06224d; }
.act-low   { --hi: #ffa45c; --lo: #f2581f; --lip: #b3330b; --rim: #561500; }
.act-power { --hi: var(--hk-purple-hi); --lo: var(--hk-purple-lo); --lip: var(--hk-purple-lip); --rim: #300858; box-shadow: inset 0 -.22rem 0 var(--lip), 0 0 0 2px #ffe14a, 0 0 10px rgba(255,225,74,.6); }
.act-power > .ico { width: 62%; height: 62%; }
/* El joystick en pequeño, como su pista en la franja del partido (el sitio del pulgar entre ‹ y ›), y
   los cuatro botones en fila sobre la pizarra de la franja (game.css): superpoder, saltar, tiro alto y
   tiro bajo (el más grande) */
.stick-chip {
  flex: none; display: inline-flex; align-items: center; justify-content: space-between; width: 3.3rem; height: 1.6rem; padding: 0 .3rem;
  border-radius: 999px; background: #241c19; border: 1.5px solid rgba(255,255,255,.32); box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
.stick-chip .gm-chev { width: auto; height: 58%; overflow: visible; }
.stick-chip .gm-chev path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stick-chip .gm-chev .o { stroke: none; }
.stick-chip .gm-chev .i { stroke: rgba(255,255,255,.75); stroke-width: 3.2; }
.stick-chip .gm-stick-spot { width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); }
.act-row { flex: none; display: inline-flex; align-items: center; gap: .15rem; padding: .22rem .3rem; border-radius: 9px; background: #241c19; box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.act-row .act-chip { width: 1.6rem; height: 1.6rem; border-width: 1.5px; }
.act-row .act-low { width: 1.75rem; height: 1.75rem; }
.set-foot { margin: 0; font-size: .8rem; font-weight: 600; }

/* ── Móvil apaisado ── */
@media (max-height: 500px) and (orientation: landscape) {
  .shop { gap: .5rem; }
  .offer { width: 8rem; padding: .4rem .4rem .5rem; }
  .offer-art { aspect-ratio: 1.35; }
  .offer-name { font-size: .88rem; min-height: 0; }
  .lb { gap: .3rem; padding-top: .35rem; }
  .lb-head .ribbon { font-size: 1.4rem; }
  .lb-panel { padding: .35rem; }
  .lb-row { min-height: 2.6rem; grid-template-columns: 2.4rem 2.3rem minmax(0, 1fr) auto auto 5.8rem; }
  .lb-league { display: none; }
  .lb-avatar { width: 2.3rem; height: 2.3rem; }
  .prof { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem .8rem; padding: .5rem var(--gutter) .6rem; }
  .prof-col { gap: .5rem; }
  .prof-card { padding: .55rem .7rem; gap: .7rem; }
  .prof-id { gap: .3rem; }
  .prof-avatar { width: 5.2rem; }
  .prof-nick { font-size: 1.4rem; }
  .prof-level .level-badge { width: 2.4rem; height: 2.4rem; }
  .prof-level .level-badge b { font-size: 1rem; }
  .prof-league { grid-template-columns: 5.2rem 1fr auto; gap: .6rem; padding: .45rem .55rem; }
  .prof-league-info > .t-dim:first-child { display: none; }
  .prof-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; padding: .45rem; }
  .st-tile { grid-template-columns: 1.7rem 1fr; column-gap: .35rem; padding: .25rem .4rem; }
  .st-ico { width: 1.7rem; height: 1.7rem; }
  .st-tile b { font-size: 1.15rem; }
  .prof-actions .btn { flex: 1 1 0; }
  .lg-path { padding-top: 1.7rem; }
  .lg-node { flex-basis: 11.5rem; }
  .lg-node-meta { display: none; }
  /* Sala compacta: con poca altura, «Crear sala» y «Salir de la sala» quedaban medio tapados
     por la navegación inferior (9-12 px de 44-50 en 667×375). */
  .room-menu { gap: .9rem; padding: .2rem var(--gutter) .6rem; align-content: start; }
  .room-card { padding: .6rem .9rem .7rem; gap: .3rem; }
  .room-card-ico { width: 2.5rem; height: 2.5rem; }
  .room-card h3 { font-size: 1.25rem; }
  .room-card p { font-size: .9rem; line-height: 1.25; }
  .room-card .btn-lg { font-size: 1.2rem; padding: .4em 1.3em .6em; }
  .room-code-input { font-size: 1.3rem; min-height: 44px; }
  .room-letter { width: 2.4rem; height: 2.9rem; font-size: 1.8rem; }
  .room-lobby {
    display: grid; grid-template-columns: auto auto; grid-template-areas: "code players" "status players" "leave players";
    align-content: center; justify-content: center; align-items: center; gap: .4rem 1.6rem; padding-bottom: .6rem;
  }
  .room-code-box { grid-area: code; display: grid; grid-template-columns: auto auto; gap: .35rem .6rem; padding: .45rem .7rem; }
  .room-code-box > .t-dim { grid-column: 1 / -1; text-align: center; }
  .room-players { grid-area: players; }
  .room-status { grid-area: status; }
  .room-lobby > .btn { grid-area: leave; justify-self: center; }
  .room-players .pcard { width: 10rem; }
  .room-players .pcard-art { aspect-ratio: 1.25; }
  .tr-body { grid-template-columns: minmax(12rem, 32%) 1fr; padding-top: .2rem; }
  .tr-league-view canvas { aspect-ratio: 16 / 6.5; }
  .tr-main { display: grid; grid-template-columns: auto auto; grid-template-areas: "bracket bracket" "banner actions"; justify-content: center; align-items: center; gap: .6rem 1rem; }
  .tr-bracket { grid-area: bracket; }
  .tr-main > .tr-banner { grid-area: banner; }
  .tr-actions { grid-area: actions; flex-direction: column; align-items: stretch; gap: .45rem; }
  .tr-main.no-banner { grid-template-columns: auto; grid-template-areas: "bracket" "actions"; }
  .tr-main.no-banner .tr-actions { flex-direction: row; }
  .tr-round { width: 7rem; padding: .35rem .3rem; gap: .15rem; }
  .tr-round-ico { width: 2rem; height: 2rem; }
  .tr-banner { padding: .3rem 1rem; }
  .tr-banner b { font-size: 1.1rem; }
  .tr-champ b { font-size: 1.6rem; }
  .tr-cup { width: 2.8rem; height: 2.8rem; }
  .tr-note { display: none; }
  .set-row { min-height: 2.9rem; }
  /* Bienvenida (apodo y bandera): con la cabecera de la ventana, «¡Listo!» tiene que caber sin desplazar. */
  .welcome-form { gap: .3rem; }
  .welcome-q { font-size: 1.05rem; }
  .welcome-flags { max-height: 22vh; }
  .nick-form .input { min-height: 44px; padding-block: .2em; }
  .packslot { grid-template-columns: 8rem 1fr; }
  .daily-track { gap: .3rem; }
  .dr-art { width: 2rem; height: 2rem; }
}

/* ── Vertical ── */
@media (orientation: portrait) {
  .lb-row { grid-template-columns: 2.2rem 2.4rem minmax(0, 1fr) auto 5.2rem; gap: .4rem; }
  .lb-row .lb-level { display: none; }
  .prof { grid-template-columns: 1fr; }
  .prof-avatar { width: 6.5rem; }
  .prof-league { grid-template-columns: 6.5rem 1fr auto; }
  .lg-path { flex-direction: column; align-items: stretch; overflow-x: hidden; overflow-y: auto; gap: 2rem; scroll-snap-type: y proximity; }
  .lg-node { flex: none; flex-direction: row; }
  .lg-node-art { width: 45%; aspect-ratio: auto; border-radius: 15px 0 0 15px; border-bottom: 0; border-right: 3px solid var(--ink); }
  .lg-node-body { flex: 1; align-items: flex-start; text-align: left; }
  .lg-node:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -2rem; width: .5rem; height: 2rem; background: repeating-linear-gradient(180deg, #fff3a0 0 .5rem, transparent .5rem .8rem); }
  .room-code-box { flex-direction: column; gap: .5rem; max-width: 100%; }
  .room-players { gap: .5rem; }
  .room-players .pcard { width: 8.5rem; }
  .room-vs { font-size: 1.6rem; }
  .tr-body { grid-template-columns: 1fr; }
  .tr-round { width: 6.2rem; }
  .tr-link { width: .8rem; }
  .set-row { grid-template-columns: 2.2rem 1fr auto; row-gap: 0; }
  .set-row .range { grid-column: 1 / -1; }
  .set-row .set-val { grid-row: 1; grid-column: 3; }
  .set-preview { padding-left: 0; flex-wrap: wrap; }
  .touch-preview { width: min(17rem, 100%); }
  .howto { grid-template-columns: 1fr; }
  .howto .ha-list { grid-template-columns: 1fr; }
  .packslot { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .packslot-art { width: 8rem; }
  .packslot-actions { justify-content: center; }
  .daily-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls-2p { grid-template-columns: 1fr; }
  .ctl-vs { text-align: center; }
  .quest { grid-template-columns: 2.2rem 1fr auto; }
  .quest-reward { grid-column: 2; grid-row: 2; }
}

/* ── Celebraciones a pantalla completa (ui/celebrations.js): mejora y campeón ── */
.cel-root {
  --cel: #ffc83a; --cel-l: #fff0b0;
  position: fixed; inset: 0; z-index: 84; overflow: hidden; display: grid; place-items: center; cursor: pointer;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 16px);
  animation: fade-in .22s both;
}
.cel-root.closing { animation: fade-in .22s reverse both; }
.cel-bg { position: absolute; inset: 0; }
.cel-bg.hk-bg { --sy: 45%; --sw: 54%; --sh: 76%; }
.cel-bg .hk-bg__rays { display: none !important; }   /* los rayos son los de .cel-rays, centrados en el premio */
.cel-rays {
  position: absolute; left: 50%; top: 45%; width: 200vmax; height: 200vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cel-l) 55%, transparent) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 3%, rgba(0,0,0,.55) 14%, transparent 34%); mask-image: radial-gradient(circle, #000 3%, rgba(0,0,0,.55) 14%, transparent 34%);
  animation: spin-c 22s linear infinite; pointer-events: none;
}
.cel-body { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 3rem); max-width: 60rem; max-height: 100%; }
.cel-info { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; min-width: 0; }
.cel-title { margin: 0; font-size: 3rem; line-height: 1; color: var(--title); --sc: var(--title-ink); --sw: .2em; --sd: .09em; animation: pop-in .5s .1s cubic-bezier(.2,1.5,.4,1) both; }
.cel-title-xl { font-size: 3.4rem; }
.cel-name { font-size: 1.5rem; line-height: 1.05; animation: fade-in .3s .2s both; }
.cel-art {
  --kit: #1f6a7c; position: relative; flex: none; width: min(46vh, 17rem); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 5px solid var(--ink);
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--kit) 50%, #fff) 0%, var(--kit) 50%, color-mix(in srgb, var(--kit) 50%, #000) 100%);
  box-shadow: 0 0 0 6px var(--cel), 0 0 50px var(--cel-l), 0 12px 0 rgba(0,0,0,.35);
  animation: cel-art-in .55s cubic-bezier(.2,1.45,.4,1) both;
}
.cel-art canvas { width: 100%; height: 100%; }
.cel-art.is-item canvas { width: 76%; height: 76%; margin: 12%; }
/* Personaje: la ficha completa sobre el foco dorado (ver .spot en ui.css), sin medallón. */
.cel-art-char { width: min(56vh, 20rem); aspect-ratio: .9; border-radius: 0; overflow: visible; border: 0; background: none; box-shadow: none; }
.cel-art-char canvas { position: absolute; left: 0; top: -4cqh; width: 100%; height: 100cqh; }
@keyframes cel-art-in { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cel-level { display: flex; align-items: center; gap: .5rem; font-size: 2rem; }
.cel-lv { line-height: 1; }
.cel-lv-new { color: #c3fb0e; --sc: #173f00; }
.cel-lv-new b { display: inline-block; min-width: 1.2ch; font-weight: 400; }
.cel-arrow { width: 1.6rem; height: 1.6rem; }
.cel-arrow .ico { width: 100%; height: 100%; }
.cel-level.pop .cel-lv-new { animation: pop-big .6s cubic-bezier(.2,1.6,.4,1); }
.cel-stats { list-style: none; margin: .2rem 0 0; padding: .5rem .8rem; display: grid; gap: .35rem; width: min(24rem, 60vw); background: var(--well); border-radius: var(--r-md); box-shadow: inset 0 3px 7px rgba(0,0,0,.5); }
.cel-stats li { position: relative; display: grid; grid-template-columns: 5.6rem 1fr 2.8rem; align-items: center; gap: .6rem; }
.cel-st-label { font-weight: 800; font-size: max(11px, .92rem); }
.cel-st-track { position: relative; height: 1.05rem; border-radius: 999px; background: #1d1b1d; border: 1.5px solid var(--ink); overflow: hidden; }
.cel-st-track i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 100%); background: linear-gradient(180deg, #56e6ff 0 50%, #16b3dd 50% 100%); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 1.5px 0 0 var(--ink); transition: width .3s cubic-bezier(.2,.8,.2,1); }
.cel-stats li.done .cel-st-track i { background: linear-gradient(180deg, #c3fb0e 0 50%, #5fd906 50% 100%); }
.cel-st-val { text-align: right; font-size: 1rem; }
.cel-st-add { position: absolute; right: 3.2rem; top: 50%; font-size: 1.05rem; color: var(--cyan); --sc: var(--ink); opacity: 0; pointer-events: none; }
.cel-stats li.done .cel-st-add { animation: cel-float 1s ease-out both; }
@keyframes cel-float { 0% { opacity: 0; transform: translateY(-20%); } 25% { opacity: 1; transform: translateY(-60%); } 100% { opacity: 0; transform: translateY(-190%); } }
.cel-ok { margin-top: .4rem; opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .2s, transform .35s cubic-bezier(.2,1.6,.4,1); }
.cel-root.finished .cel-ok { opacity: 1; transform: none; pointer-events: auto; }
/* Campeón */

.cel-trophy { flex: none; width: min(40vh, 14rem); aspect-ratio: 1; filter: drop-shadow(0 0 30px rgba(255,210,60,.9)) drop-shadow(0 10px 0 rgba(0,0,0,.35)); animation: cel-trophy-in 1s cubic-bezier(.2,1.3,.4,1) both, float 2.4s ease-in-out 1s infinite; }
.cel-trophy .ico { width: 100%; height: 100%; }
@keyframes cel-trophy-in { 0% { transform: scale(.1) rotateY(0); opacity: 0; } 60% { transform: scale(1.15) rotateY(540deg); opacity: 1; } 100% { transform: scale(1) rotateY(720deg); } }
.cel-loot { display: flex; align-items: center; gap: 1rem; margin-top: .3rem; }
.cel-pack { width: 3.6rem; opacity: 0; transform: translateY(40px) scale(.4) rotate(-20deg); transition: opacity .3s, transform .5s cubic-bezier(.2,1.5,.4,1); }
.cel-pack .pack-art { width: 100%; height: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.cel-root.show-packs .cel-pack { opacity: 1; transform: none; animation: pack-bob 1.2s ease-in-out .5s infinite; }

@media (max-height: 500px) and (orientation: landscape) {
  .cel-title { font-size: 1.9rem; }
  .cel-title-xl { font-size: 2.5rem; }
  .cel-name { font-size: 1.15rem; }
  .cel-level { font-size: 1.5rem; }
  .cel-art { width: min(52vh, 12rem); }
  .cel-art-char { width: min(60vh, 13rem); }
  .cel-stats { gap: .2rem; padding: .35rem .6rem; }
  .cel-info { gap: .3rem; }
  .cel-ok { margin-top: .1rem; }
}
@media (orientation: portrait) {
  .cel-body { flex-direction: column; text-align: center; }
  .cel-info { align-items: center; }
  .cel-art { width: min(58vw, 15rem); }
  .cel-art-char { width: min(64vw, 17rem); }
  .cel-stats { width: min(24rem, 86vw); }
}
