/* ==========================================================================
   Spin the Wheel Studio — Premium Design System
   Obsidian Dark Studio, High-Contrast Typography, Retina Micro-Interactions
   ========================================================================== */

:root {
  /* Brand & Vibrant Accents */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-primary-glow: rgba(99, 102, 241, 0.25);
  --brand-subtle: rgba(99, 102, 241, 0.12);
  --brand-border: rgba(99, 102, 241, 0.35);

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-emerald-border: rgba(16, 185, 129, 0.35);
  --accent-crimson: #f43f5e;
  --accent-crimson-subtle: rgba(244, 63, 94, 0.12);
  --accent-crimson-border: rgba(244, 63, 94, 0.35);
  --accent-cyan: #06b6d4;

  /* Surface Hierarchy (Deep Onyx / Obsidian Studio) */
  --bg-app: #07080c;
  --bg-stage: #0a0c12;
  --bg-surface: #0e1119;
  --bg-surface-elevated: #151824;
  --bg-surface-active: #1d2233;
  --bg-input: #090b10;
  --bg-hover: #1b2030;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.13);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-focus: #6366f1;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #07080c;

  /* Typography Stack */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --space-2xl: 56px;

  /* Standard Border Radii (Strict <= 8px for containers/cards) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.75);
  --shadow-modal: 0 24px 64px -8px rgba(0, 0, 0, 0.9);

  /* Transitions */
  --ease-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Subtle Ambient Studio Spotlight at Top */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.03) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--ease-fast);
}

a:hover {
  color: #818cf8;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Global Canvas Confetti */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   Header (Studio Navigation)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 56px;
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0;
  color: #ffffff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--ease-fast);
}

.header-nav a:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  text-decoration: none;
}

.header-nav a.active {
  color: #ffffff;
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) var(--space-2xl) var(--space-md);
  width: 100%;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Hero Header Banner (Direct on page, never in card) */
.studio-hero-banner {
  text-align: center;
  margin: var(--space-sm) auto var(--space-lg) auto;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #c7d2fe;
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 2.125rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.18;
}

.hero-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.625rem;
  }
  .hero-subtitle {
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   Studio Interactive Stage (Unframed Responsive Grid)
   ========================================================================== */
.studio-stage {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(320px, 0.95fr);
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-2xl);
}

@media (max-width: 960px) {
  .studio-stage {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* --- Left Column: Interactive Wheel Stage --- */
.wheel-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Studio Floating Dock / Controls Toolbar */
.studio-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  margin-bottom: var(--space-md);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-sm);
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Segmented Button Controls (Speed: 3s, 5s, 8s) */
.segmented-control {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.speed-pill-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.speed-pill-btn:hover {
  color: var(--text-main);
}

.speed-pill-btn.active {
  background: var(--bg-surface-elevated);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Palette Swatches Row */
.palette-swatches-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.palette-swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--ease-fast), border-color var(--ease-fast);
  outline: none;
}

.palette-swatch-btn:hover {
  transform: scale(1.15);
}

.palette-swatch-btn.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.palette-swatch-btn-vibrant {
  background: conic-gradient(#4f46e5, #f43f5e, #10b981, #f59e0b, #4f46e5);
}
.palette-swatch-btn-cyber {
  background: conic-gradient(#00f0ff, #ff007a, #7928ca, #10e575, #00f0ff);
}
.palette-swatch-btn-sunset {
  background: conic-gradient(#e11d48, #ea580c, #f59e0b, #fbbf24, #e11d48);
}
.palette-swatch-btn-emerald {
  background: conic-gradient(#047857, #10b981, #34d399, #14b8a6, #047857);
}
.palette-swatch-btn-ocean {
  background: conic-gradient(#0284c7, #38bdf8, #6366f1, #a855f7, #0284c7);
}
.palette-swatch-btn-pastel {
  background: conic-gradient(#f87171, #fbbf24, #38bdf8, #f472b6, #f87171);
}

/* Icon Buttons (Sound, Fullscreen) */
.dock-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.dock-icon-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.dock-icon-btn.active {
  color: #c7d2fe;
  background: var(--brand-subtle);
  border-color: var(--brand-border);
}

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

/* The Canvas Wheel Frame */
.wheel-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-2xs) 0 var(--space-md) 0;
  cursor: pointer;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

/* Big Tactile Hero Spin Button */
.wheel-cta-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-spin-hero {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  transition: all var(--ease-fast);
  position: relative;
  overflow: hidden;
}

.btn-spin-hero::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.btn-spin-hero:hover:not(:disabled)::before {
  left: 100%;
}

.btn-spin-hero:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.btn-spin-hero:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-spin-hero.is-spinning {
  background: linear-gradient(135deg, #3730a3 0%, #1e1b4b 100%);
  opacity: 0.85;
  cursor: wait;
}

.btn-spin-hero kbd {
  display: inline-block;
  padding: 3px 7px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-xs);
  color: #e0e7ff;
}

/* --- Right Column: Studio Control Console --- */
.studio-console {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 480px;
}

/* Console Header Tabs */
.console-tabs {
  display: flex;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 4px 0 4px;
  gap: 4px;
}

.console-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.console-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.console-tab.active {
  color: #ffffff;
  background: var(--bg-surface);
  border-bottom-color: var(--brand-primary);
}

.console-tab-badge {
  padding: 1px 7px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.console-tab.active .console-tab-badge {
  background: var(--brand-subtle);
  color: #c7d2fe;
}

/* Console Body Views */
.console-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Quick Add Input Bar */
.quick-add-group {
  display: flex;
  gap: 6px;
}

.quick-add-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--ease-fast);
}

.quick-add-input:focus {
  border-color: var(--border-focus);
}

.quick-add-btn {
  padding: 8px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--ease-fast);
}

.quick-add-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Actions Toolbar (Shuffle, Sort, Clear, Bulk Toggle) */
.console-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.btn-action:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-action.active {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: #c7d2fe;
}

.btn-action-danger {
  color: #f87171;
}

.btn-action-danger:hover {
  background: var(--accent-crimson-subtle);
  border-color: var(--accent-crimson-border);
  color: #fca5a5;
}

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

/* Chips List View */
.option-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  animation: fadeInChip 0.15s ease-out;
  max-width: 100%;
}

@keyframes fadeInChip {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.option-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.option-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-chip-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease-fast);
}

.option-chip-delete:hover {
  color: #f87171;
}

.option-chip-delete svg {
  width: 13px;
  height: 13px;
}

/* Bulk Editor Area (Collapsible) */
.bulk-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bulk-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

#options-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-main);
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color var(--ease-fast);
}

#options-input:focus {
  border-color: var(--border-focus);
}

