: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', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 10px;
  transition: background 0.3s, color 0.3s;
  /* 中央揃えの設定 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
}

main {
  width: 100%;
  max-width: 500px;
}

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

form, #countdown, #specialUI {
  background: var(--input-bg);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

#time {
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

label {
  display: block;
  margin: 1rem 0 0.2rem;
  font-weight: bold;
}

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

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

#yearInput {
  margin-top: 0.5rem;
}

#withAgeContainer {
  display: flex;
  align-items: center;
  cursor: pointer;
}

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

button, #importLabel {
  padding: 0.6rem 1.2rem;
  margin: 0.3rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: opacity 0.2s;
}

button:hover, #importLabel: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;
}

/* 🎊 花吹雪エフェクトの強化 */
body.birthday::before,
body.birthday::after {
  content: "🎊🎉🌸🎈✨🎂🎁🌟";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  font-size: 2.5rem;
  white-space: nowrap;
  animation: confetti 6s linear infinite;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

body.birthday::after {
  animation-delay: 3s;
  animation-duration: 7s;
  left: -5%;
}

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

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

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

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