:root {
  --bg: #070707;
  --panel: rgba(255,255,255,.025);
  --white: #f5f3ee;
  --muted: #8d8d8d;
  --line: rgba(255,255,255,.16);
  --line-strong: rgba(255,255,255,.34);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--white);
}

body {
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.035), transparent 32%),
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  pointer-events: none;
}


.grain {
  position: fixed;
  inset: 0;
  opacity: .018;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}


@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-2%,2%); }
  40% { transform: translate(3%,-1%); }
  60% { transform: translate(-1%,3%); }
  80% { transform: translate(2%,-2%); }
}

.shell {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.view {
  min-height: 100vh;
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  display: none;
  place-items: center;
  align-content: center;
  text-align: center;
  position: relative;
  padding: 72px 0;
}

.view.active {
  display: grid;
  animation: fadeIn .7s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sigil {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 35px;
  margin-bottom: 28px;
  box-shadow: 0 0 80px rgba(255,255,255,.05);
}

.sigil.small {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.eyebrow {
  letter-spacing: .32em;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 18px;
}

h1, h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
}

h1 { font-size: clamp(42px, 7vw, 74px); }
h2 { font-size: clamp(30px, 4.6vw, 52px); max-width: 760px; }

.panel {
  width: min(390px, 100%);
  margin-top: 44px;
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.panel.compact { margin-top: 36px; }

label {
  display: block;
  text-align: left;
  margin-bottom: 18px;
}

label span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--white);
  padding: 10px 2px 12px;
  outline: none;
  font: inherit;
  transition: border-color .2s ease;
}

input:focus { border-color: var(--white); }

button {
  font: inherit;
  cursor: pointer;
}

.panel button {
  width: 100%;
  border: 1px solid var(--white);
  background: var(--white);
  color: #080808;
  padding: 13px 16px;
  margin-top: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  transition: .25s ease;
}

.panel button:hover {
  background: transparent;
  color: var(--white);
}

.error {
  color: #c7c7c7;
  min-height: 18px;
  margin: 14px 0 0;
  font-size: 12px;
}

.corner-code {
  position: absolute;
  right: 0;
  bottom: 28px;
  color: #444;
  font-size: 10px;
  letter-spacing: .3em;
}

.ghost {
  position: absolute;
  top: 26px;
  right: 0;
  border: 0;
  background: transparent;
  color: #676767;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10px;
}

.ghost:hover { color: var(--white); }
.back { right: auto; left: 0; }

.countdown-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(8px, 2vw, 22px);
  margin: 26px 0 20px;
}

.count-unit {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 92px;
}

.count-unit strong {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(44px, 8vw, 86px);
  font-weight: 400;
  letter-spacing: -.04em;
}

.count-unit span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.divider {
  font-family: "Cormorant Garamond", serif;
  color: #535353;
  font-size: 42px;
}

.subtle, .whisper {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .14em;
}

.sealed-line {
  width: min(460px, 70vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin: 56px 0 22px;
}

.whisper { opacity: .52; }

.gift {
  width: 190px;
  height: 170px;
  margin: 58px auto 28px;
  border: 0;
  background: transparent;
  position: relative;
  filter: drop-shadow(0 20px 55px rgba(0,0,0,.55));
}

.gift-body,
.gift-lid,
.gift-ribbon-v,
.gift-ribbon-h {
  position: absolute;
  display: block;
  border: 1px solid rgba(255,255,255,.62);
}

.gift-body {
  width: 148px;
  height: 112px;
  left: 21px;
  bottom: 4px;
  background: #0b0b0b;
}

.gift-lid {
  width: 166px;
  height: 38px;
  left: 12px;
  top: 18px;
  background: #0d0d0d;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
  transform-origin: 20% 100%;
  z-index: 3;
}

.gift-ribbon-v {
  width: 22px;
  height: 148px;
  left: 84px;
  bottom: 4px;
  border-top: 0;
  border-bottom: 0;
  background: rgba(255,255,255,.03);
  z-index: 4;
}

.gift-ribbon-h {
  width: 166px;
  height: 18px;
  left: 12px;
  top: 28px;
  border-left: 0;
  border-right: 0;
  background: rgba(255,255,255,.03);
  z-index: 4;
}

.gift:hover .gift-lid {
  transform: translateY(-6px) rotate(-1.5deg);
}

.gift::before,
.gift::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 46px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 50% 50% 0 50%;
  z-index: 5;
}

.gift::before {
  left: 52px;
  transform: rotate(28deg);
}

.gift::after {
  right: 52px;
  transform: scaleX(-1) rotate(28deg);
}

.reveal {
  width: min(800px, calc(100% - 34px));
  padding-top: 110px;
  padding-bottom: 120px;
  align-content: start;
}

