:root { --bg: #07060d; --ink: #f2f0ff; --mute: #8f8aa8; --a: #7c5cff; --b: #19d3c5; --c: #ff5c93; color-scheme: dark; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, "Segoe UI", sans-serif; display: grid; place-items: center; overflow: hidden; }
#fond { position: fixed; inset: 0; width: 100%; height: 100%; }
.halo { position: fixed; width: 60vmax; height: 60vmax; left: 50%; top: 50%; translate: -50% -50%; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--a), var(--b), var(--c), var(--a)); filter: blur(120px); opacity: .22; animation: tourne 18s linear infinite; }
@keyframes tourne { to { rotate: 360deg; } }
main { position: relative; width: min(92vw, 400px); text-align: center; }

h1 { font-size: clamp(3rem, 12vw, 4.6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; display: flex; justify-content: center; }
h1 .l { display: inline-block; background: linear-gradient(120deg, var(--a), var(--b) 55%, var(--c)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(60%) rotateX(-90deg) scale(.6); filter: blur(10px);
  animation: lettre .9s cubic-bezier(.2, .9, .2, 1.2) forwards, flux 6s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms), 0s; }
@keyframes lettre { to { opacity: 1; transform: none; filter: none; } }
@keyframes flux { 50% { background-position: 100% 0; } }
.sous { color: var(--mute); margin: .6rem 0 1.8rem; animation: monte .8s .7s both; }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } }

.carte { display: grid; gap: 1rem; text-align: left; padding: 1.6rem; border-radius: 22px;
  background: rgba(20, 17, 38, .55); backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06); animation: monte .9s .9s both; }
.carte.sort { animation: sort .35s ease-in forwards; }
.carte.entre { animation: entre .5s cubic-bezier(.2, .9, .2, 1.1) both; }
.carte.tremble { animation: tremble .45s; }
.cache { display: none; }
@keyframes sort { to { opacity: 0; transform: translateX(-40px) scale(.96); filter: blur(6px); } }
@keyframes entre { from { opacity: 0; transform: translateX(40px) scale(.96); filter: blur(6px); } }
@keyframes tremble { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

label { display: grid; gap: .35rem; font-size: .8rem; color: var(--mute); }
input { font: inherit; color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px; padding: .8rem .9rem; outline: none; transition: border-color .25s, box-shadow .25s, background .25s; }
input:focus { border-color: var(--a); background: rgba(124, 92, 255, .08); box-shadow: 0 0 0 4px rgba(124, 92, 255, .2); }
button { position: relative; overflow: hidden; font: inherit; font-weight: 700; color: #fff; border: 0; border-radius: 12px; padding: .9rem; cursor: pointer;
  background: linear-gradient(120deg, var(--a), var(--b)); background-size: 200% 100%; transition: transform .2s, background-position .5s, box-shadow .3s; }
button:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 12px 30px -8px var(--a); }
button:active { transform: scale(.97); }
button[disabled] { opacity: .6; cursor: wait; }
button span { position: relative; }
.err { min-height: 1.3em; color: #ff7d9d; font-size: .85rem; text-align: center; }
.aide { color: var(--mute); font-size: .88rem; text-align: center; }

.code { display: flex; gap: .5rem; justify-content: center; }
.code i { width: 2.6rem; height: 3.2rem; display: grid; place-items: center; font: 700 1.5rem ui-monospace, monospace; font-style: normal;
  border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: .2s; }
.code i.on { border-color: var(--b); box-shadow: 0 0 0 4px rgba(25, 211, 197, .18); transform: translateY(-3px); }
#code { position: absolute; opacity: 0; pointer-events: none; }

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