:root {
  --background: 240 5% 96%;
  --foreground: 240 10% 10%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 10%;
  --primary: 195 100% 50%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 195 100% 65%;
  --secondary: 160 100% 45%;
  --secondary-foreground: 0 0% 100%;
  --accent: 270 100% 65%;
  --accent-foreground: 0 0% 100%;
  --muted: 240 5% 94%;
  --muted-foreground: 240 5% 45%;
  --success: 145 80% 50%;
  --success-foreground: 0 0% 100%;
  --warning: 45 95% 55%;
  --warning-foreground: 0 0% 100%;
  --destructive: 10 85% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 240 5% 88%;
  --input: 240 5% 92%;
  --ring: 195 100% 50%;
  --glass: 0 0% 100% / 0.1;
  --glass-border: 0 0% 100% / 0.2;
  --gradient-primary: linear-gradient(
    135deg,
    hsl(195 100% 50%),
    hsl(195 100% 65%)
  );
  --gradient-secondary: linear-gradient(
    135deg,
    hsl(160 100% 45%),
    hsl(145 80% 50%)
  );
  --gradient-accent: linear-gradient(
    135deg,
    hsl(270 100% 65%),
    hsl(280 100% 70%)
  );
  --gradient-water: linear-gradient(
    180deg,
    hsl(195 100% 85%),
    hsl(195 100% 50%)
  );
  --shadow-soft: 0 4px 20px hsl(195 100% 50% / 0.15);
  --shadow-glow: 0 0 30px hsl(195 100% 50% / 0.3);
  --shadow-card: 0 8px 32px hsl(240 10% 10% / 0.08);
  --bounce-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-fluid: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 1rem;
}

.dark {
  --background: 220 15% 8%;
  --foreground: 220 10% 95%;
  --card: 220 15% 12%;
  --card-foreground: 220 10% 95%;
  --primary: 195 100% 55%;
  --primary-glow: 195 100% 70%;
  --secondary: 160 80% 40%;
  --accent: 270 80% 60%;
  --muted: 220 15% 15%;
  --muted-foreground: 220 10% 65%;
  --border: 220 15% 20%;
  --input: 220 15% 18%;
  --glass: 220 10% 95% / 0.05;
  --glass-border: 220 10% 95% / 0.1;
  --shadow-card: 0 8px 32px hsl(220 15% 2% / 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s var(--ease-fluid), color 0.3s var(--ease-fluid);
}

@keyframes wave {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes celebrate {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

@keyframes bubble-float {
  0% {
    opacity: 0;
    transform: translateY(0px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-110px);
  }
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modal-slide-in {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}
@keyframes message-appear {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-fluid);
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.95);
}
.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 2px solid hsl(var(--border));
}
.btn-outline:hover {
  background: hsl(var(--muted));
}
.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover {
  filter: brightness(1.1);
}
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-fluid);
  color: hsl(var(--muted-foreground));
  font-size: 1.25rem;
}
.btn-icon:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.onboarding-container {
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    hsl(var(--background)),
    hsl(var(--background)),
    hsl(var(--primary) / 0.05)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}
.onboarding-card {
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-card);
}
.progress-section {
  margin-bottom: 2rem;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}
.progress-bar {
  height: 0.5rem;
  background: hsl(var(--muted));
  border-radius: 0.25rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.5s var(--ease-fluid);
  width: 20%;
}
.step-content {
  text-align: center;
  margin-bottom: 2rem;
  min-height: 20rem;
}
.step-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.step-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  fill: currentColor;
}
.step-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.step-subtitle {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}
.form-group {
  margin-bottom: 1rem;
  text-align: left;
}
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 1rem;
  transition: all 0.3s var(--ease-fluid);
  appearance: none;
}
select.form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}
.dark select.form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f1f5f9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}
.activity-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.activity-option {
  width: 100%;
  padding: 1rem;
  border: 2px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease-fluid);
  text-align: left;
}
.activity-option:hover {
  border-color: hsl(var(--primary) / 0.5);
}
.activity-option.active {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}
.activity-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.activity-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.goal-card {
  background: linear-gradient(
    135deg,
    hsl(var(--card)),
    hsl(var(--muted) / 0.5)
  );
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.goal-value {
  font-size: 2rem;
  font-weight: bold;
  color: hsl(var(--primary));
  text-align: center;
}
.goal-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin-bottom: 0.5rem;
}
.navigation {
  display: flex;
  gap: 0.75rem;
}
.navigation .btn {
  flex: 1;
}

.toggle-switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: hsl(var(--muted));
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-top: 1.5rem;
}
.toggle-switch-label {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--border));
  transition: 0.4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background: var(--gradient-primary);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--gradient-primary);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

