/* ==========================================================================
   Design System Variables & Core Tokens (Inspired by sleek modern SaaS UIs)
   ========================================================================== */
:root {
  /* Light Mode Theme Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  
  --accent-primary: #10b981; /* Emerald green */
  --accent-primary-hover: #059669;
  --accent-primary-glow: rgba(16, 185, 129, 0.25);
  
  --accent-secondary: #6366f1; /* Indigo */
  --accent-secondary-hover: #4f46e5;
  
  --danger-color: #ef4444;
  --danger-color-hover: #dc2626;
  --danger-color-glow: rgba(239, 68, 68, 0.2);
  
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-focus: #10b981;
  
  --pointer-color: #ef4444;
  --kbd-bg: #e2e8f0;
  --kbd-color: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px 2px rgba(16, 185, 129, 0.4);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Theme Palette Overrides */
body.dark-mode {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --border-color: #374151;
  
  --accent-primary: #10b981;
  --accent-primary-hover: #34d399;
  --accent-primary-glow: rgba(52, 211, 153, 0.25);
  
  --accent-secondary: #818cf8;
  --accent-secondary-hover: #4f46e5;
  
  --danger-color: #f87171;
  --danger-color-hover: #ef4444;
  
  --input-bg: #111827;
  --input-border: #374151;
  --input-focus: #10b981;
  
  --kbd-bg: #374151;
  --kbd-color: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px 3px rgba(16, 185, 129, 0.3);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  padding-top: 64px; /* Space offset for fixed sticky header on desktop */
}

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

ul, ol {
  list-style: none;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Aesthetics Utilities
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background-color: var(--bg-secondary);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
}

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Keyboard badge design */
.kbd-key {
  background-color: var(--kbd-bg);
  color: var(--kbd-color);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  font-size: 0.8em;
  font-family: monospace;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--bg-card); /* Fully solid opaque background to cover scrolled contents */
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Button System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.btn-danger {
  background-color: var(--danger-color);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
  background-color: var(--danger-color-hover);
  transform: translateY(-1px);
}

.btn-large {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-lg);
}

.btn-glow {
  box-shadow: var(--shadow-glow);
}
.btn-glow:hover {
  box-shadow: 0 0 25px 4px rgba(16, 185, 129, 0.5);
}

.btn-icon span {
  display: inline-block;
}

/* Icon Buttons (theme, fullscreen toggles) */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
  transform: scale(1.05);
}
.icon-btn:active {
  transform: scale(0.95);
}

/* Sun/Moon Theme Toggle specific icons hide/show */
.icon-sun {
  display: none;
}
.icon-moon {
  display: block;
}
body.dark-mode .icon-sun {
  display: block;
}
body.dark-mode .icon-moon {
  display: none;
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.app-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

/* Responsive Stacking Rules */
@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Left Column: Wheel Section
   ========================================================================== */
.wheel-section {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.wheel-outer-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.wheel-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.wheel-action-btn {
  color: var(--text-secondary);
  opacity: 0.6;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.wheel-action-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Canvas Box Wrapper (Controls ratios and scales) */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  margin: 1rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  display: block;
}

/* Pointer Triangle Indicator */
.wheel-pointer {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Center SPIN Clickable Dome Hub */
.spin-btn-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  border: 5px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

body.dark-mode .spin-btn-center {
  background: radial-gradient(circle at 35% 35%, #334155 0%, #1e293b 50%, #0f172a 100%);
  border-color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.spin-btn-center:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.8);
}
.spin-btn-center:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.spin-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #0f172a;
}
body.dark-mode .spin-text {
  color: #f8fafc;
}

/* Secondary Controls */
.wheel-bottom-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.shortcut-tip {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Wheel Fullscreen Mode specific styling overrides */
#wheel-container.wheel-fullscreen-active {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#wheel-container.wheel-fullscreen-active .wheel-outer-card {
  width: 100%;
  height: 100%;
  max-width: 900px;
  justify-content: space-around;
  padding: 1.5rem;
}

#wheel-container.wheel-fullscreen-active .canvas-wrapper {
  max-width: calc(100vh - 220px);
}

/* ==========================================================================
   Right Column: Panel Section (Management Panel Cards & Tabs)
   ========================================================================== */
.panel-section {
  width: 100%;
}

.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: 600px;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Tab Header Navigation (Pill styled togglers) */
.tabs-header {
  display: flex;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.4rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Tab Content Areas */
.tab-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
}

/* Add Entry Form Row */
.entry-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.add-entry-form {
  flex: 1;
  display: flex;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.add-entry-form:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.add-entry-form input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
}

/* Small tool utility bar */
.utility-toolbar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  transition: all var(--transition-fast);
}
.btn-tool:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}
.btn-tool.danger:hover {
  background-color: var(--danger-color-glow);
  color: var(--danger-color);
  border-color: var(--danger-color);
}

