/* === REDESIGNED PREMIUM LAP SECTION === */
.laps-card {
  width: 100%;
  max-width: clamp(420px, 88vw, 680px);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.09) 100%
  );
  border-radius: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.25),
    0 6px 24px rgba(102, 166, 255, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(102, 166, 255, 0.25);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  overflow: hidden;
  position: relative;
  z-index: 20;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.laps-card:hover {
  box-shadow: 
    0 16px 56px rgba(0, 0, 0, 0.28),
    0 8px 28px rgba(102, 166, 255, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border-color: rgba(102, 166, 255, 0.35);
  transform: translateY(-3px);
}

.laps-card-inner { 
  padding: 0; 
  height: 100%;
  display: flex;
  flex-direction: column;
}

.laps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.2rem, 3.5vw, 1.8rem);
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border-bottom: 1px solid rgba(102, 166, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.laps-header-main {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 2.2vw, 1rem);
}

.laps-icon { 
  font-size: clamp(1.4rem, 3.5vw, 1.6rem);
  filter: drop-shadow(0 2px 6px rgba(102, 166, 255, 0.35));
}

.laps-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.laps-count {
  background: linear-gradient(135deg, 
    rgba(102, 166, 255, 0.25) 0%, 
    rgba(102, 166, 255, 0.15) 100%);
  color: var(--accent-color);
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  font-weight: 700;
  border-radius: 1.2em;
  padding: 0.35em 0.9em;
  margin-left: 0.5em;
  border: 1px solid rgba(102, 166, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(102, 166, 255, 0.2);
}
.laps-actions {
  display: flex;
  gap: clamp(0.5rem, 1.8vw, 0.7rem);
}

.laps-action {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(102, 166, 255, 0.25);
  border-radius: clamp(0.7rem, 2vw, 0.9rem);
  padding: clamp(0.5em, 1.8vw, 0.65em);
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  min-width: clamp(36px, 7.5vw, 44px);
  height: clamp(36px, 7.5vw, 44px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.laps-action::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-color) 0%, #7ab7ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.laps-action svg {
  position: relative;
  z-index: 1;
  width: clamp(15px, 3.2vw, 17px);
  height: clamp(15px, 3.2vw, 17px);
  transition: transform 0.3s ease;
}

.laps-action:hover, .laps-action:focus-visible {
  border-color: var(--accent-color);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 16px rgba(102, 166, 255, 0.35);
}

.laps-action:hover svg {
  transform: scale(1.1);
}

.laps-action:hover::before {
  opacity: 0.2;
}

.laps-action.danger::before {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
}

.laps-action.danger:hover {
  border-color: #ff6b6b;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}

.laps-action.danger:hover::before {
  opacity: 0.25;
}
.laps-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.9rem, 3.2vw, 1.4rem);
  padding: clamp(1rem, 2.5vw, 1.4rem) clamp(1.2rem, 3.5vw, 1.8rem);
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.08) 100%
  );
  border-bottom: 1px solid rgba(102, 166, 255, 0.12);
}

.laps-stat {
  text-align: center;
  padding: clamp(0.8rem, 2.2vw, 1rem);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border-radius: clamp(0.8rem, 2.2vw, 1rem);
  border: 1px solid rgba(102, 166, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.laps-stat:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border-color: rgba(102, 166, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 166, 255, 0.15);
}

.laps-stat-label {
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  color: rgba(179, 207, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4em;
  font-weight: 600;
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.laps-stat-value {
  font-family: 'Space Grotesk', monospace;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 700;
  color: var(--accent-color);
  text-shadow: 0 2px 6px rgba(102, 166, 255, 0.35);
  display: block;
  letter-spacing: -0.01em;
}
.laps-list-outer {
  padding: clamp(1rem, 2.5vw, 1.4rem) clamp(1.2rem, 3.5vw, 1.8rem);
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.laps-search {
  width: 100%;
  margin-bottom: clamp(0.8em, 2.2vw, 1em);
  padding: clamp(0.7em, 2.2vw, 0.9em) clamp(1em, 2.8vw, 1.2em);
  border-radius: clamp(0.7rem, 2.2vw, 0.9rem);
  border: 1px solid rgba(102, 166, 255, 0.25);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  color: #fff;
  font-size: clamp(0.9rem, 2.4vw, 1rem);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.laps-search::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.laps-search:focus {
  border-color: var(--accent-color);
  outline: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  box-shadow: 0 0 0 3px rgba(102, 166, 255, 0.25), 0 2px 12px rgba(102, 166, 255, 0.15);
}

.laps-list {
  max-height: clamp(200px, 28vh, 320px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(0.5em, 1.8vw, 0.7em);
  scroll-behavior: smooth;
  flex: 1;
  padding-right: 6px; /* Space for custom scrollbar */
}

/* Custom scrollbar for lap list */
.laps-list::-webkit-scrollbar {
  width: 7px;
}

.laps-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 4px 0;
}

.laps-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.5) 0%,
    rgba(102, 166, 255, 0.35) 100%
  );
  border-radius: 4px;
  transition: background 0.3s ease;
}

.laps-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.7) 0%,
    rgba(102, 166, 255, 0.5) 100%
  );
}
.laps-empty {
  text-align: center;
  color: rgba(179, 207, 255, 0.85);
  padding: clamp(2.5em, 7vw, 3.5em) clamp(1em, 3vw, 1.5em);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5em, 1.8vw, 0.8em);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border-radius: clamp(1rem, 2.5vw, 1.3rem);
  border: 1.5px dashed rgba(102, 166, 255, 0.25);
  margin: clamp(1rem, 3.5vw, 1.5rem) 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.laps-empty-icon { 
  font-size: clamp(2.2rem, 5.5vw, 2.8rem);
  opacity: 0.75;
  filter: drop-shadow(0 3px 6px rgba(102, 166, 255, 0.25));
}

.laps-empty-title { 
  font-size: clamp(1.05rem, 2.8vw, 1.25rem); 
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.laps-empty-desc { 
  font-size: clamp(0.9rem, 2.2vw, 1rem); 
  color: rgba(179, 207, 255, 0.75);
  line-height: 1.5;
}
/* Enhanced lap row styling */
.lap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.07) 100%
  );
  border: 1px solid rgba(102, 166, 255, 0.18);
  border-radius: clamp(0.8rem, 2.2vw, 1.2rem);
  padding: clamp(0.8em, 2.2vw, 1em) clamp(1em, 2.8vw, 1.4em);
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95em, 2.4vw, 1.05em);
  color: #fff;
  box-shadow: 
    0 3px 10px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(102, 166, 255, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.lap-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-color) 0%, #7ab7ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.lap-row:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(102, 166, 255, 0.45);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.18),
    0 3px 12px rgba(102, 166, 255, 0.25);
}

.lap-row:hover::before {
  opacity: 0.15;
}

.lap-row > * {
  position: relative;
  z-index: 1;
}

.lap-row .lap-num {
  font-weight: 700;
  color: var(--accent-color);
  font-size: clamp(0.95em, 2.4vw, 1.15em);
  min-width: clamp(2.2em, 5.5vw, 2.8em);
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.2) 0%,
    rgba(102, 166, 255, 0.12) 100%
  );
  border-radius: 50%;
  padding: 0.3em;
  border: 1px solid rgba(102, 166, 255, 0.35);
  box-shadow: 0 2px 6px rgba(102, 166, 255, 0.15);
  transition: all 0.3s ease;
}