.dashboard-container {
  min-height: 100vh;
  background: hsl(var(--background));
  position: relative;
  z-index: 1;
}
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  padding: 1rem;
}
.header-content {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.greeting-title {
  font-size: 1.25rem;
  font-weight: bold;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}
.greeting-subtitle {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--gradient-accent);
  color: white;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.streak-icon {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}
.main-content {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.glass-section {
  text-align: center;
  padding-top: 2rem;
}
.main-display-area {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.pet-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  flex-shrink: 0;
  position: relative;
}
.water-glass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.water-glass {
  position: relative;
  width: 8rem;
  height: 10rem;
  margin-bottom: 1rem;
}
.glass-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 20px rgba(0, 191, 212, 0.2));
}
.glass-outline {
  color: hsl(var(--border));
}
.bubbles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bubble {
  fill: hsl(var(--primary-glow) / 0.6);
  opacity: 0;
}

.bubble-1 {
  animation: bubble-float 4s infinite 0.5s;
}
.bubble-2 {
  animation: bubble-float 3.5s infinite 1.5s;
}
.bubble-3 {
  animation: bubble-float 5s infinite 2s;
}
.wave {
  animation: wave 2s ease-in-out infinite;
}
.wave-delay {
  animation: wave 2s ease-in-out infinite;
  animation-delay: 0.5s;
}
.progress-text {
  min-width: 124px;
  margin-top: 1rem;
}
.percentage {
  font-size: 2rem;
  font-weight: bold;
  color: hsl(var(--primary));
  transition: color 0.5s var(--ease-fluid);
}
.amount-text {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: hsl(var(--primary));
}
.stat-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}
.section-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}
.quick-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.quick-btn {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  color: white;
  font-weight: 600;
  transition: all 0.3s var(--ease-fluid);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.quick-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}
.quick-btn:active {
  transform: scale(0.95);
}
.quick-btn .quick-icon {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
  transition: transform 0.3s var(--ease-fluid);
}
.quick-btn:hover .quick-icon {
  transform: scale(1.1);
}
.quick-amount {
  font-size: 1.125rem;
  font-weight: bold;
}
.custom-amount-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.custom-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}
.custom-input-group {
  display: flex;
  gap: 0;
  margin-bottom: 0.5rem;
  border: 2px solid hsl(var(--border));
  border-radius: 0.75rem;
  overflow: hidden;
  transition: border-color 0.3s var(--ease-fluid);
}
.custom-input-group:focus-within {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}
.custom-input-group input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
}
.custom-input-group input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}
#add-custom-btn {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0;
  transition: background 0.3s;
}
#add-custom-btn:hover {
  filter: brightness(1.1);
}
#add-custom-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.custom-help {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.timeline-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.timeline-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.timeline-dot {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--gradient-primary);
  border-radius: 50%;
}
.timeline-amount {
  font-weight: 600;
}
.timeline-time {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}
.timeline-user-name {
  font-size: 0.75rem;
  font-weight: bold;
  color: hsl(var(--secondary));
  margin-left: 0.5rem;
}
.timeline-delete {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  transition: color 0.3s var(--ease-fluid);
}
.timeline-delete:hover {
  color: hsl(var(--destructive));
}
.empty-timeline {
  background: hsl(var(--card));
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.empty-icon {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.5rem;
  opacity: 0.5;
  fill: hsl(var(--muted-foreground));
}
.empty-timeline p {
  color: hsl(var(--muted-foreground));
}
.empty-timeline p:first-of-type {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.empty-timeline p:last-of-type {
  font-size: 0.875rem;
}

.progress-card {
  background: linear-gradient(
    135deg,
    hsl(var(--card)),
    hsl(var(--muted) / 0.5)
  );
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid hsl(var(--border) / 0.5);
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
}
.progress-bar-large {
  height: 0.75rem;
  background: hsl(var(--muted));
  border-radius: 0.375rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.5s var(--ease-fluid);
  width: 0%;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.week-day {
  text-align: center;
}
.week-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}
.week-bar {
  height: 2rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  background: hsl(var(--muted));
  position: relative;
  overflow: hidden;
}
.week-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gradient-primary);
  transition: height 0.5s var(--ease-fluid);
}
.week-day.today .week-label {
  color: hsl(var(--primary));
  font-weight: 600;
}
.week-percentage {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}
.week-day.today .week-percentage {
  color: hsl(var(--primary));
  font-weight: 600;
}