.flash {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.flash.fire { animation: flash .8s ease; }

@keyframes flash {
  0% { opacity: 0; }
  15% { opacity: .92; }
  32% { opacity: .08; }
  100% { opacity: 0; }
}

.opened-gift {
  height: 70px;
  margin-bottom: 30px;
  position: relative;
  opacity: 0;
  transform: scale(.8);
}

.opened-gift.show {
  animation: giftBurst .9s .18s ease forwards;
}

.opened-gift span {
  width: 1px;
  height: 62px;
  background: rgba(255,255,255,.45);
  position: absolute;
  top: 0;
  left: 50%;
  transform-origin: bottom;
}

.opened-gift span:nth-child(1) { transform: rotate(-52deg); }
.opened-gift span:nth-child(2) { transform: rotate(0deg); }
.opened-gift span:nth-child(3) { transform: rotate(52deg); }

@keyframes giftBurst {
  to { opacity: 1; transform: scale(1); }
}

.poem {
  margin-top: 50px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.65;
  letter-spacing: .01em;
  text-align: center;
}

.poem-line {
  opacity: 0;
  transform: translateY(8px);
  min-height: 1.2em;
  margin: 0;
}

.poem-line.show {
  animation: lineIn .85s ease forwards;
}

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

@media (max-width: 700px) {
  .countdown-wrap { gap: 4px; }
  .count-unit { min-width: 60px; }
  .divider { font-size: 26px; }
  .view { width: min(100% - 26px, 920px); }
  h2 br { display: none; }
}




.test-actions {
  width: min(620px, 100%);
  margin-top: 46px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.choice-button {
  min-height: 170px;
  padding: 25px;
  border: 1px solid var(--line);
  background: rgba(8,8,8,.58);
  color: var(--white);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease, background .3s ease;
  backdrop-filter: blur(12px);
}

.choice-button::after {
  content: "?";
  position: absolute;
  right: -5px;
  bottom: -40px;
  font-family: "Cormorant Garamond", serif;
  font-size: 145px;
  color: rgba(255,255,255,.025);
  transition: transform .4s ease, color .4s ease;
}

.choice-button:hover {
  border-color: rgba(255,255,255,.58);
  transform: translateY(-3px);
  background: rgba(255,255,255,.035);
}

.choice-button:hover::after {
  transform: translateY(-8px) rotate(5deg);
  color: rgba(255,255,255,.06);
}

.choice-button > span {
  display: block;
  color: #656565;
  font-size: 9px;
  letter-spacing: .25em;
  margin-bottom: 36px;
}

.choice-button strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 25px;
  font-weight: 400;
  margin-bottom: 8px;
}

.choice-button small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 620px) {
  .test-actions {
    grid-template-columns: 1fr;
  }

  .choice-button {
    min-height: 145px;
  }
}








/* --- V6 : GIF fourni par l'utilisateur en fond --- */
body {
  background: #050505;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,.43), rgba(0,0,0,.43)),
    url("background.gif") center center / cover no-repeat;
  opacity: .9;
  transform: translateZ(0);
}

.grain {
  display: none;
}

.shell {
  position: relative;
  z-index: 1;
}

/* Petit voile au centre pour conserver la lisibilité des textes */
.view::before {
  content: "";
  position: absolute;
  inset: 8% -8%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,.48) 0%,
    rgba(0,0,0,.25) 42%,
    rgba(0,0,0,0) 72%
  );
}


/* --- V7 : points d'interrogation au-dessus du GIF --- */
.questions-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.question {
  position: absolute;
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  line-height: 1;
  color: rgba(255,255,255,.075);
  text-shadow: 0 0 18px rgba(255,255,255,.025);
  user-select: none;
  will-change: transform;
  backface-visibility: hidden;
}

.question-1 {
  left: 4%;
  top: 8%;
  font-size: clamp(80px, 11vw, 160px);
  transform: rotate(-9deg);
  animation: questionDriftA 22s ease-in-out infinite alternate;
}

.question-2 {
  right: 6%;
  top: 14%;
  font-size: clamp(55px, 7vw, 105px);
  transform: rotate(11deg);
  animation: questionDriftB 27s ease-in-out infinite alternate;
}

.question-3 {
  left: 10%;
  bottom: 8%;
  font-size: clamp(45px, 6vw, 90px);
  transform: rotate(6deg);
  animation: questionDriftC 25s ease-in-out infinite alternate;
}

.question-4 {
  right: 8%;
  bottom: 5%;
  font-size: clamp(90px, 12vw, 175px);
  transform: rotate(-7deg);
  animation: questionDriftD 29s ease-in-out infinite alternate;
}

.question-5 {
  left: 29%;
  top: 4%;
  font-size: clamp(34px, 4.5vw, 68px);
  opacity: .7;
  animation: questionDriftB 24s ease-in-out infinite alternate-reverse;
}

.question-6 {
  right: 25%;
  bottom: 13%;
  font-size: clamp(32px, 4vw, 60px);
  opacity: .65;
  animation: questionDriftA 26s ease-in-out infinite alternate-reverse;
}

@keyframes questionDriftA {
  from { translate: 0 0; }
  to { translate: 12px -16px; }
}

@keyframes questionDriftB {
  from { translate: 0 0; }
  to { translate: -10px 14px; }
}

@keyframes questionDriftC {
  from { translate: 0 0; }
  to { translate: 9px -12px; }
}

@keyframes questionDriftD {
  from { translate: 0 0; }
  to { translate: -13px -10px; }
}


/* V8 : bouton Quitter toujours visible en haut à droite */
.logout,
.logout.top-right {
  position: fixed;
  top: 24px;
  right: 28px;
  left: auto;
  z-index: 50;
  padding: 8px 10px;
  color: rgba(255,255,255,.55);
}

.logout:hover,
.logout.top-right:hover {
  color: #f5f3ee;
}

@media (max-width: 600px) {
  .logout,
  .logout.top-right {
    top: 15px;
    right: 14px;
  }
}
