:root {
  --bg-color: #ffffff;
  --text-color: #222222;
  --accent: #ff4081;
  --input-bg: #f0f0f0;
  --border: #cccccc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1e1e1e;
    --text-color: #ffffff;
    --accent: #ff80ab;
    --input-bg: #2c2c2c;
    --border: #444444;
  }
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 1rem;
  transition: background 0.3s, color 0.3s;
}

main {
  max-width: 600px;
  margin: auto;
}

h1, h2, h3 {
  text-align: center;
  color: var(--accent);
}

form, #countdown, #specialUI {
  background: var(--input-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 1rem;
}

label {
  display: block;
  margin: 1rem 0 0.2rem;
}

input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

.buttons {
  margin-top: 1.5rem;
  text-align: center;
}

button {
  padding: 0.6rem 1.2rem;
  margin: 0.3rem;
  border: none;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  opacity: 0.85;
}

.hidden {
  display: none;
}

.celebration {
  font-size: 1.4rem;
  text-align: center;
  padding: 1rem;
  animation: pop 1s ease-in-out infinite alternate;
}

@keyframes pop {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

/* 🎊 花吹雪アニメーション */
body.birthday::before {
  content: "🎊🎉🌸🎈✨🎂🎁🎉🌟";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: confetti 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 9999;
}

@keyframes confetti {
  0% {
    transform: translateX(-50%) translateY(-100%) rotate(0deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(40vh) rotate(180deg);
  }
  100% {
    transform: translateX(-50%) translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  button {
    width: 100%;
    margin: 0.3rem 0;
  }

  input[type="number"] {
    font-size: 1rem;
  }
}
