/* Pokémon LAN Party · paleta sacada de la pantalla de título:
   noche azul-violeta, letras violeta metálico y cables de fibra cian. */
:root {
  --night: #070818;
  --bg: #0b0b1f;
  --bg2: #110f2b;
  --card: rgba(26, 20, 60, .72);
  --card2: rgba(40, 30, 86, .7);
  --solid: #17133a;
  --line: rgba(124, 92, 220, .28);
  --line2: rgba(124, 92, 220, .5);
  --text: #ece8ff;
  --muted: #9a92c7;
  --violet: #8b5cf6;
  --violet2: #c4a2ff;
  --plum: #3b1d6e;
  --cyan: #38e1ff;
  --cyan2: #8ff0ff;
  --amber: #ffb547;
  --rose: #ff4f8b;
  --good: #3ee59a;
  --warn: #ffc24a;
  --bad: #ff5a7a;
  --info: #38e1ff;
  --radius: 14px;
  --glow-c: 0 0 0 1px rgba(56,225,255,.35), 0 0 18px rgba(56,225,255,.18);
  --glow-v: 0 0 0 1px rgba(139,92,246,.45), 0 0 22px rgba(139,92,246,.22);
  --font: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --brand: "Bungee", "Chakra Petch", Impact, sans-serif;
  font-family: var(--font);
  font-size: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; color: var(--text); line-height: 1.45; background: transparent; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--cyan); }
