:root {
  --bg: #07070d;
  --cyan: #6fe6f2;
  --pink: #e86ad8;
  --violet: #8b7bff;
  --text: #e9ecf5;
  --muted: #8d93a8;
  --accent: var(--cyan);           /* change selon le projet */
  --glow-s: 0 0 4px rgba(111, 230, 242, .45), 0 0 14px rgba(111, 230, 242, .18);
  --glow-p: 0 0 4px rgba(232, 106, 216, .45), 0 0 14px rgba(232, 106, 216, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Rajdhani", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Décor ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.ambient {
  position: absolute; inset: -10%;
  background-size: cover; background-position: center;
  filter: blur(60px) saturate(1.3) brightness(.35);
  opacity: .9;
  transition: background-image .6s, opacity .6s;
}
.horizon {
  position: absolute; left: 0; right: 0; top: 58%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--cyan), transparent);
  opacity: .35; filter: blur(1px);
}
.grid {
  position: absolute; left: -50%; right: -50%; top: 58%; height: 80%;
  background-image:
    linear-gradient(rgba(139, 123, 255, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 123, 255, .22) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(380px) rotateX(62deg);
  transform-origin: top;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 75%);
  animation: gridMove 3s linear infinite;
}
@keyframes gridMove { to { background-position: 0 60px, 0 0; } }

#particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75));
}

/* ---------- Layout ---------- */
.hub {
  position: relative; z-index: 3;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.2vh, 22px);
  padding: 16px;
}

.logo {
  position: relative;
  font-family: "Orbitron", sans-serif; font-weight: 900;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: .12em;
  color: #f4fbff;
  text-shadow: var(--glow-s);
  animation: flicker 7s infinite;
}
.logo::before, .logo::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  opacity: .7;
}
.logo::before { color: var(--pink); transform: translate(-2px, 0); clip-path: inset(0 0 100% 0); animation: logoGlitch 5s infinite steps(1); }
.logo::after  { color: var(--cyan); transform: translate(2px, 0);  clip-path: inset(100% 0 0 0); animation: logoGlitch 5s infinite steps(1) reverse; }
@keyframes logoGlitch {
  0%, 92%, 100% { clip-path: inset(100% 0 0 0); }
  93% { clip-path: inset(10% 0 60% 0); }
  95% { clip-path: inset(55% 0 20% 0); }
  97% { clip-path: inset(30% 0 45% 0); }
}
@keyframes flicker {
  0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; }
  20%, 63% { opacity: .75; }
}

/* ---------- Carrousel ---------- */
.carousel {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 4vw, 70px);
  width: 100%;
}
.nav {
  flex: none;
  width: clamp(28px, 4vw, 54px); height: clamp(56px, 8vw, 108px);
  opacity: .7;
  transition: opacity .25s, transform .25s;
}
.nav svg { width: 100%; height: 100%; overflow: visible; }
.nav polyline {
  fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px var(--accent));
  transition: stroke .25s;
}
.nav:hover, .nav:focus-visible { opacity: 1; outline: none; }
.nav:hover polyline, .nav:focus-visible polyline { stroke: var(--accent); }
.prev:hover { transform: translateX(-6px); }
.next:hover { transform: translateX(6px); }
.nav:active { transform: scale(.9); }

.stage {
  width: min(62vw, 960px, calc((100vh - 330px) * 16 / 9));
  min-width: 220px;
  perspective: 1200px;
}
.card {
  position: relative; display: block;
  aspect-ratio: 16 / 9;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
  outline: none;
}
.frame {
  position: absolute; inset: 0; overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: #0d0d18;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 0 18px -4px var(--accent),
    0 30px 80px -20px rgba(0,0,0,.9);
  transition: box-shadow .4s, border-color .4s;
}
.card:hover .frame, .card:focus-visible .frame {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 0 32px -2px var(--accent), 0 30px 80px -20px rgba(0,0,0,.9);
}
.frame img, .placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease, filter .4s;
}
.card:hover .frame img { transform: scale(1.04); }
.placeholder {
  display: grid; place-items: center;
  font-family: "Orbitron", sans-serif; font-weight: 700; letter-spacing: .2em;
  font-size: clamp(16px, 3vw, 38px);
  color: rgba(255,255,255,.85);
  text-shadow: var(--glow-s);
}
.shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.08) 45%, transparent 60%);
  transform: translateX(-100%);
}
.card:hover .shine { animation: shine 1.1s ease; }
@keyframes shine { to { transform: translateX(100%); } }

