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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }

/* Ad slots */
.ad-slot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.ad-placeholder {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  color: var(--text-muted);
  font-size: 0.85rem;
  height: 90px;
  border-radius: 8px;
  margin: 16px auto;
  max-width: 728px;
}
.ad-live { border: none; background: transparent; }

@media (max-width: 768px) {
  .ad-placeholder { max-width: 320px; height: 50px; }
}

/* Hero */
.hero {
  background: var(--gradient);
  color: white;
  padding: 48px 0 36px;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Calculator card */
.calc-card {
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  margin-top: -24px;
  position: relative;
  z-index: 2;
}

.calc-input label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.input-row input[type="date"],
.input-row input[type="time"] {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.input-row input[type="date"]:focus,
.input-row input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }

.time-toggle {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.time-toggle input { margin-right: 6px; }
.time-input {
  margin-top: 12px;
  padding: 16px;
  background: #f1f5f9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.time-input label { font-size: 0.9rem; margin-bottom: 0; }
.time-input input[type="time"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.time-input .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Result */
.result-block { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); }
.hidden { display: none !important; }

.age-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.age-big > span:first-child { font-size: 4rem; font-weight: 800; color: var(--primary); }
.age-big > span:nth-child(3) { font-size: 3rem; font-weight: 700; color: var(--text); }
.age-big > span:nth-child(5) { font-size: 2.5rem; font-weight: 600; color: var(--text-muted); }
.age-unit {
  font-size: 1.2rem !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.stat-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 4px;
  word-break: break-word;
}
.stat-label {
  font-size: 0.8rem;
  color: #0369a1;
  opacity: 0.8;
  font-weight: 500;
}

/* Countdown */
.countdown-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 36px 0;
  text-align: center;
}
.countdown-section h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #92400e;
}
.countdown-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cd-cell {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 80px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}
.cd-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #92400e;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.countdown-date {
  margin-top: 16px;
  color: #92400e;
  font-weight: 500;
}

/* Fun stats */
.fun-stats-section { padding: 48px 0; }
.fun-stats-section h2 { text-align: center; margin-bottom: 28px; font-size: 1.8rem; }
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.fun-card {
  background: var(--card);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fun-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgb(0 0 0 / 0.1);
}
.fun-icon { font-size: 2.5rem; margin-bottom: 10px; }
.fun-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.fun-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Date diff */
.datediff-section { padding: 48px 0; background: #f1f5f9; }
.datediff-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 24px; }
.datediff-section .calc-card { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > div { display: flex; flex-direction: column; gap: 6px; }
.two-col input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}
#diff-btn { margin-top: 16px; width: 100%; }

.diff-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.diff-main {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
}
.diff-label {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 500;
}
.diff-detail {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* FAQ */
.faq-section { padding: 48px 0; }
.faq-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 28px; }
.faq-grid {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 40px 0 24px;
  margin-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}
.footer-brand .logo { color: white; font-size: 1.2rem; }
.footer-tag { font-size: 0.9rem; margin-top: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: white; }
.copyright {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid #334155;
  font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .subtitle { font-size: 1rem; }
  .calc-card { padding: 20px; margin-top: -16px; }
  .age-big > span:first-child { font-size: 2.8rem; }
  .age-big > span:nth-child(3) { font-size: 2rem; }
  .age-big > span:nth-child(5) { font-size: 1.8rem; }
  .age-unit { font-size: 1rem !important; }
  .result-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 8px; }
  .stat-value { font-size: 1.1rem; }
  .countdown-section h2, .fun-stats-section h2, .datediff-section h2, .faq-section h2 { font-size: 1.4rem; }
  .cd-cell { padding: 12px 14px; min-width: 65px; }
  .cd-num { font-size: 1.6rem; }
  .two-col { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { text-align: center; flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .nav-links { display: none; }
}