.settings-modal-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: hsl(var(--background) / 0.5);
  backdrop-filter: blur(8px);
  animation: modal-fade-in 0.3s var(--ease-fluid);
}
.settings-modal-card,
.modal-card {
  width: 90%;
  max-width: 32rem;
  background: hsl(var(--card));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-card);
  animation: modal-slide-in 0.4s var(--bounce-spring);
  overflow: hidden;
}
.modal-card {
  max-width: 24rem;
  padding: 2rem;
  text-align: center;
}
.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.modal-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.modal-text {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
  white-space: pre-line;
}
.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.modal-actions .btn {
  flex: 1;
}
.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.settings-modal-header h2 {
  font-size: 1.25rem;
}
.settings-modal-header .btn-icon {
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
}
.settings-modal-content,
.delete-modal-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.settings-modal-content {
  max-height: 70vh;
  overflow-y: auto;
}
.delete-modal-content p {
  text-align: center;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.delete-modal-content p strong {
  color: hsl(var(--destructive));
}
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-group h3 {
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}
.settings-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.settings-actions .btn {
  flex: 1;
}

.volume-control-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 4px;
  outline: none;
  transition: opacity 0.2s;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: hsl(var(--primary));
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid hsl(var(--card));
  box-shadow: 0 0 5px hsl(var(--primary) / 0.5);
}
.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: hsl(var(--primary));
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid hsl(var(--card));
  box-shadow: 0 0 5px hsl(var(--primary) / 0.5);
}
#volume-percentage,
#onboarding-volume-percentage,
#friend-volume-percentage {
  font-weight: 600;
  color: hsl(var(--primary));
  width: 4ch;
  text-align: right;
  font-size: 0.875rem;
}
#test-volume-btn,
#onboarding-test-volume-btn,
#test-friend-volume-btn {
  flex-shrink: 0;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(var(--background), 0.5);
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-fluid);
  overflow: hidden;
}

#celebration-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f00;
  opacity: 0;
  animation: confetti-fall 5s linear infinite;
  top: -20px;
}

.celebration-message {
  padding: 60px;
  background: rgba(32, 32, 32, 0.589);
  border-radius: 15px;
  color: hsl(160 100% 45%);
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 4px 15px hsla(var(--foreground), 0.2);
  animation: message-appear 1s var(--bounce-spring) forwards;
  opacity: 0;
}

@media (max-width: 468px) {
  .character-selection {
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) {
  .water-glass {
    width: 10rem;
    height: 12rem;
  }
  .percentage {
    font-size: 3rem;
  }
  .stats-grid {
    gap: 1.5rem;
  }
  .main-content {
    padding: 2rem;
    gap: 3rem;
  }
  .header-actions {
    gap: 0.75rem;
  }
  .celebration-message {
    font-size: 4rem;
  }
}

#save-settings-btn {
  padding: 1rem;
}

#achievements-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  transition: all 0.3s var(--ease-fluid);
}

.achievement-item.unlocked {
  background: hsl(var(--card));
}

.achievement-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
}

.achievement-details {
  flex-grow: 1;
}

.achievement-title {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.achievement-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.achievement-item.unlocked.bronze .achievement-icon {
  background-color: #cd7f325e;
  color: white;
  box-shadow: 0 0 10px #cd7f3299;
}

.achievement-item.unlocked.silver .achievement-icon {
  background-color: #c0c0c0;
  color: white;
  box-shadow: 0 0 10px #c0c0c099;
}

.achievement-item.unlocked.gold .achievement-icon {
  background-color: #ffd700;
  color: white;
  box-shadow: 0 0 15px #ffd70099;
}

.achievement-item.unlocked.esmeralda .achievement-icon {
  background-color: #50c878;
  color: white;
  box-shadow: 0 0 15px #50c87899;
}

.site-footer {
  padding: 1rem;
  text-align: center;
  margin-top: 2rem;
}

.btn-donate {
  background: linear-gradient(135deg, hsl(340 82% 52%), hsl(340 92% 62%));
  color: white;
  box-shadow: 0 4px 20px hsl(340 92% 62% / 0.2);
}

.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px hsl(340 92% 62% / 0.4);
}

#custom-amount {
  background: var(--foreground);
  color: var(--foreground);
}

#friend-peer-id {
  background: var(--foreground);
  color: var(--foreground);
}

.peer-id-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.peer-id-container .form-input {
  flex-grow: 1;
  background-color: hsl(var(--muted));
}

#copy-peer-id-btn {
  flex-shrink: 0;
}

.connection-status {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.friends-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
}

.friend-info {
  font-weight: 600;
}

.friend-status {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-left: 0.5rem;
}

.friend-item .btn-icon {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

.empty-list-info {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding: 1rem;
}

#friend-notification-settings .form-group {
  margin-bottom: 0.5rem;
}

.friends-glasses-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  min-height: 150px;
}

.friend-glass-card {
  padding: 0.5rem;
  text-align: center;
  background-color: transparent;
  border: none;
  max-width: 100px;
}