.lap-row:hover .lap-num {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.lap-row .lap-segment { 
  font-weight: 600;
  font-family: 'Space Grotesk', monospace;
  flex: 1;
  text-align: center;
  font-size: clamp(1em, 2.5vw, 1.15em);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lap-row .lap-total {
  font-size: clamp(0.85em, 2.2vw, 0.95em);
  color: rgba(179, 207, 255, 0.85);
  font-weight: 500;
  text-align: right;
  min-width: clamp(4.5em, 11vw, 5.5em);
  transition: color 0.3s ease;
}

.lap-row:hover .lap-total {
  color: rgba(255, 255, 255, 0.85);
}

.lap-row .lap-copy-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(179, 207, 255, 0.85);
  cursor: pointer;
  font-size: clamp(0.85em, 2.2vw, 0.95em);
  padding: clamp(0.35em, 1.2vw, 0.45em);
  border-radius: clamp(0.5rem, 1.8vw, 0.7rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: clamp(30px, 6.5vw, 36px);
  height: clamp(30px, 6.5vw, 36px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: clamp(0.6em, 2.2vw, 0.9em);
}

.lap-row .lap-copy-btn:hover,
.lap-row .lap-copy-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(102, 166, 255, 0.2);
}
/* Responsive lap section styles */
@media (min-width: 600px) and (max-width: 900px) {
  .laps-card {
    max-width: 92vw;
    margin: 2.5rem auto;
    border-radius: 2rem;
  }

  .laps-list {
    max-height: 48vh;
  }

  .laps-stats-row {
    gap: 1rem;
    padding: 1.2rem 1.4rem;
  }

  .laps-header {
    padding: 1.4rem 1.6rem;
  }

  .lap-row {
    padding: 0.9em 1.2em;
  }
  
  .lap-row .lap-num {
    min-width: 2.5em;
  }
}

@media (max-width: 599px) {
  .laps-card {
    max-width: calc(100vw - 2rem);
    border-radius: 1.5rem;
    box-shadow: 
      0 10px 45px rgba(0, 0, 0, 0.28),
      0 5px 22px rgba(102, 166, 255, 0.18);
    margin: 1.5rem 1rem 2.5rem;
    z-index: 20;
  }

  .laps-card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .laps-header {
    padding: 1.2rem;
    border-radius: 1.5rem 1.5rem 0 0;
  }

  .laps-header-main {
    gap: 0.7rem;
  }

  .laps-title {
    font-size: 1.1rem;
  }

  .laps-icon {
    font-size: 1.35rem;
  }

  .laps-count {
    font-size: 0.85rem;
    padding: 0.3em 0.75em;
  }

  .laps-actions {
    gap: 0.5rem;
  }

  .laps-action {
    min-width: 36px;
    height: 36px;
  }

  .laps-list {
    max-height: 42vh;
    flex: 1;
    gap: 0.6em;
  }

  .laps-list-outer { 
    padding: 1rem 1.2rem 1.4rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .laps-stats-row {
    padding: 1rem;
    gap: 0.7rem;
  }

  .laps-stat {
    padding: 0.7rem 0.4rem;
    border-radius: 0.8rem;
  }

  .laps-stat-label {
    font-size: 0.7rem;
    margin-bottom: 0.35em;
  }

  .laps-stat-value {
    font-size: 1rem;
  }

  .laps-search {
    padding: 0.7em 1em;
    font-size: 0.9rem;
    margin-bottom: 0.8em;
  }

  .lap-row {
    padding: 0.8em 0.9em;
    font-size: 0.95em;
    border-radius: 0.8rem;
  }

  .lap-row .lap-num {
    min-width: 2.2em;
    font-size: 0.9em;
  }

  .lap-row .lap-segment {
    font-size: 1em;
  }

  .lap-row .lap-total {
    font-size: 0.85em;
    min-width: 4.5em;
  }

  .lap-row .lap-copy-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85em;
    margin-left: 0.6em;
  }

  .laps-empty {
    padding: 2.5em 1em;
    margin: 1rem 0;
  }

  .laps-empty-icon {
    font-size: 2.2rem;
  }

  .laps-empty-title {
    font-size: 1.05rem;
  }

  .laps-empty-desc {
    font-size: 0.9rem;
  }
}

/* Extra small devices optimization */
@media (max-width: 380px) {
  .laps-card {
    max-width: calc(100vw - 1.5rem);
    margin: 1rem 0.75rem 2rem;
    border-radius: 1.3rem;
  }

  .laps-header {
    padding: 1rem;
  }

  .laps-header-main {
    gap: 0.6rem;
  }

  .laps-title {
    font-size: 1rem;
  }

  .laps-icon {
    font-size: 1.25rem;
  }

  .laps-count {
    font-size: 0.8rem;
    padding: 0.28em 0.7em;
  }

  .laps-action {
    min-width: 32px;
    height: 32px;
  }

  .laps-action svg {
    width: 14px;
    height: 14px;
  }

  .laps-stats-row {
    padding: 0.9rem;
    gap: 0.6rem;
  }

  .laps-stat {
    padding: 0.6rem 0.3rem;
  }

  .laps-stat-label {
    font-size: 0.65rem;
  }

  .laps-stat-value {
    font-size: 0.95rem;
  }

  .laps-list-outer {
    padding: 0.9rem 1rem 1.2rem;
  }

  .laps-search {
    padding: 0.65em 0.9em;
    font-size: 0.85rem;
  }

  .lap-row {
    padding: 0.7em 0.8em;
    font-size: 0.9em;
  }

  .lap-row .lap-num {
    min-width: 2em;
    font-size: 0.85em;
    padding: 0.25em;
  }

  .lap-row .lap-segment {
    font-size: 0.95em;
  }

  .lap-row .lap-total {
    font-size: 0.8em;
    min-width: 4em;
  }

  .lap-row .lap-copy-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8em;
    margin-left: 0.5em;
  }
}
/* --- PREMIUM NAVBAR --- */
.navbar-premium {
  position: absolute;
  top: 2.2rem;
  left: 2.2rem;
  z-index: 20;
  background: var(--glass-bg);
  border-radius: 1.5rem;
  box-shadow: 0 2px 18px 0 var(--accent-color), 0 1px 0 #0002;
  padding: 1.2rem 2rem;
  border: 1.5px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  min-width: 280px;
  max-width: 400px;
}
.navbar-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
}
.navbar-logo {
  color: var(--accent-color);
  filter: drop-shadow(0 2px 8px rgba(102, 166, 255, 0.3));
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.navbar-logo svg {
  width: 28px;
  height: 28px;
}

.navbar-logo:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 12px rgba(102, 166, 255, 0.4));
}
.navbar-title {
  font-family: "Space Grotesk", "Poppins", sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(90deg, #fff 60%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}
.navbar-by {
  font-family: "Inter", "Poppins", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e0e0e0;
  opacity: 0.85;
  letter-spacing: 0.01em;
  align-self: flex-end;
}

@media (max-width: 700px) {
  .navbar-premium {
    top: 1.5rem;
    left: 1.5rem;
    padding: 1rem 1.5rem;
    min-width: 220px;
    max-width: calc(100vw - 3rem);
  }
  .navbar-content {
    width: 100%;
  }
  .navbar-brand {
    gap: 0.8rem;
  }
  .navbar-title {
    font-size: 1.4rem;
  }
  .navbar-logo svg {
    width: 24px;
    height: 24px;
  }
  .navbar-by {
    font-size: 0.95rem;
  }
}

/* --- PREMIUM TIMER LAYOUT --- */
.main-premium {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  z-index: 10;
  position: relative;
  padding: clamp(3rem, 10vh, 8rem) clamp(1rem, 5vw, 2rem) clamp(3rem, 8vh, 6rem);
  overflow-y: visible;
  overflow-x: hidden;
  /* Enhanced performance */
  contain: layout style;
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Better spacing */
  gap: clamp(2rem, 6vh, 4rem);
}

.main-premium::-webkit-scrollbar {
  width: 6px;
}

.main-premium::-webkit-scrollbar-track {
  background: transparent;
}

.main-premium::-webkit-scrollbar-thumb {
  background: rgba(102, 166, 255, 0.3);
  border-radius: 3px;
}

.main-premium::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 166, 255, 0.5);
}
.timer-premium {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 0;
  width: 100%;
  max-width: 1400px;
  background: none;
  box-shadow: none;
  border: none;
  /* Performance optimizations */
  contain: layout;
  transform: translateZ(0);
  will-change: auto;
}
.time-premium {
  font-family: "Space Grotesk", monospace;
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  user-select: none;
  text-align: center;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.15) 100%
  );
  backdrop-filter: blur(30px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  padding: clamp(0.4em, 2vw, 0.6em) clamp(0.6em, 3vw, 1em);
  box-shadow: 0 20px 60px 0 rgba(0, 0, 0, 0.3),
    0 8px 30px 0 rgba(102, 166, 255, 0.4),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(102, 166, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 0 40px rgba(102, 166, 255, 0.8), 0 4px 15px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
  /* Enhanced glassmorphism */
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.time-premium.running {
  animation: subtleGlow 3s ease-in-out infinite;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.2),
    0 6px 20px 0 rgba(102, 166, 255, 0.35),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.25);
}

.time-premium.updating {
  /* Smooth transition instead of flip animation */
  transition: color 0.15s ease-out;
}
.subtitle-premium {
  font-family: "Inter", sans-serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: #ffffff;
  opacity: 0.9;
  margin-bottom: 2em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  transition: opacity 0.3s ease;
}

/* Enhanced Motivational Quote Section */
.quote-container {
  max-width: min(90vw, 700px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  position: relative;
  z-index: 5;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.2),
    0 4px 20px 0 rgba(102, 166, 255, 0.15),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px 0 rgba(0, 0, 0, 0.25),
    0 6px 25px 0 rgba(102, 166, 255, 0.2),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.25);
}

.quote-content {
  position: relative;
}

