:root {
  --bg-light: #eef7fc;
  --card-light: #ffffffdd;
  --text-light: #1e3b44;
  --accent: #2c7da0;
  --accent-dark: #1f5e7a;
  --shadow: 0 10px 25px rgba(0,0,0,0.05);
}

body.dark {
  --bg-light: #0a1922;
  --card-light: #1a2f3bcc;
  --text-light: #e0f2fe;
  --accent: #48b5e0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background 0.3s ease, color 0.2s;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  padding: 1rem;
  min-height: 100vh;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.burger-btn, .theme-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-light);
}

/* Glass Card */
.glass-card {
  background: var(--card-light);
  backdrop-filter: blur(8px);
  border-radius: 2rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Timer Panel */
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.preset {
  background: rgba(44,125,160,0.2);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
}

.preset.active {
  background: var(--accent);
  color: white;
}

.timer-display {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#timerCanvas {
  width: 100%;
  max-width: 240px;
  height: auto;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.8rem;
  font-weight: bold;
  font-feature-settings: "tnum";
}

.mode-badge {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 0.2rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
}

.session-info {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.timer-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.ctrl {
  background: #f0f0f0;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 3rem;
  font-weight: bold;
  cursor: pointer;
}
.ctrl.primary {
  background: var(--accent);
  color: white;
}

/* Dynamic Content */
.dynamic-content {
  min-height: 160px;
}
.default-content {
  text-align: center;
  padding: 1rem;
}

/* Sound Panel */
.sound-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.sound-upload input {
  flex: 1;
}
.sound-status {
  width: 100%;
  font-size: 0.8rem;
  color: var(--accent);
}

/* Animation Runner */
.animation-runner {
  background: rgba(0,0,0,0.1);
  border-radius: 2rem;
  height: 80px;
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
}
.runner {
  position: absolute;
  bottom: 10px;
  font-size: 2rem;
  animation: runCycle 3s infinite ease-in-out;
  left: 0;
}
@keyframes runCycle {
  0% { left: -10%; transform: scaleX(1); }
  45% { left: 85%; transform: scaleX(1); }
  50% { left: 85%; transform: scaleX(-1); }
  95% { left: -10%; transform: scaleX(-1); }
  100% { left: -10%; transform: scaleX(1); }
}
.disabled-animation .runner {
  animation: none;
  left: 20px;
}

.small-btn {
  background: none;
  border: 1px solid var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  cursor: pointer;
}
.hint {
  font-size: 0.7rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Burger Overlay */
.burger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-start;
  transition: 0.3s;
}
.burger-overlay.hidden {
  display: none;
}
.burger-menu {
  background: var(--card-light);
  width: 70%;
  max-width: 280px;
  height: 100%;
  padding: 2rem 1.5rem;
  backdrop-filter: blur(20px);
  transform: translateX(0);
}
.burger-menu ul {
  list-style: none;
  margin-top: 2rem;
}
.burger-menu li {
  padding: 1rem 0;
  font-size: 1.2rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  padding: 1rem;
  opacity: 0.7;
}
.install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 3rem;
  padding: 0.8rem 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 100;
}
/* Responsive */
@media (max-width: 480px) {
  .timer-text {
    font-size: 2rem;
  }
  .preset-buttons {
    justify-content: center;
  }
}