* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  overflow: hidden;
  transition: background 0.3s ease;
}

body.dark {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.top-container {
  position: relative;
  align-items: center;
  justify-content: center;
  display: none;
}

.header {
  font-size: 0.3em;
  width: 100%;
}
.header2 {
  font-size: 0.2em;
  width: 100%;
}
.paragraph {
  font-size: 0.1em;
  width: 100%;
}

.container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.controls {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  gap: 1rem;
}

.theme-toggle,
.time-format-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  letter-spacing: 0.05em;
}

.theme-toggle:hover,
.time-format-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

body.dark .theme-toggle,
body.dark .time-format-toggle {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

body.dark .theme-toggle:hover,
body.dark .time-format-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
}

.clock-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock {
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-direction: row;
}

.time-group {
  display: flex;
}

.digit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1ch;
  font-size: clamp(3rem, 12vw, 15rem);
  font-weight: 900;
  color: #4a5568;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.dark .digit {
  color: #e2e8f0;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.ampm {
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 900;
  color: #4a5568;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  display: none;
  text-align: center;
  margin-bottom: 1rem;
}

body.dark .ampm {
  color: #e2e8f0;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.separator {
  margin: 0 0;
  font-size: clamp(3rem, 12vw, 15rem);
  color: #4a5568;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.dark .separator {
  color: #e2e8f0;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}


.clock {
  font-size: clamp(3rem, 12vw, 15rem);
  color: #4a5568;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  white-space: nowrap;
}

.date-wrapper {
  margin-top: 2rem;
  text-align: center;
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

#date {
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 900;
  color: #4a5568;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

#day {
  font-size: clamp(1.2rem, 3vw, 2.5rem);
  font-weight: 800;
  color: #6b7280;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-family: "Orbitron", "Roboto Mono", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.dark #date {
  color: #e2e8f0;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

body.dark #day {
  color: #94a3b8;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .controls {
    top: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }

  .theme-toggle,
  .time-format-toggle {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .digit {
    letter-spacing: 0.02em;
  }

  .date-line {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  .controls {
    flex-direction: column;
    gap: 0.3rem;
    top: 0.5rem;
    right: 0.5rem;
  }

  .theme-toggle,
  .time-format-toggle {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .clock {
    flex-direction: column;
    gap: 1rem;
  }

  .time-group {
    display: flex;
    justify-content: center;
  }

  .separator {
    display: none;
  }

  .ampm {
    position: static;
    font-size: clamp(1.2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
    transform: none;
  }

  .digit {
    letter-spacing: 0;
    font-size: clamp(4rem, 25vw, 12rem);
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .digit {
    font-size: clamp(2rem, 8vh, 8rem);
  }

  .clock {
    font-size: clamp(2rem, 8vh, 8rem);
  }
}
