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

body {
  /* AESTHETIC BACKGROUND START */
  background-color: #0f172a;
  background: radial-gradient(circle at top, #1e293b, #020617);
  /* AESTHETIC BACKGROUND END */
  
  color: #e2e8f0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2vw;
}

h1 {
  margin-top: 2rem;
  font-family: 'Montserrat', sans-serif; /* New Aesthetic Font */
  font-size: clamp(2rem, 5vw, 4.5rem);
  text-align: center;
  font-weight: 100; /* Ultra thin for that clean look */
  letter-spacing: 0.5rem; /* Wide spacing */
  text-transform: uppercase;
  color: #ffffff;
  
  /* Soft White Glow */
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 
               0 0 40px rgba(255, 255, 255, 0.1);
               
  /* Optional: Subtle gradient overlay */
  background: linear-gradient(to bottom, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- KEEPING TIMER STYLES EXACTLY THE SAME --- */
.countdown {
  margin: 3rem auto;
  width: 90%;
  max-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.time-section {
  text-align: center;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
}

.time-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.time-segment {
  font-size: clamp(2rem, 10vw, 6rem);
  font-weight: 900;
  width: clamp(2rem, 10vw, 6rem);
  height: clamp(3rem, 15vw, 9rem);
}

.segment-display {
  position: relative;
  height: 100%;
  width: 100%;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); /* Added subtle shadow */
  border-radius: 6px;
}

.segment-display__top,
.segment-display__bottom {
  overflow: hidden;
  text-align: center;
  width: 100%;
  height: 50%;
  position: relative;
}

.segment-display__top {
  line-height: 1.5;
  color: #f4ecec;
  background-color: #1e293b; /* Slightly lighter dark */
  border-radius: 6px 6px 0 0;
}

.segment-display__bottom {
  line-height: 0;
  color: #ffffff;
  background-color: #334155; /* Slightly lighter dark */
  border-radius: 0 0 6px 6px;
}

.segment-overlay {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  perspective: 800px;
  transform-style: preserve-3d;
  z-index: 5;
}

.segment-overlay__top,
.segment-overlay__bottom {
  position: absolute;
  overflow: hidden;
  text-align: center;
  width: 100%;
  height: 50%;
  backface-visibility: hidden;
  z-index: 1;
}

.segment-overlay__top {
  top: 0;
  line-height: 1.5;
  color: #fff;
  background-color: #1e293b;
  transform-origin: bottom;
  z-index: 2;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

.segment-overlay__bottom {
  bottom: 0;
  line-height: 0;
  color: #eee;
  background-color: #334155;
  border-top: 1px solid rgba(0,0,0,0.3);
  transform-origin: top;
  z-index: 1;
  border-radius: 0 0 6px 6px;
}

.segment-overlay.flip .segment-overlay__top {
  animation: flip-top 0.5s ease-in forwards;
}

.segment-overlay.flip .segment-overlay__bottom {
  animation: flip-bottom 0.2s ease-out forwards;
}

@keyframes flip-top {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

@keyframes flip-bottom {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* --- NEW BUTTON STYLES --- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 16px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.1);
}

.controls button {
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px; /* Pill shape */
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.controls button:active {
  transform: translateY(0);
}

/* Specific colors for buttons */
.btn-start { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.btn-pause { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.btn-reset { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.btn-lap   { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }


/* --- LAPS STYLE --- */
.laps {
  width: 90%;
  max-width: 400px;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  margin-top: 1rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.3); /* Transparent dark */
  border-radius: 12px;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.05);
}

.laps div {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid #3b82f6; /* Blue accent line */
  display: flex;
  justify-content: space-between;
}

.laps div:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Custom Scrollbar */
.laps::-webkit-scrollbar {
  width: 6px;
}
.laps::-webkit-scrollbar-track {
  background: transparent;
}
.laps::-webkit-scrollbar-thumb {
  background-color: #475569;
  border-radius: 10px;
}

/* Media Queries for Fine-Tuning */
@media (max-width: 768px) {
  .countdown { flex-direction: column; gap: 2rem; }
  .time-section { width: 100%; }
}