.friend-glass-card .friend-name {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.friend-glass-card .water-glass-container {
  margin-bottom: 0.25rem;
}

.friend-glass-card .water-glass {
  width: 4rem;
  height: 5rem;
  margin: 0 auto;
  position: relative;
}

.friend-glass-card .percentage-friend {
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.2;
}

.friend-glass-card .amount-text-friend {
  font-size: 0.65rem;
  color: hsl(var(--muted-foreground));
}

.friend-glass-card.goal-met .friend-name::after {
  content: " 🏆";
  display: inline;
  font-size: 0.7rem;
}

.friend-glass-card .axolotl-image {
  width: 5rem;
  height: 5rem;
}

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.toast {
  min-width: 300px;
  max-width: 350px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
  border-radius: 0.75rem;
  overflow: hidden;
  animation: toast-out 0.3s var(--ease-fluid) forwards;
}

.toast.show {
  animation: toast-in 0.4s var(--bounce-spring) forwards;
}

.toast-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.875rem;
}

.toast-header strong {
  margin-right: auto;
  font-weight: 600;
}

.toast-header .toast-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.toast-body {
  padding: 1rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.btn-close {
  width: 1.5rem;
  height: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  margin-left: 0.75rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

.btn-close:hover {
  opacity: 1;
}

.dark .btn-close {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.toast.success .toast-header {
  background-color: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success) / 0.2);
}

.toast.success .toast-header strong {
  color: hsl(var(--success));
}

#water-glass {
  margin-bottom: -20px;
}

#percentage-text {
  margin-bottom: -15px;
}

.pet-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}

.axolotl-image {
  width: 250px;
  height: 250px;
  object-fit: contain;
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
  transform: scale(1);
}

.axolotl-image.fade-out {
  opacity: 0;
  transform: scale(0.9);
}

@keyframes celebrate {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

.axolotl-image.celebrate-anim {
  animation: celebrate 1s ease-in-out infinite;
}

.character-selection {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.character-option {
  padding: 1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  width: 120px;
  transition: all 0.2s ease-in-out;
}

.character-option:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

.character-option.selected {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary));
  background: hsl(var(--primary) / 0.2);
}

.character-option img {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.5rem;
  display: block;
  object-fit: contain;
}

.character-option span {
  font-weight: 600;
  font-size: 1rem;
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toast-body img {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

.toast-body-text {
  flex-grow: 1;
}

.hidden-character {
  display: none !important;
}

@keyframes anim-sad-kf {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) rotate(1.5deg);
  }
  75% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
}
.anim-sad {
  animation: anim-sad-kf 6s ease-in-out infinite;
}

@keyframes anim-tired-kf {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) rotate(1.5deg);
  }
  75% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
}
.anim-tired {
  animation: anim-tired-kf 5s ease-in-out infinite;
}

@keyframes anim-neutral-kf {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) rotate(1.5deg);
  }
  75% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
}
.anim-neutral {
  animation: anim-neutral-kf 4s ease-in-out infinite;
}

@keyframes anim-happy-kf {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) rotate(1.5deg);
  }
  75% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
}
.anim-happy {
  animation: anim-happy-kf 2.5s ease-in-out infinite;
}

#character-bubble-overlay {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 145px;
  margin: 0 auto;
  width: 200px;
  height: 250px;
  pointer-events: none;
  z-index: 10;
}

.character-bubble {
  position: absolute;
  bottom: 0;
  background: hsl(220, 100%, 80%);
  border: 1px solid hsl(var(--primary-glow) / 0.7);
  box-shadow: 0 0 4px hsla(195, 100%, 75%, 0.9);
  border-radius: 50%;
  opacity: 0;
  animation-name: rise-and-fade;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes rise-and-fade {
  0% {
    transform: translateY(0) scale(0.2);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-250px) scale(1);
    opacity: 0;
  }
}

.user-list-group {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 40vh;
  overflow-y: auto;
}

.user-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: hsl(var(--muted));
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.user-list-item:hover {
  background-color: hsl(var(--border));
}

.user-list-item-info {
  font-weight: 600;
}

.user-list-item-char {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-left: 0.5rem;
  text-transform: capitalize;
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-refresh.loading {
  animation: spin 1s linear infinite;
}

.settings-modal-header h2 {
  flex-grow: 1;
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: hsl(var(--secondary-foreground));
  box-shadow: 0 4px 20px hsl(160 100% 45% / 0.15);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-refresh {
  width: 15px;
  height: 15px;
  background-color: #9da3af;
  -webkit-mask: url("assets/images/refresh.svg") no-repeat center / contain;
  mask: url("assets/images/refresh.svg") no-repeat center / contain;
}

.icon-refresh:hover {
  background-color: #dfe0e3;
}

#find-friends-btn:disabled {
  cursor: not-allowed;

  opacity: 0.4;
}
