/* ═══════════════════════════════════════════════════════
   SpinAWheel.net — Design System & Styles
   Premium dark/light theme with glassmorphism
   ═══════════════════════════════════════════════════════ */

/* ── Google Fonts loaded via HTML link tags (see header.ejs) ── */

/* ── CSS Reset ─────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Design Tokens — Dark Theme (Default) ──────────── */
:root,
[data-theme="dark"] {
  --bg-primary: #0a0e27;
  --bg-secondary: #111638;
  --bg-tertiary: #1a1f4a;
  --bg-gradient: linear-gradient(135deg, #0a0e27 0%, #0c1a2e 50%, #0d1333 100%);

  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-active: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.35);
  --secondary: #10b981;
  --secondary-hover: #059669;
  --accent: #f43f5e;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --nav-bg: rgba(10, 14, 39, 0.85);
  --modal-overlay: rgba(0, 0, 0, 0.7);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --wheel-glow: 0 0 60px rgba(14, 165, 233, 0.2), 0 0 120px rgba(16, 185, 129, 0.1);
}

/* ── Design Tokens — Light Theme ───────────────────── */
[data-theme="light"] {
  --bg-primary: #f0f7ff;
  --bg-secondary: #e0f2fe;
  --bg-tertiary: #bae6fd;
  --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #e0f7fa 50%, #f0f7ff 100%);

  --surface: rgba(255, 255, 255, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --surface-active: rgba(255, 255, 255, 1);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(100, 100, 150, 0.12);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(14, 165, 233, 0.18);
  --secondary: #059669;
  --secondary-hover: #047857;
  --accent: #e11d48;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;

  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);

  --nav-bg: rgba(240, 247, 255, 0.85);
  --modal-overlay: rgba(0, 0, 0, 0.45);

  --shadow-sm: 0 2px 8px rgba(100, 100, 150, 0.08);
  --shadow-md: 0 8px 24px rgba(100, 100, 150, 0.12);
  --shadow-lg: 0 16px 48px rgba(100, 100, 150, 0.15);
  --shadow-glow: 0 0 30px var(--primary-glow);

  --wheel-glow: 0 0 40px rgba(14, 165, 233, 0.1), 0 0 80px rgba(16, 185, 129, 0.06);
}

/* ── Background ────────────────────────────────────── */
body {
  background: var(--bg-gradient);
  background-attachment: fixed;
}

/* Animated background orbs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}
body::before {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  right: -200px;
  animation: float-orb 20s ease-in-out infinite;
}
body::after {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  left: -150px;
  animation: float-orb 25s ease-in-out infinite reverse;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(40px, -30px); }
  66% { transform: translate(-30px, 40px); }
}

/* ── Glassmorphism Utility ─────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ── Navigation ────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 6px var(--primary-glow));
  transition: transform 0.3s ease;
}
.nav-brand:hover .nav-logo {
  transform: rotate(30deg);
}

.nav-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  transition: all 0.2s ease;
  position: relative;
}
.nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.nav-btn:active {
  transform: translateY(0);
}
.nav-btn.active {
  color: var(--primary);
  background: var(--primary-glow);
}

/* ── Main Spinner Layout ───────────────────────────── */
.spinner-layout {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 60px - 80px);
  align-items: start;
}

/* ── Wheel Section ─────────────────────────────────── */
.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 660px;
  aspect-ratio: 1;
  cursor: pointer;
  filter: drop-shadow(var(--wheel-glow));
  transition: filter 0.3s ease;
}
.wheel-container:hover {
  filter: drop-shadow(0 0 80px rgba(14, 165, 233, 0.3));
}
.wheel-container.spinning {
  cursor: default;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Entries Panel ─────────────────────────────────── */
.entries-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  max-height: calc(100vh - 108px);
}

/* Panel Tabs (Entries / Results) */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin; /* Firefox */
}
.panel-tabs::-webkit-scrollbar {
  height: 4px;
}
.panel-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.panel-tabs::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}
.panel-tabs::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

.panel-tab {
  flex: 1 0 auto;
  min-width: 80px;
  white-space: nowrap;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  position: relative;
}
.panel-tab:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}
.panel-tab.active {
  color: var(--primary);
}
.panel-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: var(--radius-full);
  background: var(--surface-active);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.panel-tab.active .tab-badge {
  background: var(--primary-glow);
  color: var(--primary);
}

