/* ============================================================
   FICHIER     : play.css
   EMPLACEMENT : hush_send/knowme/js&css/play.css
   ROLE        : Style de la page des repondants KnowMe.
     Fond uni, cartes en verre, bordures discretes, aucun emoji.
     Les couleurs --g1 / --g2 sont posees par play.js a partir du
     degrade choisi par le createur dans l'application.
   ============================================================ */
:root {
  --g1: #7B2FBE;
  --g2: #00D4FF;
  --grad: linear-gradient(135deg, var(--g1), var(--g2));
  --bg: #08080C;
  --card: rgba(255, 255, 255, .035);
  --card2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --tx: #F5F5F7;
  --tx2: rgba(245, 245, 247, .62);
  --tx3: rgba(245, 245, 247, .36);
  --ok: #2FD07A;
  --ko: #E5484D;
  --font: 'Poppins', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F6F6F8;
  --card: rgba(0, 0, 0, .035);
  --card2: rgba(0, 0, 0, .06);
  --line: rgba(0, 0, 0, .08);
  --line2: rgba(0, 0, 0, .16);
  --tx: #111114;
  --tx2: rgba(17, 17, 20, .62);
  --tx3: rgba(17, 17, 20, .40);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Voile degrade tres leger (meme principe que l'image du Sondage). */
.veil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 45% at 0% 0%, color-mix(in srgb, var(--g1) 22%, transparent), transparent 70%),
    radial-gradient(70% 45% at 100% 100%, color-mix(in srgb, var(--g2) 16%, transparent), transparent 70%);
}

/* ---------- En-tete ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.brand img { border-radius: 8px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; color: var(--tx2); }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: 16px;
  padding: 8px; display: none; box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.menu.open { display: block; animation: pop .18s var(--spring); }
.menu-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--tx3); padding: 8px 10px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border-radius: 10px; background: none; border: 0;
  font-size: 13px; font-weight: 600; color: var(--tx); cursor: pointer; text-align: left;
}
.menu-item:hover, .menu-item.active { background: var(--card2); }
.menu-item svg { width: 16px; height: 16px; color: var(--tx2); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }

/* ---------- Mise en page ---------- */
.wrap { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 22px 16px 90px; }
.view { animation: viewIn .4s var(--spring) both; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px 20px; margin-bottom: 12px;
}
.center { text-align: center; }
.avatar {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--grad); display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #fff;
  border: 3px solid color-mix(in srgb, #fff 30%, transparent);
}
.h1 { font-size: 22px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
.h2 { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.sub { font-size: 13px; color: var(--tx2); margin-top: 6px; line-height: 1.5; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tx3); margin-bottom: 8px; display: block; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 99px; background: var(--card2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--tx2);
}
.pill svg { width: 13px; height: 13px; }

.field {
  width: 100%; padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 600;
  background: var(--card2); border: 1px solid var(--line); outline: none;
  transition: border-color .2s;
}
.field:focus { border-color: var(--g1); }
.field::placeholder { color: var(--tx3); font-weight: 500; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border-radius: 14px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .15s var(--spring), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-ghost { background: var(--card2); border-color: var(--line); color: var(--tx); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gap { height: 12px; }

.notice {
  padding: 12px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.5;
  background: var(--card2); border: 1px solid var(--line); color: var(--tx2); margin-bottom: 14px;
}
.notice b { color: var(--tx); }

/* ---------- Quiz ---------- */
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width .5s ease; }
.counter { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--tx2); margin-bottom: 12px; }
.q-text { font-size: 19px; font-weight: 700; line-height: 1.45; letter-spacing: -.3px; margin: 10px 0 22px; word-break: break-word; }
.q-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--tx2); }
.q-tag svg { width: 12px; height: 12px; }

