/* =========================================================
   ♡ LOVE TESTER 2000 — Y2K Design System
   ========================================================= */

:root {
  /* — Palette — */
  --pink:        #ff4fa3;
  --pink-hot:    #ff1e8e;
  --pink-soft:   #ffb6d9;
  --pink-pale:   #ffe4f1;
  --lilac:       #b794ff;
  --blue:        #66d9ff;
  --blue-deep:   #2a6bff;
  --lime:        #c4ff4d;
  --cream:       #fff6fb;
  --ink:         #2a0f33;
  --ink-soft:    #6b3a6e;
  --chrome-1:    #ffffff;
  --chrome-2:    #d9e6ff;
  --chrome-3:    #9fb8e8;

  /* — Tokens — */
  --radius:      22px;
  --radius-sm:   12px;
  --shadow-pop:  0 12px 0 rgba(42,15,51,.18), 0 22px 45px rgba(255,30,142,.28);
  --shadow-soft: 0 10px 30px rgba(120,40,120,.22);
  --border:      3px solid var(--ink);
  --ease:        cubic-bezier(.22,1,.36,1);

  --font-display: "Press Start 2P", system-ui, sans-serif;
  --font-pixel:   "VT323", monospace;
  --font-body:    "Fredoka", system-ui, sans-serif;
  --font-script:  "Pacifico", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, #ffd1ea 0%, #ffc0e6 22%, #d7c2ff 60%, #bfe0ff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ctext y='22' font-size='22'%3E%E2%9C%A8%3C/text%3E%3C/svg%3E") 4 4, auto;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   FOND DÉCORATIF
   ========================================================= */
.bg-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.bg-art {
  position: absolute; inset: -8%;
  background: url("assets/artwork.jpg") center/cover no-repeat;
  filter: saturate(1.1) blur(3px) brightness(1.05);
  opacity: .22;
  mix-blend-mode: luminosity;
  transform: scale(1.08);
}

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
          mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
  opacity: .5;
}

.bg-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(42,15,51,.05) 0 2px, transparent 2px 4px);
  opacity: .5;
}

.stars { position: absolute; inset: 0; }
.stars i {
  position: absolute;
  color: #fff;
  font-size: var(--s, 14px);
  text-shadow: 0 0 8px var(--pink-soft);
  animation: twinkle var(--d,3s) ease-in-out infinite alternate;
  opacity: .9;
}
@keyframes twinkle { from { transform: scale(.5) rotate(0deg); opacity: .25; } to { transform: scale(1) rotate(25deg); opacity: 1; } }

/* curseur coeur qui suit la souris */
.cursor-heart {
  position: fixed; top: 0; left: 0; z-index: 9999;
  font-size: 16px; color: var(--pink-hot);
  transform: translate(-50%,-50%);
  pointer-events: none; opacity: 0;
  transition: opacity .3s;
  text-shadow: 0 0 6px #fff;
}

/* =========================================================
   CADRE PRINCIPAL / FENÊTRE
   ========================================================= */
.frame {
  position: relative; z-index: 2;
  width: min(560px, 94vw);
  margin: clamp(16px, 4vh, 48px) auto;
  display: flex; flex-direction: column;
  align-items: stretch;
}

.titlebar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
  border: var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 9px 14px;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 19px;
  letter-spacing: .5px;
  text-shadow: 1px 1px 0 rgba(0,0,0,.35);
}
.titlebar-dots { display: flex; gap: 6px; }
.titlebar-dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(0,0,0,.4); display: block; }
.titlebar-dots i:nth-child(1){ background: #ff6b6b; }
.titlebar-dots i:nth-child(2){ background: #ffd93d; }
.titlebar-dots i:nth-child(3){ background: #6bff95; }
.titlebar-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar-clock { font-variant-numeric: tabular-nums; opacity: .9; }

.window {
  position: relative;
  background:
    linear-gradient(180deg, var(--cream), #fff);
  border: var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-pop);
  padding: clamp(18px, 4vw, 30px);
  overflow: hidden;
  min-height: 440px;
}
.window::before {
  /* reflet glossy haut */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,.65), transparent);
  pointer-events: none;
}

/* =========================================================
   GESTION DES ÉCRANS
   ========================================================= */
.screen { display: none; position: relative; z-index: 1; animation: screenIn .5s var(--ease) both; }
.screen.is-active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee {
  margin: -6px -14px 18px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-pixel);
  font-size: 17px;
  letter-spacing: 1px;
  border: 2px solid var(--pink-hot);
  box-shadow: inset 0 0 12px rgba(196,255,77,.4);
}
.marquee-track { display: flex; width: max-content; animation: marquee 16s linear infinite; }
.marquee-track span { padding: 7px 0; white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================
   HERO
   ========================================================= */
.hero { text-align: center; margin-bottom: 18px; }
.hero-kicker {
  display: inline-block; margin: 0 0 12px;
  font-family: var(--font-pixel); font-size: 22px;
  color: var(--pink-hot);
  background: #fff;
  padding: 3px 16px; border-radius: 999px;
  border: 2px solid var(--pink-hot);
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--pink-soft);
}
.hero-title { margin: 4px 0; line-height: 1; }
.hero-title .line {
  display: block;
  font-family: var(--font-display);
  -webkit-text-stroke: 2px var(--ink);
  letter-spacing: 0;
}
.hero-title .line-1 { font-size: clamp(18px, 5.2vw, 26px); color: var(--blue); transform: rotate(-1deg); }
.hero-title .line-2 {
  font-size: clamp(19px, 6.2vw, 31px);
  color: var(--pink-hot);
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 var(--lilac);
  transform: rotate(1deg);
  margin-top: 8px;
}
.hero-sub { font-size: 17px; color: var(--ink-soft); margin: 14px 4px 0; font-weight: 500; }
.hero-sub em { color: var(--pink-hot); font-style: italic; font-weight: 600; }