/* Tab Content */
.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.tab-content.active {
  display: flex;
}

/* Entry Controls */
.entries-controls {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.control-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.control-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

/* Entries Textarea */
.entries-textarea {
  flex: 1;
  min-height: 280px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  resize: none;
  outline: none;
}
.entries-textarea::placeholder {
  color: var(--text-muted);
}

/* ═══ SUB-TABS (List | Text | Style | Sound) ═══ */

.sub-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.sub-tabs-group {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 2px;
  gap: 0;
}

.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.sub-tab svg {
  flex-shrink: 0;
}
.sub-tab:hover {
  color: var(--text-primary);
}
.sub-tab.active {
  background: var(--surface-active);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .sub-tab.active {
  background: #fff;
}

.sub-tabs-actions {
  display: flex;
  gap: 6px;
}

.sub-tab-action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.add-entry-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.add-entry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.more-actions-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.more-actions-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* ═══ SUB-TAB CONTENT PANELS ═══ */

.sub-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sub-tab-content.active {
  display: flex;
}

/* ═══ ENTRY LIST (List Tab) ═══ */

.entry-list-header {
  display: grid;
  grid-template-columns: 28px 1fr 28px 76px 34px 30px 28px;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-list-body {
  flex: 1;
  overflow-y: auto;
  min-height: 180px;
  max-height: calc(100vh - 420px);
}

.entry-list-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.entry-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px 76px 34px 30px 28px;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  min-height: 42px;
}
.entry-row:last-child {
  border-bottom: none;
}
.entry-row:hover {
  background: var(--surface-hover);
}

.entry-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.entry-name-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.entry-name-input:hover {
  border-color: var(--border-strong);
}
.entry-name-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

/* Weight stepper */
.er-weight {
  display: grid;
  grid-template-columns: 20px 1fr 20px;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  height: 28px;
  background: var(--surface);
}

.weight-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  height: 100%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.weight-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.weight-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.weight-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
}
.weight-input::-webkit-inner-spin-button,
.weight-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.er-pct {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Color dot */
.color-dot-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(0,0,0,0.1);
}
.color-dot-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Entry action button */
.entry-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.entry-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ═══ COLOR PICKER POPOVER ═══ */

.color-picker-popover {
  position: absolute;
  z-index: 150;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  animation: modalIn 0.2s ease;
}
.color-picker-popover.hidden {
  display: none;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.cpg-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.cpg-dot:hover {
  transform: scale(1.2);
  border-color: var(--text-primary);
}

.color-picker-reset {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.color-picker-reset:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ═══ DROPDOWN MENU ═══ */

.dropdown-menu {
  position: absolute;
  z-index: 200;
  top: auto;
  right: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  animation: modalIn 0.2s ease;
}
.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.dropdown-item.danger {
  color: var(--error);
}
.dropdown-item.danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ═══ ENTRY CONTEXT MENU ═══ */

.entry-context-menu {
  position: absolute;
  z-index: 250;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  min-width: 170px;
  animation: modalIn 0.15s ease;
}

.ecm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.ecm-item:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.ecm-item:disabled {
  opacity: 0.4;
  cursor: default;
}
.ecm-item.danger {
  color: var(--error);
}
.ecm-item.danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ═══ STYLE PANEL (Style Tab) ═══ */

.style-panel,
.sound-panel {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.style-section {
  margin-bottom: 20px;
}
.style-section:last-child {
  margin-bottom: 0;
}

.style-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Palette Grid */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.palette-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.palette-card:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.palette-card.active {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.palette-swatches {
  display: flex;
  gap: 3px;
}

.palette-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.palette-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.palette-card.active .palette-name {
  color: var(--primary);
}

/* Slider Row */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-label-sm {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.slider-label-lg {
  font-size: 1rem;
  color: var(--text-muted);
}

.styled-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
  outline: none;
  cursor: pointer;
}
.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px var(--primary-glow);
}
.styled-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer;
}

.slider-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 50px;
  text-align: right;
}

/* ═══ SOUND PRESETS (Sound Tab) ═══ */

.sound-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sound-preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.sound-preset-card:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.sound-preset-card.active {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.sound-preset-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.sound-preset-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.sound-preset-card.active .sound-preset-label {
  color: var(--primary);
}

/* Results list */
.results-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease;
}

.result-number {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.result-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.result-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Multi-Wheel Tabs ──────────────────────────────── */
.wheel-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.wheel-tab-list {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.wheel-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  position: relative;
}
.wheel-tab:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.wheel-tab.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

.wheel-tab .close-tab {
  display: none;
  margin-left: 6px;
  font-size: 0.7rem;
  opacity: 0.6;
}
.wheel-tab:hover .close-tab {
  display: inline;
}
.wheel-tab .close-tab:hover {
  opacity: 1;
}

.add-wheel {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.1rem;
  border-style: dashed;
  flex-shrink: 0;
}
.add-wheel:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Multi-Wheel Grid ──────────────────────────────── */
.wheels-grid {
  display: grid;
  gap: 20px;
  width: 100%;
  align-items: start;
  justify-items: center;
}
.wheels-grid[data-count="1"] {
  grid-template-columns: 1fr;
}
.wheels-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
.wheels-grid[data-count="3"] {
  grid-template-columns: 1fr 1fr 1fr;
}
.wheels-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}
.wheels-grid[data-count="5"],
.wheels-grid[data-count="6"] {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Wheel Card */
.wheel-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease;
  padding: 4px;
}
.wheel-card.active {
  /* Optional: slight transform or glow on canvas wrap instead of a square border */
}
.wheel-card.spinning {
  cursor: default;
}

.wheel-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  filter: drop-shadow(var(--wheel-glow));
  transition: filter 0.3s ease, transform 0.2s ease;
}
.wheel-canvas-wrap:hover {
  filter: drop-shadow(0 0 60px rgba(14, 165, 233, 0.25));
}
.wheel-card.active .wheel-canvas-wrap {
  transform: scale(1.02);
}
.wheel-card.spinning .wheel-canvas-wrap {
  cursor: default;
  transform: scale(1);
}
.wheel-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-card-label {
  text-align: center;
  padding: 6px 0 2px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.wheel-card-label:hover {
  color: var(--text-primary);
}
.wheel-card.active .wheel-card-label {
  color: var(--primary);
}

/* Single wheel → bigger */
.wheels-grid[data-count="1"] .wheel-card {
  max-width: 680px;
}
.wheels-grid[data-count="1"] .wheel-card-label {
  font-size: 1rem;
}
/* 2 wheels */
.wheels-grid[data-count="2"] .wheel-card {
  max-width: 420px;
}
/* 3+ wheels → smaller */
.wheels-grid[data-count="3"] .wheel-card,
.wheels-grid[data-count="4"] .wheel-card,
.wheels-grid[data-count="5"] .wheel-card,
.wheels-grid[data-count="6"] .wheel-card {
  max-width: 320px;
}
.wheels-grid[data-count="3"] .wheel-card-label,
.wheels-grid[data-count="4"] .wheel-card-label,
.wheels-grid[data-count="5"] .wheel-card-label,
.wheels-grid[data-count="6"] .wheel-card-label {
  font-size: 0.78rem;
}

/* ── Wheel Management Buttons ──────────────────────── */
.wheel-management {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.management-row {
  display: flex;
  gap: 8px;
}

.management-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* ── Winner Modal ──────────────────────────────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.library-content {
  max-width: 600px;
  text-align: left;
}
.library-list {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}
.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.library-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}
.library-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.library-item-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}
.library-item-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.library-item-actions {
  display: flex;
  gap: 8px;
}
.library-item-actions .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.winner-modal-box {
  position: relative;
  z-index: 1;
  background: #ffffff;
  width: 500px;
  max-width: 95vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

.winner-modal-header {
  background: #3b82f6; /* Exact blue from screenshot */
  padding: 14px 20px;
}

.winner-modal-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.winner-modal-body {
  padding: 40px 20px;
  text-align: center;
  background: #ffffff;
}

.winner-modal-body .winner-name {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 400;
  color: #333333;
  font-family: 'Inter', sans-serif;
}

.winner-modal-footer {
  padding: 10px 20px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  background: #ffffff;
}

.winner-btn-ghost {
  background: transparent;
  border: none;
  color: #333333;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
}
.winner-btn-ghost:hover {
  color: #000000;
}

.winner-btn-primary {
  background: #5c8df6;
  border: none;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
}
.winner-btn-primary:hover {
  background: #4a7be4;
}

/* Share modal */
.share-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.share-url-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.share-url-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  outline: none;
}
.share-url-input:focus {
  border-color: var(--primary);
}

.share-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  position: relative;
  margin-top: 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-gradient-border {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 100%;
  animation: footer-gradient-shift 8s ease-in-out infinite;
}

@keyframes footer-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

/* Brand Column */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.footer-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 6px var(--primary-glow));
  transition: transform 0.3s ease;
}
.footer-brand:hover .footer-logo {
  transform: rotate(30deg);
}