.bool { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bool button {
  height: 92px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .15s var(--spring), border-color .2s;
}
.bool button svg { width: 26px; height: 26px; }
.bool .yes svg { color: var(--ok); }
.bool .no svg { color: var(--ko); }
.bool button:active { transform: scale(.94); }
.bool button:hover { border-color: var(--line2); }

.numdisp { text-align: center; font-size: 42px; font-weight: 800; min-height: 74px; padding-top: 6px; letter-spacing: -1px; }
.numdisp.empty { font-size: 16px; font-weight: 500; color: var(--tx3); padding-top: 24px; letter-spacing: 0; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.pad button {
  height: 56px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line);
  font-size: 21px; font-weight: 700; cursor: pointer; display: grid; place-items: center;
  transition: transform .12s var(--spring), background .2s;
}
.pad button:active { transform: scale(.92); }
.pad button svg { width: 22px; height: 22px; }
.pad .ok { background: var(--grad); border-color: rgba(255, 255, 255, .25); color: #fff; }
.pad button:disabled { opacity: .35; }

/* Transitions entre questions (animation choisie par le createur). */
.enter-slide { animation: inSlide .38s var(--spring) both; }
.exit-slide  { animation: outSlide .22s ease both; }
.enter-fade  { animation: inFade .32s ease both; }
.exit-fade   { animation: outFade .2s ease both; }
.enter-zoom  { animation: inZoom .36s var(--spring) both; }
.exit-zoom   { animation: outZoom .22s ease both; }
.enter-flip  { animation: inFlip .42s var(--spring) both; }
.exit-flip   { animation: outFlip .24s ease both; }
@keyframes inSlide { from { transform: translateX(48px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes outSlide { to { transform: translateX(-48px); opacity: 0 } }
@keyframes inFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes outFade { to { opacity: 0 } }
@keyframes inZoom { from { transform: scale(.86); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes outZoom { to { transform: scale(.86); opacity: 0 } }
@keyframes inFlip { from { transform: perspective(500px) rotateY(80deg); opacity: 0 } to { transform: perspective(500px) rotateY(0); opacity: 1 } }
@keyframes outFlip { to { transform: perspective(500px) rotateY(-80deg); opacity: 0 } }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.96) } to { opacity: 1; transform: none } }

/* ---------- Resultat ---------- */
.hero { padding: 26px 20px 22px; }
.grade { font-size: 24px; font-weight: 800; letter-spacing: -.6px; margin-top: 4px; }
.score { margin-top: 18px; display: grid; place-items: center; }
.ring { width: 170px; height: 170px; }
.ring .track { stroke: var(--line2); stroke-width: 10; }
.ring .fill { stroke-width: 10; stroke-dasharray: 439.8; stroke-dashoffset: 439.8; transform: rotate(-90deg); transform-origin: center; }
.ring text { fill: var(--tx); font-family: var(--font); stroke: none; }
.half { width: 220px; height: 124px; overflow: visible; }
.half .track { stroke: var(--line2); stroke-width: 11; }
.half .fill { stroke-width: 11; stroke-dasharray: 283; stroke-dashoffset: 283; }
.half text { fill: var(--tx); font-family: var(--font); stroke: none; }
.bar-pct { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.bar-track { width: 100%; height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0 8px; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad); }
.bar-lbl { width: 100%; display: flex; justify-content: space-between; font-size: 11px; color: var(--tx3); }
.badge { padding: 20px 38px; border-radius: 22px; background: var(--card2); border: 1px solid var(--line2); }
.badge b { font-size: 56px; font-weight: 800; line-height: 1; display: block; }
.badge span { font-size: 16px; color: var(--tx2); }

.list { margin: 4px -6px 0; }
.res {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid var(--line); opacity: 0;
  animation: resIn .42s var(--spring) both; animation-delay: calc(var(--i) * 70ms + 250ms);
}
.res:last-child { border-bottom: 0; }
.res .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.res .dot svg { width: 14px; height: 14px; stroke-width: 3; color: #fff; }
.res.f .dot { background: var(--ok); }
.res.m .dot { background: var(--ko); }
.res .t { flex: 1; font-size: 13.5px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.res .v { font-size: 11px; font-weight: 700; }
.res.f .v { color: var(--ok); }
.res.m .v { color: var(--ko); }
@keyframes resIn { from { opacity: 0; transform: translateX(-14px) } to { opacity: 1; transform: none } }

.hush-ft { text-align: center; padding: 22px 20px; }
.hush-ft .btn { display: inline-flex; width: auto; padding: 0 26px; margin-top: 14px; }

/* ---------- Feuille de partage + rappel ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); animation: inFade .25s ease; }
.sheet { width: 100%; max-width: 480px; background: var(--bg); border: 1px solid var(--line2); border-radius: 24px; padding: 24px 20px 20px; animation: sheetUp .35s var(--spring); max-height: 80dvh; overflow-y: auto; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
.step { display: flex; gap: 12px; margin-top: 16px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--tx); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.step b { display: block; font-size: 13.5px; }
.step p { font-size: 12.5px; color: var(--tx2); line-height: 1.5; margin-top: 2px; }
.remind {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 150;
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 99px;
  background: var(--grad); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; animation: pop .3s var(--spring);
}
.remind svg { width: 16px; height: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 70px); z-index: 400;
  background: var(--bg); border: 1px solid var(--line2); color: var(--tx);
  padding: 12px 22px; border-radius: 99px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: transform .3s var(--spring), opacity .3s; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.spinner { width: 36px; height: 36px; margin: 60px auto 14px; border: 3px solid var(--line2); border-top-color: var(--g1); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}