/* coins façon HUD */
.corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); opacity: .85; transition: all .3s; filter: drop-shadow(0 0 3px var(--accent)); }
.tl { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.tr { top: -8px; right: -8px; border-left: 0; border-bottom: 0; }
.bl { bottom: -8px; left: -8px; border-right: 0; border-top: 0; }
.br { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }
.card:hover .tl { transform: translate(-4px, -4px); }
.card:hover .tr { transform: translate(4px, -4px); }
.card:hover .bl { transform: translate(-4px, 4px); }
.card:hover .br { transform: translate(4px, 4px); }

.enter {
  position: absolute; right: 14px; bottom: 12px;
  font-family: "Orbitron", sans-serif; font-size: 12px; letter-spacing: .2em;
  padding: 6px 10px;
  background: rgba(7,7,13,.75); border: 1px solid var(--accent);
  color: var(--accent);
  opacity: 0; transform: translateY(6px);
  transition: all .3s;
}
.card:hover .enter, .card:focus-visible .enter { opacity: 1; transform: none; }

/* ---------- Glitch de changement ---------- */
.slice {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; pointer-events: none;
}
.frame.glitch img, .frame.glitch .placeholder { animation: imgGlitch .45s steps(2) both; }
.frame.glitch .s1 { animation: slice1 .45s steps(1) both; mix-blend-mode: screen; background-color: rgba(232,106,216,.35); }
.frame.glitch .s2 { animation: slice2 .45s steps(1) both; mix-blend-mode: screen; background-color: rgba(111,230,242,.35); }
.frame.glitch .s3 { animation: slice3 .45s steps(1) both; }
@keyframes imgGlitch {
  0%   { transform: translate(0); filter: none; }
  20%  { transform: translate(-6px, 2px) skewX(4deg); filter: hue-rotate(40deg) saturate(2); }
  40%  { transform: translate(5px, -2px); filter: contrast(1.6) brightness(1.3); }
  60%  { transform: translate(-3px, 0) skewX(-3deg); filter: hue-rotate(-40deg); }
  80%  { transform: translate(2px, 1px); filter: none; }
  100% { transform: translate(0); filter: none; }
}
@keyframes slice1 {
  0%   { opacity: 1; clip-path: inset(8% 0 78% 0);  transform: translateX(-18px); }
  25%  { opacity: 1; clip-path: inset(40% 0 44% 0); transform: translateX(14px); }
  50%  { opacity: 1; clip-path: inset(70% 0 12% 0); transform: translateX(-10px); }
  75%  { opacity: 1; clip-path: inset(22% 0 66% 0); transform: translateX(6px); }
  100% { opacity: 0; }
}
@keyframes slice2 {
  0%   { opacity: 1; clip-path: inset(60% 0 25% 0); transform: translateX(16px); }
  30%  { opacity: 1; clip-path: inset(15% 0 70% 0); transform: translateX(-20px); }
  60%  { opacity: 1; clip-path: inset(48% 0 38% 0); transform: translateX(10px); }
  100% { opacity: 0; }
}
@keyframes slice3 {
  0%   { opacity: .9; clip-path: inset(30% 0 60% 0); transform: translateX(24px); }
  40%  { opacity: .9; clip-path: inset(82% 0 6% 0);  transform: translateX(-24px); }
  70%  { opacity: .9; clip-path: inset(5% 0 88% 0);  transform: translateX(12px); }
  100% { opacity: 0; }
}

/* ---------- Titre / description ---------- */
.meta { text-align: center; max-width: min(760px, 92vw); min-height: 92px; }
.title {
  font-family: "Orbitron", sans-serif; font-weight: 700;
  font-size: clamp(20px, 3.4vw, 40px);
  letter-spacing: .08em; text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 4px var(--accent), 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.desc {
  margin-top: 6px;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--muted);
  letter-spacing: .03em;
}
.meta.fade .desc { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

.dots { display: flex; gap: 10px; }
.dots button {
  width: 26px; height: 4px;
  background: rgba(255,255,255,.18);
  transition: all .3s;
}
.dots button[aria-selected="true"] { background: var(--accent); box-shadow: 0 0 8px var(--accent); width: 40px; }
.hint { font-size: 12px; color: rgba(255,255,255,.3); letter-spacing: .15em; text-transform: uppercase; }

/* ---------- Transition de sortie ---------- */
.warp { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: flex; flex-direction: column; }
.warp div { flex: 1; transform: scaleX(0); background: var(--bg); }
.warp.on { pointer-events: all; }
.warp.on div { animation: bar .5s cubic-bezier(.7,0,.3,1) forwards; }
.warp.on div:nth-child(odd)  { transform-origin: left;  border-top: 1px solid var(--pink); }
.warp.on div:nth-child(even) { transform-origin: right; border-top: 1px solid var(--cyan); }
.warp.on div:nth-child(1) { animation-delay: .00s; }
.warp.on div:nth-child(2) { animation-delay: .05s; }
.warp.on div:nth-child(3) { animation-delay: .02s; }
.warp.on div:nth-child(4) { animation-delay: .08s; }
.warp.on div:nth-child(5) { animation-delay: .03s; }
.warp.on div:nth-child(6) { animation-delay: .06s; }
@keyframes bar { to { transform: scaleX(1); } }
body.leaving .hub { animation: leave .55s steps(6) forwards; }
@keyframes leave {
  0%   { transform: none; filter: none; }
  30%  { transform: translate(-8px, 3px) skewX(6deg); filter: hue-rotate(60deg) contrast(1.6); }
  60%  { transform: translate(10px, -2px) scale(1.04); filter: hue-rotate(-60deg) brightness(1.6); }
  100% { transform: scale(1.12); filter: brightness(3) blur(4px); opacity: 0; }
}

/* ---------- Panel admin ---------- */
.admin {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(3,3,8,.78);
  backdrop-filter: blur(6px);
  padding: 16px;
}
.admin[hidden] { display: none; }
.admin-box {
  width: min(640px, 100%); max-height: 90vh; overflow: auto;
  background: #0c0c16;
  border: 1px solid rgba(111,230,242,.35);
  box-shadow: 0 0 30px -10px var(--cyan);
  padding: 20px;
}
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 8px; }
.admin-head h3 { font-family: "Orbitron", sans-serif; font-size: 15px; letter-spacing: .15em; color: var(--cyan); text-shadow: var(--glow-s); }
.admin label { display: block; font-size: 13px; color: var(--muted); letter-spacing: .05em; margin-bottom: 10px; }
.admin input, .admin textarea {
  display: block; width: 100%; margin-top: 4px;
  background: #07070d; color: var(--text);
  border: 1px solid rgba(255,255,255,.14);
  padding: 8px 10px; font: inherit; font-size: 15px;
  resize: vertical;
}
.admin input:focus, .admin textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 8px -2px var(--cyan); }
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--cyan); color: var(--cyan);
  font-family: "Orbitron", sans-serif; font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  transition: all .2s;
}
.btn:hover { background: rgba(111,230,242,.12); box-shadow: 0 0 10px -2px var(--cyan); }
.btn.ghost { border-color: rgba(255,255,255,.2); color: var(--text); }
.btn.danger { border-color: var(--pink); color: var(--pink); }
.btn.sm { padding: 5px 8px; font-size: 10px; }
.msg { margin-top: 10px; font-size: 14px; min-height: 1em; color: var(--pink); }
.msg.ok { color: var(--cyan); }

.plist { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plist li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.02);
}
.plist img, .plist .noimg { width: 72px; aspect-ratio: 16/9; object-fit: cover; flex: none; background: #15152a; }
.plist .info { flex: 1; min-width: 0; }
.plist .info b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .info small { color: var(--muted); }
.plist .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.editor { margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.15); }
.editor h4 { font-family: "Orbitron", sans-serif; font-size: 12px; letter-spacing: .15em; margin-bottom: 12px; color: var(--pink); }
.imgrow { display: flex; gap: 8px; align-items: stretch; }
.imgrow input { margin-top: 0; }
.imgrow .file { margin: 0; font-size: 11px; color: var(--text); display: flex; align-items: center; white-space: nowrap; cursor: pointer; }
.admin input.color { width: 60px; height: 34px; padding: 2px; cursor: pointer; }
.preview {width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 10px; border: 1px solid rgba(255,255,255,.1); }
.row { display: flex; gap: 8px; }
.login { display: flex; flex-direction: column; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .stage { width: calc(100vw - 110px); }
  .hint { display: none; }
  .enter { opacity: 1; transform: none; font-size: 10px; }
  .plist li { flex-wrap: wrap; }
  .plist .acts { width: 100%; }
}

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