:root {
  color-scheme: dark;
  --bg: #0d0716;
  --text: #fff8f3;
  --muted: #b6a4c7;
  --orange: #ff8a3d;
  --orange-soft: #ffb066;
  --pink: #ff5f9e;
  --violet: #9d7bff;
  --like: #46e6a4;
  --pass: #ff6b7a;
  --accent: linear-gradient(135deg, #ffc06a 0%, #ff8a3d 42%, #ff5f9e 100%);
  --accent-text: #2a1200;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --surface-strong: #1a1029;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --photo-bg: radial-gradient(circle at 30% 20%, #2a183d, #150d20 72%);
  --shimmer-base: rgba(255, 255, 255, 0.035);
  --shimmer-shine: rgba(255, 255, 255, 0.12);
  --glow-one: #ff7a2f;
  --glow-one-opacity: 0.3;
  --glow-two: #ff4f9a;
  --glow-two-opacity: 0.24;
  --glow-three: #7b3dff;
  --glow-three-opacity: 0.22;
  --shadow-card: 0 34px 70px -42px rgba(0, 0, 0, 0.95), 0 16px 46px -30px rgba(255, 95, 158, 0.35);
  --shadow-btn: 0 18px 34px -20px rgba(0, 0, 0, 0.9);
  --toast-bg: #241534;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff6ed;
  --text: #2b1810;
  --muted: #7e675a;
  --orange: #d95a0a;
  --orange-soft: #f08a3c;
  --pink: #d61f6d;
  --violet: #6b3fd1;
  --like: #0e9f6e;
  --pass: #dc3d4f;
  --accent: linear-gradient(135deg, #ffb347 0%, #ff7a29 45%, #ff4f95 100%);
  --accent-text: #2a1200;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --surface-strong: #ffffff;
  --line: rgba(90, 45, 20, 0.14);
  --line-strong: rgba(90, 45, 20, 0.24);
  --photo-bg: radial-gradient(circle at 30% 20%, #ffe4cf, #ffd0b3 72%);
  --shimmer-base: rgba(120, 70, 40, 0.06);
  --shimmer-shine: rgba(255, 255, 255, 0.75);
  --glow-one: #ffb066;
  --glow-one-opacity: 0.5;
  --glow-two: #ff9ec4;
  --glow-two-opacity: 0.42;
  --glow-three: #c9b2ff;
  --glow-three-opacity: 0.4;
  --shadow-card: 0 34px 70px -46px rgba(120, 60, 30, 0.45), 0 16px 46px -32px rgba(214, 31, 109, 0.28);
  --shadow-btn: 0 18px 34px -22px rgba(120, 60, 30, 0.5);
  --toast-bg: #2b1810;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 15%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--pink);
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
}

.glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.glow--one {
  top: -28vmax;
  left: -20vmax;
  width: 62vmax;
  height: 62vmax;
  background: radial-gradient(circle, var(--glow-one) 0%, transparent 66%);
  opacity: var(--glow-one-opacity);
}

.glow--two {
  right: -24vmax;
  top: 16vmax;
  width: 56vmax;
  height: 56vmax;
  background: radial-gradient(circle, var(--glow-two) 0%, transparent 66%);
  opacity: var(--glow-two-opacity);
}

.glow--three {
  left: -10vmax;
  bottom: -34vmax;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, var(--glow-three) 0%, transparent 66%);
  opacity: var(--glow-three-opacity);
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 1040px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) clamp(14px, 4vw, 28px)
    max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --------------------------------- Barra ---------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.brand:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.brand__paw {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand__name em {
  font-style: normal;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(14px);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

#open-champions:hover svg {
  color: var(--orange);
}

.fav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ---------------------------------- Intro ---------------------------------- */

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  animation: rise 0.5s ease both;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow span {
  font-size: 0.82rem;
  letter-spacing: 0;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(1.75rem, 4.4vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 850;
  text-wrap: balance;
}

h1 span {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(0.86rem, 2.4vw, 0.95rem);
  text-wrap: pretty;
}

/* ---------------------------------- Stats ---------------------------------- */

.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  animation: rise 0.5s 0.05s ease both;
}

.stats strong {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 800;
}

.stat__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* ---------------------------------- Juego ---------------------------------- */

.game {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  animation: rise 0.55s 0.08s ease both;
}

.roundbar {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.roundbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roundbar__text {
  min-width: 0;
}

.roundbar__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.roundbar__meta {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--orange) 60%, transparent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------- Arena ---------------------------------- */

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.arena__vs {
  position: relative;
  display: grid;
  place-items: center;
  z-index: 2;
}

.arena__vs::before {
  content: "";
  position: absolute;
  top: 6%;
  bottom: 6%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

.arena__vs span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 36px -12px rgba(255, 95, 158, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.duel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease,
    opacity 0.3s ease, filter 0.3s ease;
  animation: card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.duel-card:nth-of-type(2) {
  animation-delay: 0.05s;
}

@media (hover: hover) {
  .duel-card:not(:disabled):hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 20px 50px -28px rgba(255, 138, 61, 0.5);
  }
}

.duel-card:not(:disabled):active {
  transform: scale(0.99);
}

.duel-card:disabled {
  cursor: default;
}

.duel-card.is-chosen {
  border-color: var(--like);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--like) 70%, transparent),
    0 30px 70px -30px rgba(70, 230, 164, 0.5);
  transform: translateY(-3px) scale(1.005);
}

.duel-card.is-lost {
  opacity: 0.42;
  filter: grayscale(0.8) brightness(0.85);
  transform: scale(0.975);
}

.duel-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3.5;
  overflow: hidden;
  background: var(--photo-bg);
}

.duel-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

@media (hover: hover) {
  .duel-card:not(:disabled):hover .duel-card__img {
    transform: scale(1.03);
  }
}

.duel-card__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    var(--shimmer-base) 8%,
    var(--shimmer-shine) 20%,
    var(--shimmer-base) 34%
  );
  background-size: 240% 100%;
  animation: shimmer 1.35s linear infinite;
  transition: opacity 0.3s ease;
}

