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

:root {
  color-scheme: dark;
  --bg: #0a0712;
  --bg-elev: #120c1f;
  --surface: #151022;
  --surface-alt: #0f0b1a;
  --card: #1b142a;
  --accent: #8b5cf6;
  --accent-strong: #c4b5fd;
  --accent-deep: #6d28d9;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --text: #f4f1ea;
  --text-muted: #c9c1b4;
  --text-faint: #a59b8d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(139, 92, 246, 0.35);
  --shadow: rgba(0, 0, 0, 0.6);
  --max-width: 1180px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --dg-gap: 14px;
  --dg-card-bg: rgba(12, 9, 17, 0.76);
  --dg-card-border: rgba(139, 92, 246, 0.24);
  --dg-card-radius: 12px;
  --title-font: "Cinzel", "Trajan Pro", "Palatino Linotype", "Times New Roman", serif;
  --site-bg: url("../images/deckalchemybg.png");
  --hero-art: var(--site-bg);
}

html {
  background: transparent;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 7, 18, 0.45) 0%, rgba(9, 6, 16, 0.55) 50%, rgba(8, 5, 14, 0.7) 100%),
    radial-gradient(ellipse 120% 80% at 50% 20%, rgba(139, 92, 246, 0.15), transparent 50%),
    var(--site-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

img {
  max-width: 100%;
}

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

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(25, 19, 35, 0.816);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 8px 24px -20px rgba(0, 0, 0, 0.7);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: var(--title-font);
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.logo:hover {
  color: inherit;
  opacity: 0.9;
}

.logo-mark {
  font-size: 18px;
  color: var(--accent-strong);
  text-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

.logo-mark img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.site-header .logo-mark img {
  width: 32px;
  height: 32px;
}

.footer-logo .logo-mark img {
  width: 18px;
  height: 18px;
}

.logo span:last-child {
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-links a {
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.3);
}

.hero {
  padding: 120px 0 110px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10, 7, 18, 0.86), rgba(10, 7, 18, 0.92));
}

.hero--art {
  background-image:
    linear-gradient(180deg, rgba(10, 7, 18, 0.78), rgba(10, 7, 18, 0.92)),
    var(--hero-art);
  background-size: cover;
  background-position: center;
}

.hero-content {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 44px;
  align-items: center;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent-strong);
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 20px;
  font-family: var(--title-font);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 16px;
  font-family: var(--title-font);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  font-family: var(--title-font);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-accent {
  display: block;
  color: var(--accent);
  margin-top: 6px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.section-header--center {
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
  justify-items: center;
}

.section--dark {
  background: rgba(18, 14, 12, 0.92);
}

.section--cta {
  background: linear-gradient(180deg, rgba(10, 7, 18, 0.88), rgba(10, 7, 18, 0.94));
}

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(16, 12, 10, 0.9);
}

.button {
  border: none;
  background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 70%);
  color: #1a0f2b;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 26px -20px var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -12px var(--shadow);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button--ghost {
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: var(--accent-strong);
}

.button--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.button--discord {
  gap: 8px;
}

.button--discord svg {
  flex-shrink: 0;
}

.text-muted {
  color: var(--text-muted);
}

.nav .button {
  padding: 8px 14px;
  font-size: 12px;
}