h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: .6px; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(var(--cyan), var(--violet)); box-shadow: 0 0 10px var(--cyan); }
h3 { font-size: 12px; margin: 0 0 8px; color: var(--violet2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }

/* Cielo nocturno con rejilla tenue (sala LAN) y halos de luz */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(139,92,246,.28), transparent 60%),
    radial-gradient(700px 420px at 95% 10%, rgba(56,225,255,.14), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(110,40,180,.25), transparent 60%),
    linear-gradient(180deg, #0c0b24 0%, #070818 100%); }
.sky::after { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(124,92,220,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(124,92,220,.07) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }

/* ---------- cabecera con el logo del juego ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line2); }
.hero-bg { position: absolute; inset: -30px; background: url(/asset/splash) center 35% / cover no-repeat; filter: blur(14px) saturate(1.2) brightness(.55); transform: scale(1.05); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,8,24,.2) 0%, rgba(7,8,24,.55) 45%, rgba(7,8,24,.85) 100%); pointer-events: none; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--cyan), transparent); box-shadow: 0 0 14px var(--cyan); opacity: .8; }
.hero-inner { position: relative; z-index: 1; max-width: 1500px; margin: 0 auto; padding: 14px 22px 16px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.logo { --s: .74; width: calc(354px * var(--s)); height: calc(198px * var(--s)); flex: none;
  background: url(/asset/splash) no-repeat; background-size: calc(512px * var(--s)) calc(384px * var(--s));
  background-position: calc(-78px * var(--s)) calc(-138px * var(--s));
  mask-image: radial-gradient(ellipse 50% 50% at 47% 52%, #000 45%, transparent 98%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 47% 52%, #000 45%, transparent 98%);
  filter: drop-shadow(0 0 18px rgba(139,92,246,.45)); }
.hero-main { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 8px; }
.kicker { font-family: var(--brand); font-size: 13px; letter-spacing: 3px; color: var(--cyan2); text-shadow: 0 0 12px rgba(56,225,255,.6); display: flex; align-items: center; gap: 8px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan), 0 0 3px #fff inset; animation: pulse 2.4s infinite; }
.trainer { display: flex; flex-direction: column; gap: 8px; }
.trainer .name { font-family: var(--brand); font-size: 26px; line-height: 1; letter-spacing: 1px;
  background: linear-gradient(180deg, #f3e9ff 0%, #c4a2ff 45%, #7c4ad6 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #1b0b3a) drop-shadow(0 0 10px rgba(139,92,246,.5)); }
.trainer .facts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fact { background: rgba(10,8,30,.55); border: 1px solid var(--line2); border-radius: 99px; padding: 3px 11px; font-size: 12px; color: var(--muted); backdrop-filter: blur(6px); }
.fact b { color: var(--text); }
.fact.cap { border-color: rgba(255,194,74,.55); color: var(--warn); }
.badges { display: flex; gap: 4px; }
.bdg { width: 34px; height: 34px; object-fit: contain; filter: grayscale(1) brightness(.4) contrast(.9); opacity: .55; transition: filter .3s, opacity .3s, transform .2s; }
.bdg.on { filter: drop-shadow(0 0 7px rgba(255,181,71,.6)); opacity: 1; }
.bdg.on:hover { transform: scale(1.15); }
.hero .status { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-start; }
.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(10,8,30,.6); color: var(--muted); border: 1px solid var(--line2); letter-spacing: .3px; backdrop-filter: blur(6px); white-space: nowrap; }
.pill.on { color: var(--good); border-color: rgba(62,229,154,.5); box-shadow: 0 0 12px rgba(62,229,154,.18); }
.pill.on::before, .pill.fight::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; margin-right: 7px; vertical-align: 1px; }
.pill.fight { color: #ff9ab4; border-color: rgba(255,79,139,.6); box-shadow: 0 0 14px rgba(255,79,139,.25); animation: pulse 1.6s infinite; }
.pill.warn { color: var(--warn); border-color: rgba(255,194,74,.5); }

/* ---------- pestañas ---------- */
.tabs { display: flex; align-items: center; gap: 14px; padding: 8px 22px; background: rgba(11,10,31,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; overflow-x: auto; transition: padding .2s, background .2s; }
.navbrand { position: absolute; left: 22px; top: 50%; transform: translate(-6px, -50%); font-family: var(--brand); font-size: 13px; letter-spacing: 1px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  background: linear-gradient(90deg, var(--violet2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.stuck .navbrand { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1340px) { .navbrand { display: none; } }
body.stuck .tabs { background: rgba(11,10,31,.94); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tgroups { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.tgroup { display: flex; gap: 2px; padding: 3px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.tsep { width: 4px; height: 4px; border-radius: 50%; background: var(--line2); flex: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid transparent; border-radius: 11px; padding: 7px 12px;
  color: var(--muted); cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; letter-spacing: .2px; white-space: nowrap; transition: color .15s, background .15s, border-color .15s; }
.tab:hover { color: var(--text); background: rgba(124,92,220,.14); }
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.tab.active { color: #fff; background: linear-gradient(180deg, rgba(56,225,255,.2), rgba(139,92,246,.26)); border-color: rgba(56,225,255,.55);
  box-shadow: 0 0 16px rgba(56,225,255,.2), inset 0 1px 0 rgba(255,255,255,.12); }
.tab.active .navico { color: var(--cyan2); filter: drop-shadow(0 0 6px rgba(56,225,255,.7)); }
.navico { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.navico svg { width: 100%; height: 100%; }
.tmark { position: absolute; top: -6px; right: -8px; font-style: normal; }
.tmark.live, .tmark.dotonly { top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 8px var(--rose); animation: pulse 1.2s infinite; }
.tmark.dotonly { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: none; }
.tmark.n { min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center; color: #0b0a1f; }
.tmark.n.on { background: var(--good); box-shadow: 0 0 8px rgba(62,229,154,.6); }
.tmark.n.warn { background: var(--warn); box-shadow: 0 0 8px rgba(255,194,74,.5); }
.tmark.live + .tmark.n, .tmark.n + .tmark.n { right: auto; left: -8px; }
/* Pantallas medianas: iconos, y el nombre solo en la sección abierta. */
@media (max-width: 1180px) {
  .tabs { gap: 8px; padding: 7px 14px; }
  .tab { padding: 7px 10px; }
  .tab:not(.active) .tlabel { display: none; }
}
/* Móvil: barra de abajo con las 4 principales y «Más». */
.dock { display: none; }
@media (max-width: 700px) {
  .tabs { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .dock { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; }
  .dbar { display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(13,11,36,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line2); box-shadow: 0 -8px 24px rgba(0,0,0,.45); position: relative; z-index: 2; }
  .dtab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px 4px; background: none; border: none; border-radius: 12px; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .dtab .navico { width: 22px; height: 22px; }
  .dtab .tlabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dtab.active { color: #fff; background: linear-gradient(180deg, rgba(56,225,255,.16), rgba(139,92,246,.22)); }
  .dtab.active .navico { color: var(--cyan2); filter: drop-shadow(0 0 6px rgba(56,225,255,.7)); }
  .dtab.more.open { color: var(--text); }
  .dsheet-bg { position: fixed; inset: 0; background: rgba(5,4,16,.55); backdrop-filter: blur(2px); z-index: 1; }
  .dsheet { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); z-index: 1; padding: 12px 12px 14px; margin-bottom: 0;
    background: #120f2e; border: 1px solid var(--line2); border-radius: 18px 18px 14px 14px; box-shadow: 0 -12px 40px rgba(0,0,0,.6), 0 0 24px rgba(139,92,246,.2);
    animation: sheet-up .18s ease-out; }
  .dock .dsheet { position: fixed; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .dsheet-g + .dsheet-g { margin-top: 10px; }
  .dsheet h4 { margin: 0 0 6px 4px; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--violet2); }
  .dsheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stab { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; text-align: left; }
  .stab .navico { width: 20px; height: 20px; color: var(--violet2); }
  .stab.active { border-color: rgba(56,225,255,.55); background: linear-gradient(180deg, rgba(56,225,255,.14), rgba(139,92,246,.2)); }
  .stab.active .navico { color: var(--cyan2); }
}
@keyframes sheet-up { from { transform: translateY(14px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }

.view { padding: 20px 22px 40px; max-width: 1500px; margin: 0 auto; }
.grid { display: grid; gap: 16px; }
.cols2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.cols3 { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }
@media (max-width: 520px) { .cols2, .cols3 { grid-template-columns: 1fr; } .view { padding: 14px; } .logo { --s: .45; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.panel.flat { background: rgba(10,8,30,.5); box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); font-size: 15px; }
.empty::before { content: ""; display: block; width: 46px; height: 46px; margin: 0 auto 14px; background: url(/asset/ball) center / contain no-repeat; image-rendering: pixelated; opacity: .8; filter: drop-shadow(0 0 10px rgba(139,92,246,.6)); }
.banner { padding: 11px 15px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; backdrop-filter: blur(8px); }
.banner b { font-size: 15px; letter-spacing: .3px; }
.banner.good { border-color: rgba(62,229,154,.55); background: linear-gradient(90deg, rgba(62,229,154,.16), rgba(26,20,60,.6)); box-shadow: 0 0 18px rgba(62,229,154,.12); }
.banner.good b { color: var(--good); }
.banner.bad { border-color: rgba(255,90,122,.55); background: linear-gradient(90deg, rgba(255,90,122,.16), rgba(26,20,60,.6)); }
.banner.bad b { color: var(--bad); }
.banner.warn { border-color: rgba(255,194,74,.55); background: linear-gradient(90deg, rgba(255,194,74,.14), rgba(26,20,60,.6)); }
.banner.warn b { color: var(--warn); }
.banner.info { border-color: rgba(56,225,255,.45); background: linear-gradient(90deg, rgba(56,225,255,.12), rgba(26,20,60,.6)); }
.banner.info b { color: var(--cyan2); }

/* ---------- tipos (iconos del juego) ---------- */
.ticon { display: inline-block; width: 48px; height: 21px; flex: none; vertical-align: middle; background: url(/asset/types) no-repeat; background-size: 48px auto; background-position: 0 calc(var(--i) * -21px); image-rendering: pixelated; border-radius: 4px; }
.type { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.5); letter-spacing: .3px; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18); }
.mult { display: inline-block; min-width: 36px; text-align: center; padding: 1px 6px; border-radius: 5px; font-weight: 700; font-size: 12px; }
.m0 { background: #2a2745; color: #a7a2c9; }
.m25 { background: rgba(62,229,154,.22); color: #8ff7c6; }
.m50 { background: rgba(62,229,154,.14); color: #9ff3cf; }
.m100 { background: transparent; color: var(--muted); }
.m200 { background: rgba(255,90,122,.22); color: #ffb2c1; }
.m400 { background: #c2234a; color: #fff; box-shadow: 0 0 10px rgba(255,79,139,.5); }
.caticon { display: inline-block; width: 40px; height: 17.5px; vertical-align: middle; background: url(/asset/category) no-repeat; background-size: 40px auto; background-position: 0 calc(var(--i) * -17.5px); image-rendering: pixelated; }

/* ---------- sprites ---------- */
.icon { width: 64px; height: 64px; flex: none; background-repeat: no-repeat; background-size: 200% 100%; image-rendering: pixelated; animation: icon 0.6s steps(2) infinite; }
.icon.sm { width: 40px; height: 40px; }
@keyframes icon { to { background-position-x: 200%; } }
.icon.dead, .front.dead { filter: grayscale(1) brightness(.5); animation-play-state: paused; }
.front { flex: none; background-repeat: no-repeat; image-rendering: pixelated; }
.front.anim { animation: strip var(--dur) steps(var(--frames)) infinite; }
@keyframes strip { to { background-position-x: calc(var(--frames) * var(--size) * -1px); } }
.egg { width: 64px; height: 64px; display: grid; place-items: center; font-size: 30px; }

/* ---------- tarjetas pokémon ---------- */
.mon { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 11px; position: relative; backdrop-filter: blur(10px); transition: border-color .2s, box-shadow .2s; }
.mon:hover { border-color: var(--line2); box-shadow: var(--glow-v); }
.mon.isdead { border-color: rgba(255,90,122,.5); background: linear-gradient(180deg, rgba(255,90,122,.1), var(--card) 45%); }
.mon .head { display: flex; gap: 12px; align-items: center; }
.mon .head .front { border-radius: 12px; background-color: rgba(10,8,30,.45); box-shadow: inset 0 0 0 1px var(--line), inset 0 -24px 30px -20px rgba(56,225,255,.18); }
.mon .title { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.mon .sub { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(10,8,30,.5); border: 1px solid var(--line2); color: var(--muted); }
.badge.dead { background: rgba(255,90,122,.16); color: #ffa6b8; border-color: rgba(255,90,122,.55); }
.badge.alive { background: rgba(62,229,154,.12); color: var(--good); border-color: rgba(62,229,154,.45); }
.badge.cap { background: rgba(255,194,74,.14); color: var(--warn); border-color: rgba(255,194,74,.55); }
.badge.status { background: #6b3fd1; color: #f1e8ff; border-color: transparent; }
.shiny { color: #ffd54a; text-shadow: 0 0 8px rgba(255,213,74,.7); }
.hp { height: 8px; background: rgba(5,4,18,.8); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(124,92,220,.25); }
.hp > i { display: block; height: 100%; border-radius: 99px; transition: width .5s; box-shadow: 0 0 10px currentColor; }
.hptext { font-size: 12px; color: var(--muted); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding-top: 1px; }
.stats { display: grid; grid-template-columns: 36px 30px 1fr 38px; gap: 4px 8px; align-items: center; font-size: 12px; }
.stats .bar { height: 6px; background: rgba(5,4,18,.8); border-radius: 99px; overflow: hidden; }
.stats .bar i { display: block; height: 100%; border-radius: 99px; }
.stats .up { color: #ff9ab4; font-weight: 700; }
.stats .down { color: #8fd8ff; font-weight: 700; }
.stats .val { text-align: right; font-weight: 700; }

table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--violet2); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(139,92,246,.07); }
.moves td { font-size: 13px; }
.moves .mname { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.defgrid { display: grid; grid-template-columns: 44px 1fr; gap: 6px 10px; align-items: center; font-size: 12px; }
details > summary { cursor: pointer; color: var(--violet2); font-size: 12px; font-weight: 600; user-select: none; letter-spacing: .3px; }
details[open] > summary { margin-bottom: 8px; }
.desc { color: var(--muted); font-size: 12px; }

/* ---------- combate ---------- */
.battle { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; position: relative; }
@media (max-width: 1000px) { .battle { grid-template-columns: 1fr; } }
.side h2 { display: flex; align-items: center; gap: 8px; }
.foe { border-color: rgba(255,79,139,.4); box-shadow: 0 0 0 1px rgba(255,79,139,.12), 0 0 30px rgba(255,79,139,.08); }
.foe:hover { box-shadow: 0 0 0 1px rgba(255,79,139,.4), 0 0 26px rgba(255,79,139,.18); }
.own { border-color: rgba(56,225,255,.4); box-shadow: 0 0 0 1px rgba(56,225,255,.12), 0 0 30px rgba(56,225,255,.08); }
.own:hover { box-shadow: var(--glow-c); }
.bigsprite { display: grid; place-items: center; min-width: 116px; min-height: 104px; border-radius: 50%;
  background: radial-gradient(ellipse 50% 22% at 50% 82%, rgba(56,225,255,.25), transparent 70%); }
.foe .bigsprite { background: radial-gradient(ellipse 50% 22% at 50% 82%, rgba(255,79,139,.25), transparent 70%); }
.stagechips { display: flex; gap: 4px; flex-wrap: wrap; }
.stage { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; }
.stage.pos { background: rgba(255,154,180,.16); color: #ff9ab4; }
.stage.neg { background: rgba(143,216,255,.16); color: #8fd8ff; }
.unknown { color: var(--muted); font-style: italic; }
.ko { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 5px; letter-spacing: .5px; }
.ko.sure { background: #c2234a; color: #fff; box-shadow: 0 0 10px rgba(255,79,139,.55); }
.ko.maybe { background: rgba(255,194,74,.2); color: var(--warn); }
.dmg { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
tr.best { background: linear-gradient(90deg, rgba(62,229,154,.12), transparent); box-shadow: inset 3px 0 0 var(--good); }
.partyballs { display: flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 99px; background: rgba(10,8,30,.55); border: 1px solid var(--line); }
.pb { width: 20px; height: 20px; background: url(/asset/ball) center / contain no-repeat; image-rendering: pixelated; }
.pb.out { background-image: url(/asset/ballfainted); }
.pb.unk { background-image: url(/asset/ballempty); opacity: .7; }
.seenrow { display: flex; gap: 8px; flex-wrap: wrap; }
.seenmon { display: flex; align-items: center; gap: 4px; background: rgba(10,8,30,.55); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px 2px 2px; font-size: 12px; }

/* ---------- caja ---------- */
.boxes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.boxgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.slot { aspect-ratio: 1; background: rgba(10,8,30,.55); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.slot:hover { border-color: var(--cyan); box-shadow: var(--glow-c); transform: translateY(-1px); }
.slot .lv { position: absolute; bottom: 1px; right: 5px; font-size: 10px; color: var(--muted); font-weight: 700; }
.slot.isdead { border-color: rgba(255,90,122,.55); background: rgba(255,90,122,.08); }
.slot .x { position: absolute; top: 1px; left: 5px; font-size: 11px; color: var(--bad); font-weight: 800; }
.slot.hidden { opacity: .12; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); background: rgba(13,11,36,.96); border-left: 1px solid var(--line2); z-index: 10; overflow-y: auto; padding: 18px; box-shadow: -20px 0 50px rgba(0,0,0,.6), -1px 0 20px rgba(139,92,246,.2); backdrop-filter: blur(14px); }
.drawer .close { float: right; }

/* ---------- formularios ---------- */
.btn { background: rgba(40,30,86,.8); border: 1px solid var(--line2); border-radius: 9px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--cyan); box-shadow: var(--glow-c); }
.btn.primary { background: linear-gradient(180deg, #9a6bff, #6a35d6); border-color: #a98bff; color: #fff; }
.btn.primary:hover { box-shadow: var(--glow-v); }
.btn.small { padding: 3px 9px; font-size: 12px; }
input[type=text], input[type=number], input[type=search], input:not([type]), select { background: rgba(7,6,22,.75); border: 1px solid var(--line2); border-radius: 9px; padding: 6px 10px; }
input:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-c); }
input[type=checkbox] { accent-color: var(--violet); width: 16px; height: 16px; }
label.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: 2px; }

/* ---------- nuzlocke ---------- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: relative; overflow: hidden; backdrop-filter: blur(10px); }
.counter::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--violet), var(--cyan)); opacity: .8; }
.counter b { display: block; font-family: var(--brand); font-size: 24px; font-weight: 400; background: linear-gradient(180deg, #fff, var(--violet2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.res { font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.res.ok { background: rgba(62,229,154,.14); color: var(--good); }
.res.fail { background: rgba(255,90,122,.15); color: #ffa6b8; }
.res.pend { background: rgba(56,225,255,.12); color: var(--cyan2); }
.res.live { background: rgba(255,194,74,.15); color: var(--warn); }
.res.none { background: rgba(10,8,30,.55); color: var(--muted); }
.areas td { font-size: 13px; }
.areas tr.cur { background: linear-gradient(90deg, rgba(56,225,255,.12), transparent); box-shadow: inset 3px 0 0 var(--cyan); }
.grave { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.tomb { background: linear-gradient(135deg, rgba(255,90,122,.08), var(--card)); border: 1px solid rgba(255,90,122,.35); border-radius: var(--radius); padding: 12px; display: flex; gap: 12px; align-items: center; }
.log li { padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log { list-style: none; padding: 0; margin: 0; max-height: 440px; overflow-y: auto; }
.teamtable td, .teamtable th { text-align: center; padding: 4px; }
.teamtable td:first-child, .teamtable th:first-child { text-align: left; }
.danger-row td { background: rgba(255,90,122,.09); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(124,92,220,.35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- desplegables con clic ---------- */
.clickable { cursor: pointer; user-select: none; }
.clickable:hover .mname, span.clickable:hover b { color: var(--cyan2); }
.caret { color: var(--violet2); font-size: 10px; }
tr.descrow td { background: rgba(10,8,30,.55); color: var(--muted); font-size: 12px; border-left: 2px solid var(--violet); }
.badge.hazard { background: rgba(255,194,74,.12); color: var(--warn); border-color: rgba(255,194,74,.4); text-transform: none; letter-spacing: 0; }
.who { display: inline-flex; align-items: center; gap: 3px; background: rgba(10,8,30,.55); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px 0 0; font-size: 12px; }
.who .icon.sm { width: 28px; height: 28px; }

/* ---------- habilidades, familia, niveles ---------- */
.abils { display: flex; flex-direction: column; gap: 3px; }
.abil { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 2px 8px; border-radius: 8px; border: 1px solid transparent; }
.abil.cur { border-color: rgba(56,225,255,.4); background: rgba(56,225,255,.07); }
.abil .desc { flex-basis: 100%; }
.slotname { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--violet2); min-width: 54px; }
.abil.cur .slotname::after { content: " · actual"; color: var(--cyan2); }
.family { display: flex; flex-direction: column; gap: 2px; }
.famnode { display: flex; align-items: center; gap: 6px; padding-left: calc(var(--d) * 22px); font-size: 13px; }
.famnode.cur .famname { color: var(--cyan2); font-weight: 700; }
.evoarrow { color: var(--violet2); }
.evohow { color: var(--muted); font-size: 12px; }
.evohow::before { content: "· "; }
.icon.unk { display: grid; place-items: center; animation: none; background: rgba(10,8,30,.55); border: 1px dashed var(--line2); border-radius: 8px; color: var(--muted); font-weight: 700; }
.icon.unk.sm { width: 32px; height: 32px; }
.lvchips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.lvchips .lv { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 5px; background: rgba(10,8,30,.6); border: 1px solid var(--line); }
.lvchips .lv.done { opacity: .4; }
.lvchips .lv.next { border-color: var(--cyan); color: var(--cyan2); box-shadow: 0 0 8px rgba(56,225,255,.35); }
.mega { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; background: rgba(139,92,246,.06); }

/* ---------- pokédex ---------- */
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.dexcell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dexcell:hover { border-color: var(--cyan); box-shadow: var(--glow-c); transform: translateY(-1px); }
.dexcell:not(.owned) .icon { filter: brightness(.55) saturate(.6); }
.dexnum { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.dexname { font-size: 12px; font-weight: 600; text-align: center; }
.ballmark { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; background: url(/asset/ball) center / contain no-repeat; image-rendering: pixelated; }

/* ---------- biblia del locke ---------- */
.bible { position: relative; border-radius: 18px; padding: 2px; background: linear-gradient(135deg, #b98cff, #38e1ff 45%, #6a35d6 70%, #ffb547); box-shadow: 0 0 40px rgba(139,92,246,.25); }
.bible > * { position: relative; }
.bible-head, .bible-body { background: linear-gradient(180deg, #1c1340, #120d2c); }
.bible-head { border-radius: 16px 16px 0 0; padding: 18px 22px 12px; text-align: center; border-bottom: 1px solid rgba(255,181,71,.25);
  background-image: radial-gradient(500px 120px at 50% 0%, rgba(255,181,71,.12), transparent 70%), linear-gradient(180deg, #1c1340, #160f35); }
.bible-title { font-family: var(--brand); font-size: 28px; letter-spacing: 3px; background: linear-gradient(180deg, #fff3d6, #ffb547 55%, #b8731c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2b1600) drop-shadow(0 0 14px rgba(255,181,71,.35)); }
.bible-title::before, .bible-title::after { content: " ✦ "; }
.bible-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bible-sub span { white-space: nowrap; }
.bible-body { border-radius: 0 0 16px 16px; padding: 18px; display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .bible-body { grid-template-columns: 1fr; } }
.rules { display: flex; flex-direction: column; gap: 6px; }
.rule { display: grid; grid-template-columns: 42px 1fr 26px; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 10px; background: rgba(10,8,30,.45); border: 1px solid rgba(124,92,220,.18); font-size: 13px; }
.rule.sub { margin-left: 26px; }
.rulenum { font-family: var(--brand); font-size: 14px; color: #ffcf7a; text-align: center; text-shadow: 0 0 10px rgba(255,181,71,.35); }
.rulenote { font-size: 12px; color: var(--cyan2); margin-top: 3px; }
.rulestate { text-align: center; font-weight: 700; color: var(--good); }
.rule.honor .rulestate { color: var(--violet2); }
.rule.info .rulestate { color: var(--cyan2); }
.rule.warn { border-color: rgba(255,90,122,.55); background: rgba(255,90,122,.09); }
.rule.warn .rulestate, .rule.warn .rulenote { color: #ffa6b8; }
.codex { background: rgba(10,8,30,.45); border: 1px solid rgba(255,181,71,.2); border-radius: 12px; padding: 12px; }
.codex h3 { color: #ffcf7a; }
.lvrow { display: flex; justify-content: space-between; padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.lvrow b { font-family: var(--brand); font-weight: 400; }
.lvrow.done { opacity: .4; text-decoration: line-through; }
.lvrow.next { background: rgba(255,194,74,.14); color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.recalls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; margin-top: 8px; }
.recall { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 6px; border-radius: 8px; color: var(--muted); }
.recall img { width: 28px; height: 28px; image-rendering: pixelated; opacity: .55; }
.recall.have { color: var(--text); background: rgba(255,181,71,.1); }
.recall.have img { opacity: 1; filter: drop-shadow(0 0 6px rgba(255,181,71,.5)); }
.recall b { margin-left: auto; color: #ffcf7a; }
.mult.a-good { background: rgba(62,229,154,.2); color: #8ff7c6; }
.mult.a-bad { background: rgba(255,90,122,.2); color: #ffb2c1; }
.mult.a-none { background: #2a2745; color: #a7a2c9; }
.who.atk { gap: 6px; padding: 2px 4px 2px 0; }
.who.atk .icon.sm { width: 32px; height: 32px; }
.who.atk .type { font-size: 11px; }

/* ---------- sala LAN ---------- */
.sala { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.salacard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; backdrop-filter: blur(10px); }
.salacard.online { border-color: rgba(62,229,154,.45); box-shadow: 0 0 22px rgba(62,229,154,.08); }
.salacard.mine { border-color: rgba(56,225,255,.55); box-shadow: var(--glow-c); }
.salaname { font-family: var(--brand); font-weight: 400; font-size: 17px; letter-spacing: .5px; }
.dotlive { width: 9px; height: 9px; border-radius: 50%; background: #3a3556; }
.dotlive.on { background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulse 2s infinite; }
.bdg.sm { width: 28px; height: 28px; }
.salastats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.salastats div { background: rgba(10,8,30,.5); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; }
.salastats b { display: block; font-family: var(--brand); font-weight: 400; font-size: 18px; }
.salastats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.gravemon .icon.sm { width: 34px; height: 34px; }
.gravemon { display: inline-grid; place-items: center; width: 40px; height: 44px; border-radius: 18px 18px 6px 6px;
  background: linear-gradient(180deg, rgba(160,150,200,.18), rgba(60,50,100,.25)); border: 1px solid rgba(160,150,200,.3); }
.gravemon .icon.dead { filter: grayscale(1) brightness(1.15) contrast(.9); opacity: .9; }
.loginbox { max-width: 470px; margin: 12vh auto 0; text-align: center; padding: 28px 24px; }
.loginbox p { color: var(--text); }
.badge.attempt { background: rgba(255,181,71,.14); color: #ffcf7a; border-color: rgba(255,181,71,.45); }
.attempts { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- biblia plegable ---------- */
details.bible > summary { list-style: none; cursor: pointer; display: block; }
details.bible > summary::-webkit-details-marker { display: none; }
details.bible:not([open]) > summary { border-radius: 16px; border-bottom: none; }
.bible-toggle { color: var(--cyan2); }
.bible-warn { color: #ffa6b8; }

/* ---------- caja (PC) ---------- */
.pclayout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pclayout { grid-template-columns: 1fr; } }
.pcdetail { position: sticky; top: 60px; }
.boxtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.boxtab { background: rgba(10,8,30,.55); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); }
.boxtab span { color: var(--violet2); margin-left: 4px; }
.boxtab:hover { color: var(--text); border-color: var(--line2); }
.boxtab.on { color: var(--text); border-color: var(--cyan); box-shadow: var(--glow-c); }
.boxtab.prize { border-style: dashed; }
.pcbox .boxgrid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pcbox .slot { aspect-ratio: auto; min-height: 92px; padding: 4px 2px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pcbox .slot.vacant { cursor: default; opacity: .3; }
.pcbox .slot.on { border-color: var(--cyan); box-shadow: var(--glow-c); background: rgba(56,225,255,.08); }
.pcbox .slot .slotname { font-size: 11px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.pcbox .slot .lv { bottom: 2px; right: 0; left: 0; text-align: center; }
.hitlist { display: flex; flex-direction: column; gap: 4px; }
.hit { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10,8,30,.45); cursor: pointer; }
.hit:hover, .hit.on { border-color: var(--cyan); }
.hit.isdead { border-color: rgba(255,90,122,.5); }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }

/* ---------- mochila ---------- */
.bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.bagitem { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bagitem:hover { border-color: var(--line2); }
.bagitem img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.bagname { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qty { font-family: var(--brand); color: #ffcf7a; }
.bagsection h3 { margin: 6px 0 8px; }

/* ---------- registro de combates ---------- */
.blog { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.blog.live { max-height: 420px; overflow-y: auto; padding-right: 6px; }
.bturn { margin: 10px 0 4px; padding-top: 8px; border-top: 1px solid var(--line2); }
.blog > .bturn:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.bturnhead { font-family: var(--brand); font-size: 13px; letter-spacing: 1px; color: var(--cyan2); margin-bottom: 6px; }
.bact { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bact > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bmon { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bmon .binfo { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.bmon .hp { width: 120px; height: 6px; }
.bmsg { padding: 1px 0 1px 10px; border-left: 2px solid transparent; }
.bmsg.use { font-weight: 700; }
.bmsg.use.own { border-left-color: var(--cyan); }
.bmsg.foe { color: #ffd0dc; }
.bmsg.use.foe { border-left-color: var(--bad); }
.bmsg.ko { color: var(--bad); font-weight: 700; }
.bmsg.ko.foe { color: var(--good); }
.bmsg.eff { color: var(--warn); }
.bmsg.weak { color: var(--muted); }
.bmsg.crit { color: #ffcf7a; font-style: italic; }
.bmsg.exp { color: var(--muted); font-size: 13px; }
.btable tr.clickable { cursor: pointer; }
.btable tr.clickable:hover td { background: rgba(56,225,255,.06); }
b.bad { color: var(--bad); }
@media (max-width: 640px) {
  .btable th:nth-child(3), .btable td:nth-child(3), .btable th:nth-child(7), .btable td:nth-child(7) { display: none; }
  .bmon .hp { width: 90px; }
  .bmon .binfo { min-width: 90px; }
}
.pill.fx b { color: var(--text); }
.pill.fx.mine { border-color: rgba(56,225,255,.55); color: var(--cyan2); }
.pill.fx.theirs { border-color: rgba(255,90,122,.5); color: #ffb3c2; }
.bturnhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bfx { display: inline-flex; gap: 4px; flex-wrap: wrap; font-family: var(--font); letter-spacing: 0; }
.bfx .pill { font-size: 11px; padding: 2px 8px; }

/* =================== revisión de diseño: densidad y móvil =================== */
/* Nada se sale por la derecha: los hijos de rejillas pueden encogerse y las tablas anchas hacen scroll dentro. */
.grid > *, .battle > *, .bwrap > *, .pclayout > *, .side > * { min-width: 0; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stack > * + * { margin-top: 10px; }
.grid { gap: 12px; }
.infoline { gap: 6px 18px; padding: 2px 4px; }
.infoline b { color: var(--text); }

/* Equipo: fichas iguales por fila, con los desplegables abajo */
.team { align-items: stretch; }
.team .mon { height: 100%; }
.monfoot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.mon { gap: 9px; padding: 12px; }
.eggcard { justify-content: center; }
.kv { gap: 3px 10px; }

/* Secciones plegables con el título en la línea del resumen */
details.section > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
details.section > summary h2 { margin: 0; }
details.section > summary::after { content: "▸"; margin-left: auto; color: var(--violet2); }
details.section[open] > summary::after { content: "▾"; }
details.section[open] > summary { margin-bottom: 10px; }

/* Matriz de defensa: tipos en filas, el equipo en columnas */
.matrix th, .matrix td { padding: 3px 4px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { vertical-align: bottom; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); }
.matrix thead .icon.sm { margin: 0 auto -4px; }
.matrix thead .tiny { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 auto; }
.matrix .mx .mult { min-width: 30px; font-size: 11px; padding: 0 4px; }
.matrix .mxsum { text-align: left; font-size: 11px; white-space: nowrap; }
.matrix .mxsum .bad { color: #ffb2c1; } .matrix .mxsum .good { color: #8ff7c6; }
.matrix tbody tr:nth-child(odd) { background: rgba(10,8,30,.22); }

/* Ataque del equipo: un mosaico por tipo */
.atiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.atile { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: rgba(10,8,30,.4); display: flex; flex-direction: column; gap: 4px; }
.atile.good { border-color: rgba(62,229,154,.35); }
.atile.bad { border-color: rgba(255,90,122,.45); background: rgba(255,90,122,.07); }
.atwho { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.atwho > span { display: inline-flex; align-items: center; gap: 2px; }
.atwho .icon.sm { width: 28px; height: 28px; }
.atsum h3 { margin-bottom: 4px; }

/* Combate: registro a la derecha (como Showdown) cuando cabe */
.bwrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.bwrap.nolog { grid-template-columns: minmax(0, 1fr); }
.blogpanel { position: sticky; top: 56px; padding: 12px; }
.blogpanel .blog.live { max-height: calc(100vh - 130px); }
.blogpanel .bact { display: grid; grid-template-columns: 1fr 1fr; }
.blogpanel .bmon .binfo { min-width: 0; }
.blogpanel .bmon .hp { width: 100%; max-width: 110px; }
.blogpanel .blog { font-size: 13px; }
@media (max-width: 1250px) {
  .bwrap { grid-template-columns: minmax(0, 1fr); }
  .blogpanel { position: static; }
  .blogpanel .blog.live { max-height: 340px; }
}
.mon.foe, .mon.own { gap: 8px; }
.bigsprite { min-width: 96px; min-height: 92px; }

/* Pestañas sin barra de scroll visible */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ---------- móvil ---------- */
@media (max-width: 700px) {
  :root { font-size: 13px; }
  .hero-inner { padding: 8px 12px 10px; gap: 8px 12px; align-items: flex-start; }
  .logo { --s: .28; order: 0; }
  .hero-main { min-width: 0; gap: 4px; order: 1; flex: 1 1 0; }
  .hero .status { order: 2; flex-basis: 100%; gap: 6px; }
  .kicker { display: none; }
  .trainer { gap: 5px; }
  .trainer .name { font-size: 20px; }
  .trainer .facts { gap: 4px; }
  .fact { padding: 2px 8px; font-size: 11px; }
  .bdg { width: 24px; height: 24px; }
  .pill { padding: 3px 9px; font-size: 11px; }
  .view { padding: 10px 10px 30px; }
  .panel { padding: 12px; }
  .mon { padding: 10px; }
  .banner { padding: 8px 11px; }
  .banner b { font-size: 13px; }
  h2 { font-size: 13px; }
  th, td { padding: 5px 5px; }
  .c-cat, .c-acc { display: none; }
  .moves .ticon, .ticon { width: 40px; height: 17.5px; background-size: 40px auto; background-position: 0 calc(var(--i) * -17.5px); }
  .bigsprite { min-width: 76px; min-height: 76px; }
  .stats { grid-template-columns: 30px 26px 1fr 32px; }
  .atiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix .icon.sm { width: 30px; height: 30px; }
  .matrix thead .tiny { display: none; }
  .drawer { padding: 12px; }
  .cols2, .cols3 { grid-template-columns: 1fr; }
}
/* Matriz de defensa a todo el ancho: columnas iguales por Pokémon */
.matrix { width: 100%; table-layout: fixed; }
.matrix col.ctype { width: 92px; }
.matrix col.csum { width: 190px; }
.matrix th, .matrix td { padding: 5px 6px; }
.matrix thead .icon.sm { display: block; width: 48px; height: 48px; margin: 0 auto -2px; }
.matrix thead .tiny { font-size: 12px; max-width: 100%; }
.matrix .mx .mult { min-width: 44px; font-size: 13px; padding: 2px 8px; }
.matrix .mxsum { font-size: 12px; }
@media (max-width: 700px) {
  .matrix { table-layout: auto; }
  .matrix col.ctype, .matrix col.csum { width: auto; }
  .matrix thead .icon.sm { width: 30px; height: 30px; }
  .matrix .mx .mult { min-width: 30px; font-size: 11px; padding: 0 4px; }
  .matrix th, .matrix td { padding: 3px 4px; }
}
.atwho { flex-direction: column; gap: 0; }
.badge.hazard { white-space: nowrap; }
.salastats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
  /* Nuzlocke: cada zona como tarjeta */
  .areas thead { display: none; }
  .areas tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
  .areas td { border: none; padding: 0; }
  .areas td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .areas td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .areas td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .areas td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .areas td:nth-child(5) { grid-column: 2; grid-row: 2 / 4; align-self: center; }
  .areas td[colspan] { grid-column: 1 / -1; }
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .counter { padding: 8px 10px; }
  .counter b { font-size: 19px; }
  .counter span { font-size: 10px; }
  .log { max-height: 300px; }
  .c-id { display: none; }
  .dexgrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 5px; }
  .dexcell { padding: 5px 3px; border-radius: 9px; }
  .dexname { font-size: 10px; }
  .pcempty { display: none; }
  .pcbox .slot { min-height: 72px; padding-bottom: 14px; }
  .pcbox .slot .slotname { font-size: 9px; }
  .pcbox .boxgrid { gap: 4px; }
  .sala { gap: 10px; }
  .salacard { padding: 11px; gap: 8px; }
  .grave { grid-template-columns: 1fr; }
  .bible-title { font-size: 20px; }
}
.side h2 { flex-wrap: wrap; }
@media (max-width: 700px) {
  .areas tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .areas td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .areas td:nth-child(3) { grid-column: 3; grid-row: 1; }
  .areas td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .areas td:nth-child(4) { grid-column: 2; grid-row: 2; }
  .areas td:nth-child(5) { grid-column: 3; grid-row: 2; }
  .areas td:nth-child(2) .row, .areas td:nth-child(4) .row { flex-wrap: nowrap; gap: 4px; }
  .areas .icon.sm { width: 32px; height: 32px; }
}

/* ---------- estadísticas ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.insight { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(10px); min-height: 112px; }
.insight.clickable:hover { border-color: var(--cyan); box-shadow: var(--glow-c); }
.insight .ivis { flex: none; width: 96px; display: grid; place-items: center; }
.insight .ibig { font-size: 52px; line-height: 1; filter: drop-shadow(0 0 12px rgba(255,181,71,.35)); }
.insight .ikicker { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--violet2); font-weight: 700; }
.insight .ititle { font-family: var(--brand); font-size: 19px; line-height: 1.15; margin: 2px 0 4px; word-break: break-word; }
.insight .isub { font-size: 12px; color: var(--muted); }
.insight.gold { border-color: rgba(255,181,71,.6); background: linear-gradient(135deg, rgba(255,181,71,.16), var(--card) 60%); box-shadow: 0 0 22px rgba(255,181,71,.15); }
.insight.gold .ikicker { color: #ffcf7a; }
.insight.fire { border-color: rgba(255,111,155,.5); background: linear-gradient(135deg, rgba(255,111,155,.14), var(--card) 60%); }
.insight.grief { border-color: rgba(255,90,122,.4); }
.insight.calm { border-color: rgba(62,229,154,.4); }
.chart { width: 100%; height: auto; display: block; }
.stable td, .stable th { padding: 5px 8px; }
.stable tr.isdead { opacity: .55; }
.sval { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.sval b { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.sbar { flex: 1; height: 7px; background: rgba(5,4,18,.8); border-radius: 99px; overflow: hidden; }
.sbar i { display: block; height: 100%; border-radius: 99px; }
.records { display: flex; flex-direction: column; gap: 6px; }
.record { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(10,8,30,.45); border: 1px solid var(--line); }
.record.clickable:hover { border-color: var(--cyan); }
.remoji { font-size: 22px; width: 30px; text-align: center; flex: none; }
.statgrid { align-items: start; }
@media (max-width: 700px) {
  .insights { grid-template-columns: 1fr; gap: 8px; }
  .insight { min-height: 0; padding: 10px; }
  .insight .ivis { width: 72px; }
  .insight .ibig { font-size: 40px; }
  .insight .ititle { font-size: 16px; }
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sval { min-width: 80px; }
}
.chart { max-height: 320px; }

/* ---------- sala: hilo, carrera, logros, espectador ---------- */
.salalayout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.feedpanel { position: sticky; top: 56px; padding: 12px; }
.feed { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 140px); overflow-y: auto; padding-right: 4px; }
.fitem { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(10,8,30,.45); border: 1px solid var(--line); }
.fitem.k-muerte, .fitem.k-perdido { border-color: rgba(255,90,122,.35); }
.fitem.k-medalla, .fitem.k-campeon, .fitem.k-logro { border-color: rgba(255,181,71,.4); }
.fitem.k-cuerdas, .fitem.k-jefe { border-color: rgba(56,225,255,.35); }
.femoji { font-size: 20px; width: 26px; text-align: center; flex: none; line-height: 1.3; }
.fbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ftext { font-size: 13px; }
.fvis { display: inline-flex; vertical-align: middle; }
.fvis .icon.sm { width: 30px; height: 30px; }
.fmeta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.rchip { background: rgba(10,8,30,.6); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-size: 12px; cursor: pointer; line-height: 20px; }
.rchip.mine { border-color: var(--cyan); background: rgba(56,225,255,.12); }
.rchip.add { opacity: .55; }
.rchip.add:hover { opacity: 1; }
.rpick { display: inline-flex; gap: 2px; background: rgba(13,11,36,.95); border: 1px solid var(--line2); border-radius: 99px; padding: 2px 6px; }
.rpick button { background: none; border: none; font-size: 18px; cursor: pointer; padding: 0 2px; transition: transform .1s; }
.rpick button:hover { transform: scale(1.3); }
.achs { display: flex; gap: 4px; flex-wrap: wrap; }
.ach { font-size: 18px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,181,71,.1); border: 1px solid rgba(255,181,71,.35); cursor: help; }
.chart.race { max-height: 280px; }
.mon.spec { gap: 6px; }
.bmsg.anon { font-style: italic; }
button.pill.fight { font: inherit; font-size: 12px; font-weight: 700; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
@media (max-width: 1100px) {
  .salalayout { grid-template-columns: minmax(0, 1fr); }
  .feedpanel { position: static; order: -1; }
  .feed { max-height: 360px; }
}

/* Sala: compañeros y hilo en primer plano, la carrera plegada abajo */
.salalayout { grid-template-columns: minmax(0, 1fr) 400px; }
.salalayout .sala { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 10px; align-content: start; }
.salacard { padding: 12px; gap: 8px; }
.salacard .salaname { font-size: 18px; }
.salacard .salastats div { padding: 4px 2px; }
.salacard .salastats b { font-size: 16px; }
.salacard .gravemon { width: 34px; height: 38px; }
.salacard .gravemon .icon.sm { width: 30px; height: 30px; }
.salacard .attempts { padding-top: 6px; }
.feedpanel { top: 56px; }
.feed { max-height: calc(100vh - 150px); }
@media (max-width: 1100px) {
  .salalayout { grid-template-columns: minmax(0, 1fr); }
  .feedpanel { order: 0; }
  .feed { max-height: 420px; }
}
/* Cabecera de la tarjeta: el nombre nunca se corta; si no cabe con la píldora, la píldora baja */
.salacard > .row:first-child { flex-wrap: wrap; row-gap: 6px; }
.salacard > .row:first-child > .row { flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.salacard .salaname { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
@media (max-width: 700px) {
  /* Compañeros en carrusel horizontal: el hilo queda justo debajo */
  .salalayout .sala { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; scrollbar-width: none; }
  .salalayout .sala::-webkit-scrollbar { display: none; }
  .salalayout .salacard { flex: 0 0 86%; scroll-snap-align: start; }
}
.badge.hm { background: rgba(56,225,255,.12); color: var(--cyan2); border-color: rgba(56,225,255,.45); }
.gift { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 3px; }
.gift .icon.sm { width: 28px; height: 28px; }
.areaedit select { max-width: 100%; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: rgba(40,30,86,.97); border: 1px solid var(--warn); color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; }

/* ---------- cabecera: logo entero, tu nombre, objetivo y campanita ---------- */
.hero { overflow: visible; overflow-x: clip; z-index: 7; }
.hero-bg { clip-path: inset(30px); }
.hero::after { clip-path: inset(0); }
.logo { --s: .6; width: calc(354px * var(--s)); height: calc(200px * var(--s)); flex: none; border-radius: 16px;
  background: url(/asset/splash) no-repeat; background-size: calc(512px * var(--s)) calc(384px * var(--s));
  background-position: calc(-78px * var(--s)) calc(-138px * var(--s));
  -webkit-mask-image: none; mask-image: none; filter: none;
  border: 1px solid rgba(196,162,255,.45); box-shadow: 0 0 0 1px rgba(56,225,255,.15), 0 8px 28px rgba(0,0,0,.5), 0 0 26px rgba(139,92,246,.35); }
.hero-inner { align-items: center; }
.hero-main { gap: 6px; }
.trainer { gap: 9px; }
.trainer .name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trainer .name:has(> .name-pen) { background: none; color: inherit; filter: none; }
.trainer .name > span:first-child { background: linear-gradient(180deg, #f3e9ff 0%, #c4a2ff 45%, #7c4ad6 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #1b0b3a) drop-shadow(0 0 10px rgba(139,92,246,.5)); }
.name-pen { font: inherit; font-family: var(--font); font-size: 14px; line-height: 1; color: var(--violet2); background: rgba(10,8,30,.55);
  border: 1px solid var(--line2); border-radius: 8px; padding: 4px 7px; cursor: pointer; -webkit-text-fill-color: var(--violet2); filter: none; opacity: .75; transition: opacity .15s, border-color .15s; }
.name-pen:hover, .name-pen:focus-visible { opacity: 1; border-color: var(--cyan); }
.aka { font-family: var(--font); font-size: 11px; letter-spacing: .3px; color: var(--muted); -webkit-text-fill-color: var(--muted); font-weight: 600; }
.name-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.name-edit input { font-family: var(--brand); font-size: 20px; letter-spacing: 1px; color: var(--text); background: rgba(10,8,30,.75);
  border: 1px solid var(--cyan); border-radius: 10px; padding: 5px 10px; width: 260px; max-width: 100%; box-shadow: 0 0 14px rgba(56,225,255,.25); }
.name-edit .mini { font: inherit; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 9px; cursor: pointer; color: var(--text); background: rgba(10,8,30,.6); border: 1px solid var(--line2); }
.name-edit .mini.ok { background: linear-gradient(180deg, rgba(56,225,255,.3), rgba(139,92,246,.3)); border-color: var(--cyan); }
.name-edit .mini.ghost { color: var(--muted); }
.name-edit .mini:hover { border-color: var(--cyan); }
.name-hint, .name-err { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.name-err { color: var(--bad); font-weight: 700; }

.locke { display: flex; gap: 6px; flex-wrap: wrap; }
.lk { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 4px 10px 5px; border-radius: 10px;
  background: rgba(10,8,30,.55); border: 1px solid var(--line2); backdrop-filter: blur(6px); line-height: 1.1; }
.lk small { white-space: nowrap; font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.lk b { font-size: 17px; font-variant-numeric: tabular-nums; }
.lk.dead b { color: var(--bad); }
.lk.hot { border-color: rgba(255,194,74,.55); box-shadow: 0 0 12px rgba(255,194,74,.18); }
.lk.hot b { color: var(--warn); }
.lk.wide b { font-size: 12px; }

.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; align-self: stretch; justify-content: space-between; min-width: 0; }
.hero .status { align-items: center; }
.alerts:empty { display: none; }
.goal { width: 300px; max-width: 100%; padding: 8px 12px 9px; border-radius: 12px; background: rgba(10,8,30,.62); border: 1px solid var(--line2); backdrop-filter: blur(8px); }
.goal-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12px; }
.goal-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-n { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.goal-n b { color: var(--text); }
.goal-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); margin-top: 6px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 10px rgba(56,225,255,.5); transition: width .4s; }
.goal.near .goal-bar i { background: linear-gradient(90deg, var(--violet), var(--warn)); }
.goal.full { border-color: rgba(255,194,74,.5); }
.goal.full .goal-bar i { background: var(--warn); box-shadow: 0 0 10px rgba(255,194,74,.6); }
.goal.done { border-color: rgba(255,194,74,.5); }

.hero .status { position: relative; z-index: 5; }
.bell-wrap { position: static; }
.bell { position: relative; font: inherit; font-size: 15px; line-height: 1; padding: 5px 9px; border-radius: 99px; cursor: pointer;
  background: rgba(10,8,30,.6); border: 1px solid var(--line2); color: var(--text); backdrop-filter: blur(6px); filter: grayscale(.6); opacity: .8; }
.bell.info, .bell.warn, .bell.bad, .bell.open { filter: none; opacity: 1; }
.bell.info { border-color: rgba(56,225,255,.5); }
.bell.warn { border-color: rgba(255,194,74,.6); }
.bell.bad { border-color: rgba(255,90,122,.7); box-shadow: 0 0 12px rgba(255,90,122,.3); }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; background: var(--cyan); color: #0b0a1f; box-shadow: 0 0 8px rgba(56,225,255,.6); }
.bell.warn .bell-n { background: var(--warn); }
.bell.bad .bell-n { background: var(--bad); color: #fff; }
.bell-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: calc(100vw - 24px); max-height: 60vh; overflow-y: auto; z-index: 30;
  background: #100d2a; border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 22px rgba(139,92,246,.25); }
.bell-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: none; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.bell-item + .bell-item { border-top: 1px solid var(--line); border-radius: 0; }
.bell-item:hover { background: rgba(56,225,255,.08); }
.bell-item .aic { flex: none; width: 20px; text-align: center; font-size: 15px; }
.bell-item b { display: block; font-size: 13px; }
.bell-item small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.bell-item.bad b { color: var(--bad); }
.bell-item.warn b { color: var(--warn); }
.bell-empty { padding: 12px; font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 1000px) {
  .hero-side { flex-basis: 100%; flex-direction: row-reverse; align-items: center; justify-content: space-between; }
  .alerts { flex: 1 1 260px; max-width: 420px; display: block; }
  .goal { width: auto; }
}
@media (max-width: 700px) {
  .logo { --s: .3; border-radius: 10px; }
  .hero-inner { position: relative; flex-wrap: wrap; }
  .logo { order: 0; }
  .hero-main { order: 1; flex: 1 1 0; padding-right: 0; }
  .hero-side { order: 2; flex-basis: 100%; }
  .hero .status { position: absolute; top: 8px; right: 10px; flex-basis: auto; gap: 4px; }
  .hero .status .pill { padding: 2px 8px; font-size: 10px; }
  .bell { font-size: 12px; padding: 3px 7px; }
  .trainer .name { margin-top: 24px; }
  .name-pen { font-size: 12px; padding: 3px 6px; }
  .alerts { max-width: none; }
  .goal { padding: 6px 10px 7px; }
  .lk { min-width: 0; flex: 1 1 0; padding: 3px 4px 4px; }
  .lk b { font-size: 14px; }
  .lk small { font-size: 8.5px; letter-spacing: .4px; }
  .lk.wide { display: none; }
  .bell-menu { position: fixed; top: 44px; left: 12px; right: 12px; width: auto; }
}
@media (max-width: 700px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* ---------- combate: tú a la izquierda, el rival a la derecha (como en el juego) ---------- */
.battle .them .mon.foe .head { flex-direction: row-reverse; }
/* Una columna: el rival arriba y tú debajo, como en la pantalla del juego. */
@media (max-width: 1000px) { .battle .them { order: -1; } }

/* ---------- matriz de enfrentamiento ---------- */
.matchup h2 { flex-wrap: wrap; }
.mxtable { border-collapse: separate; border-spacing: 4px; width: 100%; }
.mxtable td, .mxtable th { padding: 0; border: none; }
.mxtable .mxwho { padding-right: 8px; width: 1%; }
.mxname { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mxname b { display: block; font-size: 13px; }
.mxname small { display: block; color: var(--muted); font-size: 11px; }
.mxname .onfield { color: var(--cyan2); font-weight: 700; }
.mxtable tr.field .mxname b { color: var(--cyan2); }
.mvcell { display: table-cell; background: rgba(255,255,255,.03); border: 1px solid var(--line) !important; border-radius: 9px; padding: 5px 7px !important; white-space: nowrap; vertical-align: middle; }
.mvcell > * { vertical-align: middle; }
.mvcell .ticon { width: 34px; height: 15px; background-size: 34px auto; background-position: 0 calc(var(--i) * -15px); margin-right: 5px; }
.mvcell .mvn { font-size: 12px; font-weight: 600; margin-right: 6px; }
.mvcell .mult { min-width: 30px; font-size: 11px; padding: 0 5px; }
.mvcell.st { opacity: .55; }
.mvcell.nomove { background: none; border-style: dashed !important; opacity: .4; }
.mvcell.top { background: linear-gradient(180deg, rgba(62,229,154,.18), rgba(62,229,154,.06)); border-color: rgba(62,229,154,.6) !important; box-shadow: 0 0 12px rgba(62,229,154,.15); }
.mxtable.take thead th { vertical-align: bottom; text-align: center; font-weight: 600; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--text); padding: 0 2px 4px; }
.mxtable.take { width: auto; }
.mvhead { min-width: 110px; }
.mvhead .ticon { display: block; margin: 0 auto 3px; width: 34px; height: 15px; background-size: 34px auto; background-position: 0 calc(var(--i) * -15px); }
.mvhead span { display: block; white-space: nowrap; }
.mvhead small { display: block; color: var(--muted); font-style: italic; font-weight: 500; font-size: 10px; }
.mvhead.maybe span { color: var(--muted); }
.mxc { text-align: center; background: rgba(255,255,255,.03); border-radius: 8px; padding: 5px 4px !important; }
.mxc.hurt { background: rgba(255,90,122,.12); box-shadow: inset 0 0 0 1px rgba(255,90,122,.45); }

/* ---------- asesor de MT y objetos ---------- */
.segs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); flex-wrap: wrap; }
.seg { font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 9px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.seg:hover { color: var(--text); background: rgba(124,92,220,.14); }
.seg.on { color: #fff; background: linear-gradient(180deg, rgba(56,225,255,.2), rgba(139,92,246,.26)); border-color: rgba(56,225,255,.55); }
.segs.small .seg { font-size: 12px; padding: 4px 10px; }
.segs .sm { display: none; }
.advcard { display: flex; flex-direction: column; gap: 8px; }
.advhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.advhead b { font-size: 15px; }
.itico { width: 26px; height: 26px; image-rendering: pixelated; flex: none; }
.cands { display: flex; flex-direction: column; gap: 4px; }
.cand { display: grid; grid-template-columns: 26px 1fr 110px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px solid transparent; }
.cand.first { border-color: rgba(62,229,154,.45); background: linear-gradient(90deg, rgba(62,229,154,.1), rgba(255,255,255,.02)); }
.cand .rank { font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.cand.first .rank { color: var(--good); }
.cwho { display: flex; gap: 8px; align-items: center; min-width: 0; }
.cwho > div { min-width: 0; }
.whys { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.why { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: rgba(124,92,220,.16); color: var(--text); white-space: nowrap; }
.why.good { background: rgba(62,229,154,.15); color: #8ff7c6; }
.why.bad { background: rgba(255,90,122,.15); color: #ffb2c1; }
.cbar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.cbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: inherit; }
.cand.first .cbar i { background: linear-gradient(90deg, var(--good), var(--cyan)); }
.badge.box { background: rgba(255,194,74,.12); color: var(--warn); border-color: rgba(255,194,74,.4); }
.warnline { color: var(--warn); }
.teaser { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 12px 16px; }
.teaser:hover { border-color: var(--cyan); }
@media (max-width: 700px) {
  .cand { grid-template-columns: 20px 1fr; }
  .cand .cbar { grid-column: 2; }
  .why { white-space: normal; }
}
@media (max-width: 700px) {
  .matchup .scrollx:has(.mxtable.do) { overflow: visible; }
  .mxtable.do, .mxtable.do tbody { display: block; }
  .mxtable.do tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; }
  .mxtable.do .mxwho { grid-column: 1 / -1; width: auto; }
  .mxtable.do .mvcell { display: flex; align-items: center; min-width: 0; white-space: normal; }
  .mxtable.do .mvcell .mvn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mxtable.do .mvcell.nomove { display: none; }
  .mxtable.take .mxwho { position: sticky; left: 0; z-index: 1; background: #15112f; }
}
@media (max-width: 700px) {
  .segs:not(.small) { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .segs .lg { display: none; }
  .segs .sm { display: inline; }
  .segs .seg { padding: 7px 6px; text-align: center; }
}

/* asesor: tarjetas plegables y explicación del cálculo */
details.advcard { padding: 0; gap: 0; }
details.advcard > summary.advhead { list-style: none; cursor: pointer; padding: 12px 16px; border-radius: inherit; }
details.advcard > summary::-webkit-details-marker { display: none; }
details.advcard > summary:hover { background: rgba(124,92,220,.08); }
details.advcard[open] > summary { border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.advbest { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.advbest .icon.sm { width: 28px; height: 28px; }
.advbest .itico { width: 22px; height: 22px; }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 8px; transition: transform .15s; flex: none; }
details[open] > summary .chev { transform: rotate(225deg); margin-bottom: -2px; }
.advbody { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; }
.advtools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.advinfo { font-size: 13px; line-height: 1.5; border-color: rgba(56,225,255,.4); }
.advinfo h3 { margin: 0 0 6px; }
.advinfo h4 { margin: 10px 0 4px; font-size: 12px; color: var(--cyan2); text-transform: uppercase; letter-spacing: .8px; }
.advinfo p { margin: 0 0 6px; color: var(--muted); }
.advinfo ul { margin: 0; padding-left: 18px; }
.advinfo li { margin: 3px 0; }
@media (max-width: 700px) {
  details.advcard > summary.advhead { padding: 10px 12px; }
  .advbest { margin-left: 0; flex-basis: 100%; }
  .chev { position: absolute; right: 14px; top: 18px; }
  details.advcard { position: relative; }
  .advbody { padding: 10px 12px 12px; }
}

/* ---------- siguiente Pokémon del rival ---------- */
.nextfoe { border: 1px solid rgba(255,194,74,.6); border-radius: 18px; padding: 12px; background: linear-gradient(180deg, rgba(255,194,74,.1), rgba(255,194,74,.02));
  box-shadow: 0 0 24px rgba(255,194,74,.15); display: flex; flex-direction: column; gap: 10px; animation: nfin .25s ease-out; }
.nfhead { display: flex; gap: 12px; align-items: center; }
.nfhead > .icon { width: 64px; height: 64px; flex: none; }
.nfkick { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--warn); }
.nftitle { font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0; }
.nextfoe .matchup { margin: 0; }
@keyframes nfin { from { transform: translateY(-6px); opacity: 0; } }
.advgroup { margin: 8px 0 -2px; display: flex; align-items: baseline; gap: 8px; }
.advhead .badge.box { margin-left: 2px; }