.duel-card.is-ready .duel-card__shimmer {
  opacity: 0;
}

.duel-card__distance {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(12, 6, 20, 0.46);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.duel-card__check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--like);
  color: #07160f;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.duel-card.is-chosen .duel-card__check {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.duel-card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  padding: 14px 16px 16px;
}

.duel-card__name {
  display: block;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 850;
}

.duel-card__name em {
  margin-left: 6px;
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--muted);
}

.duel-card__bio {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.duel-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
}

.duel-card__tags span {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-top: auto;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 26px -12px rgba(255, 95, 158, 0.75);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.duel-card.is-chosen .duel-card__cta {
  filter: saturate(0.2) brightness(1.1);
}

/* ------------------------------ Carga / error ------------------------------ */

.arena-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: clamp(260px, 40svh, 420px);
  padding: 30px 20px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.arena-status__emoji {
  margin: 0;
  font-size: 2.6rem;
}

.arena-status__text {
  margin: 0;
  max-width: 30ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.arena-skeleton {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(12px, 3vw, 28px);
  padding-bottom: 8px;
}

.skeleton-card {
  aspect-ratio: 4 / 4.45;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(
    110deg,
    var(--shimmer-base) 8%,
    var(--shimmer-shine) 20%,
    var(--shimmer-base) 34%
  );
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.8);
}

/* --------------------------------- Botones --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 34px -16px rgba(255, 95, 158, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.16s ease, filter 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--surface-hover);
}

.btn--tiny {
  flex: none;
  gap: 6px;
  padding: 8px 13px;
  font-size: 0.78rem;
}

.btn--tiny svg {
  width: 14px;
  height: 14px;
}

/* ---------------------------------- Hint ----------------------------------- */

.hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.hint kbd {
  display: inline-block;
  margin: 0 1px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
}

/* -------------------------------- Campeón ---------------------------------- */

.champion {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  animation: rise 0.5s ease both;
}

.champion__kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.champion__card {
  position: relative;
  width: min(100%, 430px);
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.champion__photo {
  position: relative;
  aspect-ratio: 4 / 3.15;
  background: var(--photo-bg);
}

.champion__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.champion__trophy {
  position: absolute;
  left: 50%;
  bottom: -30px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 1.7rem;
  box-shadow: 0 16px 34px -12px rgba(255, 95, 158, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 3px solid var(--surface-strong);
}

.champion__body {
  padding: 40px 24px 22px;
}

.champion__body h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  letter-spacing: -0.04em;
  font-weight: 850;
}

.champion__bio {
  margin: 6px auto 0;
  max-width: 32ch;
  color: var(--muted);
  font-size: 0.88rem;
  text-wrap: pretty;
}

.champion__meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.champion__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.champion__actions .btn {
  flex: 1 1 140px;
  padding: 12px 18px;
  font-size: 0.86rem;
}

.champion__share {
  margin-top: 12px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.champion__share:hover {
  color: var(--text);
}

.champion__confetti {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.champion__confetti span {
  position: absolute;
  top: -30px;
  font-size: 1.2rem;
  animation: heart-fall 2.6s ease-in forwards;
  opacity: 0;
}

/* -------------------------------- Campeones -------------------------------- */

.dialog {
  width: min(94vw, 460px);
  max-height: min(84svh, 640px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 50px 110px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: pop 0.32s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.dialog::backdrop {
  background: rgba(8, 3, 14, 0.62);
  backdrop-filter: blur(8px);
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.dialog__head h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.dialog__sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.dialog__empty {
  margin: 0;
  padding: 26px 24px 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  text-wrap: pretty;
}

.champ-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 4px 14px 14px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.champ-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.champ-item__photo {
  width: 62px;
  height: 62px;
  border-radius: 13px;
  object-fit: cover;
  background: var(--photo-bg);
}

.champ-item__body {
  min-width: 0;
}

.champ-item__name {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-item__meta {
  margin: 1px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-item__wins {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--orange);
  font-weight: 750;
}

.champ-item__remove {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.champ-item__remove:hover {
  color: var(--pass);
  border-color: color-mix(in srgb, var(--pass) 45%, transparent);
  background: color-mix(in srgb, var(--pass) 10%, transparent);
}

.champ-item__remove svg {
  width: 15px;
  height: 15px;
}

.dialog__foot {
  padding: 0 20px 18px;
}

.dialog__foot .btn {
  width: 100%;
  padding: 11px 18px;
  font-size: 0.84rem;
}

/* --------------------------------- Footer ---------------------------------- */

.footer {
  margin-top: 2px;
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
}

.footer p {
  margin: 0;
  text-wrap: balance;
}

.footer a {
  color: inherit;
}

/* ---------------------------------- Toast ---------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 80;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--toast-bg);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------- Animaciones ------------------------------- */

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes heart-fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.7);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(115vh) rotate(320deg) scale(1.15);
  }
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* ------------------------------- Responsive -------------------------------- */

@media (max-width: 720px) {
  .app {
    gap: 13px;
  }

  .main {
    gap: 13px;
  }

  .game {
    gap: 11px;
  }

  .arena {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .arena__vs {
    height: 34px;
  }

  .arena__vs::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
  }

  .arena__vs span {
    width: 38px;
    height: 38px;
    font-size: 0.72rem;
  }

  .duel-card {
    flex-direction: row;
    align-items: stretch;
    border-radius: 22px;
  }

  .duel-card__media {
    flex: 0 0 40%;
    aspect-ratio: auto;
    min-height: 156px;
  }

  .duel-card__body {
    justify-content: center;
    gap: 5px;
    padding: 12px 14px;
  }

  .duel-card__name {
    font-size: 1.22rem;
  }

  .duel-card__bio {
    font-size: 0.78rem;
  }

  .duel-card__tags span:nth-child(n + 3) {
    display: none;
  }

  .duel-card__cta {
    padding: 5px 11px;
    font-size: 0.72rem;
  }

  .arena-skeleton {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .skeleton-card {
    aspect-ratio: 16 / 6;
    border-radius: 22px;
  }

  .skeleton-card:nth-child(2) {
    display: none;
  }

  .skeleton-card + .skeleton-card {
    display: none;
  }

  .champion__card {
    width: min(100%, 400px);
  }
}

@media (max-width: 520px) {
  .brand {
    padding: 6px 12px 6px 8px;
    font-size: 0.76rem;
  }

  h1 {
    font-size: clamp(1.6rem, 7.4vw, 2rem);
  }

  .subtitle {
    max-width: 32ch;
  }

  .roundbar {
    padding: 10px 12px 11px;
  }

  .roundbar__name {
    font-size: 0.88rem;
  }

  .roundbar__meta {
    font-size: 0.7rem;
  }

  .btn--tiny {
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .hint {
    font-size: 0.7rem;
  }

  .champion__body {
    padding: 36px 18px 20px;
  }
}

@media (max-width: 390px) {
  .brand__name {
    display: none;
  }

  .brand {
    padding: 7px;
  }

  .duel-card__media {
    flex-basis: 37%;
    min-height: 148px;
  }

  .duel-card__bio {
    display: none;
  }

  .duel-card__tags {
    min-height: 0;
  }

  .duel-card__tags span:nth-child(n + 2) {
    display: none;
  }
}

@media (max-height: 870px) and (max-width: 720px) {
  .subtitle {
    display: none;
  }

  .intro {
    gap: 4px;
  }

  .duel-card__media {
    min-height: 142px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
