/* ==========================================================
   MYTHO — terrasse de café, golden hour, néons de Vice-like
   ========================================================== */

:root {
  --ink: #1b0f2a;
  --pink: #ff3d7f;
  --hot: #ff2e93;
  --orange: #ff8a3d;
  --sun: #ffd23f;
  --teal: #19e3d5;
  --violet: #7b2ff7;
  --cream: #fff6ee;
  --red: #ff2a3d;
  --display: "HelveticaNeue-CondensedBlack", "Helvetica Neue Condensed Black", "Arial Narrow", "Roboto Condensed", Impact, "Arial Black", sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: calc(env(safe-area-inset-top) + 58px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0d0619; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--ui); color: #fff;
  display: flex; justify-content: center; align-items: center;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#app {
  position: relative; width: 100%; max-width: 440px; height: 100vh; height: 100dvh; max-height: 940px;
  overflow: hidden; background: #2a1450; isolation: isolate;
  /* palette du décor, ajustée par étape */
  --far: #a0569f; --near: #5a2470; --palm: #3a1350; --win: .12; --neon: .55;
}
@media (min-width: 520px) {
  #app { height: min(100dvh - 40px, 900px); border-radius: 30px; box-shadow: 0 0 0 10px #1a0d2c, 0 30px 90px rgba(0, 0, 0, .7); }
}
#app[data-etape="plat"] { --far: #7a2e86; --near: #3d1659; --palm: #2a0d3d; --win: .55; --neon: .85; }
#app[data-etape="dessert"] { --far: #2e1452; --near: #1c0b33; --palm: #12061f; --win: 1; --neon: 1; }

.shaker { position: absolute; inset: 0; }
.shaker.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.shaker.shake-big { animation: shake-big .6s cubic-bezier(.36, .07, .19, .97); }

/* ---------------- Décor ---------------- */

