:root {
  color-scheme: dark;
  --bg: #090d14;
  --bg-soft: #0d1420;
  --surface: rgba(17, 24, 39, 0.86);
  --surface-strong: rgba(25, 35, 52, 0.94);
  --surface-muted: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(231, 185, 82, 0.36);
  --text: #f6f7fb;
  --muted: #9ca8ba;
  --dim: #657184;
  --gold: #e7b952;
  --gold-dark: #a36e1d;
  --red: #e84d3c;
  --red-dark: #9f261e;
  --green: #3ad67b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --radius-lg: 12px;
  --max: 1220px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background:
    linear-gradient(135deg, rgba(232, 77, 60, 0.08), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(44, 125, 240, 0.12), transparent 32%),
    linear-gradient(180deg, #080b11 0%, var(--bg) 48%, #070a0f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

.app-container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.app-container--loading {
  opacity: 0;
  transform: translateY(8px);
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  backdrop-filter: blur(18px);
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  z-index: -1;
  background: rgba(9, 13, 20, 0.78);
  border-bottom: 1px solid var(--border);
  transform: translateX(-50%);
}

.header__brand,
.social-link,
.social-tile,
.deck-card__btn,
.filter-btn,
.filter-tag {
  display: inline-flex;
  align-items: center;
}

.header__brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header__brand > span:last-child span {
  color: var(--gold);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 28px rgba(231, 185, 82, 0.24);
}

.brand-logo--loader {
  width: 54px;
  height: 54px;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__tagline {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(232, 77, 60, 0.42);
  border-radius: 999px;
  background: rgba(232, 77, 60, 0.12);
  color: #ff7a6b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-badge[hidden] {
  display: none;
}

.live-badge:hover {
  border-color: rgba(232, 77, 60, 0.7);
  transform: translateY(-1px);
}

.live-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d3c;
  box-shadow: 0 0 0 0 rgba(255, 77, 60, 0.55);
  animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 60, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 77, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 60, 0); }
}

.social-link:hover,
.social-tile:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.content {
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: stretch;
  padding: 24px 0 18px;
}