.quote-text {
  font-family: "Inter", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 1rem 0;
  line-height: 1.7;
  font-style: italic;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-text::before {
  content: '"';
  font-size: 3em;
  color: var(--accent-color);
  opacity: 0.4;
  position: absolute;
  left: clamp(-1.5rem, -4vw, -2rem);
  top: -0.2em;
  line-height: 1;
  font-weight: 300;
}

.quote-text::after {
  content: '"';
  font-size: 3em;
  color: var(--accent-color);
  opacity: 0.4;
  position: absolute;
  right: clamp(-1.5rem, -4vw, -2rem);
  bottom: -0.3em;
  line-height: 1;
  font-weight: 300;
}

.quote-author {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--accent-color);
  opacity: 0.9;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.quote-author::before {
  content: "— ";
  opacity: 0.6;
}
.button-group-premium {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 500px;
}

.control-btn-premium {
  min-width: clamp(120px, 25vw, 140px);
  height: clamp(56px, 12vw, 64px);
  border: none;
  border-radius: 1.5rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15),
    0 2px 10px 0 rgba(102, 166, 255, 0.2),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0 clamp(1.5em, 4vw, 2.5em);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.control-btn-premium.primary {
  background: linear-gradient(135deg, var(--accent-color) 0%, #7ab7ff 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 25px 0 rgba(102, 166, 255, 0.4),
    0 2px 10px 0 rgba(0, 0, 0, 0.2), inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.control-btn-premium.secondary {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.control-btn-premium:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.control-btn-premium:not(:disabled):hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px 0 rgba(102, 166, 255, 0.5),
    0 4px 15px 0 rgba(0, 0, 0, 0.25), inset 0 1px 2px 0 rgba(255, 255, 255, 0.4);
}

.control-btn-premium:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

/* --- PREMIUM LAPS SECTION --- */
/* Enhanced Lap Button - Keep for compatibility */
.lap-btn-enhanced {
  position: relative;
  overflow: hidden;
}

.lap-btn-enhanced::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.lap-btn-enhanced:not(:disabled):hover::before {
  left: 100%;
}

.lap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
}

/* --- ENHANCED SETTINGS PANEL --- */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: clamp(360px, 35vw, 480px);
  max-width: 90vw;
  background: linear-gradient(
    145deg,
    rgba(15, 25, 40, 0.85) 0%,
    rgba(25, 35, 50, 0.9) 50%,
    rgba(20, 30, 45, 0.88) 100%
  );
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(102, 166, 255, 0.3);
  border-right: none;
  box-shadow: -20px 0 80px 0 rgba(0, 0, 0, 0.4),
    -10px 0 40px 0 rgba(102, 166, 255, 0.15),
    inset 2px 0 2px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(102, 166, 255, 0.2);
  border-radius: 3rem 0 0 3rem;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
  outline: none;
  overflow: hidden;
  will-change: transform;
  pointer-events: none;
  visibility: hidden;
}

.settings-panel.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.settings-content {
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* --- BACKGROUND PRESETS (AESTHETIC) --- */
.background-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.background-presets .preset-btn {
  aspect-ratio: 16/10;
  min-height: 60px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
}
.background-presets .preset-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transition: opacity 0.3s ease;
}
.background-presets .preset-btn::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  background: var(--accent-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(102, 166, 255, 0.4);
}
.background-presets .preset-btn.active {
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 166, 255, 0.2), 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}
.background-presets .preset-btn.active::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Tablet and medium screens - 600px to 900px */
@media (min-width: 600px) and (max-width: 900px) {
  .settings-panel {
    width: clamp(320px, 40vw, 420px);
    right: 1rem;
    top: 1rem;
    height: calc(100vh - 2rem);
    border-radius: 2rem;
    border: 1px solid rgba(102, 166, 255, 0.3);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .settings-panel.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
    visibility: visible;
  }
}

/* Mobile screens - below 600px */
@media (max-width: 599px) {
  .settings-panel {
    width: 100vw;
    max-width: 100vw;
    border-radius: 2rem 2rem 0 0;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    height: min(85vh, calc(100vh - env(safe-area-inset-top) - 2rem));
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 1200;
    border: 1px solid rgba(102, 166, 255, 0.4);
    border-bottom: none;
    background: linear-gradient(
      145deg,
      rgba(10, 20, 35, 0.95) 0%,
      rgba(20, 30, 45, 0.98) 100%
    );
    backdrop-filter: blur(60px) saturate(200%);
    box-shadow: 0 -20px 80px 0 rgba(0, 0, 0, 0.5),
      0 -10px 40px 0 rgba(102, 166, 255, 0.2),
      inset 0 2px 4px 0 rgba(255, 255, 255, 0.1);
  }

  .settings-panel.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
    visibility: visible;
  }

  .settings-content {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}

/* Focus states for accessibility */
.settings-panel .close-btn:focus-visible,
.settings-panel button:focus-visible,
.settings-panel input:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Prevent background scroll when modal open */
body.modal-open { overflow: hidden; }
/* --- FAB TOOLTIP --- */
.fab-tooltip {
  position: absolute;
  right: 110%;
  top: 50%;
  transform: translateY(-50%) scale(0.98);
  background: var(--glass-bg);
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.45em 1.1em;
  border-radius: 1.1em;
  box-shadow: 0 2px 18px 0 var(--accent-color), 0 1px 0 #0002;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 0.7em;
}
.fab-btn:hover .fab-tooltip,
.fab-btn:focus .fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}
@media (max-width: 600px) {
  .fab-tooltip {
    right: 120%;
    font-size: 0.95rem;
    padding: 0.35em 0.8em;
  }
}

/* --- DEVELOPER INFO BUTTON --- */
.developer-info-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  z-index: 100;
  color: #fff;
}

.developer-info-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.developer-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.developer-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.developer-info-btn:hover .developer-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-10px);
}

/* --- DEVELOPER INFO MODAL --- */
.developer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1500;
}

.developer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.developer-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  box-shadow: 0 20px 80px 0 rgba(0, 0, 0, 0.25),
    0 8px 50px 0 rgba(102, 166, 255, 0.2),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  min-width: 400px;
  max-width: 90vw;
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: #fff;
}

.developer-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.developer-modal .close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
}

.developer-modal-content {
  padding: 2.5rem;
  text-align: center;
}

.developer-header {
  margin-bottom: 2rem;
}

.developer-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 32px rgba(102, 166, 255, 0.3);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.developer-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.developer-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(90deg, #fff 60%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.developer-role {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.developer-bio {
  text-align: left;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.developer-bio p {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.developer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.developer-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.developer-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.developer-link:hover::before {
  left: 100%;
}

.developer-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: var(--accent-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.link-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: auto;
}

.link-url {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.website-link .link-icon {
  color: #4caf50;
}

.email-link .link-icon {
  color: #ff6b6b;
}

@media (max-width: 600px) {
  .developer-info-btn {
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
  }

  .developer-tooltip {
    display: none;
  }

  .developer-modal {
    min-width: 300px;
    width: 92vw;
    margin: 0;
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    max-height: calc(
      92vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
  }

  .developer-modal-content {
    padding: 1.5rem;
  }

  .developer-links {
    gap: 0.8rem;
  }

  .developer-link {
    padding: 0.8rem 1rem;
  }

  .link-text {
    font-size: 1rem;
  }

  .link-url {
    font-size: 0.8rem;
  }
}

/* --- ENHANCED FLOATING ACTION BUTTON GROUP --- */
.fab-group {
  position: fixed;
  bottom: clamp(1.5rem, 5vw, 2.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2vw, 1.2rem);
  z-index: calc(var(--z-modal) + 2);
  align-items: flex-end;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.fab-group.hidden {
  opacity: 0;
  transform: translateX(120px) scale(0.8);
  pointer-events: none;
}

.fab-btn {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  border: 1.5px solid rgba(102, 166, 255, 0.3);
  border-radius: clamp(1.2rem, 3vw, 1.6rem);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 4px 16px rgba(102, 166, 255, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  width: clamp(52px, 12vw, 64px);
  height: clamp(52px, 12vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #fff;
  outline: none;
  padding: 0;
  position: relative;
  backdrop-filter: blur(20px) saturate(140%);
  overflow: hidden;
}

.fab-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-color) 0%, #7ab7ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.fab-btn:focus {
  outline: 3px solid rgba(102, 166, 255, 0.5);
  outline-offset: 2px;
}

.fab-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.25),
    0 6px 24px rgba(102, 166, 255, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  border-color: rgba(102, 166, 255, 0.6);
}

.fab-btn:hover::before {
  opacity: 1;
}

.fab-btn:active {
  transform: translateY(-1px) scale(1.02);
  transition: transform 0.1s ease;
}

.fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.2em, 3vw, 1.5em);
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
/* FAB Tooltip Enhancements */
.fab-btn {
  position: relative;
}

.fab-tooltip {
  position: absolute;
  right: calc(100% + 1rem);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fab-btn:hover .fab-tooltip,
.fab-btn:focus .fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-8px);
}

/* Mobile and tablet responsive styles */
@media (max-width: 900px) {
  .fab-group {
    bottom: clamp(1rem, 3vw, 1.5rem);
    right: clamp(0.8rem, 3vw, 1.2rem);
    z-index: 1001;
  }
  
  .fab-btn {
    width: clamp(48px, 10vw, 56px);
    height: clamp(48px, 10vw, 56px);
  }
  
  .fab-icon svg {
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
  }

  .fab-tooltip {
    display: none;
  }
}

@media (max-width: 600px) {
  .fab-group {
    bottom: 1rem;
    right: 0.8rem;
    gap: 0.7rem;
  }
}

/* --- REDESIGNED PREMIUM SHARE MODAL --- */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.share-modal-enhanced {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(
    145deg,
    rgba(15, 25, 40, 0.95) 0%,
    rgba(25, 35, 50, 0.98) 50%,
    rgba(20, 30, 45, 0.96) 100%
  );
  backdrop-filter: blur(40px) saturate(180%);
  border: 2px solid rgba(102, 166, 255, 0.3);
  border-radius: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 
    0 25px 100px rgba(0, 0, 0, 0.4),
    0 12px 48px rgba(102, 166, 255, 0.2),
    inset 0 1px 3px rgba(255, 255, 255, 0.1);
  
  /* Responsive sizing */
  width: clamp(300px, 90vw, 480px);
  max-height: 90vh;
  
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
  overflow: hidden;
}

.share-modal-enhanced.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.share-modal-header {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 1.2rem);
  padding: clamp(1.2rem, 4vw, 2rem);
  border-bottom: 1px solid rgba(102, 166, 255, 0.2);
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border-radius: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) 0 0;
}

