/* Modern CSS Stylesheet for Premack Principle Reinforcement Board & Timer */

:root {
  /* Dynamic Color Palette - Indigo & Purple with Emerald Accents */
  --bg-space: #060913;
  --bg-radial: radial-gradient(circle at 50% 0%, #151030 0%, #060913 70%);
  --primary: 260 85% 65%; /* HSL for easy opacity control */
  --primary-glow: hsla(260, 85%, 65%, 0.3);
  --secondary: 160 84% 39%; /* Emerald green for positive reinforcement */
  --secondary-glow: hsla(160, 84%, 39%, 0.2);
  --accent-pink: 320 80% 60%;
  --card-bg: rgba(17, 24, 39, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --glass-blur: blur(16px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-space);
  background-image: var(--bg-radial);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem;
}

/* Background Glowing Orbs */
.orb {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
  animation: orbFloat 20s infinite alternate ease-in-out;
}

.orb-purple {
  background: radial-gradient(circle, hsla(260, 85%, 65%, 0.8) 0%, transparent 70%);
  top: -10%;
  left: 10%;
  animation-delay: 0s;
}

.orb-emerald {
  background: radial-gradient(circle, hsla(160, 84%, 39%, 0.6) 0%, transparent 70%);
  bottom: 10%;
  right: 5%;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, -30px) scale(1.1);
  }
  100% {
    transform: translate(-30px, 40px) scale(0.95);
  }
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, hsla(260, 85%, 75%, 0.9) 70%, hsla(160, 84%, 60%, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr auto 1.1fr;
  gap: 1.5rem;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2.2rem;
  }
}

/* Glassmorphism Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), var(--shadow-glow);
}

/* Card Header Section */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1rem;
}

