:root {
  --bg-light: #f5f5f5;
  --text-light: #333;
  --card-light: #fff;
  --bg-dark: #1f2023;
  --text-dark: #fff;
  --card-dark: #2a2c31;
  --input-bg: #fff;
  --input-text: #000;
  --accent: #4a90e2;
}

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

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  transition: background .3s, color .3s;
}

html.theme-dark,
html.theme-dark body {
  background: var(--bg-dark);
  color: var(--text-dark);
}

html.theme-light,
html.theme-light body {
  background: var(--bg-light);
  color: var(--text-light);
}

.app-brand {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.app-icon {
  width: 48px;
  height: 48px;
  transition: filter .3s;
}

html.theme-dark .app-icon {
  filter: invert(1) brightness(1.2);
}

.app-brand-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: inherit;
}

#root {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 1rem;
}

.card {
  background: var(--card-light);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  transition: background .3s, box-shadow .3s;
}

html.theme-dark .card {
  background: var(--card-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

html.theme-dark .card,
html.theme-dark .card * {
  color: var(--text-dark);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.75rem;
  letter-spacing: 1px;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .3rem;
  border-radius: 6px;
}

.theme-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

html.theme-dark .theme-icon {
  filter: invert(1) brightness(1.2);
}

label {
  display: block;
  text-align: left;
  margin-bottom: .5rem;
  font-weight: 500;
}

input[type="time"],
input[type="number"] {
  width: 100%;
  padding: .5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--input-text);
  transition: border-color .2s, background .3s, color .3s;
}

html.theme-dark input[type="time"],
html.theme-dark input[type="number"] {
  background: var(--input-bg);
  color: var(--input-text);
}

input[type="time"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.output p {
  font-size: 1.125rem;
  margin-top: 1rem;
}

.output strong {
  font-weight: bold;
  color: var(--text-light);
}

html.theme-dark .output strong {
  color: var(--text-dark);
}

.credits {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .8rem;
  opacity: .7;
}

.credits-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: inherit;
  text-decoration: none;
  justify-content: center;
}

.github-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

html.theme-dark .github-icon {
  filter: invert(1) brightness(1.2);
}

@keyframes spin-once {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

.spin-once {
  animation: spin-once .8s ease-out;
}