.footer-brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 340px;
}

/* Social Icons */
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.footer-social-link:hover {
  color: var(--primary);
  background: var(--primary-glow);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--primary-glow);
  text-decoration: none;
}

/* Link Columns */
.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link-list a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-link-list a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Footer Bottom */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  transition: all 0.2s ease;
  text-decoration: none;
}
.back-to-top:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Footer Responsive */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand-col {
    grid-column: 1 / -1;
  }
  .footer-brand-desc {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}


/* ── Ad Slots (hidden by default) ──────────────────── */
.ad-slot {
  display: none;
}
.ad-slot.visible {
  display: block;
}
.ad-sidebar {
  position: fixed;
  left: 12px;
  top: 80px;
  width: 160px;
  z-index: 50;
}
.ad-bottom {
  width: 100%;
  max-width: 728px;
  margin: 16px auto;
}

/* ── Content Pages ─────────────────────────────────── */

/* Hero Header */
.content-hero {
  text-align: center;
  padding: 48px 24px 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.content-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.06;
  filter: blur(60px);
  pointer-events: none;
}
.content-hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--secondary);
  opacity: 0.05;
  filter: blur(50px);
  pointer-events: none;
}

.content-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.content-hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.content-hero .last-updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

/* Breadcrumb Trail */
.breadcrumb-trail {
  padding: 12px 24px;
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-trail a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.breadcrumb-trail a:hover {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: var(--border-strong);
}

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

/* Content Page Body */
.content-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.content-page h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-page .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.content-page h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 16px;
}