.badge {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-first {
  background: rgba(139, 92, 246, 0.15);
  color: hsl(260, 95%, 75%);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-then {
  background: rgba(16, 185, 129, 0.15);
  color: hsl(160, 95%, 70%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-title-input {
  background: transparent;
  border: 1px dashed transparent;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 700;
  width: 100%;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  outline: none;
  transition: var(--transition-smooth);
}

.card-title-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.card-title-input:focus {
  border-color: hsl(var(--primary));
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* checklist tracker */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.checklist-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  transition: var(--transition-smooth);
  animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.checklist-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  position: relative;
}

.checklist-checkbox:hover {
  border-color: hsl(var(--primary));
}

.checklist-checkbox:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.checklist-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth);
}

.checklist-checkbox:checked::after {
  opacity: 1;
  transform: scale(1);
}

.checklist-text {
  flex-grow: 1;
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  transition: var(--transition-smooth);
  min-width: 0; /* Prevents flex box items from breaking container boundary on mobile */
}

.checklist-text.completed {
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-remove-step {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.checklist-item:hover .btn-remove-step {
  opacity: 1;
}

.btn-remove-step:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.btn-add-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-secondary);
  padding: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-add-step:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

/* Token Economy Board */
.token-board-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.token-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.token-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.token-target-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
}

.token-target-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.token-target-btn.active {
  background: hsl(var(--primary));
  color: white;
}

.token-slots {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0.8rem 0;
}

.token-slot {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.token-slot:hover {
  border-color: hsl(var(--primary));
  background: rgba(139, 92, 246, 0.05);
  transform: scale(1.05);
}

.token-slot.active {
  border-style: solid;
  border-color: hsl(var(--secondary));
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 12px hsla(160, 84%, 39%, 0.2);
}

.token-star {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px #f59e0b);
  animation: starPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

@keyframes starPop {
  0% {
    transform: scale(0) rotate(-45deg);
    filter: drop-shadow(0 0 0px transparent);
  }
  80% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* TIMER COLUMN (THEN CARD) */
.timer-display-container {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #02040a;
}

/* Reward Image Behind */
.reward-image-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transition: filter 0.5s ease;
}

/* REVEAL OVERLAYS (THE CLOCK SHUTTER / SCREEN) */

/* 1. Puzzle Grid Style */
.grid-reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  z-index: 2;
  pointer-events: auto; /* Enable hover/clicks on cells */
}

.grid-cell {
  background: linear-gradient(135deg, #0e1224, #120e24);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, box-shadow 0.2s;
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}

.grid-cell:hover {
  background: linear-gradient(135deg, hsla(260, 85%, 65%, 0.8), hsla(320, 80%, 60%, 0.8));
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(0.96);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.25), 0 0 15px var(--primary-glow);
}

.grid-cell.revealed {
  opacity: 0;
  transform: scale(0.85) rotate(4deg);
  pointer-events: none; /* Let clicks pass through once revealed */
}

/* 2. Conic/Radial Wipe Overlay */
.conic-reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background: conic-gradient(transparent 0%, #111827 0%);
  transition: background 0.1s linear;
}

/* 3. Blinds Overlay */
.blinds-reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.blind-strip {
  flex-grow: 1;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
}

.blind-strip.revealed {
  transform: scaleY(0);
}

/* 4. Blur / Frosted Reveal Overlay */
.blur-reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(40px) saturate(40%);
  -webkit-backdrop-filter: blur(40px) saturate(40%);
  transition: backdrop-filter 0.5s ease, opacity 0.5s ease;
  opacity: 1;
}

/* Visual countdown screen stats overlay (e.g. digital clock and control) */
.timer-interface {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: radial-gradient(circle, rgba(6, 9, 19, 0.2) 0%, rgba(6, 9, 19, 0.6) 100%);
  pointer-events: none; /* Let clicks pass through if needed, but we override for buttons */
}

/* Time text design */
.clock-display-wrapper {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  pointer-events: auto;
}

.clock-text {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: 'Outfit', monospace;
  color: white;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.clock-completed-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 19, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.clock-completed-screen.show {
  opacity: 1;
  pointer-events: auto;
}

.complete-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: hsl(var(--secondary));
  text-shadow: 0 0 15px hsla(160, 84%, 39%, 0.4);
  animation: bounceComplete 1s infinite alternate ease-in-out;
}

.complete-desc {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.btn-complete-reset {
  background: hsl(var(--secondary));
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px hsla(160, 84%, 39%, 0.4);
  transition: var(--transition-smooth);
}

.btn-complete-reset:hover {
  transform: translateY(-2px);
  background: hsl(160, 84%, 45%);
}

@keyframes bounceComplete {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* TIMER BUTTONS & CONTROLS */
.timer-quick-presets {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.timer-preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.timer-preset-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: hsl(var(--primary));
  color: white;
}

.timer-custom-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-input-field {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: white;
  width: 60px;
  padding: 0.4rem;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  outline: none;
  transition: var(--transition-smooth);
}

.time-input-field:focus {
  border-color: hsl(var(--primary));
  background: rgba(255, 255, 255, 0.06);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.main-timer-buttons {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-primary {
  background: hsl(var(--primary));
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: hsl(260, 85%, 70%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.audio-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.audio-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* SETTINGS & CONFIGURATION PANEL (BOTTOM CARD) */
.settings-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

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

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-dropdown {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  padding: 0.8rem;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.select-dropdown:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.select-dropdown option {
  background: #0f172a;
  color: white;
}

/* Image Selector Presets Grid */
.image-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.image-preset-card {
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.image-preset-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preset-card.active {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
  transform: scale(1.03);
}

.image-preset-upload {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.image-preset-upload:hover {
  background: rgba(139, 92, 246, 0.05);
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.image-preset-upload span {
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

#file-upload-input {
  display: none;
}

/* Slider Design */
.speed-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.speed-slider {
  flex-grow: 1;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: hsl(var(--primary));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
  transition: var(--transition-smooth);
}

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

.speed-val {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 45px;
  color: hsl(var(--primary));
}

/* Footer Section */
footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Connective Flow Arrow */
.flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  filter: drop-shadow(0 0 8px hsla(260, 85%, 65%, 0.3));
  animation: arrowPulse 2s infinite alternate ease-in-out;
}

.connector-arrow {
  width: 48px;
  height: 48px;
}

@media (max-width: 968px) {
  .flow-connector {
    display: none;
  }
}

@keyframes arrowPulse {
  0% {
    transform: scale(0.9) translateX(-5px);
    color: rgba(255, 255, 255, 0.1);
  }
  100% {
    transform: scale(1.1) translateX(5px);
    color: hsla(260, 85%, 65%, 0.85);
  }
}

/* Velcro Visual 'I am working for' Thumbnail */
.working-for-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.8rem;
  border-radius: 18px;
  align-items: center;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.working-for-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.working-for-display {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid hsl(var(--primary));
  box-shadow: 0 0 10px var(--primary-glow);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.working-for-display:hover {
  transform: scale(1.06);
  box-shadow: 0 0 15px hsla(260, 85%, 65%, 0.5);
  border-color: hsl(var(--accent-pink));
}

#working-for-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Preset Library Button Styles */
.btn-preset-library {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-preset-library:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: hsl(var(--primary));
  color: white;
}

/* Visual Presets Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

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

.modal-content {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: var(--shadow-card), 0 0 40px rgba(139, 92, 246, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition-smooth);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, hsl(var(--primary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0 1rem;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-tab-btn.active {
  border-bottom-color: hsl(var(--primary));
  color: white;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  display: none;
  max-height: 55vh;
}

.modal-body.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.8rem;
}

.preset-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1rem 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.preset-card:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: hsl(var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.preset-emoji {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.preset-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Reward Emoji Card */
#reward-emoji-card {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: filter 0.5s ease;
}

/* Zoom Animation */
.animate-zoom {
  animation: modalZoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalZoom {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile Responsiveness Polish */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 1.2rem;
    border-radius: 20px;
    gap: 1.2rem;
  }
  
  .token-slots {
    gap: 0.5rem;
  }
  
  .token-slot {
    width: 44px;
    height: 44px;
  }
  
  .token-star {
    font-size: 1.4rem;
  }
  
  .clock-text {
    font-size: 2.8rem;
  }
  
  .btn-preset-library {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  
  .image-presets-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }
  
  .modal-content {
    width: 95%;
    border-radius: 20px;
  }
  
  .modal-body.active {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
    padding: 1rem;
  }
  
  .preset-card {
    padding: 0.8rem 0.4rem;
  }
  
  .preset-emoji {
    font-size: 1.8rem;
  }
  
  .preset-text {
    font-size: 0.75rem;
  }
  
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .timer-custom-inputs {
    justify-content: center;
  }
  
  .main-timer-buttons {
    justify-content: center;
    width: 100%;
  }
  
  .btn-primary {
    flex-grow: 1;
    justify-content: center;
  }
}
