:root {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --accent-color: #38bdf8;
  --alarm-bg: #ef4444;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background-color 0.5s ease;
}

.container {
  text-align: center;
  z-index: 10;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 300;
  opacity: 0.8;
}

.clock {
  font-size: 6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
  margin-bottom: 2rem;
}

.status {
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 2rem;
}

.controls {
  margin-top: 2rem;
}

button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

/* Alarm State */
body.alarm-active {
  background-color: #000;
  animation: pulse-bg 2s infinite;
}

.alarm-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

body.alarm-active .alarm-container {
  display: flex;
}

.alarm-image {
  max-width: 90%;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both infinite;
  object-fit: contain;
}

.alarm-message {
  font-size: 3rem;
  font-weight: 900;
  color: #ef4444;
  margin-top: 2rem;
  text-transform: uppercase;
  animation: blink 0.5s infinite;
  text-align: center;
}

.stop-btn {
  margin-top: 2rem;
  background-color: #ef4444;
  border: none;
  font-weight: bold;
  font-size: 1.5rem;
  padding: 16px 48px;
}

.stop-btn:hover {
  background-color: #dc2626;
}

@keyframes pulse-bg {
  0% { background-color: #000; }
  50% { background-color: #1a0505; }
  100% { background-color: #000; }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
