:root {
  --bg: #0c0a12;
  --bg2: #15121f;
  --panel: #1c1829;
  --panel2: #252037;
  --line: #2f2944;
  --text: #ece6f7;
  --muted: #ada4c4;
  --gold: #f0c04a;
  --gold-dark: #8a6512;
  --accent: #7c5cff;
  --good: #5fd38a;
  --bad: #ff5d5d;
  --r: #6fb0e8;
  --sr: #b585ff;
  --ssr: #f5c542;
  --radius: 14px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #241b3a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2 { font-family: var(--serif); margin: 0; letter-spacing: .01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
small { font-size: .8em; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex: none; }
.el-ico { width: 1.05em; height: 1.05em; vertical-align: -0.18em; flex: none; }

/* ---------- Estructura ---------- */
#app {
  position: relative;
  max-width: 560px;
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(21,18,31,.85), rgba(12,10,18,.95));
  border-inline: 1px solid var(--line);
  overflow: hidden;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(12,10,18,.9);
  border-bottom: 1px solid var(--line);
}
.player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plv {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-family: var(--serif);
  background: radial-gradient(circle at 35% 30%, #6a52c9, #2a1f52);
  border: 2px solid var(--gold);
}
.pinfo { min-width: 0; }
.pname { font-size: 13px; font-weight: 600; white-space: nowrap; }
.currencies { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.cur {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px 3px 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 99px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}

.screen { overflow-y: auto; padding: 16px 16px 24px; scroll-behavior: smooth; }

.nav {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(12,10,18,.95);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 8px;
  background: none; border: 0;
  color: var(--muted); font-size: 11px;
  position: relative;
}
.nav-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--gold); }
.nav-btn.active::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 2px;
  background: var(--gold); border-radius: 2px;
}

