:root {
  --bg: #070d1c;
  --bg-2: #0c1733;
  --panel: rgba(12, 23, 51, 0.92);
  --line: rgba(232, 238, 248, 0.16);
  --blue: #1d6dff;
  --blue-2: #7eb6ff;
  --red: #e10600;
  --red-2: #ff4d45;
  --silver: #e8eef8;
  --white: #f4f7fb;
  --muted: #9aabc4;
  --ok: #3dd68c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at 0% -10%, rgba(29, 109, 255, 0.32), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(225, 6, 0, 0.22), transparent 30%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; position: sticky; top: 0; z-index: 5;
  background: rgba(7, 13, 28, 0.9); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.04em; font-size: 1.15rem; color: var(--silver); }
.logo img { width: 38px; height: 38px; object-fit: contain; }
.brand-mark { width: 96px; height: 96px; object-fit: contain; display: block; margin: 0 auto 8px; filter: drop-shadow(0 8px 18px rgba(29, 109, 255, 0.35)); }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a, .ghost, .primary, .danger, .small {
  border: 1px solid transparent; border-radius: 999px; padding: 8px 14px; background: transparent;
}
.nav a.active, .ghost { border-color: var(--line); background: rgba(255,255,255,0.04); }
.primary { background: linear-gradient(180deg, #4d8dff, var(--blue)); color: white; font-weight: 700; }
.danger { background: linear-gradient(180deg, var(--red-2), var(--red)); color: white; font-weight: 700; }
.small { padding: 6px 10px; border-color: var(--line); background: rgba(255,255,255,0.04); }
.pesos { margin-left: auto; color: var(--blue-2); font-weight: 700; }
.view { width: min(1180px, calc(100% - 28px)); margin: 22px auto 40px; }
.view .panel, .view .hero { margin-bottom: 14px; }
.back-row { margin: 0 0 14px; }
.hero, .panel, .auth-card {
  background:
    linear-gradient(180deg, rgba(232, 238, 248, 0.05), transparent 42%),
    var(--panel);
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); padding: 22px;
}
.hero, .auth-card { text-align: center; }
.auth-card label, .auth-card .error, .auth-card .ok { text-align: left; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); }
h1, h2, h3 { margin: 0 0 10px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.stats, .menu-grid, .card-grid, .product-grid { display: grid; gap: 14px; }
.menu-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card-grid, .product-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.menu-card, .product {
  display: block; padding: 18px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(29, 109, 255, 0.18), rgba(225, 6, 0, 0.05));
}
.menu-card strong, .product strong { display: block; margin-bottom: 6px; }
label { display: grid; gap: 6px; margin: 12px 0; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #070d1c; padding: 10px 12px;
}
textarea { min-height: 90px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.error { color: #ffb4c0; }
.ok { color: var(--ok); }
.banner {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 14px;
  background: rgba(225, 6, 0, 0.16); border: 1px solid rgba(225, 6, 0, 0.45);
}
.banner.win {
  background: rgba(61, 214, 140, 0.18); border-color: rgba(61, 214, 140, 0.7); color: #b8ffd9;
}
.banner.loss { color: #ffd0d4; }
.banner.draw { color: var(--blue-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.filters input, .filters select { width: auto; min-width: 140px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.builder { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; }
.deck-list { display: grid; gap: 8px; }
.deck-row, .list-row {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px;
}
.list-row label { margin: 0; }
.list-row select, .list-row input { width: auto; min-width: 120px; }
.unowned { opacity: 0.55; filter: grayscale(0.4); }

.game-card {
  width: 168px; min-height: 236px; padding: 10px; border-radius: 16px; position: relative;
  background:
    linear-gradient(180deg, rgba(232, 238, 248, 0.1), transparent 28%),
    linear-gradient(160deg, #102454, #0c1733 58%, #2a0c12);
  border: 1px solid rgba(126, 182, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 10px 24px rgba(0,0,0,0.28);
  display: flex; flex-direction: column; gap: 6px;
}
.game-card .name { font-weight: 800; line-height: 1.15; }
.art {
  height: 78px; border-radius: 10px; display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, rgba(29, 109, 255, 0.28) 0 8px, rgba(225, 6, 0, 0.08) 8px 16px);
  color: var(--blue-2); font-size: 0.75rem; letter-spacing: 0.08em;
}
.game-card .meta, .game-card .text { color: var(--muted); font-size: 0.78rem; }
.game-card .text { flex: 1; }
.stats-line { display: flex; justify-content: space-between; font-weight: 800; }
.atk { color: var(--red-2); } .hp { color: var(--silver); }
.game-card.support { border-color: rgba(225, 6, 0, 0.6); }
.game-card.face-down {
  background:
    radial-gradient(circle at 50% 42%, rgba(29, 109, 255, 0.2), transparent 46%),
    linear-gradient(160deg, #102454, #070d1c);
  align-items: center; justify-content: center; gap: 8px;
  color: var(--silver); font-weight: 800; text-align: center;
}
.back-mark { width: 74px; height: 74px; object-fit: contain; }
.set-peek {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  padding: 6px 8px; border-radius: 10px;
  background: rgba(7, 13, 28, 0.92); color: var(--silver);
  font-size: 0.75rem; opacity: 0; transition: opacity 0.15s ease;
}
.game-card.own-set:hover .set-peek, .game-card.own-set:focus-within .set-peek { opacity: 1; }
.game-card.selected { outline: 3px solid var(--blue-2); }
.game-card.sick { box-shadow: inset 0 0 0 2px rgba(255, 196, 87, 0.7); }
.game-card.damaged .hp { color: #ffb4c0; }
.slot.empty {
  width: 168px; min-height: 120px; border-radius: 16px; border: 1px dashed rgba(232, 238, 248, 0.28);
  display: grid; place-items: center; color: var(--muted); font-size: 0.8rem;
  background: rgba(7, 13, 28, 0.45);
}

.board { display: grid; gap: 12px; }
.side, .zone {
  background: rgba(8, 16, 30, 0.72); border: 1px solid var(--line); border-radius: 18px; padding: 12px;
}
.lane { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.hand { display: flex; gap: 8px; overflow-x: auto; }
.log { max-height: 220px; overflow: auto; display: grid; gap: 4px; font-size: 0.86rem; }
.opening {
  position: fixed; inset: 0; background: rgba(4, 8, 16, 0.82); display: grid; place-items: center; z-index: 20; padding: 20px;
}
.opening .cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pager { display: flex; gap: 8px; margin-top: 12px; }

@media (max-width: 860px) {
  .builder { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .pesos { margin-left: 0; }
  .game-card, .slot.empty { width: 142px; min-height: 210px; }
  .lane.fixed { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}

.view:has(.duel), .view:has(.coin-scene) { width: min(1280px, calc(100% - 16px)); }
.art { overflow: hidden; padding: 0; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card { cursor: default; }
.game-card.playable { cursor: pointer; }
.game-card .badge {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  background: #f0c14a; color: #2a2108; border-radius: 999px;
  font-size: 0.68rem; font-weight: 800; padding: 2px 7px;
}

#app-loading {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(4, 8, 16, 0.62);
}
#app-loading[hidden] { display: none !important; }
.loader-card { display: grid; justify-items: center; gap: 12px; font-weight: 800; }
.spinner {
  width: 58px; height: 58px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18); border-top-color: var(--blue-2);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.duel { position: relative; display: grid; gap: 12px; }
.duel-top, .fighter-head, .field-row, .hand-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0; color: var(--blue-2); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.phase-rail { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.phase-rail li { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.phase-rail li.on { background: var(--blue); color: white; border-color: transparent; font-weight: 800; }
.fighter, .field-row, .hand-row, .log, .coin-scene {
  background: rgba(8, 16, 30, 0.78); border: 1px solid var(--line); border-radius: 18px; padding: 12px;
}
.fighter.you { border-color: rgba(29, 109, 255, 0.55); }
.fighter.opponent { border-color: rgba(225, 6, 0, 0.5); }
.life {
  position: relative; min-width: 92px; border-radius: 18px; border: 1px solid var(--line);
  background: #070d1c; color: var(--silver); font-size: 1.7rem; font-weight: 800; padding: 8px 12px;
  text-align: center;
}
.life small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.life.ready, .slot.ready, .game-card.playable.ready { outline: 3px solid var(--ok); }
.piles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.lane-label { margin: 8px 0 4px; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.lane.fixed { display: grid; grid-template-columns: repeat(3, minmax(150px, 168px)); gap: 8px; overflow: visible; }
.backs { display: flex; gap: 6px; min-height: 28px; }
.card-back {
  width: 28px; height: 40px; border-radius: 6px;
  background:
    url("/imagenes/favicon.png") center / 78% no-repeat,
    linear-gradient(160deg, #102454, #070d1c);
  border: 1px solid rgba(126, 182, 255, 0.55);
}
.move-toast { min-height: 1.2em; margin: 0; color: #f0c14a; font-weight: 800; }
.chain-banner, .hint {
  margin: 0; padding: 10px 12px; border-radius: 14px;
  background: rgba(240, 193, 74, 0.12); border: 1px solid rgba(240, 193, 74, 0.35);
}
.hint { color: var(--white); }
.dock { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; bottom: 8px; padding: 8px 0; }
.log { max-height: 180px; }
.slot.empty { position: relative; }
.table-wrap { overflow-x: auto; }
.outcome.victoria { color: var(--ok); font-weight: 800; }
.outcome.derrota { color: var(--red-2); font-weight: 800; }
.outcome.empate { color: var(--blue-2); font-weight: 800; }
.floater {
  position: absolute; left: 50%; top: 6px; z-index: 6; pointer-events: none;
  font-size: 1.45rem; font-weight: 900; letter-spacing: 0.02em;
  text-shadow: 0 2px 8px #000;
  animation: float-up 1.6s ease forwards;
}
.floater.hurt { color: var(--red-2); }
.floater.heal { color: #7dffb2; }
.attack-arrow {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5;
  pointer-events: none; overflow: visible;
}
.attack-arrow line {
  stroke: #f4f7fb; stroke-width: 4; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(29, 109, 255, 0.9));
}
.attack-arrow polygon { fill: var(--red-2); filter: drop-shadow(0 0 4px rgba(225, 6, 0, 0.8)); }
.callout {
  position: absolute; left: 50%; top: 42%; z-index: 6; pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(7, 13, 28, 0.88); border: 1px solid var(--silver);
  color: var(--silver); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  animation: callout-in 1.3s ease forwards;
}
.game-card.hit, .life.hit, .slot.hit { animation: hit-shake 0.62s linear; }
.game-card.lunge, .life.lunge { animation: lunge 0.72s ease; z-index: 4; }
.game-card.summon-pop { animation: pop-in 0.85s ease; }
.game-card.charging {
  z-index: 4;
  animation: charge-card 0.42s ease forwards;
}
@keyframes charge-card {
  to { transform: translateY(-16px) scale(1.08); box-shadow: 0 0 22px rgba(126, 182, 255, 0.95); }
}
.loader-mark { width: 88px; height: 88px; object-fit: contain; animation: pulse-logo 1s ease-in-out infinite; }
@keyframes callout-in {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -68%) scale(1); }
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1.05); }
}
@keyframes hit-shake {
  0%, 100% { transform: translateX(0); filter: none; }
  18% { transform: translateX(-8px); filter: brightness(2.2); }
  36% { transform: translateX(7px); filter: brightness(1.4); }
  54% { transform: translateX(-5px); }
  72% { transform: translateX(3px); }
}
@keyframes lunge {
  0% { transform: translate(0, 0) scale(1); }
  42% { transform: translate(var(--lx, 0px), var(--ly, -16px)) scale(1.08); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.35) translateY(18px); filter: brightness(1.8); }
  55% { opacity: 1; transform: scale(1.06) translateY(0); filter: brightness(1.25); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}
@keyframes pulse-logo {
  50% { transform: scale(1.08); filter: drop-shadow(0 0 16px rgba(29, 109, 255, 0.85)); }
}

.coin-scene { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 16px 36px; }
.coin { width: 148px; height: 148px; position: relative; transform-style: preserve-3d; margin: 12px auto; }
.coin .face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  backface-visibility: hidden; font-weight: 800; font-size: 1.5rem;
  box-shadow: inset 0 0 0 8px rgba(255,255,255,0.25), 0 12px 30px rgba(0,0,0,0.35);
}
.coin .front { background: radial-gradient(circle at 30% 30%, #ffe7a3, #b8860b); color: #3a2504; }
.coin .back { background: radial-gradient(circle at 30% 30%, #f7fbff, #6d86b8); color: #10203c; transform: rotateY(180deg); }
.coin.spin { animation: coin-spin 1.35s ease-in-out; }
.coin.cara { transform: rotateY(0deg); }
.coin.cruz { transform: rotateY(180deg); }
@keyframes coin-spin { from { transform: rotateY(0deg); } to { transform: rotateY(1800deg); } }
.overlay {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(4, 8, 16, 0.82); padding: 20px;
}
.grave-panel { width: min(980px, 100%); max-height: min(86vh, 900px); overflow: auto; }
.grave-panel .art { height: auto; aspect-ratio: 3 / 4; }
.grave-panel .art img { object-fit: contain; background: #070d1c; }

.card-sheet {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  gap: 18px;
  position: relative;
  align-items: start;
  max-height: min(88vh, 860px);
}
.sheet-close { position: absolute; top: 14px; right: 14px; }
.sheet-art {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #070d1c;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.sheet-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-body { min-width: 0; max-height: min(78vh, 760px); overflow: auto; padding: 28px 8px 4px 0; }
.sheet-body h2 { margin-bottom: 6px; }
.sheet-text { white-space: pre-wrap; line-height: 1.4; }
.sheet-actions { display: grid; gap: 8px; margin-top: 14px; }
.sheet-actions button { width: 100%; text-align: left; white-space: normal; border-radius: 14px; }
.game-card.token:not(.face-down) {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #070d1c;
  display: flex;
  flex-direction: column;
}
.game-card.token:not(.face-down) .art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  width: 100%;
  border-radius: inherit;
  background: #070d1c;
}
.game-card.token.has-stats .art { flex: 0 0 auto; aspect-ratio: 3 / 4; }
.token-stats {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  background: #10192e;
}
.game-card.token .art img { object-fit: contain; width: 100%; height: 100%; }
.game-card.token.damaged::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red-2);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}
.game-card.arriving { visibility: hidden; }
.flight-card {
  position: fixed;
  z-index: 40;
  object-fit: contain;
  pointer-events: none;
  border-radius: 12px;
  background: #070d1c;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 18px rgba(126, 182, 255, 0.55);
}
.attack-bolt {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, #fff 0%, #f0c14a 42%, #e10600 74%, transparent 76%);
  filter: drop-shadow(0 0 8px #ff4d45);
}
.life.threatened, .game-card.threatened { outline: 2px solid var(--red-2); outline-offset: 2px; }
.duel .game-card { cursor: pointer; }
.duel .game-card.playable { outline: 2px solid var(--ok); outline-offset: 2px; }
.duel .slot.empty { font-size: 0.68rem; text-align: center; padding: 4px; }

.shell:has(.duel) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.shell:has(.duel) .topbar { padding: 6px 12px; }
.shell:has(.duel) .logo img { width: 28px; height: 28px; }
.shell:has(.duel) .view {
  width: min(1480px, calc(100% - 12px));
  margin: 4px auto 6px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.shell:has(.duel) .back-row { margin: 0 0 4px; }
.shell:has(.duel) #view { flex: 1; min-height: 0; display: flex; }
.duel {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.duel-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 8px;
}
.duel-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.chronicle {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(8, 16, 30, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
}
.chronicle .lane-label { margin: 0 0 2px; }
.duel h1 { font-size: 1.15rem; margin: 0; }
.duel .error:empty, .duel .move-toast:empty { display: none; }
.duel .move-toast { min-height: 0; }
.duel .fighter {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  overflow: hidden;
}
.arena {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.duel .field-row {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: center;
  gap: 6px;
  padding: 8px 6px;
}
.duel .field-row .game-card.token,
.duel .field-row .slot.empty {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
}
.duel .fighter-head { gap: 8px; }
.duel .life { font-size: 1.25rem; min-width: 76px; padding: 4px 8px; }
.duel .backs { min-height: 0; }
.duel .card-back { width: 16px; height: 22px; }
.duel .lane-label { margin: 2px 0 8px; }
.duel .game-card.playable,
.life.threatened,
.game-card.threatened { outline-offset: 0; }
.duel .hand-row { justify-content: flex-start; flex-wrap: nowrap; align-items: center; }
.duel .hand { flex: 1; min-width: 0; }
.duel .lane.fixed {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  container-type: size;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  justify-items: center;
}
.duel .lane.fixed .game-card,
.duel .lane.fixed .slot.empty {
  width: min(calc((100cqi - 16px) / 3), calc((100cqh - 22px) * 0.75));
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: 3 / 4;
  padding: 0;
}
.duel .lane.fixed .slot.empty { padding: 4px; }
.duel .lane.fixed .game-card.token.has-stats {
  aspect-ratio: auto;
  height: auto;
  max-height: 100%;
}
.duel .field-row, .duel .hand-row { flex: 0 0 auto; padding: 6px 8px; gap: 8px; }
.fighter-head strong { display: block; }
.duel .hand .game-card.token {
  width: auto;
  height: 104px;
  min-height: 0;
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
  padding: 0;
}
.duel .hand { align-items: center; overflow-x: auto; overflow-y: hidden; }
.duel .hint, .duel .chain-banner, .duel .banner { padding: 6px 10px; }
.duel .dock { padding: 0; position: static; }
.chronicle .log {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  align-content: start;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}
.log .entry {
  padding: 6px 8px;
  border-radius: 8px;
  border-left: 3px solid var(--line);
  background: rgba(7, 13, 28, 0.35);
}
.log .entry.ataque, .log .entry.dano, .log .entry.destruida { border-left-color: var(--red-2); }
.log .entry.invocacion, .log .entry.robo { border-left-color: var(--blue-2); }
.log .entry.vida { border-left-color: var(--ok); }
.log .entry.negada, .log .entry.boca_abajo { border-left-color: #f0c14a; }
.log .entry.fresh { animation: log-in 1.6s ease; }
@keyframes log-in {
  from { background: rgba(240, 193, 74, 0.34); }
  to { background: rgba(7, 13, 28, 0.35); }
}

@media (max-width: 720px) {
  .card-sheet { grid-template-columns: 1fr; }
  .sheet-art { width: min(220px, 72%); margin: 0 auto; }
  .sheet-body { max-height: none; padding-top: 8px; }
}

@media (orientation: portrait) and (max-width: 900px) {
  .shell:has(.duel) {
    position: fixed;
    top: -100vw;
    top: -100dvw;
    left: 0;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    height: 100dvw;
    transform: rotate(90deg);
    transform-origin: bottom left;
    overflow: hidden;
  }
}

.primary, .danger, .ghost, .small, .menu-card, .nav a {
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}
.primary:hover, .danger:hover, .ghost:hover, .small:hover, .nav a:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.primary {
  box-shadow: 0 8px 18px rgba(29, 109, 255, 0.35);
}
.danger { box-shadow: 0 8px 18px rgba(225, 6, 0, 0.28); }
.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}
.menu-card.tone-play { border-color: rgba(126, 182, 255, 0.7); background: linear-gradient(180deg, rgba(29, 109, 255, 0.42), rgba(12, 23, 51, 0.4)); }
.menu-card.tone-rank { border-color: rgba(240, 193, 74, 0.8); background: linear-gradient(180deg, rgba(240, 193, 74, 0.34), rgba(12, 23, 51, 0.4)); }
.ranked {
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 800; color: #1a1203;
  background: linear-gradient(180deg, #ffe08a, #f0c14a);
  box-shadow: 0 8px 18px rgba(240, 193, 74, 0.35);
}
.ranked:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ladder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ladder ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ladder-row {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04);
}
.ladder-row.mine { border: 1px solid rgba(240, 193, 74, 0.85); background: rgba(240, 193, 74, 0.14); }
@media (max-width: 860px) {
  .ladder-grid { grid-template-columns: 1fr; }
}
.menu-card.tone-decks { border-color: rgba(240, 193, 74, 0.7); background: linear-gradient(180deg, rgba(240, 193, 74, 0.28), rgba(12, 23, 51, 0.4)); }
.menu-card.tone-collection { border-color: rgba(232, 238, 248, 0.55); background: linear-gradient(180deg, rgba(232, 238, 248, 0.2), rgba(12, 23, 51, 0.4)); }
.menu-card.tone-shop { border-color: rgba(255, 77, 69, 0.7); background: linear-gradient(180deg, rgba(225, 6, 0, 0.32), rgba(12, 23, 51, 0.4)); }
.menu-card.tone-esencia { border-color: rgba(186, 140, 255, 0.8); background: linear-gradient(180deg, rgba(150, 90, 255, 0.34), rgba(12, 23, 51, 0.4)); }
.paypal-slot { min-height: 42px; }
.menu-card.tone-profile { border-color: rgba(61, 214, 140, 0.7); background: linear-gradient(180deg, rgba(61, 214, 140, 0.28), rgba(12, 23, 51, 0.4)); }
.menu-card.tone-admin { border-color: rgba(180, 140, 255, 0.7); background: linear-gradient(180deg, rgba(140, 90, 255, 0.28), rgba(12, 23, 51, 0.4)); }

.view:has(.home-screen) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 0 0;
}
.home-screen { min-height: calc(100vh - 90px); display: flex; flex-direction: column; }
.home-screen > .hero,
.home-screen > .menu-grid {
  width: min(1180px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}
.home-screen .marquee {
  margin-top: auto;
  width: 100%;
  overflow: hidden;
  padding: 18px 0 8px;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee-left 36s linear infinite;
}
.marquee-card {
  width: 168px;
  height: 224px;
  object-fit: contain;
  border-radius: 14px;
  background: #070d1c;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
@keyframes marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

.product { overflow: hidden; }
.product-art {
  width: min(180px, 100%);
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border-radius: 14px;
  background: #070d1c;
  justify-self: center;
}
.product-art.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
}
.product:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(29, 109, 255, 0.22); }

.choice-bar:empty { display: none; }
.choice-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(240, 193, 74, 0.16);
  border: 1px solid rgba(240, 193, 74, 0.55);
}
.choice-target { box-shadow: 0 0 16px rgba(240, 193, 74, 0.45); }
.game-card.pickable {
  outline: 3px solid #f0c14a;
  outline-offset: 2px;
  cursor: pointer;
  animation: pick-pulse 1s ease-in-out infinite;
}
@keyframes pick-pulse {
  50% { box-shadow: 0 0 18px rgba(240, 193, 74, 0.9); }
}

.pack-scene { display: grid; justify-items: center; gap: 16px; width: min(980px, 100%); }
.pack-box {
  width: min(280px, 80vw);
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(160deg, #4d8dff, #1d6dff 42%, #e10600);
  box-shadow: 0 20px 50px rgba(29, 109, 255, 0.45);
  animation: pack-shake 0.7s ease;
}
.pack-box.burst { animation: pack-burst 0.4s ease forwards; }
.pack-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.pack-flip {
  position: relative;
  width: 168px;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(24px) scale(0.86) rotateY(70deg);
}
.pack-flip.show { animation: pack-reveal 0.55s ease forwards; }
.rarity-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(7, 13, 28, 0.82);
}
.pack-flip.rarity-comun { filter: drop-shadow(0 0 10px rgba(232, 238, 248, 0.45)); }
.pack-flip.rarity-poco_comun { filter: drop-shadow(0 0 14px rgba(61, 214, 140, 0.8)); }
.pack-flip.rarity-poco_comun .rarity-label { color: #b8ffd9; }
.pack-flip.rarity-rara { filter: drop-shadow(0 0 16px rgba(126, 182, 255, 0.95)); }
.pack-flip.rarity-rara .rarity-label { color: #d6e8ff; }
.pack-flip.rarity-epica { filter: drop-shadow(0 0 18px rgba(240, 193, 74, 0.95)); }
.pack-flip.rarity-epica .rarity-label { color: #ffe7a3; }
@keyframes pack-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}
@keyframes pack-burst {
  to { transform: scale(1.15); opacity: 0; filter: brightness(2); }
}
@keyframes pack-reveal {
  to { opacity: 1; transform: translateY(0) scale(1) rotateY(0deg); }
}
