* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --purple: #8B5CF6;
  --pink: #EC4899;
  --orange: #F97316;
  --bg-dark: #0F0A1A;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Background blobs */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--purple);
  top: -100px;
  left: -100px;
  animation: float 15s ease-in-out infinite;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: var(--pink);
  bottom: 10%;
  right: -100px;
  animation: float 18s ease-in-out infinite reverse;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--orange);
  bottom: -50px;
  left: 20%;
  animation: float 20s ease-in-out infinite 2s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.berry-mascot {
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.berry-mascot.wiggle {
  animation: wiggle 0.5s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--pink), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

/* Main content */
.main-content {
  position: relative;
  z-index: 1;
}

/* Timer section */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.timer-circle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink), var(--orange));
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timer-circle.idle {
  animation: gentle-float 4s ease-in-out infinite;
}

.timer-circle.active {
  animation: pulse-glow 2s ease-in-out infinite;
  box-shadow: 0 0 60px rgba(236, 72, 153, 0.5);
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 80px rgba(236, 72, 153, 0.6);
    transform: scale(1.02);
  }
}

.timer-display {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border-radius: 50%;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: 2px;
}

.vibe-button {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem 3rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.vibe-button.start {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
}

.vibe-button.start:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
}

.vibe-button.stop {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: white;
}

.vibe-button.stop:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 40px rgba(249, 115, 22, 0.4);
}

/* Stats cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.5);
}

.stat-card:nth-child(1) {
  border-left: 3px solid var(--purple);
}

.stat-card:nth-child(2) {
  border-left: 3px solid var(--pink);
}

.stat-card:nth-child(3) {
  border-left: 3px solid var(--orange);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Upgrade counter */
.upgrade-counter {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  cursor: help;
}

.upgrade-label {
  font-size: 1rem;
}

.upgrade-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pink);
}

.upgrade-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Achievements */
.achievements-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.achievements-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
}

.achievements-scroll::-webkit-scrollbar {
  height: 6px;
}

.achievements-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.achievements-scroll::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 3px;
}

.achievement-badge {
  flex-shrink: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
  transition: all 0.3s ease;
  cursor: help;
}

.achievement-badge.unlocked {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
}

.achievement-badge.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-icon {
  font-size: 1.75rem;
}

.achievement-title {
  font-size: 0.7rem;
  text-align: center;
  color: var(--text-secondary);
}

.share-button {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-button:hover {
  transform: scale(1.05);
}

/* Session history */
.history-section {
  margin-bottom: 2rem;
}

.history-toggle {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-toggle:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

.arrow {
  transition: transform 0.3s ease;
}

.arrow.open {
  transform: rotate(180deg);
}

.history-list {
  margin-top: 0.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.session-item {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.session-item.even {
  background: rgba(255, 255, 255, 0.02);
}

.session-item:hover {
  background: rgba(139, 92, 246, 0.1);
}

.session-info {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.session-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.session-duration {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.session-vibe {
  font-size: 0.9rem;
}

.delete-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #EF4444;
}

.delete-btn.confirm {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
  width: auto;
  padding: 0 0.75rem;
  border-radius: 14px;
  font-size: 0.8rem;
}

.no-sessions {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Reset zone */
.reset-zone {
  text-align: center;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}

.reset-zone:hover {
  color: rgba(255, 255, 255, 0.4);
}

.reset-zone:active {
  color: #EF4444;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2rem;
}

.footer-link {
  color: var(--pink);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--purple);
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .title {
    font-size: 1.8rem;
  }
  
  .timer-circle {
    width: 200px;
    height: 200px;
  }
  
  .timer-display {
    font-size: 2rem;
  }
  
  .vibe-button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
  
  .session-info {
    gap: 0.75rem;
    font-size: 0.85rem;
  }
  
  .achievement-badge {
    min-width: 85px;
    padding: 0.5rem 0.75rem;
  }
}