/* Elimination Mode Toggle Switch */
.panel-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
}

.switch-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.switch-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.switch-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  transition: var(--ease-fast);
  border-radius: var(--radius-pill);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: var(--ease-fast);
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background-color: #ffffff;
}

/* Share Wheel Link CTA */
.btn-share-custom {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.btn-share-custom:hover {
  background: var(--bg-hover);
  border-color: var(--brand-border);
  color: #c7d2fe;
}

.btn-share-custom svg {
  width: 15px;
  height: 15px;
}

/* Presets Tab View */
.presets-tab-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-category-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-category-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-pill-item {
  padding: 5px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease-fast);
}

.preset-pill-item:hover {
  background: var(--bg-hover);
  color: #ffffff;
  border-color: var(--border-medium);
}

/* History Log Tab View */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
}

.history-winner {
  font-weight: 700;
  color: #c7d2fe;
}

.history-time {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.history-empty {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Winner Celebration Modal
   ========================================================================== */
.winner-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease-smooth), visibility var(--ease-smooth);
}

.winner-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.winner-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: var(--space-xl) var(--space-lg);
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.92);
  transition: transform var(--ease-spring);
}

.winner-modal-backdrop.is-active .winner-modal-card {
  transform: scale(1);
}

.winner-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease-fast);
}

.winner-modal-close:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.winner-modal-close svg {
  width: 18px;
  height: 18px;
}

.winner-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-emerald-subtle);
  border: 1px solid var(--accent-emerald-border);
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.winner-modal-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
  word-break: break-word;
  line-height: 1.15;
}

.winner-modal-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.winner-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-modal-primary {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: all var(--ease-fast);
}

.btn-modal-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.btn-modal-secondary {
  width: 100%;
  height: 42px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.btn-modal-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-modal-danger {
  color: #f87171;
}

.btn-modal-danger:hover {
  background: var(--accent-crimson-subtle);
  border-color: var(--accent-crimson-border);
  color: #fca5a5;
}

/* ==========================================================================
   Scenario Presets Matrix Hub (Section Band)
   ========================================================================== */
.preset-hub-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.section-header-wrap {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-tag {
  font-size: 0.6875rem;
  font-weight: 800;
  color: #c7d2fe;
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
  margin-bottom: var(--space-xs);
}

.section-title {
  font-size: 1.625rem;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.875rem;
  max-width: 520px;
  margin: 0 auto;
}

.category-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-md);
}

.category-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: border-color var(--ease-fast);
}

.category-block:hover {
  border-color: var(--border-medium);
}

.category-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}

.category-block-emoji {
  font-size: 1.125rem;
}

.category-block-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
}

.category-links-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.preset-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--ease-fast);
}

.preset-link-card:hover {
  background: var(--bg-hover);
  color: #ffffff;
  text-decoration: none;
}

.preset-link-card svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--ease-fast);
}

.preset-link-card:hover svg {
  color: var(--brand-primary);
  transform: translateX(3px);
}

/* ==========================================================================
   Editorial Bands: Features, How It Works, FAQ
   ========================================================================== */
.editorial-band {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.feature-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color var(--ease-fast);
}

.feature-item:hover {
  border-color: var(--border-medium);
}

.feature-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xs);
  color: #c7d2fe;
}

.feature-icon-box svg {
  width: 17px;
  height: 17px;
}

.feature-item-title {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.feature-item-desc {
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.step-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-num {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.step-title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.step-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-list {
  max-width: 760px;
  margin: var(--space-lg) auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.faq-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--ease-fast);
}

.faq-card:hover {
  border-color: var(--border-medium);
}

.faq-card summary {
  padding: var(--space-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-card summary::-webkit-details-marker {
  display: none;
}

.faq-card summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--ease-fast);
}

.faq-card[open] summary::after {
  content: "−";
  color: var(--brand-primary);
}

.faq-body {
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: rgba(7, 8, 12, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-xl) var(--space-md);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

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

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

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.wheel-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--ease-smooth);
}

.wheel-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