.content-page h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.content-page p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.content-page ul, .content-page ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}
.content-page li {
  margin-bottom: 8px;
}

.content-page strong {
  color: var(--text-primary);
  font-weight: 600;
}

.content-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.content-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.content-card h3 {
  margin-top: 0;
}

.content-card .card-emoji {
  font-size: 1.6rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-glow);
  border: 1px solid var(--border);
}

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

.step-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.step-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.step-card h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  text-align: center;
}

.step-card p {
  font-size: 0.9rem;
  margin: 0;
}

/* CTA Section — Upgraded */
.cta-section {
  text-align: center;
  margin-top: 48px;
  padding: 48px 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}

.cta-section h2 {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.cta-section p {
  position: relative;
  z-index: 1;
}

.cta-section .btn {
  margin-top: 16px;
  padding: 14px 32px;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

/* Table of Contents (legal pages) */
.content-toc {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.content-toc-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.content-toc ol {
  padding-left: 20px;
  margin: 0;
}

.content-toc li {
  margin-bottom: 6px;
}

.content-toc a,
a.toc-link {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color 0.2s;
}
.content-toc a:hover,
a.toc-link:hover {
  color: var(--primary);
  text-decoration: none;
}


/* Keyboard shortcut badges */
.kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Editable Wheel Title ──────────────────────────── */
.wheel-title-wrapper {
  text-align: center;
  margin-bottom: 8px;
}

.wheel-title-editable {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  outline: none;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 300px;
  min-width: 80px;
}

.wheel-title-editable:hover {
  border-color: var(--border-strong);
}

.wheel-title-editable:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  -webkit-text-fill-color: var(--text-primary);
  background: transparent;
}

/* ── Speed Control ─────────────────────────────────── */
.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.speed-control label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.speed-control input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
  outline: none;
  cursor: pointer;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.speed-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px var(--primary-glow);
}

.speed-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer;
}

.speed-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 50px;
  text-align: right;
}