.hero-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-meta > div {
  background: rgba(18, 14, 12, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.meta-label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.3px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.meta-value {
  font-weight: 600;
  color: var(--text);
}

.hero-panel {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 50px -36px var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: none;
}

.hero-panel--deck {
  display: grid;
  gap: 18px;
}

.panel-header,
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.2px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.panel-footer {
  margin-top: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(139, 92, 246, 0.18);
  color: var(--accent-strong);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.budget-indicator {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.budget-indicator.budget-indicator--active {
  color: var(--accent-strong);
  font-weight: 600;
}

.budget-badge {
  display: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.budget-badge.budget-badge--active {
  display: inline-block;
  background: rgba(34, 197, 94, 0.2);
  color: var(--success, #22c55e);
}

.panel-header .budget-badge.budget-badge--active {
  margin-left: 8px;
}

.pill {
  background: rgba(18, 14, 12, 0.8);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.builder-preview {
  display: grid;
  gap: 16px;
}

.builder-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(18, 14, 12, 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.builder-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.builder-column {
  background: rgba(16, 12, 10, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.builder-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
}

.builder-list-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid rgba(36, 48, 65, 0.9);
}

.builder-count {
  color: var(--accent-strong);
  font-weight: 700;
  text-align: center;
}

.builder-tag {
  font-size: 11px;
  color: var(--text-faint);
}

.builder-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mana-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: rgba(16, 12, 10, 0.9);
}

.mana-pill.mana-w {
  background: #f5f5f4;
  color: #1f2937;
}

.mana-pill.mana-u {
  background: #1e40af;
  color: #e0f2fe;
}

.mana-pill.mana-b {
  background: #111827;
  color: #f9fafb;
}

.mana-pill.mana-r {
  background: #991b1b;
  color: #fee2e2;
}

.mana-pill.mana-g {
  background: #065f46;
  color: #dcfce7;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}

.seed-card {
  background: rgba(18, 14, 12, 0.9);
  border: 1px dashed rgba(139, 92, 246, 0.35);
  border-radius: 12px;
  padding: 22px 0;
  text-align: center;
  font-weight: 600;
}

.seed-card--empty {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   DECK GENERATOR — TABBED LAYOUT SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* ── Sticky toolbar ── */
.dg-toolbar {
  position: sticky;
  top: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(18, 14, 12, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--dg-card-radius);
  margin-bottom: var(--dg-gap);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

.dg-toolbar__seeds {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dg-toolbar__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dg-toolbar__range {
  width: 100px;
}

.dg-toolbar__range-val {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-strong);
}

.dg-toolbar__actions {
  display: flex;
  gap: 8px;
}

.dg-toolbar__btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-strong);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dg-toolbar__btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(139, 92, 246, 0.6);
}

.dg-toolbar__status {
  margin-left: auto;
}

.dg-toolbar__badge {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Tab bar ── */
.dg-tabs {
  display: flex;
  gap: 0;
  background: rgba(18, 14, 12, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--dg-card-radius);
  padding: 4px;
  margin-bottom: var(--dg-gap);
}

.dg-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: calc(var(--dg-card-radius) - 4px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-align: center;
  white-space: nowrap;
}

.dg-tab:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
}

.dg-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dg-tab.active {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

/* ── Tab panels ── */
.dg-panels {
  min-height: 200px;
  background: rgba(13, 10, 19, 0.65);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--dg-card-radius);
  padding: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dg-panel {
  display: none;
}

.dg-panel.active {
  display: block;
}

.dg-panel > * + * {
  margin-top: var(--dg-gap);
}

/* ── Responsive grid ── */
.dg-grid {
  display: grid;
  gap: var(--dg-gap);
}

.dg-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.dg-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Card (control group wrapper) ── */
.dg-card {
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-border);
  border-radius: var(--dg-card-radius);
  padding: 14px 16px;
}

.dg-card--wide {
  /* spans full width in any grid — no special rule needed when outside grid */
}

.dg-card--center {
  display: grid;
  align-content: center;
  justify-items: start;
}

.dg-card__heading {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ── Accordion (details/summary) ── */
.dg-accordion {
  border: 1px solid var(--dg-card-border);
  border-radius: var(--dg-card-radius);
  overflow: hidden;
  background: rgba(12, 10, 20, 0.4);
}

.dg-accordion__header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s;
}

.dg-accordion__header::-webkit-details-marker,
.dg-accordion__header::marker {
  display: none;
}

.dg-accordion__header::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.dg-accordion[open] .dg-accordion__header::before {
  transform: rotate(180deg);
}

.dg-accordion__header:hover {
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.06);
}

.dg-accordion__body {
  padding: 0 16px 16px;
  display: grid;
  gap: var(--dg-gap);
}

/* ── Generate button (always visible below tabs) ── */
.dg-generate {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
}

.dg-generate .generator-button {
  width: min(420px, 100%);
  min-width: 200px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
}

/* ── Search panel inside tab ── */
.dg-panel .search-panel {
  display: grid;
  gap: 10px;
}

/* ── Color filter inside dg-card: horizontal row ── */
.dg-card .color-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.dg-card .color-filter-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.dg-card .color-filter-btn img {
  width: 24px;
  height: 24px;
}

/* ── Filters trio: Colors | Mechanics | Curve in one card ── */
.dg-filters-trio {
  display: grid;
  grid-template-columns: auto 1fr minmax(260px, 0.8fr);
  gap: 0;
}

.dg-filters-trio__col {
  padding: 14px 16px;
}

.dg-filters-trio__col + .dg-filters-trio__col {
  border-left: 1px solid var(--dg-card-border);
}

.dg-filters-trio__col--mechanics {
  min-width: 0;
}

.dg-filters-trio__col--mechanics .synergy-filter {
  max-height: 160px;
}

/* ── Owned-only toggle button ── */
.dg-owned-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dg-owned-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.dg-owned-toggle:hover {
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--text);
}

.dg-owned-toggle.is-active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.dg-owned-toggle__icon {
  font-size: 15px;
  line-height: 1;
}

/* ── Screen-reader only (visually hidden) ── */
.dg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Set filter (Search tab) ── */
.dg-set-filter {
  margin-top: 10px;
}

.dg-set-filter__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dg-set-filter__toggle {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.dg-set-filter__toggle:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
}

.dg-set-filter__summary {
  font-size: 11px;
  color: var(--text-muted);
}

.dg-set-filter__panel {
  margin-top: 8px;
  padding: 10px;
  background: rgba(9, 7, 14, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
}

.dg-set-filter__panel[hidden] {
  display: none;
}

.dg-set-filter__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.dg-set-filter__action {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-strong);
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dg-set-filter__action:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}

.dg-set-filter__list {
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.dg-set-filter__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0;
}

.dg-set-filter__item input {
  width: auto;
}

/* ── DG responsive ── */
@media (max-width: 768px) {
  .dg-filters-trio {
    grid-template-columns: 1fr;
  }

  .dg-filters-trio__col + .dg-filters-trio__col {
    border-left: none;
    border-top: 1px solid var(--dg-card-border);
  }

  .dg-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .dg-toolbar__actions {
    order: 3;
    width: 100%;
  }

  .dg-toolbar__btn {
    flex: 1;
  }

  .dg-toolbar__status {
    order: 2;
    margin-left: 0;
  }

  .dg-grid--2,
  .dg-grid--3 {
    grid-template-columns: 1fr;
  }

  .dg-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dg-tab {
    font-size: 12px;
    padding: 9px 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .dg-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════
   LEGACY GENERATOR STYLES (kept for backwards compatibility)
   ═══════════════════════════════════════════════════════════════ */

.generator {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

/* (Old generator-row layout rules removed — now using dg-* tabbed system) */

.seed-slot-grid--compact {
  margin: 12px 0 0;
  max-height: 438px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.search-results.search-results--compact {
  max-height: 280px;
}

.format-set-list {
  max-height: 132px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: rgba(13, 10, 9, 0.95);
}

.format-set-dropdown-toggle {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(13, 10, 9, 0.95);
  color: var(--text);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.format-set-dropdown-toggle:hover,
.format-set-dropdown-toggle:focus {
  border-color: var(--accent-strong);
  outline: none;
}

.format-set-dropdown-panel {
  margin-top: 8px;
  position: static;
  background: rgba(9, 7, 14, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 18px -14px rgba(0, 0, 0, 0.8);
  display: grid;
  gap: 8px;
}

.format-set-dropdown-panel.is-hidden {
  display: none;
}

.format-set-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.format-set-item input {
  width: auto;
}

.mechanic-pill--auto::after {
  content: "Auto";
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.22);
  color: var(--accent-strong);
}

/* (Old generator-row--generate and format-row rules removed) */

/* (Old generator-panel--unified rules removed — now using dg-* tabbed system) */

.generator-panel {
  background: rgba(18, 14, 12, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 36px -30px var(--shadow);
}

.generator-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.generator-actions .generator-button {
  min-width: 200px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
}

.seed-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 188px);
  justify-content: start;
  gap: 18px;
  margin: 20px 0 24px;
  align-items: start;
}

.deck-generator-page .generator-panel--seeds-top .seed-slot-grid {
  gap: 16px;
  margin: 16px 0 0;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.recommendation-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.18);
  font-size: 13px;
}

.recommendation-image {
  width: 54px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.recommendation-body {
  display: grid;
  gap: 6px;
}

.recommendation-title {
  font-weight: 600;
  color: var(--text);
}

.recommendation-meta {
  color: var(--text-faint);
  font-size: 12px;
}

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

.recommendation-button {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--accent-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.seed-slot {
  background: rgba(14, 11, 10, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  aspect-ratio: 2.5 / 3.5;
  width: 100%;
  max-width: 188px;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 14px;
  text-align: center;
  position: relative;
  min-height: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 24px -22px var(--shadow);
}

.seed-slot--commander {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4);
}

.seed-slot-wrapper {
  display: grid;
  gap: 8px;
  align-content: start;
  position: relative;
  padding-top: 26px;
}

.seed-slot-tag {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--accent-strong);
}

.seed-slot-label {
  text-align: center;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 16px;
}

.seed-slot.active {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.seed-slot:hover {
  border-color: var(--accent-strong);
}

.seed-slot.drag-over {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.seed-slot .seed-name {
  font-weight: 700;
  font-size: 14px;
}

.seed-slot .seed-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.seed-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.seed-slot-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7));
  padding: 10px 8px 8px;
  border-radius: 10px;
}

.seed-slot-overlay .seed-name {
  font-size: 13px;
}

.seed-slot-content {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  padding: 8px;
}

.seed-slot button {
  position: absolute;
  background: rgba(7, 10, 14, 0.7);
  color: var(--text);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  transition: all 0.2s;
}

.seed-slot button:hover {
  background: rgba(7, 10, 14, 0.9);
  border-color: var(--accent);
}

.seed-slot .seed-slot-pin {
  top: 10px;
  right: 10px;
  font-size: 16px;
  line-height: 1;
}

.seed-slot .seed-slot-remove {
  top: 10px;
  right: 45px;
  font-size: 18px;
  line-height: 1;
}

.seed-slot-copies-wrap {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 10, 14, 0.85);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.seed-slot-copies-label {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}

.seed-slot-copies-select {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 4px 6px;
  background: rgba(14, 11, 10, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.seed-slot-copies-select:hover,
.seed-slot-copies-select:focus {
  border-color: var(--accent);
  outline: none;
}

.seed-slot--pinned {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6), 0 4px 12px rgba(139, 92, 246, 0.3);
}

.seed-slot--pinned .seed-slot-pin {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent);
}

.search-panel label,
.control-group label,
.dg-card label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0.3px;
  color: var(--text-faint);
  font-weight: 600;
}

.search-filters {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.filter-group--inline label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 500;
  color: var(--text-muted);
}

.color-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.color-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(18, 14, 12, 0.9);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.color-filter-btn:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.color-filter-btn img {
  display: block;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.color-filter-btn.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
}

.color-filter-btn.is-selected:hover {
  border-color: var(--accent-strong);
}

/* Synergy / mechanic multi-select pills */
.filter-group-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text-faint);
}

.synergy-filter__search-wrap {
  flex-shrink: 0;
}

.synergy-filter__search {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.synergy-filter__search::placeholder {
  color: var(--text-muted);
}

.synergy-filter__search:focus {
  border-color: rgba(139, 92, 246, 0.5);
}

.synergy-filter__pills-wrap {
  min-height: 36px;
}

.synergy-filter__empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Expected curve preview (before generation) — matches generated deck style */
.curve-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

.curve-preview-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.curve-preview-chart {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 120px;
  padding: 20px 4px 28px;
}

.curve-preview-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
  padding: 0 3px;
}

.curve-preview-fill {
  width: 100%;
  max-width: 36px;
  min-width: 12px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, rgba(139, 92, 246, 0.35) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.3s ease;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
}

.curve-preview-cmc {
  position: absolute;
  bottom: -24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.curve-preview-count {
  position: absolute;
  top: -18px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-strong);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.synergy-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
  margin-bottom: 6px;
}

.synergy-filter__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.synergy-filter__group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  opacity: 0.9;
}

.synergy-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mechanic-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.mechanic-pill:hover {
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--text);
}

.mechanic-pill.is-selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.mechanic-pill.is-selected:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent-strong);
}

.synergy-filter-clear {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}

.synergy-filter-clear:hover {
  color: var(--accent-strong);
}

.helper-text--inline {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 12px;
}

.helper-text--tip {
  color: var(--text-faint);
  margin-top: 6px;
}

/* Owned cards only + any inline checkbox in control-group */
.control-group--checkbox .checkbox-label,
.control-group label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
}

.control-group--checkbox .checkbox-label-text,
.control-group label:has(input[type="checkbox"]) .checkbox-label-text {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Checkbox: clean flat style, no full-width/padding from global input */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(13, 10, 9, 0.95);
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

input[type="checkbox"]:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.25);
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(13, 10, 9, 0.95);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.search-results {
  margin-top: 12px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(14, 10, 9, 0.95);
  padding: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.search-result {
  padding: 14px;
  border: 1px solid rgba(36, 48, 65, 0.9);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  background: rgba(18, 14, 12, 0.9);
}

.search-result-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: start;
}

.search-result img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.search-result-placeholder {
  width: 100px;
  height: 140px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.search-result-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-type {
  color: var(--accent);
  font-weight: 500;
}

.search-result-separator {
  color: var(--text-faint);
}

.search-result-set {
  color: var(--text-muted);
  font-style: italic;
}

.search-result-price {
  font-weight: 600;
  color: var(--accent-strong);
}

.search-result-price.search-result-price--within-budget {
  color: var(--success, #22c55e);
}

.search-result-budget-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.2);
  color: var(--success, #22c55e);
  margin-left: 4px;
}

.mana-cost {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.search-result .mana-cost {
  gap: 2px;
  margin-top: 1px;
}

.mana-symbol {
  width: 16px;
  height: 16px;
}

.search-result .mana-symbol {
  width: 17px;
  height: 17px;
}

.search-result:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.helper-text {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.controls {
  display: grid;
  gap: 16px;
  margin: 18px 0 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid rgba(139, 92, 246, 0.6);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid rgba(139, 92, 246, 0.6);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.range-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  color: var(--accent-strong);
}
.control-group--full {
  grid-column: 1 / -1;
}

.format-rules {
  grid-column: 1 / -1;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(16, 12, 10, 0.85);
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.format-rules strong {
  font-weight: 600;
  color: var(--accent-strong);
}

.format-rule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted);
}

.format-rule-row span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.format-legality-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.format-legality-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.format-legality-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-strong);
}

.format-legality-label:has(input:disabled) {
  cursor: default;
  opacity: 0.75;
}

.format-legality-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.format-rule-row b {
  color: var(--text);
  font-weight: 600;
}

.is-hidden {
  display: none !important;
}

.controls .button {
  grid-column: 1 / -1;
}

.deck-output {
  background: rgba(18, 14, 12, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  margin-top: 24px;
  display: none;
}

.deck-output.is-visible {
  display: block;
}

.saved-decks {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  margin-top: 24px;
}

.saved-decks-list {
  display: grid;
  gap: 12px;
}

.saved-decks-empty {
  margin-bottom: 12px;
}

.saved-decks-refresh {
  padding: 8px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.saved-deck-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(14, 10, 20, 0.85);
}

.saved-deck-title {
  font-weight: 600;
  color: var(--text);
}

.saved-deck-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-deck-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.12);
}

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

