:root {
  --coral: #ff6f61;
  --rose: #ff4d6d;
  --magenta: #c9184a;
  --plum: #6a0572;
  --cream: #fff5eb;
  --gold: #ffd166;
  --pink: #ff9ab8;
  --ink-soft: rgba(255, 245, 235, 0.78);
  --ink-faint: rgba(255, 245, 235, 0.5);
  --display: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --script: "Caveat", cursive;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--display);
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(125deg, var(--coral), var(--rose), var(--magenta), var(--plum), var(--magenta), var(--rose), var(--coral));
  background-size: 400% 400%;
  animation: sunset 22s ease-in-out infinite;
}

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

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.hearts-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -10vh;
  opacity: 0;
  animation-name: float-up;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

@keyframes float-up {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.85; }
  85% { opacity: 0.55; }
  100% { transform: translate(var(--drift, 30px), -115vh) rotate(25deg); opacity: 0; }
}

.burst-heart {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  animation: burst-out 0.75s cubic-bezier(.19,1,.22,1) forwards;
}

@keyframes burst-out {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--bx, 0px), var(--by, -60px)) scale(1); opacity: 0; }
}

#app {
  position: relative;
  z-index: 2;
  height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 7vw;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  max-width: 440px;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1.1s cubic-bezier(.19,1,.22,1) 0.15s forwards;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.flags-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
}

.flag {
  width: 46px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.35);
  animation: flutter 4.5s ease-in-out infinite;
  transform-origin: left center;
}

.flag-fi { animation-delay: -1.3s; transform-origin: right center; }

@keyframes flutter {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  25% { transform: rotate(1.5deg) scaleY(0.98); }
  50% { transform: rotate(-1deg) scaleY(1.01); }
  75% { transform: rotate(1deg) scaleY(0.99); }
}

.flag-fr { display: flex; }
.flag-fr span { flex: 1; }
.flag-fr span:nth-child(1) { background: #0055a4; }
.flag-fr span:nth-child(2) { background: #ffffff; }
.flag-fr span:nth-child(3) { background: #ef4135; }

.flag-fi { position: relative; background: #ffffff; }
.flag-fi .bar-v {
  position: absolute;
  left: 30%;
  top: 0;
  width: 18%;
  height: 100%;
  background: #003580;
}
.flag-fi .bar-h {
  position: absolute;
  top: 40%;
  left: 0;
  width: 100%;
  height: 20%;
  background: #003580;
}

.heart-pulse {
  color: var(--gold);
  animation: heartbeat 1.15s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.6));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.22); }
  28% { transform: scale(0.96); }
  42% { transform: scale(1.14); }
  70% { transform: scale(1); }
}

.headline {
  font-family: var(--script);
  font-weight: 600;
  font-size: clamp(26px, 8vw, 34px);
  line-height: 1.25;
  color: var(--cream);
  margin: 0 0 30px;
  max-width: 22ch;
  text-shadow: 0 4px 18px rgba(106, 5, 114, 0.4);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 34px;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 14px 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.num {
  font-family: var(--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 3px 10px rgba(106, 5, 114, 0.35);
  display: inline-block;
}

.num.is-pop { animation: pop 0.45s cubic-bezier(.34,1.56,.64,1); }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(-4deg); color: var(--gold); }
  100% { transform: scale(1); }
}

.label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.phrase {
  font-family: var(--script);
  font-weight: 600;
  font-size: clamp(20px, 5.6vw, 25px);
  line-height: 1.5;
  color: var(--cream);
  margin: 0;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.phrase.is-swapping { opacity: 0; }

.phrase-hint {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 10px 0 0;
  opacity: 0.6;
  animation: pulse-hint 2.6s ease-in-out infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-2px); }
}