.share-icon {
  width: clamp(40px, 8vw, 48px);
  height: clamp(40px, 8vw, 48px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color) 0%, #7ab7ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 
    0 8px 32px rgba(102, 166, 255, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.share-modal-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  flex: 1;
  letter-spacing: -0.01em;
  margin: 0;
}

.share-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  width: clamp(32px, 6vw, 36px);
  height: clamp(32px, 6vw, 36px);
  cursor: pointer;
  border-radius: clamp(8px, 2vw, 10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 3vw, 1.2rem);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.share-close-btn:hover {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.4);
  color: #ff6464;
  transform: scale(1.05) rotate(90deg);
}

.share-close-btn:focus {
  outline: 2px solid rgba(102, 166, 255, 0.5);
  outline-offset: 2px;
}

.share-modal-content {
  padding: clamp(1rem, 3vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 1.5rem);
  flex: 1;
  overflow-y: auto;
}

.share-description {
  font-family: "Inter", sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.share-url-container {
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2vw, 1rem);
}

.url-display {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: clamp(0.6rem, 2vw, 0.8rem);
  padding: clamp(0.7rem, 2vw, 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  word-break: break-all;
  text-align: center;
}

.url-text {
  font-family: "Inter", monospace;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.copy-share-btn {
  background: linear-gradient(135deg, var(--accent-color) 0%, #6bb6ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: clamp(0.6rem, 2vw, 0.8rem);
  padding: clamp(0.7rem, 2vw, 0.9rem) clamp(1rem, 3vw, 1.2rem);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 0.9rem);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 2vw, 0.6rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 16px rgba(102, 166, 255, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.copy-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 24px rgba(102, 166, 255, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #7ab7ff 0%, #8cc5ff 100%);
}

.copy-share-btn:active {
  transform: translateY(-1px);
  transition: transform 0.1s ease;
}

.copy-share-btn:focus {
  outline: 2px solid rgba(102, 166, 255, 0.5);
  outline-offset: 2px;
}

/* Social Media Buttons */
.share-social {
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2vw, 1rem);
  margin-top: clamp(0.5rem, 2vw, 1rem);
}

.social-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: clamp(0.6rem, 2vw, 0.8rem);
  padding: clamp(0.7rem, 2vw, 0.9rem);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.8rem, 2.2vw, 0.85rem);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.6rem, 2vw, 0.8rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  width: 100%;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: #fff;
}

.social-btn:focus {
  outline: 2px solid rgba(102, 166, 255, 0.5);
  outline-offset: 2px;
}

.social-btn svg {
  width: clamp(18px, 4vw, 20px);
  height: clamp(18px, 4vw, 20px);
  flex-shrink: 0;
}

.social-btn.twitter:hover {
  background: rgba(29, 161, 242, 0.2);
  border-color: rgba(29, 161, 242, 0.4);
}

.social-btn.whatsapp:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.4);
}

.social-btn.telegram:hover {
  background: rgba(0, 136, 204, 0.2);
  border-color: rgba(0, 136, 204, 0.4);
}