.hero__copy {
  min-height: 198px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(232, 77, 60, 0.16), transparent 36%),
    linear-gradient(160deg, rgba(231, 185, 82, 0.1), transparent 46%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero__label {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.9rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.hero__copy > p:last-child {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.hero__panel {
  display: flex;
  min-height: 198px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  border: 1px solid rgba(231, 185, 82, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(231, 185, 82, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    var(--surface-strong);
  box-shadow: var(--shadow);
}

.hero__panel--socials {
  justify-content: stretch;
}

.hero__panel span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__panel strong {
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.hero__panel small {
  margin-top: 10px;
  color: var(--muted);
}

.hero-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 11px;
  flex: 1;
  margin-top: 0;
}

.social-tile {
  gap: 10px;
  justify-content: center;
  min-height: 0;
  padding: 12px 10px;
  border: 1px solid currentColor;
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: 0.83rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.social-tile .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.social-tile span {
  color: currentColor;
}

.social-tile--youtube {
  color: #ff615a;
}

.social-tile--twitch {
  color: #9b7cff;
}

.social-tile--kick {
  color: #2be179;
}

.social-tile--web {
  color: #4c91ff;
}

.social-tile--untapped {
  color: #f0c96a;
}

.social-tile--donate {
  color: #ff78a7;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.stat-item {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.stat-item strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  line-height: 1;
}

.stat-item span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.filter-bar {
  position: sticky;
  top: 65px;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(150px, 190px));
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(13, 20, 32, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
}

.search-wrapper {
  position: relative;
}

.search-wrapper .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--dim);
  transform: translateY(-50%);
}

.search-input,
.filter-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  font-size: 16px;
}

.search-input {
  padding: 0 14px 0 42px;
}

.filter-select {
  padding: 0 12px;
  color-scheme: dark;
}

.filter-select option {
  color: #f6f7fb;
  background: #111827;
}

.filter-select option:checked,
.filter-select option:hover {
  color: #111827;
  background: #e7b952;
}

.search-input:focus,
.filter-select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(231, 185, 82, 0.12);
}

.filter-colors {
  display: inline-flex;
  gap: 6px;
  min-height: 44px;
  align-items: center;
}

.filter-btn {
  justify-content: center;
  min-height: 44px;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-weight: 800;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(231, 185, 82, 0.11);
}

.filter-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(231, 185, 82, 0.2);
  border-radius: 999px;
  background: rgba(231, 185, 82, 0.08);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
}

.deck-section {
  min-height: 400px;
}

.expansion-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.expansion-header__kicker {
  display: block;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.expansion-header h2 {
  margin: 5px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.expansion-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.deck-card {
  display: flex;
  min-height: 228px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  animation: cardIn 420ms ease both;
}

.deck-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.deck-card__top,
.deck-card__meta,
.deck-card__source,
.deck-card__actions {
  display: flex;
  align-items: center;
}

.deck-card__top {
  justify-content: space-between;
  gap: 10px;
}

.deck-card__top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.deck-card__detail {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(231, 185, 82, 0.24);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(231, 185, 82, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
}

.deck-card__detail:hover {
  border-color: var(--border-strong);
  background: rgba(231, 185, 82, 0.14);
}

.deck-card__colors {
  display: inline-flex;
  gap: 5px;
}

.mana-dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: var(--mana);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.mana-dot--lg {
  width: 18px;
  height: 18px;
}

.badge {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--pioneer,
.badge--explorer {
  color: #d9c7ff;
}

.badge--brawl,
.badge--alchemy {
  color: #ffd2a6;
}

.deck-card__name {
  margin: 24px 0 12px;
  font-size: 1.42rem;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.deck-card__meta {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.deck-card__meta span,
.deck-card__source span {
  min-width: 0;
}

.deck-card__source {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}

.deck-card__source span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--dim);
  font-size: 0.74rem;
  font-weight: 800;
}

.deck-card__actions {
  gap: 8px;
  margin-top: 12px;
}

.deck-card__btn {
  justify-content: center;
  min-height: 42px;
  flex: 1;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 900;
}

.deck-card__btn--primary {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #f3d889);
}

.deck-card__btn--video {
  color: var(--text);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
}

.deck-card__btn--disabled {
  color: var(--dim);
  background: rgba(255, 255, 255, 0.055);
  cursor: not-allowed;
}

.deck-card__btn:not(.deck-card__btn--disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.deck-card--skeleton {
  gap: 14px;
}

.skeleton {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton--short {
  width: 42%;
}

.skeleton--title {
  width: 76%;
  height: 30px;
  margin-top: 16px;
}

.skeleton--actions {
  height: 42px;
  margin-top: auto;
}

.empty-state {
  padding: 54px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 6px 0 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.view-tab {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  font-size: 0.92rem;
  transition: color 160ms ease, background 160ms ease;
}

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

.view-tab.active {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #f3d889);
}

.info-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.info-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.info-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  background: var(--surface-strong);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

.info-table tr:last-child td {
  border-bottom: 0;
}

.info-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.info-dim {
  color: var(--muted);
  font-weight: 600;
}

.year-pill {
  display: inline-block;
  min-width: 52px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(231, 185, 82, 0.09);
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.banned-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.banned-search-wrap {
  flex: 1 1 240px;
  max-width: 360px;
}

.banned-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.banned-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.banned-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.banned-chip.active {
  color: #111827;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #f3d889);
}

.banned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.banned-card[hidden] {
  display: none;
}

.banned-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(232, 77, 60, 0.08), transparent 42%),
    var(--surface);
}

.banned-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.banned-card__head h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.banned-count {
  min-width: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(232, 77, 60, 0.16);
  color: #ff8f82;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.banned-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banned-list li {
  padding: 7px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 620px);
  gap: 24px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
}

.footer h2 {
  margin: 0 0 8px;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.social-link {
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
  font-weight: 800;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.toast {
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(14px);
}

.deck-modal {
  position: relative;
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(231, 185, 82, 0.14), transparent 36%),
    var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.deck-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-right: 42px;
}

.deck-modal h2 {
  margin: 22px 42px 18px 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.deck-modal__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.deck-modal__meta div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.deck-modal__meta dt {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.deck-modal__meta dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.deck-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.initial-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.initial-loader--hidden {
  opacity: 0;
  visibility: hidden;
}

.initial-loader__content {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.initial-loader__content strong {
  font-size: 1.3rem;
}

.initial-loader__content p {
  margin: 0;
  color: var(--muted);
}

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

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero__panel {
    min-height: 160px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .search-wrapper,
  .filter-tags {
    grid-column: 1 / -1;
  }
}

/* Notch / barra de estado en PWA instalada */
.header {
  padding-top: calc(14px + env(safe-area-inset-top));
}

.header::before {
  top: calc(-1 * env(safe-area-inset-top));
}

@media (max-width: 640px) {
  .app-container {
    width: min(100% - 24px, var(--max));
  }

  .content {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }

  .header {
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 0 12px;
  }

  .header__tagline {
    display: none;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .hero {
    padding-top: 16px;
    gap: 16px;
  }

  .hero__copy,
  .hero__panel {
    padding: 20px;
  }

  .hero__copy {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 12vw, 3rem);
  }

  .hero__copy > p:last-child {
    margin-top: 14px;
  }

  .hero__panel {
    min-height: auto;
  }

  .hero-social-grid {
    grid-template-rows: none;
    min-height: 0;
  }

  .social-tile {
    min-height: 52px;
    padding: 12px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-item {
    padding: 13px 14px;
  }

  /* Filtros compactos: selects 2x2, colores y botones a lo ancho */
  .filter-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .filter-colors {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .filter-btn--mana {
    flex: 1;
  }

  .filter-btn--clear,
  .filter-btn--refresh {
    justify-content: center;
  }

  .footer {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .deck-grid {
    grid-template-columns: 1fr;
  }

  .deck-card {
    min-height: 0;
  }

  .social-links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .deck-modal {
    padding: 20px;
  }

  .deck-modal__meta,
  .deck-modal__actions {
    grid-template-columns: 1fr;
  }

  .deck-modal__actions {
    flex-direction: column;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: clamp(2.1rem, 11vw, 2.6rem);
  }

  .header__brand {
    font-size: 1.05rem;
  }

  .live-badge {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}

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