/* ============================================
   COUNCIL OF SEVEN KINGS — Component Styles
   ============================================ */

/* ---- Theme Toggle ---- */
.theme-toggle {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
  border-radius: var(--radius-full);
  padding: var(--space-3);
  color: var(--color-text);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-interactive), 
              border-color var(--transition-interactive),
              transform var(--transition-interactive);
  backdrop-filter: blur(12px);
}
.theme-toggle:hover {
  background: var(--color-surface-dynamic);
  transform: translateY(-1px);
}
.theme-toggle:active {
  transform: translateY(0);
}

/* ---- Gold ornamental dividers ---- */
.ornament {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary) 30%, var(--color-primary) 70%, transparent);
  opacity: 0.25;
}

.gold-text {
  color: var(--color-primary);
}

/* ---- Sections ---- */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-32)) var(--space-4);
}
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
.container-narrow {
  max-width: var(--content-default);
}
.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-12);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: background var(--transition-interactive), 
              color var(--transition-interactive), 
              box-shadow var(--transition-interactive), 
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px oklch(from var(--color-primary) l c h / 0.3);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary-highlight);
  transform: translateY(-1px);
}
.btn-outline:active {
  transform: translateY(0);
}
.btn-lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-4) var(--space-8);
  overflow: hidden;
  text-align: center;
}
.hero-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, oklch(from var(--color-primary) l c h / 0.06) 0%, transparent 70%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  max-width: 900px;
}
.hero-headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 58ch;
  line-height: 1.6;
}

/* Hero card fan */
.hero-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: clamp(200px, 30vw, 340px);
  position: relative;
  margin: var(--space-6) 0 var(--space-4);
  width: 100%;
  max-width: 700px;
}
.hero-card {
  width: clamp(100px, 15vw, 180px);
  height: auto;
  border-radius: var(--radius-lg);
  position: absolute;
  transform-origin: 50% 100%;
  border: 2px solid oklch(from var(--color-primary) l c h / 0.35);
  box-shadow: 0 8px 24px oklch(0 0 0 / 0.5);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
/* Individual card positions for fan layout */
.hero-card:nth-child(1) { transform: rotate(-25deg) translateY(-15px); z-index: 1; }
.hero-card:nth-child(2) { transform: rotate(-15deg) translateY(-5px); z-index: 2; }
.hero-card:nth-child(3) { transform: rotate(-5deg) translateY(0px); z-index: 3; }
.hero-card:nth-child(4) { transform: rotate(5deg) translateY(0px); z-index: 4; }
.hero-card:nth-child(5) { transform: rotate(15deg) translateY(-5px); z-index: 5; }
.hero-card:nth-child(6) { transform: rotate(25deg) translateY(-15px); z-index: 6; }
.hero-card:hover {
  z-index: 10 !important;
  box-shadow: 0 12px 40px oklch(from var(--color-primary) l c h / 0.3);
}
.hero-card:nth-child(1):hover { transform: rotate(-25deg) translateY(-28px) scale(1.08); }
.hero-card:nth-child(2):hover { transform: rotate(-15deg) translateY(-18px) scale(1.08); }
.hero-card:nth-child(3):hover { transform: rotate(-5deg) translateY(-12px) scale(1.08); }
.hero-card:nth-child(4):hover { transform: rotate(5deg) translateY(-12px) scale(1.08); }
.hero-card:nth-child(5):hover { transform: rotate(15deg) translateY(-18px) scale(1.08); }
.hero-card:nth-child(6):hover { transform: rotate(25deg) translateY(-28px) scale(1.08); }

.hero-trust {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
.hero-trust strong {
  color: var(--color-primary);
}

/* ============================================
   PAIN POINTS
   ============================================ */
.pain-section {
  background: var(--color-surface);
}
.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
}
.pain-card {
  background: var(--color-bg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.pain-card:hover {
  border-color: oklch(from var(--color-secondary) l c h / 0.4);
  box-shadow: 0 0 30px oklch(from var(--color-secondary) l c h / 0.08);
}
.pain-icon {
  color: var(--color-secondary);
  margin-bottom: var(--space-4);
}
.pain-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
}
.pain-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-8);
  counter-reset: step;
}
.step {
  text-align: center;
  padding: var(--space-6);
}
.step-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  opacity: 0.6;
}
.step h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
}
.step p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 45ch;
  margin-inline: auto;
}

/* Step II hero treatment */
.step-hero {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  box-shadow: 0 4px 30px oklch(from var(--color-primary) l c h / 0.08);
  margin-top: calc(-1 * var(--space-4));
}
.step-hero .step-number {
  font-size: clamp(2rem, 4vw, 3rem);
  opacity: 0.85;
}
.step-hero h3 {
  font-size: var(--text-xl);
}
.step-hero p {
  font-size: var(--text-base);
  line-height: 1.8;
}
@media (max-width: 768px) {
  .step-hero {
    transform: none;
  }
}

/* ============================================
   KINGS ROSTER
   ============================================ */