/* Scrollable Entries List */
.list-scroll-area {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  animation: entry-fade-in 0.2s ease-out;
}
.entry-item:hover {
  border-color: var(--border-color);
  transform: translateX(1px);
}

@keyframes entry-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.entry-text {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.action-icon-btn:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}
.action-icon-btn.danger:hover {
  color: var(--danger-color);
  background-color: var(--danger-color-glow);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  height: 100%;
}

.empty-icon {
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 250px;
  line-height: 1.4;
}

/* History logs */
.history-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.history-actions-row h3 {
  font-size: 1rem;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.9rem;
}

.history-winner {
  font-weight: 600;
}

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

/* Settings Sliders & Form layouts */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}

.input-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Range Slider */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  transition: transform 0.1s;
}
.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn-inline {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}
.icon-btn-inline:hover {
  color: var(--text-primary);
}

/* Dropdown select widget */
.select-widget {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  font-size: 0.85rem;
}

/* Grid themes */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.theme-chip {
  padding: 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}
.theme-chip:hover {
  transform: scale(1.02);
}
.theme-chip.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--accent-primary);
}

/* Checkboxes */
.checkbox-group {
  gap: 0.75rem;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  accent-color: var(--accent-primary);
  margin-top: 0.15rem;
}
.checkbox-labels {
  display: flex;
  flex-direction: column;
}
.checkbox-labels label {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==========================================================================
   Modal Dialog Layouts
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000; /* Higher than projector fullscreen view (z-index: 9999) to display modals on top */
  background-color: rgba(9, 13, 22, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card.modal-small {
  max-width: 400px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
}

.close-modal-btn {
  color: var(--text-secondary);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.close-modal-btn:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-lead {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Bulk Drop Zone drag state */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  margin-bottom: 1rem;
}
.drop-zone svg {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  opacity: 0.6;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background-color: var(--bg-secondary);
}

.textarea-container textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  resize: vertical;
  font-size: 0.85rem;
}

/* Winner Modal Overlay specific design */
.modal-winner {
  background-color: rgba(9, 13, 22, 0.75);
}

#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.winner-card {
  z-index: 5;
  border: 2px solid var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  max-width: 440px;
  animation: winner-pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-mode .winner-card {
  background-color: rgba(31, 41, 55, 0.95);
}

@keyframes winner-pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.text-center {
  text-align: center;
}

.winner-trophy-ring {
  width: 72px;
  height: 72px;
  background-color: var(--accent-primary-glow);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.trophy-icon {
  width: 36px;
  height: 36px;
}

.winner-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.winner-name-text {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--text-primary);
  word-wrap: break-word;
  text-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.winner-timestamp {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.layout-row {
  display: flex;
  flex-direction: row;
}

.justify-center {
  justify-content: center;
}

/* Edit single entry body */
.edit-entry-form-body input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
}

/* ==========================================================================
   Technical SEO Sections (Below the fold layout)
   ========================================================================== */
.seo-long-section {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.seo-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.seo-block {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.seo-section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.seo-section-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Steps grid system */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

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

.step-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition-fast);
}
.step-card:hover {
  transform: translateY(-2px);
}

.step-num {
  width: 32px;
  height: 32px;
  background-color: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.step-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.step-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Features Grid layout */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

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

.feature-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.feature-card:hover {
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  color: var(--accent-secondary);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* SEO Article Structure & Typography */
.seo-article {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.seo-block-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}

.seo-sub-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.seo-prose {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.seo-text-muted {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: -0.5rem;
}

.seo-prose-note {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  font-style: italic;
}

/* SEO Tables (Responsive & Accessible) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 0.5rem 0 1rem;
  background-color: var(--bg-primary);
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.seo-table th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.seo-table td {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  line-height: 1.5;
  vertical-align: middle;
}

.seo-table tr:last-child td {
  border-bottom: none;
}

.seo-table tr:hover td {
  background-color: var(--bg-secondary);
}

.seo-table td strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Badges for table color styles */
.badge-style {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-rainbow {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.badge-brand {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--accent-secondary);
}

.badge-pastel {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
}

.badge-twotone {
  background-color: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

body.dark-mode .badge-twotone {
  color: #fbbf24;
}

/* Bullet list with custom icons */
.seo-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.5rem 0 1rem;
  padding: 0;
}

.seo-bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.seo-bullet-list .bullet-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary-glow);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.seo-bullet-list strong {
  color: var(--text-primary);
}

/* Everyday Use Cases Card Grid */
.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .seo-card-grid {
    grid-template-columns: 1fr;
  }
}

.seo-usecase-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.seo-usecase-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.usecase-icon {
  color: var(--accent-primary);
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-usecase-card p {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

/* CTA Section Block */
.seo-cta-block {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cta-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cta-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.cta-lead {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.btn-cta {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Steps Grid styling updates for ordered list reset */
ol.steps-grid {
  list-style: none;
  padding: 0;
}

/* FAQ Accordion layout */
.faq-wrapper {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.faq-item:hover {
  border-color: var(--text-secondary);
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color var(--transition-fast);
}
.faq-trigger:hover {
  background-color: var(--bg-secondary);
}

.faq-trigger .chevron {
  color: var(--text-secondary);
  transition: transform var(--transition-normal);
}

.faq-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-content p {
  padding: 0.25rem 1.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.app-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 1.5rem 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-links-grid {
  display: flex;
  gap: 4.5rem;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
  }
  .footer-links-grid {
    gap: 2.5rem;
    flex-wrap: wrap;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-col a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.footer-col a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 1.5rem;
}

.footer-bottom-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-icon {
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.social-icon:hover {
  color: var(--accent-secondary);
  transform: translateY(-1px);
}

/* ==========================================================================
   Toast Alerts
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), toast-fade-out 0.3s ease forwards 2.7s;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ==========================================================================
   Mobile Header, Drawer & Actions Responsive Additions
   ========================================================================== */
.wheel-bottom-actions-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
  flex-wrap: wrap; /* Wrap on narrow screen layouts */
}

.mobile-only {
  display: none !important;
}

.mobile-menu-drawer {
  position: fixed;
  top: 58px; /* Mobile header height offset */
  left: 0;
  width: 100vw;
  max-height: 0; /* Animate using max-height for fluid CSS transition */
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  z-index: 99;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  padding: 0 1.5rem;
}

.mobile-menu-drawer.active {
  max-height: 350px;
  padding: 1.5rem 1.5rem;
}

#wheel-container.wheel-fullscreen-active .wheel-bottom-actions-row {
  display: none !important;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

/* Mobile Media Queries Overrides & Cleanups */
@media (max-width: 768px) {
  body {
    padding-top: 58px; /* Height padding for fixed header on mobile screen sizes */
  }

  .mobile-only {
    display: flex !important;
  }
  
  .logo-text {
    font-size: 1.15rem;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
  }

  .header-container {
    padding: 0.6rem 1rem;
  }
  
  .header-actions {
    gap: 0.5rem;
  }

  .main-wrapper {
    padding: 1rem 0.5rem;
  }

  .panel-section,
  #wheel-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .wheel-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .wheel-outer-card {
    padding: 1rem 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .canvas-wrapper {
    margin: 0.5rem auto 1.25rem;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
  }

  .panel-card {
    height: 540px;
  }

  .tab-pane {
    padding: 1rem 0.75rem;
  }

  .tab-btn {
    padding: 0.5rem 0.4rem;
    font-size: 0.75rem;
    gap: 0.25rem;
  }
  
  .tab-btn svg {
    width: 14px;
    height: 14px;
  }

  .utility-toolbar {
    justify-content: space-between;
    gap: 0.25rem;
  }

  .btn-tool {
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
    gap: 0.2rem;
  }
  
  @media (max-width: 480px) {
    .wheel-bottom-actions-row {
      flex-direction: column;
      align-items: stretch;
      gap: 0.5rem;
    }
    .wheel-bottom-actions-row .btn {
      width: 100%;
    }
    .entry-actions-row {
      flex-direction: column;
      gap: 0.5rem;
    }
    #bulk-import-btn {
      width: 100%;
    }
  }

  @media (max-width: 400px) {
    .btn-tool span {
      display: none; /* Hide tool text on narrow viewports to prevent overflow */
    }
    .btn-tool {
      padding: 0.5rem;
      justify-content: center;
      flex: 1;
    }
  }
}