/* Responsive Share Modal Styles */
@media (max-width: 600px) {
  .share-modal-enhanced {
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    border-radius: 1.2rem;
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .share-modal-content {
    max-height: 60vh;
    overflow-y: auto;
  }

  .share-social {
    gap: 0.7rem;
  }

  .social-btn {
    padding: 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  .share-modal-enhanced {
    width: calc(100vw - 1rem);
    margin: 0.5rem;
    border-radius: 1rem;
  }

  .share-modal-header {
    padding: 1rem;
  }

  .share-modal-content {
    padding: 1rem;
  }
}

/* --- HERO LAYOUT REIMAGINED --- */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100vw;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 4vh;
  box-shadow: 0 2px 10px 0 rgba(102, 166, 255, 0.1);
}
.brand-bar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-title);
  font-size: 1.3rem;
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 2px 18px 0 var(--accent-color);
  /* Minimal tactile feedback, no scale */
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}
.brand-logo {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 8px #0002);
}
.brand-title {
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff 60%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 0.5rem;
}
.brand-by {
  font-size: 1.1rem;
  font-weight: 400;
  color: #e0e0e0;
  opacity: 0.8;
  margin-left: 0.5rem;
}
/* Open, premium timer layout */
.timer-hero-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  padding: 3.5rem 1.2rem 2.5rem 1.2rem;
  width: 100vw;
  max-width: 100vw;
  margin-bottom: 2.5rem;
  background: none;
  box-shadow: none;
  border: none;
}
.time-hero {
  font-family: var(--font-title);
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 32px var(--accent-color), 0 2px 8px #0002;
  user-select: none;
  text-align: center;
  line-height: 1.1;
  margin-bottom: 0.2em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1.2rem;
  padding: 0.2em 0.7em;
  box-shadow: 0 2px 12px 0 rgba(102, 166, 255, 0.08);
  transition: color var(--transition), text-shadow var(--transition);
}
.subtitle-hero {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: #fff;
  opacity: 0.85;
  margin-bottom: 1.2em;
  text-align: center;
  text-shadow: 0 1px 8px #0002;
  letter-spacing: 0.01em;
}
.button-group-hero {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.control-btn-hero {
  min-width: 120px;
  height: 58px;
  border: none;
  border-radius: 1.2rem;
  background: var(--glass-bg);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 16px 0 rgba(102, 166, 255, 0.1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 0 2.2em;
  backdrop-filter: var(--glass-blur);
}
.control-btn-hero.primary {
  background: linear-gradient(90deg, var(--accent-color) 60%, #5a9cf8 100%);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 2px 22px 0 var(--accent-color), 0 1px 0 #0002;
  border: none;
}
.control-btn-hero.secondary {
  background: var(--glass-bg);
  color: #fff;
  border: 1.5px solid var(--glass-border);
  font-weight: 700;
}
.control-btn-hero:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.control-btn-hero:not(:disabled):hover {
  background: linear-gradient(90deg, var(--accent-color) 60%, #5a9cf8 100%);
  color: #fff;
  box-shadow: 0 2px 18px 0 var(--accent-color), 0 1px 0 #0002;
  filter: brightness(1.03);
  /* Minimal tactile feedback, no scale or strong shadow */
}
.btn-icon {
  font-size: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.2em;
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent-color: #66a6ff;
  --accent-hover: #5a9cf8;
  --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.18);
  --shadow-strong: 0 4px 32px 0 rgba(102, 166, 255, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-bg-dark: rgba(0, 0, 0, 0.22);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(20px) saturate(180%);
  --radius-lg: 2.5rem;
  --radius-md: 1.25rem;
  --radius-sm: 0.7rem;
  --radius-full: 50%;
  --font-title: "Space Grotesk", "Poppins", system-ui, sans-serif;
  --font-body: "Inter", "Poppins", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Monaco", monospace;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --z-modal: 1000;
  --primary-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --secondary-gradient: linear-gradient(120deg, #fcb69f 0%, #ffecd2 100%);
  --glass-blur: blur(22px) saturate(160%);
  --extended-bg: #181c2a;
  /* Mobile-first responsive units */
  --space-xs: clamp(0.25rem, 2vw, 0.5rem);
  --space-sm: clamp(0.5rem, 3vw, 1rem);
  --space-md: clamp(1rem, 4vw, 1.5rem);
  --space-lg: clamp(1.5rem, 5vw, 2.5rem);
  --space-xl: clamp(2rem, 6vw, 3.5rem);
  --font-size-xs: clamp(0.75rem, 2.5vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 3vw, 1rem);
  --font-size-base: clamp(1rem, 3.5vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 4vw, 1.25rem);
  --font-size-xl: clamp(1.25rem, 5vw, 1.5rem);
}

html {
  /* Prevent zoom and scaling */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
  /* Only show vertical scrollbar when needed */
  overflow-y: auto;
  scrollbar-gutter: auto;
  min-height: 100vh;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  /* FIXED BACKGROUND - stays in place during scroll */
  background: linear-gradient(
    180deg,
    var(--primary-gradient) 0%,
    var(--extended-bg) 100%
  );
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  font-family: var(--font-body);
  background: transparent;
  min-height: 100vh;
  color: #fff;
  transition: none;
  overflow-x: hidden;
  overflow-y: auto;
  letter-spacing: 0.01em;
  position: relative;
  /* Lock background from zooming and scaling */
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(1px);
  z-index: 1;
  pointer-events: none;
}

/* --- HERO & NAVBAR --- */

.hero {
  position: relative;
  width: 100vw;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 1;
}
.hero-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.7) blur(3.5px) saturate(1.3);
  transition: background-image 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}
.navbar {
  position: relative;
  z-index: 2;
  margin: 2.5rem 0 0 2.5rem;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: 1.7rem 2.7rem 1.3rem 2.7rem;
  border: 1.5px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 320px;
}
.app-title {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 6vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff 60%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.1em;
  text-shadow: 0 2px 24px rgba(102, 166, 255, 0.12);
}
.app-subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 400;
  color: #e0e0e0;
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px #0002;
}

/* --- MAIN LAYOUT --- */

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 60vh;
  padding: 3.2rem 1.2rem 2rem 1.2rem;
  gap: 2.7rem;
  z-index: 2;
}

/* --- STOPWATCH CARD --- */

.stopwatch-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stopwatch-glass {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass), 0 2px 32px 0 rgba(0, 0, 0, 0.1);
  border: 1.5px solid var(--glass-border);
  padding: 3.2rem 2.2rem 2.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  backdrop-filter: var(--glass-blur);
  position: relative;
  transition: box-shadow var(--transition), background var(--transition);
}
.stopwatch-glass:hover {
  box-shadow: 0 8px 48px 0 var(--accent-color), 0 2px 32px 0 rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.28);
}
.stopwatch-container {
  position: relative;
  width: 270px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.glow-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: radial-gradient(
    circle at 60% 40%,
    var(--accent-color) 0%,
    #fff0 80%
  );
  opacity: 0.22;
  filter: blur(22px);
  transition: opacity var(--transition);
}
.glow-ring.active {
  opacity: 0.6;
  animation: pulseGlow 2.2s ease-in-out infinite;
}
.time-display {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: clamp(2.7rem, 8vw, 4.7rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 32px rgba(102, 166, 255, 0.18), 0 1px 0 #0002;
  letter-spacing: 0.04em;
  user-select: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: color var(--transition), text-shadow var(--transition);
  animation: floatAnimation 7s ease-in-out infinite;
  border-radius: 1.2rem;
  padding: 0.2em 0.7em;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px 0 rgba(102, 166, 255, 0.08);
}
.time-display.running {
  color: var(--accent-color);
  text-shadow: 0 2px 40px var(--accent-color), 0 1px 0 #0002;
  transform: scale(1.04);
  background: rgba(102, 166, 255, 0.1);
}

/* --- BUTTONS --- */

.button-group {
  display: flex;
  gap: 1.3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.control-btn {
  min-width: 120px;
  height: 58px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 16px 0 rgba(102, 166, 255, 0.1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  backdrop-filter: var(--glass-blur);
}
.control-btn.primary {
  background: linear-gradient(90deg, var(--accent-color) 60%, #5a9cf8 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 22px 0 var(--accent-color), 0 1px 0 #0002;
  border: none;
}
.control-btn.secondary {
  background: var(--glass-bg);
  color: #fff;
  border: 1.5px solid var(--glass-border);
  font-weight: 600;
}
.control-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.control-btn:not(:disabled):hover {
  background: linear-gradient(90deg, var(--accent-color) 60%, #5a9cf8 100%);
  color: #fff;
  box-shadow: 0 2px 18px 0 var(--accent-color), 0 1px 0 #0002;
  filter: brightness(1.03);
  /* Minimal tactile feedback, no scale or strong shadow */
}
.btn-text {
  position: relative;
  z-index: 1;
}

/* --- LAPS (Legacy - using Tailwind now) --- */
/* Old laps styles removed for Tailwind compatibility */
.laps-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 1.1rem;
  text-align: center;
  letter-spacing: 0.01em;
}
.laps-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 166, 255, 0.6) rgba(255, 255, 255, 0.1);
}
.lap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 1.05rem;
  font-family: var(--font-mono);
  color: #fff;
  animation: fadeInUp 0.3s ease-out;
  transition: background 0.2s;
}
.lap-item:hover {
  background: rgba(255, 255, 255, 0.18);
}
.lap-number {
  font-weight: 700;
  color: #b3e0ff;
  font-size: 1rem;
}
.lap-time {
  font-weight: 700;
  color: #fff;
  font-size: 1.15rem;
}
.lap-diff {
  font-weight: 400;
  font-size: 1rem;
  opacity: 0.85;
}
.lap-diff.faster {
  color: #4ade80;
}
.lap-diff.slower {
  color: #f87171;
}

/* --- SETTINGS --- */

.settings-toggle {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 68px;
  height: 68px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  color: #fff;
  box-shadow: 0 2px 20px 0 rgba(102, 166, 255, 0.18);
  cursor: pointer;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast),
    box-shadow var(--transition-fast), transform var(--transition-fast);
}
.settings-toggle:hover {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 6px 32px 0 var(--accent-color);
  transform: scale(1.08);
}
.settings-icon {
  width: 2.4rem;
  height: 2.4rem;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 390px;
  max-width: 100vw;
  background: var(--glass-bg);
  box-shadow: -8px 0 40px 0 rgba(31, 38, 135, 0.18);
  border-left: 1.5px solid var(--glass-border);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--glass-blur);
}
.settings-panel.show {
  transform: translateX(0);
}
.settings-content {
  padding: 2.5rem 1.7rem 1.7rem 1.7rem;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
.settings-header {
  background: linear-gradient(
    145deg,
    rgba(102, 166, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(102, 166, 255, 0.1) 100%
  );
  backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 2px solid rgba(102, 166, 255, 0.3);
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 4vw, 2.5rem)
    clamp(1rem, 3vh, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
}

.settings-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #e0f2ff 30%,
    var(--accent-color) 70%,
    #7ab7ff 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 8px rgba(102, 166, 255, 0.3);
}

.close-btn {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: clamp(40px, 8vw, 48px);
  height: clamp(40px, 8vw, 48px);
  cursor: pointer;
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(15px);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.1),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.close-btn:hover {
  background: linear-gradient(
    145deg,
    rgba(255, 100, 100, 0.2) 0%,
    rgba(255, 150, 150, 0.15) 100%
  );
  border-color: rgba(255, 100, 100, 0.5);
  color: #ff8080;
  transform: scale(1.05) rotate(90deg);
  box-shadow: 0 6px 25px 0 rgba(255, 100, 100, 0.3),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.settings-body {
  flex: 1;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  overflow-y: auto;
}
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  backdrop-filter: blur(10px);
}
.setting-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.setting-label::before {
  content: "";
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--accent-color), #5a9cf8);
  border-radius: 2px;
}

/* --- BACKGROUND PRESETS --- */