.saved-deck-toggle {
  font-size: 11px;
  padding: 6px 10px;
}

/* ── Community Page ────────────────────────────────────────────── */

.community-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.community-all-header {
  margin-bottom: 12px;
}

.community-all-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.community-all-subtitle {
  margin: 0;
  font-size: 13px;
}

.community-list {
  display: grid;
  gap: 16px;
}

.community-list--featured-home {
  grid-template-columns: 1fr;
  max-width: 520px;
}

/* Home page Deck of the Week: no black bar, match community look */
.community-list--featured-home .community-card--has-cover .community-card-actions-bar {
  margin: 0;
  padding: 12px 0 0;
  background: transparent;
  border-radius: 0;
}

.community-list--featured-home .community-card--has-cover .community-card-actions-bar .button {
  color: var(--accent-strong);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.2);
}

.community-list--featured-home .community-card--has-cover .community-card-actions-bar .button.community-view:hover,
.community-list--featured-home .community-card--has-cover .community-card-actions-bar .button:hover {
  background: rgba(139, 92, 246, 0.4);
  border-color: var(--accent);
}

.community-list--featured-home .community-card--has-cover .community-card-actions-bar .button.community-view {
  background: rgba(139, 92, 246, 0.85);
  border-color: rgba(139, 92, 246, 0.95);
  color: #fff;
}

