:root {
  --bg: #f3f4f6;
  --text: #111;
  --button-bg: #e0e0e0;
  --shadow-light: #ffffff;
  --shadow-dark: #bebebe;
  --radius: 12px;
  --font: 'Helvetica Neue', sans-serif;
}

body.dark {
  --bg: #1e1e2f;
  --text: #eee;
  --button-bg: #2d2d3c;
  --shadow-light: #2f2f42;
  --shadow-dark: #121212;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 10px;
  transition: background-color 0.3s, color 0.3s;
}

.main-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
  max-width: 420px;
}

.theme-toggle {
  background: var(--button-bg);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2em;
  margin-bottom: 10px;
  box-shadow: 4px 4px 8px var(--shadow-dark),
              -4px -4px 8px var(--shadow-light);
  color: var(--text);
}

.widget-box {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 6px 6px 12px var(--shadow-dark),
              -6px -6px 12px var(--shadow-light);
  padding: 30px 40px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

#timer-display {
  font-size: 2.5em;
  font-weight: bold;
}

#milliseconds {
  font-size: 0.5em;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.button-group button {
  flex: 1 1 140px;
  padding: 16px 20px;
  font-size: 1.1em;
  background: var(--button-bg);
  border: none;
  border-radius: var(--radius);
  box-shadow: 5px 5px 10px var(--shadow-dark),
              -5px -5px 10px var(--shadow-light);
  transition: all 0.2s ease;
  cursor: pointer;
  color: var(--text);
}

.button-group button:hover {
  box-shadow: inset 5px 5px 10px var(--shadow-dark),
              inset -5px -5px 10px var(--shadow-light);
}

.datetime-widget {
  font-size: 0.95em;
  padding: 15px 20px;
  border-radius: var(--radius);
  box-shadow: 3px 3px 8px var(--shadow-dark),
              -3px -3px 8px var(--shadow-light);
  width: 100%;
  background: var(--bg);
  box-sizing: border-box;
  text-align: center;
}

/* 🔁 Responsive: Adjust for small devices */
@media screen and (max-width: 500px) {
  #timer-display {
    font-size: 2em;
  }

  .button-group button {
    flex: 1 1 100%;
    padding: 14px;
    font-size: 1em;
  }

  .theme-toggle {
    font-size: 1em;
  }
}
body.dark .button-group button,
body.dark .theme-toggle {
  color: #f1f1f1;
}
body.dark .button-group button:hover {
  box-shadow: inset 3px 3px 6px #111111,
              inset -3px -3px 6px #2f2f42;
}