.roster-section {
  background: var(--color-surface);
}
.king-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-6);
}
.king-card {
  background: var(--color-bg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-interactive), 
              box-shadow var(--transition-interactive), 
              transform var(--transition-interactive);
}
.king-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.4);
  box-shadow: 0 0 40px oklch(from var(--color-primary) l c h / 0.1);
  transform: translateY(-4px);
}
.king-img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
}
.king-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.king-card:hover .king-img-wrap img {
  transform: scale(1.05);
}
.king-info {
  padding: var(--space-5) var(--space-6) var(--space-6);
}
.king-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.king-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.king-desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ============================================
   WAITLIST
   ============================================ */
.waitlist-section {
  text-align: center;
}
.counter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-10);
}
.counter-line {
  display: flex;
  align-items: baseline;
}
.counter-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.counter-plus {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
}
.counter-label {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}
.waitlist-form {
  max-width: 500px;
  margin-inline: auto;
}
.form-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.form-row input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-base);
  min-height: 44px;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.form-row input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.2);
}
.form-row input::placeholder {
  color: var(--color-text-faint);
}
.form-sub {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
.form-success {
  font-size: var(--text-sm);
  color: var(--color-tertiary);
  font-weight: 500;
}

/* ============================================
   LORE
   ============================================ */
.lore-section {
  background: var(--color-surface);
  text-align: center;
}
.lore-ornament-top,
.lore-ornament-bottom {
  font-size: var(--text-xl);
  color: var(--color-primary);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: var(--space-6);
}
.lore-ornament-bottom {
  margin-top: var(--space-6);
  margin-bottom: 0;
}
.lore-text {
  border: none;
  margin: 0;
  padding: 0 var(--space-4);
}
.lore-text p {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 62ch;
  margin-inline: auto;
  font-style: italic;
}

/* ============================================
   PRICING
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
  align-items: start;
}
.pricing-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  position: relative;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.pricing-card-featured {
  border-color: var(--color-primary);
  background: var(--color-surface-offset);
  box-shadow: 0 0 40px oklch(from var(--color-primary) l c h / 0.08);
}
.pricing-card-featured:hover {
  box-shadow: 0 0 50px oklch(from var(--color-primary) l c h / 0.15);
}
.pricing-badge {
  position: absolute;
  top: calc(-1 * var(--space-3));
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
}
.pricing-tier {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pricing-price {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary);
}
.pricing-price span {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}
.pricing-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 34ch;
}
.pricing-card .btn {
  margin-top: var(--space-2);
  width: 100%;
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.faq-item {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-interactive);
}
.faq-item[open] {
  border-color: oklch(from var(--color-primary) l c h / 0.3);
}
.faq-item summary {
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  min-height: 44px;
  transition: color var(--transition-interactive);
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-primary);
  flex-shrink: 0;
  margin-left: var(--space-4);
  transition: transform var(--transition-interactive);
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover {
  color: var(--color-primary);
}
.faq-answer {
  padding: 0 var(--space-6) var(--space-6);
}
.faq-answer p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ============================================
   CLOSER
   ============================================ */
.closer-section {
  position: relative;
  text-align: center;
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-4);
  overflow: hidden;
}
.closer-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, oklch(from var(--color-primary) l c h / 0.07) 0%, transparent 70%);
  pointer-events: none;
}
.closer-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: var(--space-12) var(--space-4) var(--space-8);
  border-top: 1px solid var(--color-divider);
  text-align: center;
}
.footer-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}
.footer-links a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-links a:hover {
  color: var(--color-text);
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.footer-pplx {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-pplx:hover {
  color: var(--color-text-muted);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: view()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero-headline {
    font-size: var(--text-2xl);
  }
  .hero-sub {
    font-size: var(--text-base);
  }
  .hero-cards {
    height: 170px;
  }
  .hero-card {
    width: clamp(65px, 16vw, 95px);
  }
  .form-row {
    flex-direction: column;
  }
  .form-row .btn {
    width: 100%;
  }
  .section-heading {
    font-size: var(--text-xl);
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-inline: auto;
  }
  .king-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-cards {
    height: 140px;
  }
  .hero-card {
    width: 55px;
  }
  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }
}

/* Tap states for mobile */
@media (hover: none) {
  .btn:active {
    opacity: 0.85;
  }
  .king-card:active {
    transform: scale(0.98);
  }
  .pain-card:active {
    border-color: oklch(from var(--color-secondary) l c h / 0.4);
  }
  .faq-item summary:active {
    color: var(--color-primary);
  }
}

/* === Seventh King Card — special treatment === */
.king-card-you {
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 24px oklch(0.7 0.15 85 / 0.2);
}
.king-card-you .king-title {
  color: var(--color-gold);
}
.king-card-you:hover {
  box-shadow: 0 0 40px oklch(0.7 0.15 85 / 0.35);
}

/* === Upload Photo Card — special treatment === */
.king-card-upload {
  border: 2px dashed var(--color-gold);
  box-shadow: 0 0 24px oklch(0.7 0.15 85 / 0.15);
  cursor: pointer;
}
.king-card-upload .king-title {
  color: var(--color-gold);
}
.king-card-upload:hover {
  border-style: solid;
  box-shadow: 0 0 40px oklch(0.7 0.15 85 / 0.35);
}

/* === Video Conference Preview === */
.conference-img-wrap {
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid oklch(0.7 0.15 85 / 0.3);
  box-shadow: 0 8px 40px oklch(0 0 0 / 0.5), 0 0 60px oklch(0.7 0.15 85 / 0.08);
}
.conference-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Customize Your Council / Historical Kings ---- */
.customize-section {
  background: var(--color-bg);
}
.historical-group {
  margin-bottom: var(--space-10);
}
.historical-group:last-child {
  margin-bottom: 0;
}
.historical-country {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  padding-left: var(--space-2);
}
.historical-flag {
  margin-right: var(--space-2);
  font-size: 1.2em;
}
.historical-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.7 0.15 85 / 0.4) transparent;
  padding-bottom: var(--space-3);
}
.historical-scroll::-webkit-scrollbar {
  height: 6px;
}
.historical-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.historical-scroll::-webkit-scrollbar-thumb {
  background: oklch(0.7 0.15 85 / 0.3);
  border-radius: var(--radius-full);
}
.historical-track {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-1);
  width: max-content;
}
.historical-card {
  flex-shrink: 0;
  width: 180px;
  text-align: center;
  transition: transform var(--transition-interactive);
}
.historical-card:hover {
  transform: translateY(-4px);
}
.historical-card img {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid oklch(0.7 0.15 85 / 0.25);
  box-shadow: 0 4px 20px oklch(0 0 0 / 0.4);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.historical-card:hover img {
  border-color: oklch(0.7 0.15 85 / 0.5);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.5), 0 0 20px oklch(0.7 0.15 85 / 0.1);
}
.historical-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-2);
  line-height: 1.2;
}
.historical-reign {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: oklch(from var(--color-text) l c h / 0.5);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .historical-card {
    width: 150px;
  }
  .historical-card img {
    width: 150px;
    height: 150px;
  }
}