/* =========================================================
   FORMULAIRE
   ========================================================= */
.love-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--font-pixel);
  font-size: 18px; letter-spacing: 1px;
  color: var(--ink); padding-left: 8px;
}
.field input {
  font-family: var(--font-body);
  font-size: 20px; font-weight: 600;
  padding: 14px 18px;
  border: var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 3px 8px rgba(183,148,255,.18), 4px 4px 0 var(--pink-soft);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  outline: none;
}
.field input::placeholder { color: #c9a9cf; font-weight: 500; }
.field input:focus {
  border-color: var(--pink-hot);
  box-shadow: inset 0 3px 8px rgba(255,30,142,.18), 4px 4px 0 var(--pink-hot);
  transform: translateY(-2px);
}

.heart-divider { display: flex; justify-content: center; align-items: center; height: 6px; }
.hd-plus {
  font-family: var(--font-display);
  font-size: 22px; color: #fff;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--pink-soft), var(--pink-hot));
  border: var(--border); border-radius: 50%;
  box-shadow: var(--shadow-soft);
  transform: rotate(0deg);
  animation: beat 1.4s ease-in-out infinite;
}
@keyframes beat { 0%,100%{ transform: scale(1); } 12%{ transform: scale(1.18); } 24%{ transform: scale(1); } 36%{ transform: scale(1.12); } }

/* Bouton principal glossy */
.btn-test, .btn-presave {
  position: relative; overflow: hidden;
  font-family: var(--font-pixel);
  font-size: 23px; letter-spacing: 1px;
  color: #fff;
  border: var(--border);
  border-radius: 999px;
  padding: 16px 20px;
  margin-top: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none; display: block;
  background: linear-gradient(180deg, #ff7ac0 0%, var(--pink-hot) 55%, #d4007a 100%);
  box-shadow: 0 7px 0 #a30062, 0 14px 24px rgba(255,30,142,.45);
  text-shadow: 1px 1px 0 rgba(0,0,0,.3);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-test:hover, .btn-presave:hover { transform: translateY(-2px); }
.btn-test:active, .btn-presave:active { transform: translateY(5px); box-shadow: 0 2px 0 #a30062, 0 6px 12px rgba(255,30,142,.4); }
.btn-test-shine, .btn-presave-shine {
  position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%,60%{ left: -60%; } 100%{ left: 130%; } }

.form-hint {
  text-align: center; font-size: 15px; color: var(--ink-soft);
  margin: 6px 0 0; font-weight: 500;
  animation: nudge 2.5s ease-in-out infinite;
}
.form-hint b { color: var(--pink-hot); }
@keyframes nudge { 0%,100%{ opacity: .7; } 50%{ opacity: 1; transform: scale(1.03); } }

/* =========================================================
   ÉCRAN LOADING
   ========================================================= */
.screen--loading { text-align: center; }
.loading-head { margin-bottom: 12px; }
.loading-kicker { font-family: var(--font-pixel); font-size: 20px; color: var(--lilac); margin: 0 0 4px; }
.loading-names {
  font-family: var(--font-display); font-size: clamp(15px,4.6vw,22px);
  color: var(--pink-hot); margin: 0;
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 2px 2px 0 #fff;
  word-break: break-word;
}

/* Polaroids */
.polaroid-stage {
  position: relative;
  height: 230px;
  margin: 8px auto 14px;
  width: 100%;
}
.polaroid {
  position: absolute; top: 50%; left: 50%;
  width: 168px;
  background: #fff;
  padding: 10px 10px 34px;
  border: 2px solid #eadff0;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(60,20,70,.32);
  transform: translate(-50%,-50%) rotate(var(--rot,-5deg)) scale(.8);
  opacity: 0;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  filter: sepia(.18) contrast(1.02) saturate(1.05);
}
.polaroid.show { opacity: 1; transform: translate(-50%,-50%) rotate(var(--rot,-5deg)) scale(1); }
.polaroid img { width: 100%; display: block; border-radius: 2px; aspect-ratio: 3/4; object-fit: cover; background: #f3e9f5; }
.polaroid figcaption {
  position: absolute; bottom: 8px; left: 0; right: 0;
  font-family: var(--font-script); font-size: 17px; color: #b5468a;
  text-align: center;
}
.polaroid::after { /* éclat photo */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
  opacity: 0; pointer-events: none;
}

/* Jauge */
.gauge-wrap { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.gauge-track {
  position: relative; flex: 1; height: 30px;
  background: repeating-linear-gradient(45deg, #ffe9f4 0 10px, #ffd9ee 10px 20px);
  border: var(--border); border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 3px 6px rgba(120,40,120,.25);
}
.gauge-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--lime), var(--blue) 40%, var(--pink-hot) 80%, var(--pink-hot));
  border-radius: 999px;
  transition: width .3s linear;
  box-shadow: 0 0 14px rgba(255,30,142,.6);
}
.gauge-shine { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.6), transparent 50%); pointer-events: none; }
.gauge-percent {
  font-family: var(--font-display); font-size: 18px; color: var(--pink-hot);
  min-width: 62px; text-align: right;
  -webkit-text-stroke: 1px var(--ink);
}

.loading-status {
  font-family: var(--font-pixel); font-size: 19px; color: var(--ink-soft);
  min-height: 24px; margin: 8px 0 16px;
}

/* now playing */
.now-playing {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  border: 2px solid var(--lime);
}
.now-playing b { color: var(--lime); }
.np-eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.np-eq i { width: 4px; background: var(--lime); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.np-eq i:nth-child(1){ height: 40%; animation-delay: 0s; }
.np-eq i:nth-child(2){ height: 90%; animation-delay: .2s; }
.np-eq i:nth-child(3){ height: 60%; animation-delay: .4s; }
.np-eq i:nth-child(4){ height: 100%; animation-delay: .1s; }
@keyframes eq { 0%,100%{ transform: scaleY(.3); } 50%{ transform: scaleY(1); } }

.np-unmute {
  display: block; margin: 14px auto 0;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  background: #fff; color: var(--ink);
  border: var(--border); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--pink-soft);
  animation: nudge 1.6s ease-in-out infinite;
}

/* =========================================================
   ÉCRAN RÉSULTAT
   ========================================================= */
.screen--result { text-align: center; }
.result-card { padding: 4px; }
.result-kicker {
  font-family: var(--font-pixel); font-size: 18px; color: var(--lilac);
  letter-spacing: 1px; margin: 0 0 6px;
}
.result-pair {
  font-family: var(--font-display); font-size: clamp(15px,4.4vw,21px);
  color: var(--ink); margin: 0 0 6px; word-break: break-word;
}
.result-pair .nm { color: var(--pink-hot); }

.result-score { line-height: .9; margin: 8px 0; }
.rs-number {
  font-family: var(--font-display);
  font-size: clamp(56px, 18vw, 96px);
  color: var(--pink-hot);
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 5px 5px 0 #fff, 9px 9px 0 var(--lilac);
  display: inline-block;
  animation: pop .6s var(--ease) both;
}
.rs-unit {
  font-family: var(--font-display); font-size: clamp(24px,7vw,40px);
  color: var(--blue); -webkit-text-stroke: 2px var(--ink);
}
@keyframes pop { 0%{ transform: scale(0) rotate(-12deg); } 70%{ transform: scale(1.15) rotate(4deg); } 100%{ transform: scale(1); } }

.result-hearts { font-size: 26px; letter-spacing: 4px; min-height: 32px; margin: 2px 0 10px; }
.result-hearts span { display: inline-block; animation: floatHeart 2s ease-in-out infinite; }

.result-text {
  font-size: 18px; line-height: 1.5; color: var(--ink);
  background: var(--pink-pale);
  border: var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 4px auto 18px;
  max-width: 440px; font-weight: 500;
  box-shadow: 4px 4px 0 var(--pink-soft);
}

.result-cta { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.cta-tease { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-soft); margin: 0; }
.cta-tease b { color: var(--pink-hot); }
.btn-presave {
  background: linear-gradient(180deg, #8fe9ff 0%, var(--blue) 45%, var(--blue-deep) 100%);
  box-shadow: 0 7px 0 #143e9e, 0 14px 24px rgba(42,107,255,.45);
}
.btn-presave:active { box-shadow: 0 2px 0 #143e9e, 0 6px 12px rgba(42,107,255,.4); }
.btn-retry {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  color: var(--ink-soft); text-decoration: underline; padding: 4px;
}
.btn-retry:hover { color: var(--pink-hot); }

/* =========================================================
   ÉTAT SPÉCIAL — COMPATIBILITÉ INFINIE (Louane + Elisa)
   ========================================================= */
.result-card.infinite .result-kicker { color: var(--pink-hot); }
.result-card.infinite .result-score { animation: glowPulse 1.6s ease-in-out infinite; }
.result-card.infinite .rs-number.infinity {
  font-size: clamp(70px, 24vw, 130px);
  color: #fff;
  -webkit-text-stroke: 3px var(--pink-hot);
  text-shadow:
    0 0 12px var(--pink-hot),
    0 0 28px var(--lilac),
    0 0 48px var(--blue);
  animation: pop .6s var(--ease) both, glowPulse 1.8s ease-in-out infinite 1s;
}
.result-card.infinite .result-text {
  background: linear-gradient(135deg, #fff0f8, #efe6ff, #e6f5ff);
  border-color: var(--pink-hot);
  color: var(--ink);
  box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(255,30,142,.5), 6px 6px 0 var(--lilac);
  position: relative; overflow: hidden;
}
.result-card.infinite .result-text::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: textShine 3s ease-in-out infinite;
}
.infinite-label {
  display: block; font-family: var(--font-display);
  font-size: clamp(16px,5vw,26px);
  background: linear-gradient(90deg, var(--pink-hot), var(--lilac), var(--blue), var(--pink-hot));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hue 4s linear infinite;
  margin-top: 6px;
}
@keyframes hue { to { background-position: 300% 0; } }
@keyframes textShine { to { transform: translateX(100%); } }
@keyframes glowPulse { 0%,100%{ filter: brightness(1); transform: scale(1); } 50%{ filter: brightness(1.25); transform: scale(1.04); } }
@keyframes floatHeart { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-8px); } }

/* =========================================================
   EXPLOSION GLITCH (easter egg)
   ========================================================= */
.boom-overlay {
  position: fixed; inset: 0; z-index: 9000;
  pointer-events: none; opacity: 0;
}
.boom-overlay.fire { animation: boomFlash .9s ease-out; }
@keyframes boomFlash {
  0%   { opacity: 0; background: #fff; }
  8%   { opacity: 1; background: #fff; }
  20%  { opacity: 1; background: var(--pink-hot); }
  40%  { opacity: .9; background: var(--lime); }
  60%  { opacity: .8; background: var(--blue); }
  100% { opacity: 0; background: transparent; }
}

/* glitch appliqué à la fenêtre lors du bug magique */
.window.glitch { animation: glitchShake .5s steps(2) 3; }
@keyframes glitchShake {
  0%{ transform: translate(0,0); } 20%{ transform: translate(-6px,4px) skewX(3deg); }
  40%{ transform: translate(6px,-4px) skewX(-3deg); } 60%{ transform: translate(-5px,-3px); }
  80%{ transform: translate(5px,3px) skewX(2deg); } 100%{ transform: translate(0,0); }
}
.gauge-fill.overload {
  width: 100% !important;
  background: linear-gradient(90deg, var(--pink-hot), var(--lime), var(--blue), var(--lilac), var(--pink-hot)) !important;
  background-size: 300% 100% !important;
  animation: hue .6s linear infinite, gaugeBuzz .25s steps(2) infinite;
  box-shadow: 0 0 24px var(--pink-hot), 0 0 48px var(--lilac) !important;
}
@keyframes gaugeBuzz { 0%{ transform: scaleY(1); } 50%{ transform: scaleY(1.4); } 100%{ transform: scaleY(1); } }

/* confettis / coeurs volants */
.flyer {
  position: fixed; z-index: 9500; pointer-events: none;
  font-size: var(--fs, 22px);
  will-change: transform, opacity;
  animation: fly var(--dur,2.4s) ease-out forwards;
}
@keyframes fly {
  0%   { transform: translate(0,0) rotate(0deg) scale(.6); opacity: 1; }
  100% { transform: translate(var(--dx,0), var(--dy,-120vh)) rotate(var(--dr,360deg)) scale(1.1); opacity: 0; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 480px) {
  .frame { width: 96vw; margin-top: 14px; }
  .window { min-height: 420px; padding: 16px; }
  .marquee { font-size: 15px; }
  .polaroid { width: 142px; }
  .polaroid-stage { height: 210px; }
  .field input { font-size: 18px; }
  .btn-test, .btn-presave { font-size: 19px; }
}

/* =========================================================
   ACCESSIBILITÉ — reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .marquee-track { animation: none; }
}