.background-presets {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.preset-btn {
  width: 70px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: border var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0.5em 0.7em;
  background-blend-mode: multiply;
  text-shadow: 0 1px 8px #0008;
}
.preset-btn.active,
.preset-btn:focus {
  border: 2.5px solid var(--accent-color);
  box-shadow: 0 4px 18px 0 var(--accent-color);
  transform: scale(1.07);
}
.custom-background {
  margin-top: 0.6rem;
}
.custom-background {
  margin-top: 1rem;
}
.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.1) 0%,
    rgba(90, 156, 248, 0.05) 100%
  );
  border: 2px dashed rgba(102, 166, 255, 0.3);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  width: 100%;
  margin-top: 1rem;
  backdrop-filter: blur(10px);
}
.file-upload-label::before {
  content: "📁";
  font-size: 1.2rem;
}
.file-upload-label:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.2) 0%,
    rgba(90, 156, 248, 0.1) 100%
  );
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 166, 255, 0.2);
}

/* --- THEME, ACCENT, FONT --- */

.theme-selector {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.05rem;
  font-family: "Inter", sans-serif;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.25s ease;
  position: relative;
  flex: 1;
  min-width: 80px;
}
.theme-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-radio {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  position: relative;
  transition: all 0.25s ease;
}
.theme-radio::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  transition: transform 0.25s ease;
}
.theme-option input[type="radio"]:checked + .theme-radio {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(102, 166, 255, 0.2);
}
.theme-option input[type="radio"]:checked + .theme-radio::after {
  transform: translate(-50%, -50%) scale(1);
}
.theme-text {
  flex: 1;
  text-align: center;
}
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.custom-color-picker-container {
  position: relative;
  width: 3.2em;
  height: 3.2em;
}

#accentColorPicker {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#accentColorPicker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(102, 166, 255, 0.4);
}

#accentColorPicker:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.color-presets {
  display: flex;
  gap: 0.6em;
}
.color-preset {
  width: 1.8em;
  height: 1.8em;
  border-radius: var(--radius-full);
  border: 2px solid #fff2;
  cursor: pointer;
  transition: border var(--transition-fast), transform var(--transition-fast);
}
.color-preset.active,
.color-preset:focus {
  border: 2.5px solid var(--accent-color);
  transform: scale(1.12);
}
.color-preset:hover {
  border: 2.5px solid #fff;
  transform: scale(1.08);
}

/* --- TOGGLES --- */

.toggle-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.custom-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.05rem;
  font-family: "Inter", sans-serif;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.25s ease;
  flex: 1;
  min-width: 140px;
}
.custom-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.custom-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.toggle-checkbox::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  transition: transform 0.25s ease;
}
.custom-toggle input[type="checkbox"]:checked + .toggle-checkbox {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(102, 166, 255, 0.2);
}
.custom-toggle input[type="checkbox"]:checked + .toggle-checkbox::after {
  transform: translate(-50%, -50%) scale(1);
}
.toggle-switch {
  width: 2.4em;
  height: 1.3em;
  background: #fff2;
  border-radius: 1em;
  position: relative;
  display: inline-block;
  transition: background var(--transition-fast);
}
.toggle-switch::after {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.15em;
  width: 1em;
  height: 1em;
  background: #fff;
  border-radius: 50%;
  transition: left var(--transition-fast), background var(--transition-fast);
}
.toggle-label input[type="checkbox"]:checked + .toggle-switch {
  background: var(--accent-color);
}
.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
  left: 1.2em;
  background: #fff;
}

/* --- SETTINGS OVERLAY --- */

.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px) saturate(120%);
  z-index: calc(var(--z-modal) + 10);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.settings-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* --- ANIMATIONS --- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.9;
  }
}
@keyframes floatAnimation {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* --- RESPONSIVE --- */

@media (max-width: 600px) {
  .navbar {
    margin: 1.2rem 0 0 1.2rem;
    padding: 1.1rem 1.3rem;
    min-width: 0;
  }
  .main-container {
    padding: 1.3rem 0.3rem;
    gap: 1.3rem;
  }
  .stopwatch-card,
  .laps-section {
    max-width: 99vw;
  }
  .stopwatch-glass {
    padding: 1.3rem 0.6rem;
  }
  .stopwatch-container {
    width: 180px;
    height: 180px;
  }
  .settings-panel {
    width: 100vw;
  }
  .settings-toggle {
    right: 1.3rem;
    bottom: 1.3rem;
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 400px) {
  .navbar {
    margin: 0.6rem 0 0 0.6rem;
    padding: 0.8rem 0.8rem;
  }
  .stopwatch-container {
    width: 120px;
    height: 120px;
  }
}

/* === Overrides: minimal quotes, responsive fixes, share overlay, mobile laps === */
/* Minimal quote styling to reduce distraction */
.quote-container {
  max-width: min(90vw, 680px);
  padding: clamp(0.75rem, 2.2vw, 1rem);
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: none;
}

/* Better mobile/tablet quote spacing */
@media (max-width: 900px) {
  .quote-container {
    margin: 1rem auto 1.5rem auto;
    padding: 0.8rem 1rem;
    max-width: 92vw;
  }
}

.quote-text {
  font-size: clamp(0.9rem, 1.9vw, 1.05rem);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  text-shadow: none;
}
.quote-text::before,
.quote-text::after { display: none; }
.quote-author {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  color: rgba(102, 166, 255, 0.9);
  opacity: 0.75;
}

/* Ensure settings panel sits above content across devices */
.settings-panel { z-index: calc(var(--z-modal) + 20); }
@media (max-width: 768px) {
  .settings-panel {
    border-radius: 1.5rem 1.5rem 0 0;
    height: min(88vh, calc(100vh - env(safe-area-inset-top) - 1rem));
    z-index: calc(var(--z-modal) + 20);
  }
}

/* Share overlay for enhanced modal */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px) saturate(120%);
  z-index: calc(var(--z-modal) + 10);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.share-overlay.active { opacity: 1; pointer-events: auto; }

/* Mobile and Tablet: lap section flows naturally below buttons */
@media (max-width: 900px) {
  #lapsContainer {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 1.2rem;
    z-index: 20;
  }
}

@media (min-width: 901px) {
  #lapsContainer {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border-radius: 1.5rem;
    z-index: 20;
  }
}

/* --- THEME MODES --- */

html.theme-dark,
body.theme-dark {
  --glass-bg: rgba(0, 0, 0, 0.22);
  --glass-border: rgba(255, 255, 255, 0.1);
  --extended-bg: #181c2a;
  color: #fff;
}
html.theme-light,
body.theme-light {
  --glass-bg: rgba(255, 255, 255, 0.22);
  --glass-border: rgba(0, 0, 0, 0.1);
  --extended-bg: #f6f8fa;
  color: #222;
}

/* --- FONTS --- */

body.font-space-grotesk {
  --font-body: "Space Grotesk", sans-serif;
}
body.font-inter {
  --font-body: "Inter", sans-serif;
}
body.font-poppins {
  --font-body: "Poppins", sans-serif;
}
body.font-jetbrains-mono {
  --font-body: "JetBrains Mono", monospace;
}

/* --- SCROLLBAR --- */
.laps-list::-webkit-scrollbar,
.settings-panel::-webkit-scrollbar {
  width: 8px;
  background: #fff1;
}
.laps-list::-webkit-scrollbar-thumb,
.settings-panel::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 8px;
}

.settings-panel.show {
  transform: translateX(0);
}

.settings-content {
  padding: var(--spacing-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--glass-border);
}

.settings-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.close-btn svg {
  width: 20px;
  height: 20px;
}

.settings-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.setting-label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

/* Background Presets */
.background-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.preset-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.custom-background {
  margin-top: var(--spacing-sm);
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-upload-label:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Theme Selector */
.theme-selector {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.radio-label:hover {
  background: var(--glass-bg);
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-fast);
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--accent-color);
}

/* Color Picker */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

#accentColorPicker {
  width: 3.2em;
  height: 3.2em;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  padding: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#accentColorPicker:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
}

#accentColorPicker:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 166, 255, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.color-presets {
  display: flex;
  gap: 0.6em;
}