.community-spotlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.community-spotlight-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 12px;
}

.community-toggle {
  display: inline-flex;
  gap: 6px;
}

.community-toggle .button {
  padding: 6px 10px;
  font-size: 11px;
}

.community-toggle .is-active {
  border-color: rgba(139, 92, 246, 0.75);
  color: var(--text);
  background: rgba(139, 92, 246, 0.18);
}

.collection-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 16px;
}

.collection-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.collection-add {
  display: grid;
  gap: 12px;
}

.collection-list {
  display: grid;
  gap: 10px;
}

.deck-comments {
  margin-top: 24px;
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 12px;
}

.deck-comment-form {
  display: grid;
  gap: 10px;
}

.deck-comment-list {
  display: grid;
  gap: 10px;
}

.deck-comment-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
}

.deck-comment-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.deck-comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-comment-body a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.deck-comment-replies {
  margin-left: 18px;
  display: grid;
  gap: 8px;
}

.compare-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.compare-grid {
  display: grid;
  gap: 18px;
}

.compare-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 12px;
}

.compare-card--full {
  grid-column: 1 / -1;
}

.compare-diff {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.compare-card-list {
  display: grid;
  gap: 6px;
}

.compare-card-row {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
  font-size: 12px;
  color: var(--text-muted);
}

.community-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.community-card--has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 140px;
}

.community-card--has-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 0.88) 100%
  );
  border-radius: inherit;
  pointer-events: none;
}

.community-card--has-cover .community-card-header,
.community-card--has-cover .community-card-actions-bar {
  position: relative;
  z-index: 1;
}

.community-card--has-cover .community-card-header {
  padding-bottom: 4px;
}

.community-card--has-cover .community-card-title,
.community-card--has-cover .community-card-meta {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.community-card--has-cover .community-badge {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Solid bar behind actions so buttons are always readable on art */
.community-card--has-cover .community-card-actions-bar {
  margin: 0 -18px -18px -18px;
  padding: 12px 18px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.85));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.community-card--has-cover .community-card-actions-bar .button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.community-card--has-cover .community-card-actions-bar .button.community-view {
  background: rgba(139, 92, 246, 0.9);
  border-color: rgba(139, 92, 246, 0.95);
  color: #fff;
}

.community-card--has-cover .community-card-actions-bar .button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

.community-card--has-cover .community-card-actions-bar .button.community-view:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.community-card--has-cover .community-card-actions-bar .helper-text {
  color: rgba(255, 255, 255, 0.8);
}

/* Community page: no black bar behind action buttons (match profile) */
.community-page .community-card--has-cover .community-card-actions-bar {
  margin: 0;
  padding: 12px 0 0;
  background: transparent;
  border-radius: 0;
}

.community-page .community-card--has-cover .community-card-actions-bar .button {
  color: var(--accent-strong);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.community-page .community-card--has-cover .community-card-actions-bar .button:hover {
  background: rgba(139, 92, 246, 0.4);
  border-color: var(--accent);
}

.community-page .community-card--has-cover .community-card-actions-bar .button.community-view {
  background: rgba(139, 92, 246, 0.85);
  border-color: rgba(139, 92, 246, 0.95);
  color: #fff;
}

.community-page .community-card--has-cover .community-card-actions-bar .helper-text {
  color: var(--text-muted);
  text-shadow: none;
}

.community-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-card-header-text {
  min-width: 0;
}

.community-card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.community-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.community-card-meta a {
  color: var(--accent-strong);
  text-decoration: none;
}

.community-card-meta a:hover {
  text-decoration: underline;
}

.community-card-colors {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.community-mana-symbol {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}

.community-card-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.community-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.community-count {
  margin-left: 6px;
}

.community-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.12);
}

/* ── Deck View ─────────────────────────────────────────────────── */

.deck-view-card {
  background: rgba(18, 14, 12, 0.94);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.08);
  display: grid;
  gap: 20px;
}

