/* Satoshi font from Fontshare */
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap");

:root {
  --bg: #f7f7f9;
  --text: #0f1217;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --accent: #e11d48; /* festive but minimal */
  --ring: rgba(225, 29, 72, 0.15);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Satoshi', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page transitions */
main, .day-page {
  transition: opacity 180ms ease, transform 180ms ease;
}
body:not(.loaded) main,
body:not(.loaded) .day-page {
  opacity: 0;
  transform: translateY(6px);
}
body.exiting main,
body.exiting .day-page {
  opacity: 0;
  transform: translateY(6px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 24px;
}
.title {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 32px;
}
.subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-weight: 500;
}

main { padding: 0 20px 40px; }
.calendar {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 16px;
  position: relative;
}

.calendar-mask {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--mask-top, 0px);
  bottom: 0;
  z-index: 5;
  backdrop-filter: blur(4px) saturate(110%);
  background: linear-gradient(180deg, rgba(255,215,0,0.14), rgba(255,215,0,0.08));
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.calendar-mask .mask-message {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #c99700, #ffd24a, #ffeaa6, #c99700);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer 2.8s linear infinite, rise 4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes rise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.day {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  position: relative;
}
.day:hover { transform: translateY(-1px); }
.day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px var(--ring);
}

.day.locked {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.45;
  filter: grayscale(30%);
  border-color: var(--border);
  box-shadow: none;
}
.day.locked:hover {
  transform: none;
}
.day.unlocked:hover {
  border-color: var(--accent);
}
.day.unlocked:active { transform: translateY(0); }

/* Today highlight */
.day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18), 0 10px 30px rgba(15, 18, 23, 0.12);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.14), 0 8px 24px rgba(15, 18, 23, 0.10); }
  50% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.28), 0 14px 40px rgba(15, 18, 23, 0.16); }
}

.day .badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  color: var(--muted);
}

/* Day contents */
.day .num {
  z-index: 1;
}
.day .icon {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
  color: var(--accent); /* uniform icon color */
}

/* Welcome Card (Day 1) */
.welcome-card {
  display: grid;
  gap: 18px;
}
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
}
.countdown-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 12px;
}
.countdown-item {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.countdown-item .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.countdown-item .label {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.typing-wrap {
  text-align: center;
}
.typing {
  margin: 0;
  font-size: 20px;
  line-height: 1.7;
}
.typing::after {
  content: '▍';
  display: inline-block;
  margin-left: 6px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
  color: var(--muted);
}
.site-footer code {
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
}
.modal[aria-hidden="false"] { display: grid; }
.modal {
  place-items: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 23, 0.4);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 18, 23, 0.12);
}
.modal-content { padding: 28px 28px 32px; }
.modal-day {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--muted);
}
.modal-message {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  appearance: none;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

@media (max-width: 700px) {
  .calendar { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 520px) {
  .calendar { grid-template-columns: repeat(3, 1fr); }
}

/* Mini-jeu Jour 1: bouton fuyant */
 .baby-game {
  display: grid;
  gap: 16px;
}
.baby-text {
  margin: 0;
  font-weight: 500;
}
.game-area {
  position: relative;
  height: 220px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.baby-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  position: absolute;
  transition: none;
}
.baby-btn:disabled {
  opacity: 1; /* garder l’apparence normale */
  cursor: pointer; /* taquin: semble cliquable, mais ne l’est pas */
}
.baby-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px var(--ring);
}