.color-preset {
  width: 40px;
  height: 40px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-preset:hover,
.color-preset.active {
  border-color: white;
  transform: scale(1.1);
}

/* Toggle Group */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.toggle-label:hover {
  background: var(--glass-bg);
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 14px;
  background: var(--glass-border);
  transition: all var(--transition-fast);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: all var(--transition-fast);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
  background: var(--accent-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(22px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    top: var(--spacing-md);
    left: var(--spacing-md);
  }

  .app-title {
    font-size: 1.25rem;
  }

  .app-subtitle {
    font-size: 0.75rem;
  }

  .main-container {
    padding: var(--spacing-lg) var(--spacing-md);
    gap: var(--spacing-lg);
  }

  .stopwatch-container {
    width: 250px;
    height: 250px;
  }

  .time-display {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .button-group {
    gap: var(--spacing-sm);
  }

  .control-btn {
    min-width: 100px;
    height: 50px;
    font-size: 0.875rem;
  }

  .settings-toggle {
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    width: 50px;
    height: 50px;
  }

  .settings-icon {
    width: 20px;
    height: 20px;
  }

  .settings-panel {
    width: 100%;
  }

  .laps-container {
    padding: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .button-group {
    flex-direction: column;
    width: 100%;
    max-width: 200px;
  }

  .control-btn {
    width: 100%;
    min-width: auto;
  }

  .background-presets {
    grid-template-columns: 1fr;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.2);
    --text-primary: #000;
    --text-secondary: #333;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .settings-toggle,
  .settings-panel,
  .settings-overlay {
    display: none;
  }

  body {
    background: white !important;
    color: black !important;
  }
}

/* Focus styles for accessibility */
.control-btn:focus,
.settings-toggle:focus,
.close-btn:focus,
.preset-btn:focus,
.color-preset:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Enhanced Micro-interactions and Animations */
@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes pulseGentleSlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 166, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(102, 166, 255, 0);
  }
}

@keyframes slideInFromBottom {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Removed numberFlip animation for cleaner timer display */

@keyframes subtleGlow {
  0%,
  100% {
    text-shadow: 0 0 30px rgba(102, 166, 255, 0.7),
      0 2px 10px rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow: 0 0 40px rgba(102, 166, 255, 0.9),
      0 2px 10px rgba(0, 0, 0, 0.4);
  }
}

/* Limit global transitions to reduce repaint overhead */
*:not(.time-premium) {
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Focus visible improvements */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Low power mode optimizations */
.low-power-mode * {
  animation: none !important;
  transition-duration: 0.1s !important;
}

.low-power-mode .time-premium.running {
  animation: none !important;
}

.low-power-mode .fab-btn:hover,
.low-power-mode .control-btn-premium:hover {
  transform: none !important;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.6) 0%,
    rgba(78, 205, 196, 0.6) 100%
  );
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.8) 0%,
    rgba(78, 205, 196, 0.8) 100%
  );
  border-color: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 166, 255, 0.6) rgba(255, 255, 255, 0.05);
}

/* Settings panel specific scrollbar */
.settings-content::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.4) 0%,
    rgba(78, 205, 196, 0.4) 100%
  );
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 166, 255, 0.7) 0%,
    rgba(78, 205, 196, 0.7) 100%
  );
}

/* Laps container scrollbar */
.laps-list-container::-webkit-scrollbar {
  width: 6px;
}

.laps-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.laps-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
.laps-list::-webkit-scrollbar,
.settings-panel::-webkit-scrollbar {
  width: 6px;
}

.laps-list::-webkit-scrollbar-track,
.settings-panel::-webkit-scrollbar-track {
  background: transparent;
}

.laps-list::-webkit-scrollbar-thumb,
.settings-panel::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.laps-list::-webkit-scrollbar-thumb:hover,
.settings-panel::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* PWA Install Button */
.install-btn,
.install-btn-navbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0.8rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.install-btn:hover,
.install-btn-navbar:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 166, 255, 0.3);
}

.install-btn svg,
.install-btn-navbar svg {
  width: 16px;
  height: 16px;
}

/* Update Notification */
.update-notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.3s ease;
}

.update-notification.show {
  top: 2rem;
}

.update-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
}

.update-content button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.update-content button:hover {
  background: var(--accent-hover);
}

/* ================================================================================================ */
/* COMPREHENSIVE RESPONSIVE DESIGN - MOBILE FIRST APPROACH */
/* ================================================================================================ */

/* Base Styles (Mobile First - 320px+) */
:root {
  --container-padding: 1rem;
  --gap-small: 0.5rem;
  --gap-medium: 1rem;
  --gap-large: 1.5rem;
}

/* Small Phones (320px - 375px) */
@media (max-width: 375px) {
  .navbar-premium {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.8rem 1.2rem;
    min-width: unset;
    max-width: unset;
  }

  .navbar-title {
    font-size: 1.2rem;
  }

  .navbar-logo svg {
    width: 22px;
    height: 22px;
  }

  .time-premium {
    font-size: 3rem !important;
  }

  .button-group-premium {
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
  }

  .control-btn-premium {
    width: 100%;
    padding: 1rem;
  }

  .fab-group {
    bottom: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }

  .fab-btn {
    width: 48px;
    height: 48px;
  }

  /* Quote section for small phones */
  .quote-container {
    margin: 1rem auto 1.5rem auto;
    padding: 0.75rem 1rem;
    max-width: 95vw;
  }

  .quote-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .quote-text::before,
  .quote-text::after {
    font-size: 1.5em;
    opacity: 0.4;
  }

  .quote-text::before {
    left: -0.5rem;
    top: -0.2rem;
  }

  .quote-text::after {
    right: -0.5rem;
    bottom: -0.3rem;
  }

  .quote-author {
    font-size: 0.8rem;
  }
}

/* Standard Mobile (376px - 480px) */
@media (min-width: 376px) and (max-width: 480px) {
  .time-premium {
    font-size: 3.5rem !important;
  }

  .button-group-premium {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .control-btn-premium {
    flex: 1;
    min-width: 120px;
  }
}

/* Tablet and Medium Screens (481px - 768px) - Enhanced for 682x915 */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --container-padding: 1.5rem;
    --gap-medium: 1.5rem;
    --gap-large: 2rem;
  }

  .navbar-premium {
    top: 1.5rem;
    left: 1.5rem;
    padding: 1rem 1.5rem;
    min-width: 200px;
    max-width: calc(100vw - 3rem);
  }

  .main-premium {
    padding: 1.5rem;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    min-height: 100vh;
    justify-content: center;
  }

  .time-premium {
    font-size: clamp(3rem, 8vw, 4.5rem) !important;
    padding: clamp(0.4em, 2vw, 0.6em) clamp(0.6em, 3vw, 1em);
  }

  .timer-premium {
    gap: clamp(1.5rem, 4vw, 2.5rem);
  }

  .button-group-premium {
    gap: clamp(1rem, 3vw, 1.8rem);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 100%;
  }

  .control-btn-premium {
    min-width: clamp(110px, 22vw, 140px);
    height: clamp(50px, 10vw, 60px);
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  }

  .quote-container {
    max-width: 85vw;
    padding: clamp(1rem, 3vw, 1.5rem);
    margin: 1.5rem auto 2rem auto;
  }

  .settings-panel {
    width: clamp(320px, 50vw, 420px);
    right: 0.5rem;
    top: 0.5rem;
    height: calc(100vh - 1rem);
  }

  /* Enhanced lap section for tablet */
  #lapsContainer {
    max-width: 85vw;
    margin: clamp(1rem, 3vw, 2rem) auto;
  }

  .laps-card {
    border-radius: clamp(1.2rem, 3vw, 1.8rem);
  }

  /* FAB positioning for tablets */
  .fab-group {
    bottom: 1.5rem;
    right: 1.2rem;
  }

  /* Tablet landscape optimization */
  @media (orientation: landscape) {
    .main-premium {
      padding: 1rem 2rem;
      gap: 1.5rem;
    }

    .navbar-premium {
      top: 1rem;
      left: 1rem;
      z-index: 100;
    }

    .time-premium {
      font-size: clamp(2.5rem, 6vw, 3.5rem) !important;
    }

    .quote-container {
      max-width: 70vw;
    }
  }
}

/* Specific optimization for 682x915 and similar portrait tablets */
@media (min-width: 650px) and (max-width: 750px) and (orientation: portrait) {
  .main-premium {
    padding: 2rem 1.5rem;
    gap: 2rem;
  }

  .time-premium {
    font-size: 4rem !important;
  }

  .button-group-premium {
    gap: 1.5rem;
    max-width: 90%;
  }

  .control-btn-premium {
    min-width: 120px;
    height: 55px;
  }

  .quote-container {
    max-width: 85vw;
    padding: 1.5rem;
  }

  #lapsContainer {
    max-width: 80vw;
  }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }

  .time-premium {
    font-size: 5rem !important;
  }

  .navbar-premium {
    top: 2rem;
    left: 2rem;
    padding: 1.2rem 2rem;
  }

  .timer-premium {
    gap: 2.5rem;
  }

  .button-group-premium {
    gap: 1.5rem;
  }

  .settings-panel {
    width: 420px;
  }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
  :root {
    --container-padding: 2.5rem;
  }

  .time-premium {
    font-size: 6rem !important;
  }

  /* Desktop specific hover effects */
  .control-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 166, 255, 0.25);
  }

  .fab-btn:hover {
    transform: scale(1.1);
  }

  /* Enhanced desktop layout */
  .main-premium {
    max-width: 1400px !important;
    margin: 0 auto;
  }

  /* Desktop width expansions for key components - FORCE EXPANSION */
  .timer-premium {
    max-width: 1200px !important;
  }

  .laps-card {
    max-width: 1000px !important;
  }

  .quote-container {
    max-width: 1000px !important;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1441px) {
  .time-premium {
    font-size: 7rem !important;
  }

  .timer-premium {
    gap: 3rem;
    max-width: 1300px !important;
  }

  .navbar-premium {
    top: 3rem;
    left: 3rem;
  }

  .laps-card {
    max-width: 1100px !important;
  }

  .quote-container {
    max-width: 1100px !important;
  }
}

