*,
*::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;
  --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;
}

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

.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));
  border-bottom: 1px solid rgba(139, 92, 246, 0.18);
}

.hero::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
  margin-top: 70px;
}

.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(20, 15, 13, 0.98), rgba(14, 11, 10, 0.98));
}

.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);
}

.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-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;
}

.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);
}

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

.deck-generator-page .generator {
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1.05fr);
}

.generator-panel--controls {
  grid-column: 1 / 2;
}

.generator-panel--search {
  grid-column: 1 / 2;
}

.generator-panel--seeds {
  grid-column: 2 / 3;
}

.generator-panel--recommendations {
  grid-column: 2 / 3;
}

.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);
}

.seed-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 20px 0 24px;
  align-items: start;
}

.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;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 12px;
  text-align: center;
  position: relative;
  min-height: 200px;
  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;
  top: 10px;
  right: 10px;
  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;
}

.search-panel label,
.control-group 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: 10px;
  margin-top: 12px;
  margin-bottom: 6px;
}

.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);
}

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

.control-group label input[type="checkbox"] {
  margin-right: 8px;
}

input,
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: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(14, 10, 9, 0.95);
  padding: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.search-result-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.search-result img {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.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.08);
  border-color: rgba(139, 92, 246, 0.35);
}

.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-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;
}

.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 view: cascading stacked columns */
.deck-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.deck-section {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 200px;
  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;
}

/* Each card shows only a sliver, except the last */
.deck-card-tile:not(:last-child) {
  height: 32px;
  overflow: hidden;
  margin-bottom: 0;
}

.deck-card-tile:last-child {
  overflow: visible;
}

.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);
}

.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;
}

/* 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 */
.deck-viz {
  background: rgba(18, 14, 12, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.viz-header h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 0;
}

/* Mana Curve Chart */
.mana-curve-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 8px 0;
}

.mana-curve-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
}

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

.mana-curve-label {
  position: absolute;
  bottom: -20px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.mana-curve-count {
  position: absolute;
  top: -18px;
  font-size: 11px;
  color: var(--accent-strong);
  font-weight: 700;
}

/* Color Distribution Chart */
.color-distribution-chart {
  display: grid;
  gap: 10px;
}

.color-bar-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
}

.color-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.color-symbol {
  font-size: 14px;
}

.color-bar {
  height: 20px;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

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

.color-bar-fill.color-w {
  background: linear-gradient(90deg, #f9fafb 0%, #e5e7eb 100%);
}

.color-bar-fill.color-u {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.color-bar-fill.color-b {
  background: linear-gradient(90deg, #1f2937 0%, #111827 100%);
}

.color-bar-fill.color-r {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.color-bar-fill.color-g {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.color-bar-fill.color-colorless {
  background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

.color-bar-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

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

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

.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);
}


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

.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 60px;
  border-top: 1px solid var(--border);
  background: rgba(13, 10, 18, 0.95);
}

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

.footer-links {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.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;
  }
}

@media (max-width: 960px) {
  .deck-generator-page .generator {
    grid-template-columns: 1fr;
  }
}

.deck-generator-page .seed-slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.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;
  background: rgba(10, 11, 16, 0.98);
  border: 2px solid rgba(139, 92, 246, 0.55);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  width: 280px;
  pointer-events: none;
  left: 0;
  top: 0;
}

.card-preview-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}