.deck-view-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.deck-view-total-price {
  margin-top: 12px;
  margin-bottom: 4px;
}

.deck-view-total-price-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-md);
}

.deck-view-total-price-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.deck-view-total-price-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.02em;
}

.deck-view-total-price-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.deck-view-total-price-box--unset .deck-view-total-price-value--unset {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.deck-view-total-price-box--unset {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.deck-view-visibility {
  margin-top: 12px;
}

.deck-view-visibility-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.deck-view-visibility-row .helper-text {
  margin: 0;
}

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

.deck-view-author-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.deck-view-author-link a {
  font-size: 12px;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Main deck area: full width, focused */
.deck-view-deck-area {
  width: 100%;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.18);
}

.deck-view-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px 0;
  letter-spacing: 0.02em;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(139, 92, 246, 0.4);
}

.deck-view-main-wrap {
  margin-top: 0;
}

/* Sideboard: collapsed by default, toggle to show */
.deck-view-sideboard-block {
  width: 100%;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.deck-view-sideboard-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.deck-view-sideboard-toggle:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
}

.deck-view-sideboard-toggle-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.deck-view-sideboard-chevron {
  transition: transform 0.2s ease;
}

.deck-view-sideboard-toggle[aria-expanded="true"] .deck-view-sideboard-chevron {
  transform: rotate(180deg);
}

.deck-view-sideboard-content {
  margin-top: 14px;
}

.deck-view-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.deck-view-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(12, 10, 20, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-size: 13px;
}

/* Deck view: use same layout as generator (stacked columns, no gap between image and label) */
.deck-view-sections-wrap.deck-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.deck-tile-image-placeholder {
  aspect-ratio: 2.5 / 3.5;
  background: rgba(12, 10, 20, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.deck-tile-placeholder-text {
  font-size: 10px;
  color: var(--text-muted);
  padding: 6px;
  text-align: center;
  line-height: 1.2;
}

.deck-view-card-preview {
  display: none;
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.deck-view-card-preview img {
  display: block;
  width: 223px;
  height: auto;
  vertical-align: top;
}

.deck-view-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(139, 92, 246, 0.18);
}

.deck-view-insights h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.deck-view-curve-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 180px;
  padding: 12px 0;
}

.deck-view-curve-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.deck-view-curve-bar-inner {
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  background: rgba(12, 10, 20, 0.6);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.deck-view-curve-fill {
  width: 100%;
  min-height: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
  transition: height 0.25s ease;
}

.deck-view-curve-cmc {
  font-weight: 600;
  color: var(--text);
}

.deck-view-curve-count {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-strong);
}

.deck-view-color-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.deck-view-color-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(12, 10, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.deck-view-color-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.deck-view-color-fill--w {
  background: linear-gradient(90deg, #f5f0e1, #e8e0c8);
  box-shadow: 0 0 8px rgba(245, 240, 225, 0.4);
}

.deck-view-color-fill--u {
  background: linear-gradient(90deg, #0e4c92, #1a7fd4);
  box-shadow: 0 0 8px rgba(26, 127, 212, 0.4);
}

.deck-view-color-fill--b {
  background: linear-gradient(90deg, #2c2c2c, #4a4a4a);
  box-shadow: 0 0 8px rgba(74, 74, 74, 0.4);
}

.deck-view-color-fill--r {
  background: linear-gradient(90deg, #c41e3a, #e84a5f);
  box-shadow: 0 0 8px rgba(232, 74, 95, 0.4);
}

.deck-view-color-fill--g {
  background: linear-gradient(90deg, #2d5016, #4a7c23);
  box-shadow: 0 0 8px rgba(74, 124, 35, 0.4);
}

.deck-view-color-fill--colorless {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
  box-shadow: 0 0 6px rgba(156, 163, 175, 0.3);
}

.deck-view-types {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.deck-view-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  background: rgba(12, 10, 20, 0.85);
}

.deck-view-type-row--creatures {
  border-left-color: #4a7c23;
}

.deck-view-type-row--instants {
  border-left-color: #1a7fd4;
}

.deck-view-type-row--sorceries {
  border-left-color: #e84a5f;
}

.deck-view-type-row--artifacts {
  border-left-color: #9ca3af;
}

.deck-view-type-row--enchantments {
  border-left-color: #c4b5fd;
}

.deck-view-type-row--planeswalkers {
  border-left-color: #e8e0c8;
}

.deck-view-type-row--lands,
.deck-view-type-row--dual-lands {
  border-left-color: #6b7280;
}

.deck-view-type-row--basic-lands {
  border-left-color: #9ca3af;
}

.deck-view-type-row--other {
  border-left-color: var(--text-muted);
}

.deck-view-type-label {
  font-weight: 600;
  color: var(--text);
}

.deck-view-build {
  display: grid;
  gap: 10px;
}

.deck-view-build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.deck-view-build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 10, 20, 0.85);
  font-size: 12px;
  color: var(--text-muted);
}

.deck-view-build-row span {
  color: var(--text-faint);
}

.deck-view-build-row em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.creator-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.creator-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(12, 10, 20, 0.85);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.creator-avatar span {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-strong);
}

.creator-details {
  display: grid;
  gap: 10px;
}

.creator-bio {
  color: var(--text-muted);
  font-size: 13px;
}

.creator-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.creator-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.12);
}

.creator-actions {
  display: flex;
  justify-content: flex-end;
}

.creator-decks {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .creator-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}
.deck-view-seeds {
  font-size: 12px;
  color: var(--text-muted);
}

.deck-viz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 720px) {
  .deck-viz-row {
    grid-template-columns: 1fr;
  }
}

.variant-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.variant-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16, 12, 10, 0.9);
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.variant-tab.active {
  background: rgba(139, 92, 246, 0.18);
  color: var(--text);
}

.deck-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.deck-actions .button {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 10px 18px;
}

.deck-list {
  display: grid;
  gap: 12px;
  font-size: 14px;
}

.deck-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text);
  padding: 10px 0 6px;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.deck-group-header span:last-child,