/* Ultra-wide Desktop (1920px+) */
@media (min-width: 1921px) {
  .main-premium {
    max-width: 1800px !important;
  }

  .time-premium {
    font-size: 8rem !important;
  }

  .timer-premium {
    max-width: 1500px !important;
  }

  .laps-card {
    max-width: 1300px !important;
  }

  .quote-container {
    max-width: 1300px !important;
  }
}

/* Additional Mobile Enhancements */
@media (max-width: 480px) {
  .theme-selector,
  .toggle-group {
    flex-direction: column;
    gap: 0.8rem;
  }
  .theme-option,
  .custom-toggle {
    min-width: auto;
  }

  .install-btn,
  .install-btn-navbar {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }

  .update-notification {
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  /* Mobile-specific settings panel */
  .settings-panel {
    width: calc(100vw - 2rem);
    max-width: 350px;
    right: 1rem;
  }

  .background-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-presets {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Ultra-Small Mobile (320px and below) - Critical for older devices */
@media (max-width: 320px) {
  .navbar-premium {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.5rem 0.75rem;
    min-width: 160px;
    max-width: calc(100vw - 1.5rem);
  }

  .navbar-title {
    font-size: 1rem;
  }

  .main-premium {
    padding-top: 1.5rem;
  }

  .time-premium {
    font-size: clamp(1.8rem, 16vw, 3.5rem) !important;
    padding: 0.2em 0.4em;
    min-width: 100px;
  }

  .quote-container {
    margin: 0 auto 0.8rem auto;
    padding: 0 0.25rem;
  }

  .quote-text {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .button-group-premium {
    gap: 0.5rem;
  }

  .control-btn-premium {
    min-width: 100px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }

  .fab-group {
    bottom: 0.75rem;
    right: 0.75rem;
    gap: 0.4rem;
  }

  .fab-btn {
    width: 44px;
    height: 44px;
  }

  /* Ensure settings panel takes full screen on very small devices */
  .settings-panel {
    width: 100vw !important;
    height: 90vh !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
  }
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .time-premium.running {
    animation: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(0, 0, 0, 0.9);
    --glass-border: rgba(255, 255, 255, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --accent-color: #ffffff;
  }

  .time-premium,
  .control-btn-premium,
  .fab-btn {
    border: 2px solid #ffffff !important;
  }
}

/* Focus Management for Accessibility */
:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .fab-group,
  .settings-panel,
  .navbar-premium {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .time-premium {
    color: black !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* =================================
   TAILWIND-COMPATIBLE STYLES
   ================================= */

/* Essential utility classes */

/* .hidden utility: do NOT use display:none for lap section, only for others */
.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s;
}

.visible {
  display: block !important;
}

/* Ensure settings panel is hidden by default */
.settings-panel:not(.show) {
  transform: translateX(100%) !important;
}

@media (max-width: 768px) {
  .settings-panel {
    border-radius: 1.5rem 1.5rem 0 0;
    height: min(88vh, calc(100vh - env(safe-area-inset-top) - 1rem));
    z-index: calc(var(--z-modal) + 20);
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  }
  .settings-panel.show {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (min-width: 769px) {
  .settings-panel {
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
    width: clamp(360px, 35vw, 480px);
    max-width: 90vw;
    border-radius: 3rem 0 0 3rem;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  }
  .settings-panel.show {
    transform: translateX(0);
    opacity: 1;
  }
}
#lapsContainer {
  transition: opacity 0.4s ease-in-out, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#lapsContainer.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  /* DO NOT set display:none here, so transitions work and desktop always shows when needed */
}

#lapsContainer:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  max-height: none;
}

/* Loading states */
.loading-quote {
  opacity: 0.6;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

/* Custom scrollbar for laps list */
.scrollbar-thin {
  scrollbar-width: thin;
}

.scrollbar-track-white\/5::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.scrollbar-thumb-white\/20::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.scrollbar-thumb-white\/20::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Smooth animations for lap items */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in {
  animation: slideInUp 0.3s ease-out;
}

/* ======= ULTRA-RESPONSIVE MOBILE-FIRST ENHANCEMENTS ======= */

/* Extra small devices (280px - 359px) */
@media (max-width: 359px) {
  .main-premium {
    padding: 1rem 0.75rem;
    min-height: 100vh;
  }

  .timer-premium {
    gap: 1rem;
  }

  .time-premium {
    font-size: 2.5rem !important;
    line-height: 1;
  }

  .quote-container {
    padding: 0.75rem;
    margin: 0.5rem 0;
    min-height: 80px;
  }

  .quote-text {
    font-size: 0.8rem !important;
    line-height: 1.3;
  }

  .quote-author {
    font-size: 0.7rem !important;
  }

  .button-group-premium {
    gap: 0.75rem;
    flex-direction: column;
  }

  .control-btn-premium {
    min-width: 100px !important;
    height: 48px !important;
    font-size: 0.85rem !important;
  }

  .fab-group {
    bottom: 1rem !important;
    right: 1rem !important;
    gap: 0.5rem !important;
  }

  .fab-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.2rem !important;
  }

  .fab-tooltip {
    display: none !important;
  }

  /* Ensure touch targets are adequate */
  .fab-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .settings-panel {
    width: 100vw !important;
    height: 90vh !important;
    border-radius: 1rem 1rem 0 0 !important;
  }

  .share-modal-enhanced {
    width: 90vw !important;
    min-width: 260px !important;
    border-radius: 1rem !important;
  }
}

/* Small devices (360px - 479px) */
@media (min-width: 360px) and (max-width: 479px) {
  .main-premium {
    padding: 1.25rem 1rem;
  }

  .time-premium {
    font-size: 3rem !important;
  }

  .quote-container {
    padding: 1rem;
    min-height: 90px;
  }

  .quote-text {
    font-size: 0.9rem !important;
  }

  .control-btn-premium {
    min-width: 110px !important;
    height: 52px !important;
  }
}

/* Medium devices (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .main-premium {
    padding: 1.5rem;
  }

  .timer-premium {
    gap: 1.5rem;
  }

  .quote-container {
    padding: 1.25rem;
    min-height: 100px;
  }

  .button-group-premium {
    flex-direction: row;
    gap: 1rem;
  }

  .settings-panel {
    width: 85vw !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
  }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
  .main-premium {
    padding: 1rem !important;
  }

  .timer-premium {
    gap: 1rem !important;
  }

  .time-premium {
    font-size: 2.5rem !important;
  }

  .quote-container {
    min-height: 60px !important;
    padding: 0.75rem !important;
    margin: 0.5rem 0 !important;
  }

  .quote-text {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
  }

  .button-group-premium {
    gap: 1rem !important;
  }

  .control-btn-premium {
    height: 44px !important;
    font-size: 0.9rem !important;
  }

  .fab-group {
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .fab-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.1rem !important;
  }

  .fab-tooltip {
    display: none !important;
  }
}

/* Touch interaction improvements */
@media (hover: none) and (pointer: coarse) {
  .fab-btn {
    min-width: 48px;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .fab-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .control-btn-premium {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .control-btn-premium:active {
    transform: scale(0.95);
  }

  /* Hide tooltips on touch devices */
  .fab-tooltip {
    display: none !important;
  }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .time-premium,
  .quote-text,
  .quote-author {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .control-btn-premium,
  .fab-btn,
  .settings-panel,
  .share-modal-enhanced {
    transform: translateZ(0);
    will-change: transform;
  }
}

/* Modal management */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Accessibility and reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === DESKTOP RESPONSIVE OVERRIDES === */
@media (min-width: 1024px) {
  .main-premium { max-width: 1400px; }
  .timer-premium { max-width: 1200px; }
  .laps-card { max-width: 1000px; }
  .button-group-premium { max-width: 600px; }
}

@media (min-width: 1440px) {
  .main-premium { max-width: 1600px; }
  .timer-premium { max-width: 1300px; }
  .laps-card { max-width: 1100px; }
}

@media (min-width: 1920px) {
  .main-premium { max-width: 1800px; }
  .timer-premium { max-width: 1500px; }
  .laps-card { max-width: 1300px; }
}