/* ============================================
   ASSIGN YOUR AGENT — FLIP CARD + SLIDERS
   ============================================ */

.assign-layout {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flip-card {
  width: 340px;
  height: 480px;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px oklch(0 0 0 / 0.3);
}

.flip-card-front {
  background: var(--color-surface);
  z-index: 2;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-card-back {
  background: var(--color-surface);
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.3);
  z-index: 1;
}

/* Match front card frame on the back */
.flip-card-back::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 3px solid oklch(from var(--color-primary) l c h / 0.25);
  pointer-events: none;
  z-index: 1;
}

.flip-btn {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: oklch(0 0 0 / 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.flip-btn:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

/* Agent config (back of card) */
.agent-config {
  padding: var(--space-6) var(--space-5);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.agent-config-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.agent-config-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.agent-config-role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid oklch(from var(--color-primary) l c h / 0.15);
}

.agent-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1;
}

.agent-slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.agent-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.agent-slider-header label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.agent-slider-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.agent-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-surface-dynamic);
  outline: none;
  cursor: pointer;
}

.agent-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.agent-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.agent-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.4);
  cursor: pointer;
}

.agent-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

@media (max-width: 768px) {
  .flip-card {
    width: 300px;
    height: 440px;
  }
}

/* ============================================
   CARD BACK — Agent Attribute Sliders
   ============================================ */
.assign-section {
  background: var(--color-surface);
  padding-bottom: clamp(var(--space-16), 10vw, var(--space-32));
}

.card-back-showcase {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-6);
}

.card-front {
  width: 340px;
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px oklch(0 0 0 / 0.2);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}
.card-front:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.3);
  box-shadow: 0 12px 48px oklch(0 0 0 / 0.3), 0 0 30px oklch(from var(--color-primary) l c h / 0.06);
}
.card-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-back {
  width: 340px;
  background: var(--color-bg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  box-shadow: 0 8px 40px oklch(0 0 0 / 0.2);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}
.card-back:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.3);
  box-shadow: 0 12px 48px oklch(0 0 0 / 0.3), 0 0 30px oklch(from var(--color-primary) l c h / 0.06);
}

.card-back-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.card-back-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.card-back-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: var(--space-1);
}

.card-back-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.card-back-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(from var(--color-primary) l c h / 0.25) 30%, oklch(from var(--color-primary) l c h / 0.25) 70%, transparent);
  margin-bottom: var(--space-5);
}

.card-back-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cb-slider-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cb-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cb-slider-header label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.cb-slider-val {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.cb-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-surface-dynamic, var(--color-surface));
  outline: none;
  cursor: pointer;
  margin: var(--space-1) 0;
}

.cb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}
.cb-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.cb-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.4);
  cursor: pointer;
}

.cb-slider-poles {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

@media (max-width: 768px) {
  .card-back-showcase {
    flex-direction: column;
    align-items: center;
  }
  .card-front,
  .card-back {
    width: 300px;
  }
}