/* ── Stats Chart ───────────────────────────────────── */
.stats-container {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.stats-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.stats-bar-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 70px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-bar-track {
  flex: 1;
  height: 22px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.stats-bar-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: right;
}

.stats-total {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.stats-total strong {
  color: var(--primary);
}

/* ── Animations ────────────────────────────────────── */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes spin-once {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Toast Notification ────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .spinner-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .wheel-section {
    min-height: 200px;
  }
  .wheel-container {
    max-width: 420px;
  }
  .entries-panel {
    max-height: none;
  }
  .entries-textarea {
    min-height: 180px;
  }
  .nav-links {
    display: none;
  }
  /* Multi-wheel grid: max 2 columns on tablet */
  .wheels-grid[data-count="3"],
  .wheels-grid[data-count="5"] {
    grid-template-columns: 1fr 1fr;
  }
  .wheels-grid[data-count="3"] .wheel-card,
  .wheels-grid[data-count="4"] .wheel-card,
  .wheels-grid[data-count="5"] .wheel-card {
    max-width: 280px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 12px;
    height: 52px;
  }
  .nav-title {
    font-size: 1.05rem;
  }
  .nav-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .spinner-layout {
    padding: 12px;
    gap: 12px;
  }
  .wheel-container {
    max-width: 340px;
  }
  .modal-content {
    padding: 28px 20px;
  }
  .winner-name {
    font-size: 1.8rem;
  }
  .content-page {
    padding: 24px 16px 40px;
  }
  .content-page h1 {
    font-size: 1.6rem;
  }
  /* Multi-wheel grid: single column on phone */
  .wheels-grid[data-count="2"],
  .wheels-grid[data-count="3"],
  .wheels-grid[data-count="4"],
  .wheels-grid[data-count="5"] {
    grid-template-columns: 1fr 1fr;
  }
  .wheels-grid .wheel-card {
    max-width: 260px;
  }
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Selection ─────────────────────────────────────── */
::selection {
  background: var(--primary-glow);
  color: var(--text-primary);
}

/* ── Focus Visible ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Fullscreen mode ───────────────────────────────── */
body.fullscreen-mode .navbar,
body.fullscreen-mode .site-footer,
body.fullscreen-mode .entries-panel {
  display: none;
}
body.fullscreen-mode .spinner-layout {
  grid-template-columns: 1fr;
  height: 100vh;
  align-items: center;
  justify-items: center;
}
body.fullscreen-mode .wheel-container {
  max-width: 85vh;
}

/* ── Panel Toggle State ──────────── */
body.panel-hidden .entries-panel {
  display: none !important;
}
body.panel-hidden .spinner-layout {
  grid-template-columns: 1fr;
}
body.panel-hidden .wheel-container {
  max-width: 85vh;
}

/* ── Entry Delete Button ─────────── */
.entry-delete-btn {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-delete-btn:hover {
  opacity: 1;
  background: var(--surface-active);
}

/* ── Hamburger for mobile (content pages) ──────────── */
.nav-hamburger {
  display: none;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  padding: 4px;
}

@media (max-width: 900px) {
  .nav-hamburger {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 16px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .nav-links.open {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════════
   Homepage SEO Content — Premium Design System
   ═══════════════════════════════════════════════════════ */

/* ── Block Layout ──────────────────────────────────── */
.seo-block {
  padding: 64px 24px;
}
.seo-block-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Badge ─────────────────────────────────────────── */
.seo-badge {
  display: inline-block;
  padding: 6px 18px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  background: var(--primary-glow);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

/* ── Gradient Text Utility ─────────────────────────── */
.seo-gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Section Headings ──────────────────────────────── */
.seo-hero-heading {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.seo-section-heading {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.seo-section-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* ── BLOCK 1: Hero Intro ──────────────────────────── */
.seo-hero-block {
  text-align: center;
  padding-top: 72px;
}
.seo-hero-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.seo-hero-lead strong {
  color: var(--text-primary);
}

/* ── BLOCK 2: Stats ───────────────────────────────── */
.seo-stats-block {
  padding-top: 24px;
  padding-bottom: 24px;
}
.seo-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.seo-stat {
  text-align: center;
  padding: 32px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.seo-stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.seo-stat-number {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.seo-stat-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── BLOCK 3: Benefits ────────────────────────────── */
.seo-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.seo-benefit-card {
  position: relative;
  padding: 28px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.seo-benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.seo-benefit-card h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.seo-benefit-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ── BLOCK 4: Use Cases ───────────────────────────── */
.seo-usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.seo-usecase {
  text-align: center;
  padding: 32px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.seo-usecase:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.seo-usecase-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 16px;
  line-height: 1;
}
.seo-usecase h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.seo-usecase p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ── BLOCK 5: How-To Steps (Timeline) ─────────────── */
.seo-howto-block {
  background: var(--glass-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.seo-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 40px;
}
.seo-steps-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 2px;
}
.seo-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 0;
  position: relative;
}
.seo-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  margin-left: -40px;
  box-shadow: 0 0 0 4px var(--bg-primary), 0 0 20px var(--primary-glow);
  z-index: 1;
}
[data-theme="light"] .seo-step-number {
  box-shadow: 0 0 0 4px var(--bg-primary), 0 4px 12px rgba(14,165,233,0.2);
}
.seo-step-body h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.seo-step-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ── BLOCK 6: Comparison Table ────────────────────── */
.seo-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.seo-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}
.seo-table th,
.seo-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.seo-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
}
.seo-table th.seo-table-highlight {
  color: var(--primary);
}
.seo-table td.seo-table-highlight {
  color: var(--text-primary);
  font-weight: 600;
}
.seo-table tr:last-child td {
  border-bottom: none;
}
.seo-table tbody tr {
  transition: background 0.2s;
}
.seo-table tbody tr:hover {
  background: var(--surface-hover);
}
.seo-check {
  color: var(--secondary);
  font-weight: 700;
  margin-right: 4px;
}
.seo-cross {
  color: var(--error);
  font-weight: 700;
  margin-right: 4px;
  opacity: 0.7;
}

/* ── BLOCK 7: FAQ (Collapsible) ───────────────────── */
.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
}
.seo-faq-item {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.seo-faq-item[open] {
  box-shadow: var(--shadow-sm);
}
.seo-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  transition: color 0.2s, background 0.2s;
  user-select: none;
}
.seo-faq-question::-webkit-details-marker {
  display: none;
}
.seo-faq-question::after {
  content: '+';
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-active);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
  margin-left: 16px;
  transition: transform 0.3s ease, background 0.3s ease;
}
.seo-faq-item[open] .seo-faq-question::after {
  content: '−';
  transform: rotate(180deg);
  background: var(--primary-glow);
}
.seo-faq-question:hover {
  background: var(--surface-hover);
}
.seo-faq-answer {
  padding: 0 24px 20px;
}
.seo-faq-answer p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .seo-block {
    padding: 40px 16px;
  }
  .seo-stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .seo-stat {
    padding: 24px 16px;
  }
  .seo-benefits-grid {
    grid-template-columns: 1fr;
  }
  .seo-usecases-grid {
    grid-template-columns: 1fr;
  }
  .seo-steps-timeline {
    padding-left: 32px;
  }
  .seo-steps-timeline::before {
    left: 15px;
  }
  .seo-step-number {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    margin-left: -32px;
  }
  .seo-faq-question {
    padding: 16px 20px;
    font-size: 0.95rem;
  }
  .seo-faq-answer {
    padding: 0 20px 16px;
  }

  /* Header Optimization */
  .navbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    height: auto;
    justify-content: center;
    gap: 12px;
  }
  .nav-brand {
    margin: 0 auto;
  }
  .nav-actions {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-actions::-webkit-scrollbar {
    height: 4px;
  }
  .nav-actions::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
  }

  /* Main Layout Stacking */
  .spinner-layout {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 20px;
    height: auto;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .wheel-section {
    position: relative;
    top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .wheels-grid {
    width: 100%;
    max-width: 100%;
  }
  /* Force all wheels to stack vertically on mobile */
  .wheels-grid[data-count="1"],
  .wheels-grid[data-count="2"],
  .wheels-grid[data-count="3"],
  .wheels-grid[data-count="4"],
  .wheels-grid[data-count="5"],
  .wheels-grid[data-count="6"] {
    grid-template-columns: 1fr;
  }
  /* Reset max width constraints for multi-wheels on mobile to ensure they aren't tiny */
  .wheels-grid[data-count] .wheel-card {
    max-width: 400px;
  }
  .wheels-grid[data-count] .wheel-card-label {
    font-size: 1rem;
  }
  .wheel-card {
    max-width: 100%;
    width: 100%;
  }
  .entries-panel {
    width: 100%;
    max-height: 65vh;
  }

  /* Panel Overflow fixes */
  .sub-tabs-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* SEO Table Overflow */
  .seo-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }


  /* Content page hero responsive */
  .content-hero {
    padding: 32px 16px 24px;
  }
  .content-page {
    padding: 24px 16px 40px;
  }
  .content-page h1 {
    font-size: 1.6rem;
  }
}