.world { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.sky { position: absolute; inset: 0; transition: opacity 1.8s ease; }
.sky-apero { background: linear-gradient(180deg, #3b63d4 0%, #6fa2ff 16%, #c9b4e8 30%, #ffc38a 40%, #ff8a5c 47%, #ff4f7b 54%, #6b2366 70%, #2a0f3a 100%); }
.sky-plat { opacity: 0; background: linear-gradient(180deg, #24135e 0%, #6c2a92 20%, #d33d8f 36%, #ff7a5c 46%, #ffae5c 50%, #5a1f63 66%, #220b30 100%); }
.sky-dessert { opacity: 0; background: linear-gradient(180deg, #05051a 0%, #140d3d 24%, #3b1462 40%, #8e2470 49%, #3a0e44 62%, #12061e 100%); }
#app[data-etape="plat"] .sky-plat, #app[data-etape="dessert"] .sky-dessert { opacity: 1; }

.starfield {
  position: absolute; inset: 0 0 50% 0; opacity: 0; transition: opacity 2s;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 52% 26%, #fff, transparent), radial-gradient(1px 1px at 70% 9%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 86% 22%, #fff, transparent), radial-gradient(1px 1px at 40% 36%, #fff, transparent),
    radial-gradient(1px 1px at 92% 40%, #fff, transparent), radial-gradient(1px 1px at 6% 42%, #fff, transparent);
}
#app[data-etape="dessert"] .starfield { opacity: .9; }

.sun {
  position: absolute; left: 62%; top: 27%; width: 130px; aspect-ratio: 1; border-radius: 50%; translate: -50% 0;
  background: radial-gradient(circle at 50% 40%, #fffbd0, #ffd23f 42%, #ff8a3d 72%, #ff3d7f);
  box-shadow: 0 0 60px 24px rgba(255, 160, 80, .5), 0 0 160px 60px rgba(255, 80, 120, .25);
  transition: top 2.2s ease, opacity 2.2s ease;
}
#app[data-etape="plat"] .sun { top: 39%; }
#app[data-etape="dessert"] .sun { top: 50%; opacity: 0; }
.moon {
  position: absolute; left: 20%; top: 14%; width: 44px; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 38% 38%, #fff, #e6e1ff 60%, #b9b0ff);
  box-shadow: 0 0 30px 8px rgba(200, 190, 255, .45); transition: opacity 2s;
}
#app[data-etape="dessert"] .moon { opacity: 1; }

.city { position: absolute; left: 0; width: 100%; bottom: 53%; height: 32%; }
.city .bld-far { fill: var(--far); transition: fill 1.8s; }
.city .bld { fill: var(--near); transition: fill 1.8s; }
.city .deco-band { fill: var(--far); transition: fill 1.8s; }
.city .win { fill: #ffe08a; opacity: var(--win); transition: opacity 1.8s; }
.city .win2 { fill: #8ff7ff; }
.city .beacon { fill: #ff2a3d; animation: beacon 1.4s steps(2) infinite; }
.city .palm, .city .palm-trunk { fill: var(--palm); transition: fill 1.8s; }
.city .palm-trunk { fill: none; stroke: var(--palm); stroke-width: 7; stroke-linecap: round; transition: stroke 1.8s; }
.neon-sign rect { fill: rgba(27, 15, 42, .7); stroke: #ff3d7f; stroke-width: 1.5; filter: drop-shadow(0 0 3px #ff3d7f); opacity: var(--neon); }
.neon-sign text, .neon-v text {
  font: 900 11px var(--display); fill: #ffd6e8; text-anchor: middle; letter-spacing: 1px;
  filter: drop-shadow(0 0 2px #ff3d7f) drop-shadow(0 0 5px #ff3d7f); opacity: var(--neon);
}
.neon-v rect { fill: rgba(27, 15, 42, .6); stroke: #19e3d5; stroke-width: 1.2; filter: drop-shadow(0 0 3px #19e3d5); opacity: var(--neon); }
.neon-v text { font-size: 10px; fill: #d8fffb; filter: drop-shadow(0 0 3px #19e3d5); animation: flicker 5s infinite; }
.neon-open { font: 900 7px var(--display); fill: #8ff7ff; text-anchor: middle; filter: drop-shadow(0 0 3px #19e3d5); opacity: var(--neon); }

.ground {
  position: absolute; left: 0; right: 0; top: 47%; bottom: 0;
  background: linear-gradient(180deg, #ff7a6b 0%, #b4377a 8%, #4a1655 30%, #1e0a2c 100%);
  transition: filter 1.8s;
}
.ground::before { /* reflets du soleil sur l'eau */
  content: ""; position: absolute; left: 50%; top: 0; width: 46%; height: 26%; translate: -20% 0;
  background: repeating-linear-gradient(180deg, rgba(255, 220, 140, .7) 0 2px, transparent 2px 7px);
  -webkit-mask: radial-gradient(closest-side, #000, transparent); mask: radial-gradient(closest-side, #000, transparent);
  animation: shimmer 3s ease-in-out infinite alternate;
}
#app[data-etape="plat"] .ground { filter: hue-rotate(-12deg) brightness(.8); }
#app[data-etape="dessert"] .ground { filter: brightness(.45) saturate(1.3); }
#app[data-etape="dessert"] .ground::before { opacity: .35; }

.road { position: absolute; left: 0; right: 0; top: calc(47% - 6px); height: 8px; }
.car { position: absolute; top: 0; width: 22px; height: 7px; border-radius: 3px 5px 2px 2px; background: #12061f; animation: drive 9s linear infinite; }
.car::before { content: ""; position: absolute; right: -3px; top: 2px; width: 4px; height: 3px; border-radius: 2px; background: #fff7c2; box-shadow: 0 0 8px 3px rgba(255, 240, 180, .8); }
.car::after { content: ""; position: absolute; left: -1px; top: 2px; width: 3px; height: 3px; border-radius: 2px; background: #ff2a3d; box-shadow: 0 0 6px 2px rgba(255, 40, 60, .8); }
.car.c2 { animation-duration: 12s; animation-delay: -5s; animation-direction: reverse; transform: scaleX(-1); }
.car.c3 { animation-duration: 7s; animation-delay: -2s; background: #ff3d7f; }

.awning {
  position: absolute; top: 0; left: 0; right: 0; height: calc(env(safe-area-inset-top) + 40px);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 40%, rgba(0, 0, 0, .18)),
    repeating-linear-gradient(90deg, #ff3d7f 0 30px, #fff1f5 30px 60px);
  border-bottom: 3px solid var(--ink);
  transition: filter 1.8s;
}
.awning::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 15px;
  background:
    radial-gradient(circle at 15px 0, #ff3d7f 14px, var(--ink) 14px 16.5px, transparent 17px) 0 0 / 60px 17px repeat-x,
    radial-gradient(circle at 45px 0, #fff1f5 14px, var(--ink) 14px 16.5px, transparent 17px) 0 0 / 60px 17px repeat-x;
}
#app[data-etape="plat"] .awning { filter: brightness(.82) saturate(1.1); }
#app[data-etape="dessert"] .awning { filter: brightness(.55) saturate(1.2); }

.fairy { position: absolute; left: -2%; right: -2%; top: calc(env(safe-area-inset-top) + 50px); height: 34px; }
.fairy svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fairy path { fill: none; stroke: #1b0f2a; stroke-width: 1.5; }
.bulb {
  position: absolute; width: 9px; height: 11px; margin: -2px 0 0 -4.5px; border-radius: 50% 50% 45% 45%;
  background: #fff2b8; border: 1.5px solid var(--ink);
  box-shadow: 0 0 6px 2px rgba(255, 214, 120, .35);
  animation: bulb 2s ease-in-out infinite alternate;
}
#app[data-etape="plat"] .bulb { box-shadow: 0 0 10px 4px rgba(255, 214, 120, .6); }
#app[data-etape="dessert"] .bulb { box-shadow: 0 0 14px 6px rgba(255, 200, 110, .8); background: #fff7d6; }

/* ---------------- Le rencard ---------------- */

.date-wrap {
  position: absolute; z-index: 1; left: 50%; top: var(--top); height: 41%; aspect-ratio: 320 / 360; max-width: 96%;
  translate: -50% 0; transform-origin: 50% 100%;
  transition: top .7s cubic-bezier(.2, .8, .2, 1), height .7s cubic-bezier(.2, .8, .2, 1), transform 1s ease, opacity 1s ease, filter 1.8s;
  filter: drop-shadow(-5px 0 0 rgba(255, 190, 90, .55)) drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
}
#app[data-etape="plat"] .date-wrap { filter: drop-shadow(-5px 0 0 rgba(255, 90, 150, .6)) drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
#app[data-etape="dessert"] .date-wrap { filter: brightness(.9) drop-shadow(-5px 0 0 rgba(25, 227, 213, .65)) drop-shadow(4px 0 0 rgba(255, 61, 127, .45)); }
#app[data-screen="home"] .date-wrap { top: calc(var(--top) + 19%); height: 35%; }
.date-wrap.leave { transform: translateX(140%) rotate(12deg); opacity: 0; }
.date-wrap.pop { animation: datePop .45s ease; }

.date-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.date-svg .body { animation: breathe 4s ease-in-out infinite; transform-origin: 160px 360px; }
.date-svg .head { transform-box: view-box; transform-origin: 160px 215px; transform: rotate(var(--tilt, 0deg)); transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.date-svg path, .date-svg ellipse, .date-svg circle, .date-svg rect { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.date-svg .nostroke { stroke: none; }
.date-svg .skin { fill: var(--skin); }
.date-svg .skin-shade { fill: var(--skin-shade); }
.date-svg .hair { fill: var(--hair); }
.date-svg .hair-hi { fill: none; stroke: var(--hair-hi); stroke-width: 4; opacity: .7; }
.date-svg .top { fill: var(--top); }
.date-svg .top-shade { fill: var(--top-shade); }
.date-svg .top-hi { fill: none; stroke: #fff; stroke-width: 4; opacity: .35; }
.date-svg .strap { fill: none; stroke: var(--top); stroke-width: 7; }
.date-svg .gold { fill: none; stroke: #ffcf3f; stroke-width: 2.5; }
.date-svg .gold-fill { fill: #ffcf3f; stroke-width: 2; }
.date-svg .hoop { fill: none; stroke: var(--hoop); stroke-width: 4; }
.date-svg .line { fill: none; stroke-width: 2.6; }
.date-svg .line.thin { stroke-width: 1.6; opacity: .55; }
.date-svg .blush { fill: #ff5f8f; opacity: var(--blush, .25); transition: opacity .4s; }
.date-svg .eye-white { fill: #fff; stroke-width: 2; }
.date-svg .iris { fill: var(--iris); stroke-width: 1.5; }
.date-svg .pupil { fill: #120818; stroke: none; }
.date-svg .glint { fill: #fff; stroke: none; }
.date-svg .iris-g { transform: translateX(var(--lx, 0px)); transition: transform .25s; }
.date-svg .lid { fill: var(--skin); stroke-width: 2.6; transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(var(--lid, 0)); transition: transform .2s; }
.date-svg.blink .lid { transform: scaleY(1); transition-duration: .05s; }
.date-svg .liner { fill: none; stroke-width: 4; }
.date-svg .brow { fill: none; stroke: var(--hair); stroke-width: 5.5; }
.date-svg .lips { fill: var(--lips); stroke-width: 2.4; }
.date-svg .mouth-in { fill: #5a0f2a; stroke-width: 2.6; }
.date-svg .teeth { fill: #fff; stroke-width: 1.4; }
.date-svg .tongue { fill: #ff6b8a; }
.date-svg .shades { fill: var(--shades); fill-opacity: .9; }
.date-svg .shine { fill: #fff; opacity: .55; }

/* Portraits illustrés (images) */
.date-wrap.is-photo { aspect-ratio: 5 / 7; height: 47%; top: calc(var(--top) - 1%); }
#app[data-screen="home"] .date-wrap.is-photo { top: calc(var(--top) + 20%); height: 40%; }
.photo { position: absolute; inset: 0; transform-origin: 50% 100%; animation: breathe 4s ease-in-out infinite; }
.photo img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transition: filter .45s ease, transform .45s cubic-bezier(.3, 1.5, .5, 1);
  -webkit-user-drag: none;
}
.date-wrap.is-photo:not(.is-cutout) img {
  border: 4px solid var(--ink); border-bottom: 0; border-radius: 22px 22px 0 0;
  -webkit-mask: linear-gradient(180deg, #000 72%, transparent 96%); mask: linear-gradient(180deg, #000 72%, transparent 96%);
}
.photo[data-mood="smile"] img, .photo[data-mood="flirty"] img { filter: brightness(1.05) saturate(1.12); transform: scale(1.01) rotate(-1deg); }
.photo[data-mood="laugh"] img { filter: brightness(1.08) saturate(1.2); animation: laughBounce .5s ease 2; }
.photo[data-mood="shocked"] img { transform: scale(1.06); filter: brightness(1.1); }
.photo[data-mood="sus"] img { transform: rotate(3deg) scale(1.02); filter: saturate(.85) contrast(1.05); }
.photo[data-mood="bored"] img { transform: rotate(-2deg); filter: grayscale(.35) brightness(.92); }
.photo[data-mood="angry"] img { transform: scale(1.04); filter: saturate(1.3) sepia(.25) hue-rotate(-25deg) brightness(.92) contrast(1.1); }
.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(80% 60% at 50% 35%, transparent 40%, rgba(255, 30, 50, .45)); }
.photo[data-mood="angry"]::after { opacity: 1; }
.mood-emoji { position: absolute; right: 4%; top: 6%; font-size: 44px; opacity: 0; pointer-events: none; filter: drop-shadow(3px 3px 0 var(--ink)); }
.mood-emoji.show { animation: emojiPop 1.4s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.dcard .face img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.9); transform-origin: 50% 12%; border: 0 !important; -webkit-mask: none !important; mask: none !important; }
.dcard .face .photo { animation: none; }
.dcard .face .photo::after { display: none; }
@keyframes laughBounce { 50% { transform: translateY(-6px) rotate(-1.5deg) scale(1.02); } }
@keyframes emojiPop { 0% { opacity: 0; transform: scale(.3) rotate(-20deg); } 20% { opacity: 1; transform: scale(1.15) rotate(8deg); } 80% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: translateY(-14px); } }

/* ---------------- Table ---------------- */

.table-wrap { position: absolute; z-index: 2; left: -7%; right: -7%; top: calc(var(--top) + 32%); transition: top .7s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
#app[data-screen="home"] .table-wrap { top: calc(var(--top) + 47%); }
.table { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 -2px 0 rgba(255, 255, 255, .25)); }
.table .prop :is(path, rect, ellipse, circle):not([stroke]) { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.table .table-refl { fill: #ffc0d8; opacity: .55; transition: fill 1.8s, opacity 1.8s; }
.table .table-night { fill: #2a0f55; opacity: 0; mix-blend-mode: multiply; transition: opacity 1.8s; }
#app[data-etape="plat"] .table .table-night { opacity: .25; }
#app[data-etape="dessert"] .table .table-night { opacity: .5; }
#app[data-etape="dessert"] .table .table-refl { fill: #19e3d5; opacity: .3; }
.table .p-plat, .table .p-dessert { display: none; }
#app[data-etape="plat"] .table .p-apero, #app[data-etape="dessert"] .table .p-apero { display: none; }
#app[data-etape="plat"] .table .p-plat, #app[data-etape="dessert"] .table .p-dessert { display: inline; animation: propIn .5s ease; }
.table .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame .18s ease-in-out infinite alternate; }
.table .candle-glow { animation: glow 1.2s ease-in-out infinite alternate; }
.table .phone-logo { font: 900 22px var(--display); fill: #fff; text-anchor: middle; }
.table .phone { animation: buzz 6s infinite; transform-box: fill-box; transform-origin: center; }

/* Étalonnage : vignette + teinte ciné */
.grade { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(130% 85% at 50% 38%, transparent 55%, rgba(25, 0, 35, .55) 100%); }
.grade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 140, 60, .1), rgba(255, 40, 140, .08)); mix-blend-mode: screen; }

/* ---------------- Écrans ---------------- */

.screen { position: absolute; inset: 0; z-index: 5; }
.screen.enter { animation: fadeIn .4s ease; }

/* ACCUEIL */
.logo { position: absolute; z-index: 2; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 62px); text-align: center; transform: rotate(-6deg); pointer-events: none; }
.logo h1 {
  margin: 2px 0 0; font: italic 900 clamp(72px, 25vw, 116px)/.84 var(--display); letter-spacing: -.02em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff6b0 0%, #ffd23f 28%, #ff8a3d 52%, #ff2e93 82%, #c7158a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 3px var(--ink);
  filter: drop-shadow(6px 6px 0 var(--ink)) drop-shadow(0 0 24px rgba(255, 46, 147, .55));
  padding: 0 10px;
}
.logo-top, .logo-sub { display: inline-block; font: 900 14px var(--display); text-transform: uppercase; transform: skewX(-12deg); }
.logo-top { background: var(--ink); color: var(--teal); letter-spacing: .22em; padding: 5px 12px; box-shadow: 3px 3px 0 var(--pink); }
.logo-sub { margin-top: 10px; background: var(--pink); color: #fff; padding: 5px 14px; border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); letter-spacing: .04em; }

.mute { position: absolute; z-index: 3; right: 12px; top: calc(env(safe-area-inset-top) + 50px); width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: rgba(255, 255, 255, .9); font-size: 18px; box-shadow: 2px 2px 0 var(--ink); }

.home-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 44px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(0deg, rgba(16, 6, 30, .97) 62%, rgba(16, 6, 30, .75) 85%, transparent);
}
.gender { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.gender button { border: 2px solid var(--ink); background: rgba(255, 255, 255, .12); color: #fff; font: 900 13px var(--display); text-transform: uppercase; padding: 6px 14px; border-radius: 999px; letter-spacing: .05em; }
.gender button.on { background: var(--teal); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.gender button:disabled { opacity: .45; cursor: not-allowed; }

.dates {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 3.3); gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -16px; padding: 6px 16px 8px; scroll-padding: 0 16px;
}
.dates::-webkit-scrollbar { display: none; }
.dcard { scroll-snap-align: start; }
.dcard {
  position: relative; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 4px 8px; text-align: center;
  background: rgba(255, 255, 255, .1); color: #fff; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s;
}
.dcard .face { position: relative; width: 54px; height: 54px; margin: 0 auto 4px; border-radius: 50%; overflow: hidden; border: 2.5px solid var(--ink); background: var(--card, var(--pink)); }
.dcard .face svg { width: 170%; height: auto; margin: -10% 0 0 -35%; }
.dcard .face .date-svg .body { animation: none; }
.dcard b { display: block; font: 900 16px/1 var(--display); text-transform: uppercase; }
.dcard small { display: block; margin-top: 2px; font-size: 11px; opacity: .8; }
.dcard.sel { background: var(--cream); color: var(--ink); transform: translateY(-3px) rotate(-1.5deg); box-shadow: 4px 5px 0 var(--pink); }
.dcard.locked { cursor: not-allowed; }
.dcard.locked .face { filter: grayscale(1) brightness(.35); }
.dcard.locked::after {
  content: attr(data-lock); position: absolute; left: 50%; top: 22px; translate: -50% 0; white-space: nowrap;
  font: 900 11px var(--display); text-transform: uppercase; background: var(--ink); color: var(--sun); padding: 3px 6px; border-radius: 5px;
}
.date-desc { min-height: 34px; margin: 10px 2px 0; font-size: 13px; line-height: 1.3; text-align: center; opacity: .9; }

.btn-primary {
  display: block; width: 100%; min-height: 60px; margin-top: 10px; border: 3px solid var(--ink); border-radius: 14px;
  background: linear-gradient(180deg, #ffe066, #ffb23f 50%, #ff7a3d); color: var(--ink);
  font: italic 900 26px var(--display); text-transform: uppercase; letter-spacing: .02em;
  box-shadow: 5px 5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .6); transform: skewX(-8deg);
}
.btn-primary:active { transform: skewX(-8deg) translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost { flex: 1; min-height: 48px; border: 2.5px solid var(--ink); border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font: 900 17px var(--display); text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); transform: skewX(-8deg); }
.btn-ghost:active { transform: skewX(-8deg) translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.howto { margin: 12px 0 0; font-size: 12.5px; text-align: center; opacity: .85; }
.howto b { color: var(--sun); }
.records { margin: 6px 0 0; font: 900 12px var(--display); text-transform: uppercase; letter-spacing: .06em; text-align: center; opacity: .65; }
.records b { color: var(--teal); }

/* RENCARD : HUD */
.hud {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 6px) 10px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start;
}
.gauge { background: rgba(20, 8, 40, .82); border: 2.5px solid var(--ink); border-radius: 12px; padding: 5px 8px 7px; box-shadow: 0 3px 0 var(--ink); }
.g-head { display: flex; justify-content: space-between; align-items: baseline; }
.lbl { font: 900 11px var(--display); letter-spacing: .08em; text-transform: uppercase; color: #ff9cc5; }
.g-head b { font: 900 15px var(--display); }
.bar { position: relative; height: 8px; border-radius: 5px; background: rgba(255, 255, 255, .15); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, #ff3d7f, #ff9ad5); transition: width .6s cubic-bezier(.3, 1.4, .5, 1); border-radius: 5px; }
.bar .goal { position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--sun); box-shadow: 0 0 4px var(--sun); }
.soupcon .bar i { background: linear-gradient(90deg, #ffb020, #ff2a3d); width: 0; }
.stars { display: flex; gap: 1px; justify-content: flex-end; font-size: 17px; line-height: 15px; }
.stars span { color: rgba(255, 255, 255, .2); -webkit-text-stroke: 1px var(--ink); transition: color .3s, text-shadow .3s, transform .3s; }
.stars span.half { color: rgba(255, 255, 255, .55); }
.stars span.on { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, .9); transform: scale(1.1); }
.stars.alarm span.on { animation: starBlink .5s steps(2) infinite; }
.stars.bump { animation: bump .4s ease; }
.etape-pill {
  display: flex; flex-direction: column; align-items: center; padding: 4px 12px 5px; border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--ink); transform: skewX(-8deg);
  font: 900 15px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
}
.etape-pill small { font: 800 11px var(--ui); opacity: .7; margin-top: 2px; }

/* Bulle */
.bubble {
  position: absolute; z-index: 3; left: 14px; right: 14px; top: calc(var(--top) + 25%);
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px;
  padding: 18px 16px 14px; box-shadow: 5px 5px 0 rgba(27, 15, 42, .92);
  transform-origin: 50% 0; transition: background .2s;
}
.bubble::before {
  content: ""; position: absolute; top: -15px; left: calc(50% - 12px); width: 24px; height: 24px; background: inherit;
  border-left: 3px solid var(--ink); border-top: 3px solid var(--ink); transform: rotate(45deg) skew(8deg, 8deg); border-radius: 4px 0 0 0;
}
.bubble p { position: relative; margin: 0; min-height: 2.5em; font: 800 clamp(17px, 4.9vw, 20px)/1.25 var(--ui); }
.bubble p .ghost { visibility: hidden; }
.bubble .who, .bubble .tag {
  position: absolute; top: -14px; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 7px;
  font: 900 13px var(--display); text-transform: uppercase; letter-spacing: .06em; transform: skewX(-10deg);
}
.bubble .who { left: 12px; background: var(--pink); color: #fff; }
.bubble .tag { right: 12px; background: var(--sun); color: var(--ink); animation: wiggle 1s ease-in-out infinite; }
.bubble.pop { animation: bubblePop .3s cubic-bezier(.3, 1.6, .5, 1); }
.bubble.reply { background: var(--cream); }
.bubble.bad { background: #ffe1e5; }
.bubble.good { background: #e7fff8; }

/* Réponses */
.controls {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 30px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(0deg, rgba(14, 5, 28, .96) 0%, rgba(14, 5, 28, .88) 72%, rgba(14, 5, 28, 0));
}
.timer { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; border: 2px solid var(--ink); opacity: 0; transition: opacity .2s; }
.timer.on { opacity: 1; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #a6ffb5); transform-origin: left; transform: scaleX(1); border-radius: 4px; }
.timer.hurry i { background: linear-gradient(90deg, #ff2a3d, #ffb020); }
.timer.hurry { animation: hurry .3s ease-in-out infinite alternate; }
.answers { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; min-height: calc(3 * 56px + 2 * 9px); }
.ans {
  --c: var(--pink);
  appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 7px 14px 7px 8px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--cream); color: var(--ink); text-align: left;
  font: 900 clamp(16px, 4.6vw, 19px)/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em;
  box-shadow: 4px 4px 0 var(--ink); transform: skewX(-7deg);
  opacity: 0; animation: ansIn .32s cubic-bezier(.3, 1.4, .5, 1) forwards; animation-delay: calc(var(--i, 0) * 70ms);
}
.ans > * { transform: skewX(7deg); }
.ans .k { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 2.5px solid var(--ink); background: var(--c); color: #fff; font-size: 19px; }
.ans:nth-child(2) { --c: var(--teal); }
.ans:nth-child(2) .k { color: var(--ink); }
.ans:nth-child(3) { --c: var(--orange); }
.ans:active { transform: skewX(-7deg) translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.ans.picked { background: var(--sun); transform: skewX(-7deg) scale(1.03); }
.answers:not(.out) .ans.dim { opacity: .3 !important; filter: grayscale(.7); }
.answers.out .ans { animation: ansOut .25s ease forwards; }
.ans.single { justify-content: center; }

/* Popups de score */
.popups { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.pop-num {
  position: absolute; font: italic 900 24px var(--display); -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 3px 3px 0 var(--ink); animation: floatUp 1.3s ease forwards; white-space: nowrap;
}
.pop-num.charme { left: 22%; top: calc(env(safe-area-inset-top) + 56px); color: #ff7ab3; }
.pop-num.soupcon { right: 6%; top: calc(env(safe-area-inset-top) + 56px); color: #ff4d5e; }
.pop-num.charme.neg { color: #b9a6c9; }
.pop-num.soupcon.good { color: var(--teal); }
.heart { position: absolute; font-size: 26px; animation: heartUp 1.4s ease-out forwards; }

#flash { position: absolute; inset: 0; z-index: 8; pointer-events: none; opacity: 0; }
#flash.red { background: radial-gradient(circle, rgba(255, 42, 61, .1), rgba(255, 42, 61, .6)); animation: flash .6s ease; }
#flash.orange { background: radial-gradient(circle, rgba(255, 160, 40, .05), rgba(255, 120, 40, .45)); animation: flash .5s ease; }
#flash.pink { background: radial-gradient(circle, rgba(255, 61, 127, .05), rgba(255, 61, 127, .35)); animation: flash .6s ease; }

#stamp {
  position: absolute; z-index: 9; left: 50%; top: 44%; pointer-events: none; opacity: 0; white-space: nowrap;
  font: italic 900 clamp(34px, 11vw, 48px) var(--display); text-transform: uppercase; color: var(--c, var(--red));
  -webkit-text-stroke: 2.5px var(--ink); text-shadow: 5px 5px 0 var(--ink);
  translate: -50% -50%;
}
#stamp.show { animation: stamp 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }

#banner { position: absolute; z-index: 9; left: -12%; right: -12%; top: 36%; pointer-events: none; display: none; transform: rotate(-6deg); }
#banner.show { display: block; animation: bannerIn 1.9s cubic-bezier(.2, .9, .2, 1) forwards; }
#banner.stay { display: block; animation: bannerStay .7s cubic-bezier(.2, .9, .2, 1) forwards; }
#banner .strip { background: rgba(14, 5, 28, .94); border-top: 4px solid var(--bc, var(--sun)); border-bottom: 4px solid var(--bc, var(--sun)); padding: 12px 0 14px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#banner h3 { margin: 0; font: italic 900 clamp(48px, 16vw, 76px)/.9 var(--display); text-transform: uppercase; color: var(--bc, var(--sun)); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 #000; letter-spacing: -.01em; }
#banner p { margin: 6px 0 0; font: 800 13px var(--ui); color: #fff; letter-spacing: .16em; text-transform: uppercase; }

/* FIN */
#end { z-index: 7; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, rgba(14, 5, 28, .25) 0%, rgba(14, 5, 28, .93) 22%, rgba(14, 5, 28, .97)); }
.end-inner { padding: calc(env(safe-area-inset-top) + 30vh) 16px calc(env(safe-area-inset-bottom) + 20px); }
.end-verdict { margin: 0 -16px 18px; padding: 10px 0 12px; text-align: center; background: rgba(14, 5, 28, .94); border-top: 4px solid var(--bc, var(--sun)); border-bottom: 4px solid var(--bc, var(--sun)); transform: rotate(-4deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: bannerStay .6s cubic-bezier(.2, .9, .2, 1); }
.end-verdict h2 { margin: 0; font: italic 900 clamp(46px, 15vw, 70px)/.9 var(--display); text-transform: uppercase; color: var(--bc, var(--sun)); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 #000; }
.end-verdict p { margin: 6px 0 0; font: 800 12px var(--ui); letter-spacing: .16em; text-transform: uppercase; }
.dcard.shake { animation: shake .4s; }
.end-line { margin: 0 0 14px; padding: 12px 14px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); font: 800 16px/1.3 var(--ui); }
.scorecard { border: 3px solid var(--ink); border-radius: 14px; background: rgba(255, 255, 255, .08); padding: 10px 14px; box-shadow: 4px 4px 0 var(--ink); }
.sc-row, .sc-total { display: flex; justify-content: space-between; align-items: baseline; }
.sc-row { font: 800 14px var(--ui); padding: 3px 0; opacity: .9; }
.sc-row b { font: 900 18px var(--display); }
.sc-row small { opacity: .7; }
.sc-total { margin-top: 6px; padding-top: 8px; border-top: 2px dashed rgba(255, 255, 255, .25); font: italic 900 22px var(--display); text-transform: uppercase; }
.sc-total b { font-size: 38px; color: var(--sun); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
.sc-best { margin: 2px 0 0; text-align: right; font: 900 12px var(--display); color: var(--teal); text-transform: uppercase; letter-spacing: .08em; min-height: 14px; }

.fiche { position: relative; margin-top: 16px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.fiche header { background: var(--ink); color: #fff; padding: 10px 14px 9px; padding-right: 130px; }
.fiche header b { display: block; font: italic 900 24px/1 var(--display); text-transform: uppercase; color: var(--sun); }
.fiche header span { display: block; margin-top: 3px; font: 800 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.fiche ul { list-style: none; margin: 0; padding: 4px 0; }
.fiche li { display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; padding: 8px 14px; border-bottom: 1.5px dashed rgba(27, 15, 42, .18); }
.fiche li:last-child { border-bottom: 0; }
.fiche .k { font: 900 12px/1.4 var(--display); text-transform: uppercase; letter-spacing: .04em; opacity: .55; }
.fiche .v { font-weight: 800; font-size: 15px; }
.fiche .note { grid-column: 2; font-size: 12px; font-weight: 700; color: #d1112a; }
.fiche li.bad { background: rgba(255, 42, 61, .13); }
.fiche li.bad .v { color: #c40e25; }
.fiche li.contredit .v { text-decoration: line-through; text-decoration-thickness: 2.5px; }
.fiche li.empty { display: block; text-align: center; opacity: .6; font-weight: 700; }
.gros { display: inline-block; margin-left: 6px; padding: 1px 6px; font: 900 10px/1.3 var(--display); text-transform: uppercase; background: var(--sun); border: 1.5px solid var(--ink); border-radius: 4px; transform: skewX(-10deg); vertical-align: 2px; }
.fiche-stamp {
  position: absolute; right: 10px; top: 9px; padding: 1px 9px; border: 3.5px solid var(--sc, #ff4d5e); border-radius: 8px; background: rgba(27, 15, 42, .6);
  color: var(--sc, #ff4d5e); font: italic 900 22px var(--display); text-transform: uppercase; transform: rotate(-7deg); pointer-events: none; white-space: nowrap;
}
.unlock { margin-top: 16px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; background: var(--teal); color: var(--ink); font: 900 17px var(--display); text-transform: uppercase; text-align: center; box-shadow: 4px 4px 0 var(--ink); animation: wiggle 1.2s ease-in-out infinite; }
.end-actions { margin-top: 18px; }
.end-sub { display: flex; gap: 10px; margin-top: 12px; }

/* ---------------- Animations ---------------- */

@keyframes shake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 2px); } 40%, 60% { transform: translate(6px, -1px); } }
@keyframes shake-big { 10%, 90% { transform: translate(-4px, 2px) rotate(-.5deg); } 20%, 80% { transform: translate(8px, -3px) rotate(.6deg); } 30%, 50%, 70% { transform: translate(-12px, 4px) rotate(-.8deg); } 40%, 60% { transform: translate(12px, -2px) rotate(.8deg); } }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.006); } }
@keyframes datePop { 0% { transform: scale(1); } 40% { transform: scale(1.04) translateY(-6px); } 100% { transform: scale(1); } }
@keyframes drive { from { left: -10%; } to { left: 110%; } }
@keyframes shimmer { from { opacity: .55; transform: scaleX(.92); } to { opacity: 1; transform: scaleX(1.06); } }
@keyframes bulb { from { filter: brightness(.9); } to { filter: brightness(1.15); } }
@keyframes beacon { 50% { opacity: .2; } }
@keyframes flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: var(--neon); } 20%, 63% { opacity: .15; } }
@keyframes flame { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.9, 1.12) rotate(3deg); } }
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes buzz { 0%, 86%, 100% { transform: rotate(0); } 87%, 91%, 95% { transform: rotate(-3deg) translateX(-1px); } 89%, 93%, 97% { transform: rotate(3deg) translateX(1px); } }
@keyframes propIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ansIn { from { opacity: 0; transform: skewX(-7deg) translateY(18px) scale(.96); } to { opacity: 1; transform: skewX(-7deg); } }
@keyframes ansOut { to { opacity: 0; transform: skewX(-7deg) translateY(12px); } }
@keyframes bubblePop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes wiggle { 0%, 100% { transform: skewX(-10deg) rotate(-2deg); } 50% { transform: skewX(-10deg) rotate(2deg); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px) scale(1); } }
@keyframes heartUp { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -160px) scale(1.2) rotate(var(--r)); } }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-14deg); } 18% { opacity: 1; transform: scale(1) rotate(-8deg); } 75% { opacity: 1; transform: scale(1.03) rotate(-8deg); } 100% { opacity: 0; transform: scale(1.1) rotate(-8deg); } }
@keyframes bannerIn { 0% { transform: rotate(-6deg) translateX(-120%); } 18% { transform: rotate(-6deg) translateX(0); } 80% { transform: rotate(-6deg) translateX(0); opacity: 1; } 100% { transform: rotate(-6deg) translateX(120%); opacity: 0; } }
@keyframes bannerStay { 0% { transform: rotate(-6deg) translateX(-120%); } 100% { transform: rotate(-6deg) translateX(0); } }
@keyframes starBlink { 50% { color: #ff2a3d; text-shadow: 0 0 10px #ff2a3d; } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes hurry { from { transform: translateX(-1px); } to { transform: translateX(1px); } }

@media (prefers-reduced-motion: reduce) {
  .shaker.shake, .shaker.shake-big, .date-svg .body, .bulb, .car { animation: none !important; }
}

/* Petits écrans (iPhone SE, etc.) */
@media (max-height: 700px) {
  .ans { min-height: 50px; }
  .answers { min-height: calc(3 * 50px + 2 * 9px); }
  .bubble { padding: 16px 14px 12px; }
  .home-bottom { padding-top: 34px; }
  .howto { display: none; }
}