/* ---------- Piezas comunes ---------- */
.bar { height: 8px; background: #0b0911; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c5cff, #b585ff); border-radius: inherit; transition: width .3s; }
.bar.thin { height: 5px; width: 90px; margin-top: 3px; }
.bar.gold i { background: linear-gradient(90deg, #b07d18, var(--gold)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px;
  background: var(--panel2); border: 1px solid #3d3558; border-radius: 10px;
  font-weight: 600;
  transition: transform .08s, filter .15s;
}
.btn:not(:disabled):active { transform: scale(.97); }
.btn:not(:disabled):hover { filter: brightness(1.15); }
.btn:disabled { opacity: .45; }
.btn.primary { background: linear-gradient(180deg, #f4cd62, #c8921f); color: #1d1405; border-color: #f7da86; }
.btn.ghost { background: transparent; }
.btn.danger { background: #5a1d26; border-color: #8a2c3a; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 16px; font-size: 16px; flex-direction: column; gap: 2px; }
.btn.big span { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.btn.full { width: 100%; margin-top: 14px; }
.row-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.link-btn { display: block; margin: 28px auto 0; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-top: 12px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-head .muted { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.panel p { margin: 8px 0 0; }

.screen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title { margin: 22px 0 10px; font-size: 15px; color: var(--muted); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.sub { color: var(--muted); font-style: italic; font-family: var(--serif); }
.power-line { margin-top: 8px; font-size: 13px; color: var(--muted); }
.power-line b { color: var(--gold); font-size: 17px; font-family: var(--serif); margin-left: 4px; }
.hint, .empty { color: var(--muted); font-size: 13px; text-align: center; margin: 16px 0 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.chip.on { border-color: var(--gold); color: var(--gold); }

.select { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.select select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; }

.stars { display: inline-flex; gap: 1px; }
.stars .star { width: 14px; height: 14px; }
.stars .on .star { fill: var(--gold); stroke: #7a5510; stroke-width: 1; }
.stars .off .star { fill: #2b2540; }

/* ---------- Tarjeta de héroe ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.hcard, .sresult {
  --c: var(--r);
  position: relative; padding: 0; overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: var(--bg2);
  border: 2px solid var(--c);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5) inset, 0 4px 14px -6px var(--c);
  text-align: left;
  transition: transform .12s;
}
.hcard:hover { transform: translateY(-2px); }
.hcard-art, .hcard-art .portrait { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hcard::after, .sresult::after {
  content: ""; position: absolute; inset: 45% 0 0;
  background: linear-gradient(180deg, transparent, rgba(8,6,12,.95));
  pointer-events: none;
}
.rar {
  position: absolute; top: 5px; left: 5px; z-index: 1;
  font-size: 10px; font-weight: 800; letter-spacing: .05em;
  padding: 1px 5px; border-radius: 4px;
  background: var(--c); color: #120d05;
}
.hel { position: absolute; top: 4px; right: 5px; z-index: 1; background: rgba(0,0,0,.55); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.hlv { position: absolute; left: 6px; bottom: 34px; z-index: 2; font-size: 11px; font-weight: 700; }
.hcard .stars { position: absolute; left: 5px; bottom: 21px; z-index: 2; }
.hcard .stars .star { width: 11px; height: 11px; }
.hname { position: absolute; left: 6px; right: 6px; bottom: 5px; z-index: 2; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Inicio ---------- */
.showcase {
  --c: var(--r);
  display: grid; grid-template-columns: 42% 1fr; gap: 14px; align-items: end;
  padding: 14px; border-radius: 18px;
  background: linear-gradient(135deg, var(--panel2), var(--bg2));
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.showcase::before {
  content: ""; position: absolute; inset: auto -30% -60% -30%; height: 120%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--c) 30%, transparent), transparent 65%);
  pointer-events: none;
}
.showcase-art { aspect-ratio: 5 / 6; border-radius: 12px; overflow: hidden; border: 2px solid var(--c); position: relative; }
.showcase-art .portrait { width: 100%; height: 100%; display: block; }
.showcase-info { position: relative; padding-bottom: 4px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 14px; min-height: 84px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tile .bar { width: 100%; }
.tile-k { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.tile-v { font-size: 13px; color: var(--muted); }
.tile-campaign { background: linear-gradient(135deg, #3a1f1f, var(--panel)); }
.tile-summon { background: linear-gradient(135deg, #2c2150, var(--panel)); }
.tile-glow { border-color: var(--gold); box-shadow: 0 0 18px -6px var(--gold); }
.tile-glow .tile-v { color: var(--gold); }
.tile:disabled { opacity: .6; }

.soon { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soon-card {
  padding: 12px 10px; border-radius: 12px; border: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 3px; color: var(--muted);
}
.soon-card b { color: var(--text); font-family: var(--serif); }
.soon-card span { font-size: 12px; }

/* ---------- Detalle de héroe ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); padding: 0; margin-bottom: 10px; font-size: 14px; }
.hero-detail { --c: var(--r); }
.hd-top { display: grid; grid-template-columns: 42% 1fr; gap: 14px; align-items: end; }
.hd-art { aspect-ratio: 5 / 6; border-radius: 14px; overflow: hidden; border: 2px solid var(--c); box-shadow: 0 8px 30px -10px var(--c); }
.hd-art .portrait { width: 100%; height: 100%; display: block; }
.hd-info h1 { font-size: 28px; margin-top: 8px; }
.hd-info .stars { margin-top: 8px; }
.hd-info .stars .star { width: 17px; height: 17px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
  background: var(--panel2); border: 1px solid var(--line);
}
.rar-tag { background: var(--c); color: #120d05; border: 0; font-weight: 800; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg2); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.stat span { width: 100%; font-size: 12px; color: var(--muted); }
.stat b { font-size: 18px; font-family: var(--serif); font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; color: var(--good); font-size: 12px; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot {
  --c: var(--line);
  display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 8px;
  align-items: center; text-align: left;
  padding: 10px; border-radius: 12px;
  background: var(--bg2); border: 1px dashed var(--line);
}
.slot.filled { border-style: solid; border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.slot.filled.r-R { --c: var(--r); }
.slot-ico { grid-row: span 2; width: 38px; height: 38px; padding: 7px; border-radius: 9px; background: #0b0911; }
.slot-name { font-weight: 600; font-size: 13px; }
.slot-sub { font-size: 11px; color: var(--muted); }
.star-btn { margin-top: 12px; width: 100%; background: linear-gradient(180deg, #4b3a7a, #2e2350); border-color: #6b55b0; }

/* ---------- Invocar ---------- */
.banner {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid #4b3d78;
  background: linear-gradient(180deg, #2a1f4d, #130f20);
}
.banner-art { display: grid; grid-template-columns: repeat(4, 1fr); height: 190px; }
.banner-hero { overflow: hidden; position: relative; }
.banner-hero .portrait { width: 100%; height: 100%; display: block; }
.banner-hero:nth-child(even) { transform: translateY(14px); }
.banner-text {
  position: relative; padding: 14px 16px 16px; margin-top: -60px;
  background: linear-gradient(180deg, transparent, #130f20 45%);
}
.banner-text h1 { font-size: 28px; }
.banner-text p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.summon-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.rates h2 { margin-bottom: 8px; }
.rate { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.rate b { margin-left: auto; font-variant-numeric: tabular-nums; }
.r-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

.sresults { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sresults.n1 { grid-template-columns: minmax(0, 160px); justify-content: center; }
.sresult { animation: reveal .45s backwards cubic-bezier(.2, .9, .3, 1.3); }
.sresult.r-SSR { animation-name: reveal, glow; animation-duration: .45s, 1.6s; animation-iteration-count: 1, infinite; }
.sresult .hname { font-size: 11px; bottom: 4px; }
.sres-tag {
  position: absolute; z-index: 2; left: 4px; bottom: 20px;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 2px;
}
.sres-tag.new { background: var(--good); color: #062012; }
.sres-tag.dup { background: rgba(0,0,0,.65); }
@keyframes reveal { from { opacity: 0; transform: scale(.6) rotateY(80deg); } }
@keyframes glow { 50% { box-shadow: 0 0 22px 2px var(--ssr); } }

/* ---------- Inventario ---------- */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
}
.item-ico { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #0b0911; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.item-ico .ico { width: 26px; height: 26px; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 14px; }
.item-stats { font-size: 12px; color: var(--good); }
.item-owner { font-size: 12px; text-align: right; flex: none; }
.pick .item { cursor: pointer; }
.pick .item:hover { border-color: var(--gold); }

/* ---------- Campaña ---------- */
.team-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tslot {
  --c: var(--r);
  position: relative; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden;
  border: 2px solid var(--c);
}
.tslot .portrait { width: 100%; height: 100%; display: block; }
.tslot span { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.tslot.empty { border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 20px; }

.stages { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stage {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.stage:not(:disabled):hover { border-color: #5a4d80; }
.stage-id { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--muted); text-align: center; }
.stage-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stage-meta { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.stage-cost { font-size: 13px; display: inline-flex; align-items: center; gap: 3px; }
.stage.done .stage-id { color: var(--good); }
.stage.boss { background: linear-gradient(90deg, #3d1a22, var(--panel)); border-color: #6b2a38; }
.stage.boss .stage-id { color: var(--bad); }
.stage:disabled { opacity: .45; }

/* ---------- Modal y aviso ---------- */
.modal {
  position: absolute; inset: 0; z-index: 30;
  display: grid; align-items: end;
  background: rgba(6,5,10,.72);
}
.modal[hidden] { display: none; }
.modal-card {
  max-height: 86%; overflow-y: auto;
  background: var(--bg2); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom));
  animation: slideup .22s ease-out;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-sub { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 6px; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 4px; }
.team-pick .hcard.picked { outline: 3px solid var(--gold); outline-offset: 2px; }
.pick-n {
  position: absolute; z-index: 3; top: 30px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: #1d1405; font-weight: 800; font-size: 12px;
  display: grid; place-items: center;
}

.toast {
  position: absolute; z-index: 40; left: 50%; bottom: 84px;
  transform: translate(-50%, 20px); opacity: 0;
  background: #2b2540; border: 1px solid #4b3d78; border-radius: 99px;
  padding: 8px 16px; font-size: 13px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Rareza al final para que pise el color por defecto de cada componente. */
.r-SR { --c: var(--sr); }
.r-SSR { --c: var(--ssr); }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 440px) {
  .pinfo { display: none; }
}
@media (max-width: 380px) {
  .topbar { padding-inline: 10px; }
  .cur { font-size: 12px; padding-right: 7px; }
  .screen { padding-inline: 12px; }
  .sresults { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 561px) {
  .modal-card { margin: 0 12px 12px; border-radius: 20px; border: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Guía de próximo paso en Inicio */
.guide {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  margin-bottom: 12px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, #3a2d10, var(--panel)); border: 1px solid #7a5f1f;
}
.guide-k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.guide-t { grid-row: 2; font-size: 14px; }
.guide .btn { grid-row: span 2; grid-column: 2; grid-row-start: 1; }

/* =========================================================
   Pasada de diseño: Inicio agrupado, navegación, accesibilidad, escritorio.
   ========================================================= */

/* Foco visible con teclado en todo lo tocable */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.hcard:focus-visible, .tile:focus-visible, .showcase:focus-visible { outline-width: 3px; }

/* Tamaños táctiles: nada tocable por debajo de 40px */
.btn.small { min-height: 40px; padding: 8px 14px; }
.chip { min-height: 40px; padding: 8px 14px; }
.x { width: 40px; height: 40px; display: grid; place-items: center; margin-right: -8px; border-radius: 10px; }
.x:hover { color: var(--text); background: var(--panel2); }
.select select { min-height: 40px; padding: 6px 10px; }
.link-btn { min-height: 40px; padding: 8px 12px; }
.slot { min-height: 64px; }
.item[role="button"] { cursor: pointer; min-height: 56px; }
.item[role="button"]:hover { border-color: #5a4d80; }

/* Volver: mismo botón en todas las pantallas secundarias */
.back {
  min-height: 40px; padding: 6px 14px 6px 8px; margin: 0 0 12px -4px;
  border-radius: 99px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; font-weight: 600;
}
.back:hover { border-color: #5a4d80; }
.back svg { width: 18px; height: 18px; }
/* La Tienda trae su propio "Volver" en el encabezado: queda el botón común. */
.secondary .screen-head > .btn[data-go="home"] { display: none; }

/* Transición corta al cambiar de pantalla */
.screen.enter > * { animation: screen-in .2s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

/* Barra inferior: marca activa e indicadores */
.nav-btn { min-height: 56px; justify-content: center; transition: color .15s; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(240,192,74,.55)); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--bad); color: #fff; font: 800 11px/1 var(--sans); font-style: normal;
  box-shadow: 0 0 0 2px var(--bg);
}
.nav-btn .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
.section-title .badge { vertical-align: 2px; margin-left: 6px; }

/* Monedas: el número cuenta y se ilumina al cambiar */
.cur b { transition: color .3s; }
.cur.up b { color: var(--good); }
.cur.down b { color: #ff9a9a; }

/* Aviso: arriba, debajo de la barra superior, para no tapar botones */
.toast {
  top: 64px; bottom: auto; transform: translate(-50%, -12px);
  max-width: calc(100% - 32px); white-space: normal; text-align: center; justify-content: center;
  border-radius: 14px; padding: 10px 16px; font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.8);
}
.toast.show { transform: translate(-50%, 0); }
.confirm-body { margin: 4px 0 0; line-height: 1.5; }
.confirm-body .ico { vertical-align: -0.2em; }

/* ---------- Inicio ---------- */
button.showcase { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; grid-template-columns: 36% 1fr; }
button.showcase:hover { border-color: #5a4d80; }
.showcase-art, .showcase-info, .showcase-info > span { display: block; }
.showcase-name { font: 700 28px/1.1 var(--serif); margin-top: 2px; }
.home-groups { display: grid; gap: 2px; }
.home-group .section-title { margin: 20px 2px 10px; color: var(--text); font-size: 13px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; }
.home-group .tiles { margin-top: 0; }
/* Los anchos los decide el grupo, no cada módulo */
.home-group .tiles > .tile { grid-column: auto; }
.home-group .tiles > .tile.tile-full { grid-column: 1 / -1; }
.tile { position: relative; min-height: 76px; transition: border-color .15s, transform .1s; }
.tile:not(:disabled):hover { border-color: #5a4d80; }
.tile:not(:disabled):active { transform: scale(.98); }
.tile-v { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tile-glow::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 3px rgba(255,93,93,.25); animation: dot-pulse 1.6s ease-in-out infinite;
}
@keyframes dot-pulse { 50% { box-shadow: 0 0 0 6px rgba(255,93,93,0); } }
.tile-daily { background: linear-gradient(135deg, #3a3012, var(--panel)); }
.tile-heroes { background: linear-gradient(135deg, #1d2a33, var(--panel)); }
.tile:disabled .tile-v { color: var(--muted); }
.soon { grid-template-columns: 1fr; margin-top: 18px; }

/* Modal de resultados de invocación legible en celular */
@media (max-width: 440px) {
  .sresults { gap: 6px; }
  .sresults.n10 .hname { font-size: 10.5px; }
  .sres-tag { font-size: 9px; padding: 1px 4px; }
}

/* ---------- Escritorio: barra lateral y contenido más ancho ---------- */
@media (min-width: 960px) {
  body {
    background:
      radial-gradient(ellipse 60% 50% at 12% 20%, rgba(124,92,255,.16), transparent 70%),
      radial-gradient(ellipse 50% 45% at 88% 80%, rgba(240,192,74,.10), transparent 70%),
      repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 14px),
      radial-gradient(ellipse at top, #241b3a 0%, var(--bg) 60%) fixed, var(--bg);
  }
  #app {
    max-width: 1120px; height: calc(100dvh - 32px); margin: 16px auto;
    grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr;
    border: 1px solid var(--line); border-radius: 20px;
    box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
  }
  .topbar { grid-column: 1 / -1; padding: 12px 22px; }
  .pinfo { display: block; }
  .nav {
    grid-row: 2; grid-column: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
    border-top: 0; border-right: 1px solid var(--line); background: rgba(12,10,18,.6);
  }
  .nav-btn { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; min-height: 48px; border-radius: 12px; font-size: 15px; }
  .nav-btn.active { background: var(--panel); }
  .nav-btn.active::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; }
  .nav-btn .badge { position: static; margin-left: auto; }
  .screen { grid-row: 2; grid-column: 2; padding: 24px 32px 40px; }
  .screen > section { max-width: 820px; margin: 0 auto; }
  .home { display: grid; grid-template-columns: 300px 1fr; gap: 0 24px; align-items: start; }
  .home > .guide, .home > .link-btn, .home > .soon { grid-column: 1 / -1; }
  .home > .showcase { grid-template-columns: 1fr; position: sticky; top: 0; margin-top: 20px; }
  .home-groups { grid-column: 2; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stages { display: grid; grid-template-columns: 1fr 1fr; }
  .item-list:not(.pick) { display: grid; grid-template-columns: 1fr 1fr; }
  .battle { grid-column: 1 / -1; grid-row: 1 / -1; }
  .toast { top: 72px; }
  .modal-card { width: min(560px, calc(100% - 24px)); justify-self: center; align-self: center; margin: 0; border-radius: 20px; border: 1px solid var(--line); }
  .modal { align-items: center; }
  .modal .summon-stage { grid-column: 1; }
  .sresults { max-width: 620px; }
}
@media (min-width: 960px) {
  .hd-top { grid-template-columns: 260px 1fr; }
  .banner-art.featured { height: 260px; }
}
@media (min-width: 960px) {
  .team-row { grid-template-columns: repeat(5, minmax(0, 104px)); }
  .arena-team { grid-template-columns: repeat(5, minmax(0, 96px)); }
}
.version { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
@media (min-width: 960px) { .home > .version { grid-column: 1 / -1; } }
.rescue { max-width: 480px; margin: 40px auto; text-align: center; }
.rescue h1 { margin-bottom: 10px; }