.deck-group-header .deck-group-price {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.deck-group-header .deck-group-price {
  color: var(--accent-strong);
  font-weight: 600;
}

.deck-group-header--sideboard {
  margin-top: 16px;
  color: var(--accent-strong);
  border-bottom-color: rgba(139, 92, 246, 0.5);
}

/* Deck view: cascading stacked columns */
.deck-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* Same width as seed slots (188px) so main deck cards match seed card size */
.deck-section {
  flex: 0 1 188px;
  width: 188px;
  min-width: 120px;
  max-width: 188px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  background: rgba(18, 14, 12, 0.95);
  overflow: hidden;
}

.deck-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-strong);
  padding: 8px 10px;
  background: rgba(139, 92, 246, 0.08);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  flex-shrink: 0;
}

.deck-section-header span:last-child {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.deck-section-list {
  position: relative;
  padding: 4px;
}

/* Card tile in cascading stack */
.deck-card-tile {
  position: relative;
  width: 100%;
  cursor: pointer;
  border-radius: 6px;
  overflow: visible;
  transition: max-height 0.25s ease-out;
}

/* Stacked cards: strip height scaled to 188px column; full card matches seed aspect 2.5/3.5 */
.deck-card-tile:not(:last-child) {
  max-height: 47px;
  height: 47px;
  overflow: hidden;
  margin-bottom: 3px;
  border-radius: 6px;
}

.deck-card-tile:last-child {
  max-height: 264px;
  overflow: visible;
  margin-top: 2px;
}

.deck-tile-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.5 / 3.5;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.deck-card-tile:hover .deck-tile-card-image {
  border-color: var(--accent-strong);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

/* Wrap for card image + printing cycle arrows */
.deck-tile-image-wrap {
  position: relative;
  width: 100%;
}
.deck-tile-printing-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 4px;
  cursor: pointer;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.deck-tile-printing-btn:hover {
  background: rgba(109, 40, 217, 0.8);
  border-color: var(--accent-strong);
}
.deck-tile-printing-btn--prev {
  left: 2px;
}
.deck-tile-printing-btn--next {
  right: 2px;
}

.deck-tile-count-badge {
  position: absolute;
  top: 3px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(109, 40, 217, 0.9);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  z-index: 5;
  pointer-events: none;
}

.deck-tile-price {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-strong);
  background: rgba(14, 11, 10, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 5;
  pointer-events: none;
}

.deck-tile-pin-btn {
  position: absolute;
  top: 4px;
  left: 6px;
  z-index: 6;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: rgba(14, 11, 10, 0.85);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: background 0.2s, transform 0.15s;
}
.deck-tile-pin-btn:hover {
  background: rgba(139, 92, 246, 0.4);
  transform: scale(1.08);
}
.deck-card-tile--pinned .deck-tile-pin-btn {
  background: rgba(139, 92, 246, 0.35);
  border: 1px solid rgba(139, 92, 246, 0.6);
}

/* Hover preview */
.card-hover-preview {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  display: none;
  padding: 8px;
  background: rgba(12, 8, 6, 0.98);
  border: 2px solid var(--accent-strong);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 60px rgba(139, 92, 246, 0.4);
}

.card-hover-preview img {
  width: 250px;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ═══ Deck Visualizations (Generated Deck) ═══ */
.deck-viz {
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.viz-header {
  margin-bottom: 14px;
}

.viz-header h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-strong);
  margin: 0;
}

/* ── Mana Curve Chart ── */
.mana-curve-chart {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 160px;
  padding: 24px 8px 32px;
}

.mana-curve-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
  padding: 0 4px;
}

.mana-curve-bar-fill {
  width: 100%;
  max-width: 40px;
  min-width: 18px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, rgba(139, 92, 246, 0.35) 100%);
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  transition: height 0.35s ease;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.mana-curve-label {
  position: absolute;
  bottom: -26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.mana-curve-label-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.mana-curve-label-fallback {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.mana-curve-count {
  position: absolute;
  top: -20px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-strong);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

/* ── Color Distribution Chart ── */
.color-distribution-chart {
  display: grid;
  gap: 14px;
  padding: 4px 0;
}

.color-bar-item {
  display: grid;
  grid-template-columns: 96px 1fr 80px;
  gap: 14px;
  align-items: center;
}

.color-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.color-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.color-symbol img {
  width: 20px;
  height: 20px;
}

.color-bar {
  height: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.color-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}

.color-bar-fill.color-w {
  background: linear-gradient(90deg, #f5f0e1 0%, #e8dcc4 100%);
  box-shadow: inset 0 0 6px rgba(245, 240, 225, 0.3);
}

.color-bar-fill.color-u {
  background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
  box-shadow: inset 0 0 6px rgba(37, 99, 235, 0.4);
}

.color-bar-fill.color-b {
  background: linear-gradient(90deg, #374151 0%, #1f2937 100%);
  box-shadow: inset 0 0 6px rgba(55, 65, 81, 0.4);
}

.color-bar-fill.color-r {
  background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: inset 0 0 6px rgba(239, 68, 68, 0.4);
}

.color-bar-fill.color-g {
  background: linear-gradient(90deg, #22c55e 0%, #15803d 100%);
  box-shadow: inset 0 0 6px rgba(34, 197, 94, 0.4);
}

.color-bar-fill.color-c {
  background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: inset 0 0 6px rgba(156, 163, 175, 0.3);
}

.color-bar-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.section {
  padding: 72px 0;
  position: relative;
}

.section--features {
  background: linear-gradient(180deg, rgba(10, 7, 18, 0.92), rgba(10, 7, 18, 0.88));
}

.features-heading {
  text-align: center;
  margin-bottom: 36px;
}

.section--alt {
  background: rgba(15, 12, 10, 0.72);
}

/* Deck of the Week / featured section: background image to match hero */
.section--featured {
  background-image:
    linear-gradient(180deg, rgba(10, 7, 18, 0.78), rgba(10, 7, 18, 0.92)),
    var(--site-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-title--caps {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.section-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
}

.section-subtitle {
  color: var(--text-muted);
}

/* News & updates (home page) */
.section--news {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}
.news-item {
  background: rgba(18, 14, 12, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 10px;
  padding: 16px 18px;
}
.news-item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.news-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.news-item-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.news-item-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}
.news-item-body-full {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.news-item-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 500;
}
.news-item-toggle:hover {
  text-decoration: underline;
}
.news-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}


.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.feature-card {
  background: rgba(18, 14, 12, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 14px 30px -26px var(--shadow);
}

.feature-card h3 {
  margin-bottom: 10px;
}

.steps {
  display: grid;
  gap: 16px;
}

.steps--grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: rgba(18, 14, 12, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 18px 20px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent-strong);
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.roadmap-card {
  padding: 20px;
  background: rgba(18, 14, 12, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
}

.data-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  background: rgba(16, 20, 28, 0.96);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 28px;
}

.data-status {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.site-footer {
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
  background: rgba(13, 10, 18, 0.95);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: var(--title-font);
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 0.9;
  color: inherit;
}

.footer-tagline {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-col {
  min-width: 120px;
}

.footer-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.site-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

.site-footer .footer-links li {
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer .footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.footer-social-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.footer-social-link:hover {
  color: var(--accent-strong);
}

.footer-social-link svg {
  display: block;
}

.footer-note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 70px;
  }

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

  .seed-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .data-status {
    border-left: none;
    padding-left: 0;
  }
}

/* (Old generator-row responsive rules removed — see dg-* responsive block above) */

@media (max-width: 680px) {
  .search-results.search-results--compact {
    max-height: 240px;
  }
}

.deck-generator-page .seed-slot-grid {
  grid-template-columns: repeat(auto-fill, 188px);
  justify-content: start;
}

.card-preview-modal {
  position: fixed;
  display: none;
  z-index: 9999;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.card-preview-modal.is-open {
  display: block;
}

.card-preview-content {
  position: absolute;
  display: flex;
  flex-direction: row;
  gap: 0;
  background: linear-gradient(165deg, rgba(18, 14, 12, 0.99) 0%, rgba(12, 10, 14, 0.99) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
  width: 500px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  left: 0;
  top: 0;
  overflow: hidden;
}

.card-preview-image-wrap {
  flex: 0 0 288px;
  padding: 12px;
  border-right: 1px solid rgba(139, 92, 246, 0.2);
}

.card-preview-content .card-preview-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-preview-details {
  flex: 1;
  min-width: 0;
  padding: 16px 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
}

.card-preview-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.card-preview-detail-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-preview-type-row .card-preview-type,
.card-preview-set-row .card-preview-set {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
}

.card-preview-set-row .card-preview-set {
  color: var(--text);
  font-weight: 500;
  font-style: italic;
}

.card-preview-mana-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-preview-mana-cost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.card-preview-mana-cost .mana-symbol {
  width: 22px;
  height: 22px;
}

.card-preview-price-box {
  margin-top: auto;
  padding: 12px 14px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
}

.card-preview-price-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card-preview-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.02em;
}

.card-preview-price.card-preview-price--na {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.card-preview-price-note {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-preview-price-note--muted {
  color: var(--text-faint);
  font-style: italic;
}

.card-preview-vendors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-preview-vendors--empty {
  min-height: 0;
}

.card-preview-vendor-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.card-preview-vendor-name {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.card-preview-vendor-price {
  color: var(--accent-strong, #c4b5fd);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card-preview-vendor-line + .card-preview-vendor-line {
  margin-top: 0;
}

/* ── Auth Modal ────────────────────────────────────────────────── */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal.is-open {
  display: flex;
}

/* Backdrop */
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

/* Card */
.auth-modal-content {
  position: relative;
  background: linear-gradient(168deg, rgba(28, 22, 42, 0.98) 0%, rgba(16, 12, 24, 0.99) 100%);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.06),
    0 24px 64px -12px rgba(0, 0, 0, 0.65),
    0 0 80px -30px rgba(139, 92, 246, 0.15);
  animation: authModalIn 0.25s ease-out;
}

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

/* Close button */
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.auth-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Header block (logo + title + subtitle) */
.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-modal-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.auth-modal-logo .logo-mark {
  font-size: 16px;
  color: var(--accent-strong);
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.auth-modal-title {
  font-size: 1.5rem;
  margin: 0 0 6px;
  line-height: 1.2;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── App message modal (in-app notices instead of alert()) ───────── */

.app-message-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app-message-modal.is-open {
  display: flex;
}

.app-message-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.app-message-content {
  position: relative;
  background: linear-gradient(168deg, rgba(28, 22, 42, 0.98) 0%, rgba(16, 12, 24, 0.99) 100%);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.06),
    0 24px 64px -12px rgba(0, 0, 0, 0.65);
  animation: authModalIn 0.25s ease-out;
}

.app-message-title {
  font-size: 1.25rem;
  margin: 0 0 12px;
  line-height: 1.3;
}

.app-message-body {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
  white-space: pre-line;
}

.app-message-ok {
  width: 100%;
  justify-content: center;
}

/* Save deck name modal (same style as app-message / auth) */
.save-deck-modal-content .app-message-body {
  margin-bottom: 16px;
}

.save-deck-field {
  margin-bottom: 20px;
}

.save-deck-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.save-deck-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.save-deck-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.save-deck-input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.save-deck-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.save-deck-actions .button {
  min-width: 100px;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.2s, color 0.2s;
}

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

.auth-tab.active {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-strong);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.15);
}

/* Form fields */
.auth-field {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  flex-shrink: 0;
}

.auth-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.auth-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.auth-input-wrap input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Submit button */
.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 13px 22px;
  font-size: 14px;
  border-radius: 10px;
}

/* Error text */
.auth-form-error {
  font-size: 13px;
  color: #f87171;
  margin: 8px 0 0;
  min-height: 0;
}

.auth-form-error:empty {
  display: none;
}

/* Footer link ("Don't have an account? Sign up") */
.auth-form-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 18px 0 0;
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--accent);
}

/* Divider (optional, for future social login) */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Profile Page ─────────────────────────────────────────────── */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.75fr);
  gap: 28px;
  align-items: start;
}

.profile-column {
  display: grid;
  gap: 24px;
}

.profile-column--main {
  min-width: 0;
}

.profile-column--sidebar {
  min-width: 0;
}

.profile-card {
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 36px -30px var(--shadow);
}

.profile-card--decks .profile-card-header,
.profile-card--collections .profile-card-header {
  margin-bottom: 14px;
}

.profile-card--compact .profile-card-header {
  margin-bottom: 12px;
}

.profile-card--compact {
  padding: 16px 18px;
}

.profile-card-header--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-card-header--with-action .button--sm {
  flex-shrink: 0;
}

/* Compact profile strip: avatar + name/email on top, Edit profile button below */
.profile-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 12px 14px;
  align-items: start;
}

.profile-strip .profile-avatar--sm {
  grid-row: 1 / -1;
}

.profile-strip-text {
  min-width: 0;
  word-break: break-word;
}

.profile-strip-text .profile-preview-name,
.profile-strip-text .profile-preview-meta {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.profile-strip #profile-edit-toggle {
  grid-column: 2;
  justify-self: start;
}

.profile-strip .profile-preview-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.profile-strip .profile-preview-meta {
  font-size: 0.8rem;
  margin-top: 2px;
}

.profile-avatar--sm {
  width: 48px;
  height: 48px;
  font-size: 14px;
  flex-shrink: 0;
}

.profile-edit-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-edit-panel.is-collapsed {
  display: none;
}

.profile-edit-panel .profile-form {
  gap: 12px;
}

.button--sm {
  font-size: 0.8rem;
  padding: 8px 14px;
}

.profile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-input,
.profile-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: rgba(12, 10, 20, 0.85);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-textarea {
  resize: vertical;
  min-height: 100px;
}

.profile-input:focus,
.profile-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.profile-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-status {
  font-size: 12px;
  color: var(--accent-strong);
  font-weight: 600;
}

.profile-status.is-error {
  color: #fca5a5;
}

.profile-subscription {
  display: grid;
  gap: 12px;
}

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

.profile-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.profile-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  color: var(--accent-strong);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.profile-preview-body {
  display: grid;
  gap: 10px;
  text-align: center;
  justify-items: center;
}

.profile-preview-body--compact {
  text-align: left;
  justify-items: stretch;
}

.profile-preview-body--compact .profile-preview-bio {
  font-size: 0.9rem;
  margin: 0;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(12, 10, 20, 0.85);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar span {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.profile-preview-name {
  font-size: 20px;
  font-family: var(--title-font);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.profile-preview-meta {
  font-size: 12px;
  color: var(--text-faint);
}

.profile-preview-bio {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-auth-warning {
  display: grid;
  place-items: center;
  min-height: 260px;
}

.profile-auth-card {
  max-width: 480px;
  background: rgba(18, 14, 12, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: center;
  box-shadow: 0 20px 36px -30px var(--shadow);
  display: grid;
  gap: 12px;
}

.profile-notifications {
  display: grid;
  gap: 10px;
}

.profile-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
  font-size: 13px;
  color: var(--text);
}

.profile-notification-date {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-deck-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
  font-size: 12px;
  color: var(--text-muted);
}

.profile-deck-list,
.profile-follow-feed {
  display: grid;
  gap: 10px;
}

/* Your decks: community-style cards with optional cover art */
.profile-deck-list--cards {
  gap: 16px;
  grid-template-columns: 1fr;
}

.profile-deck-list--cards .community-card {
  min-height: 120px;
}

.profile-deck-card--no-cover {
  background: linear-gradient(
    165deg,
    rgba(18, 14, 12, 0.98) 0%,
    rgba(30, 22, 40, 0.95) 50%,
    rgba(18, 14, 12, 0.98) 100%
  );
  border-color: rgba(139, 92, 246, 0.22);
  box-shadow: 0 12px 28px -20px var(--shadow), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.profile-deck-card--no-cover .community-card-title,
.profile-deck-card--no-cover .community-card-meta {
  color: var(--text);
}

.profile-deck-card--no-cover .community-card-meta {
  color: var(--text-muted);
}

/* No black bar behind View button on profile deck cards */
.profile-deck-list--cards .community-card-actions-bar {
  margin: 0;
  padding: 12px 0 0;
  background: transparent;
  border-radius: 0;
}

.profile-deck-list--cards .community-card-actions-bar .button {
  color: var(--accent-strong);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}

.profile-deck-list--cards .community-card-actions-bar .button:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent);
}

.profile-deck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
}

.profile-deck-title {
  font-size: 13px;
  font-weight: 600;
}

.profile-deck-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-deck-link {
  font-size: 12px;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-collection-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-collection-list {
  display: grid;
  gap: 10px;
}

.profile-collection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(12, 10, 20, 0.85);
}

.profile-collection-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-collection-actions {
  display: flex;
  gap: 8px;
}

.profile-card-subsection {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* ─── Maintenance overlay (site down for maintenance) ───────────────────── */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.maintenance-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 18, 0.92);
  backdrop-filter: blur(8px);
}

.maintenance-overlay-content {
  position: relative;
  max-width: 440px;
  width: 100%;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 24px 48px var(--shadow);
}

.maintenance-overlay-icon {
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0.9;
}

.maintenance-overlay-title {
  font-family: var(--title-font);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.maintenance-overlay-message {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 24px;
}

.maintenance-overlay-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.maintenance-overlay-btn:hover {
  background: var(--accent-strong);
}

.maintenance-overlay-btn:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
