:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --card: #151922;
  --card-hover: #1a1f2b;
  --line: #242a37;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #8b7cff;
  --accent-2: #5ee6c8;
  --danger: #ff6b7a;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 124, 255, .16), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(94, 230, 200, .08), transparent 60%),
    var(--bg);
}

a { color: inherit; }

main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 20px;
}

.top nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.top nav a.btn, .top nav a.btn:hover { color: #0b0d12; }
.top nav form { margin: 0; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .3px;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d12;
  font-weight: 800;
}

.foot {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.hero { padding: 36px 0 28px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 5vw, 42px); line-height: 1.15; }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 560px; }

.search {
  width: 100%;
  max-width: 460px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.search:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.card:hover { transform: translateY(-3px); border-color: rgba(139, 124, 255, .5); background: var(--card-hover); }

.cover { aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cover-empty {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 48px;
  font-weight: 800;
  color: rgba(139, 124, 255, .55);
  background: linear-gradient(135deg, rgba(139, 124, 255, .12), rgba(94, 230, 200, .06));
}

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.summary { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(139, 124, 255, .12);
  border: 1px solid rgba(139, 124, 255, .25);
}

.version { color: var(--accent-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dl { margin-left: auto; color: var(--muted); font-size: 12px; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.hidden { display: none; }

.back { display: inline-block; margin: 8px 0 20px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.gallery { display: flex; flex-direction: column; gap: 10px; }

.main-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: zoom-in;
}
.main-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(26px) brightness(.5) saturate(1.2);
  transform: scale(1.2);
}
.main-img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbs { display: flex; gap: 8px; overflow-x: auto; }

.thumb {
  flex: 0 0 auto;
  width: 92px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-2);
  cursor: pointer;
  opacity: .6;
}

.thumb.active, .thumb:hover { border-color: var(--accent); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.info h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.2; }
.lead { color: var(--muted); margin: 14px 0 22px; }

.facts { display: flex; gap: 28px; margin: 22px 0 0; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.description {
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.description h2 { margin: 0 0 10px; font-size: 18px; }
.description p { color: #c9cdd8; overflow-wrap: anywhere; }
.description a { color: var(--accent-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--accent), #a99bff);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.1); }
.btn-big { width: 100%; padding: 14px 20px; font-size: 16px; }
.btn-big span { font-weight: 500; font-size: 13px; opacity: .75; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: rgba(255, 107, 122, .15); color: var(--danger); border: 1px solid rgba(255, 107, 122, .35); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.link:hover { color: var(--text); }

.panel {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  margin-top: 20px;
}

.panel h1 { margin: 0 0 6px; font-size: 24px; }
.panel summary { cursor: pointer; font-weight: 600; }
.narrow { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; gap: 16px; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.grow { flex: 1 1 260px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

input[type="file"] { padding: 8px; }
textarea { resize: vertical; }

fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
legend { color: var(--muted); font-size: 14px; padding: 0 6px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.check input, .img-keep input { width: auto; }

.img-list { display: flex; flex-wrap: wrap; gap: 12px; }
.img-keep { width: 140px; gap: 4px; }
.img-keep img { width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.img-keep span { display: flex; align-items: center; gap: 6px; }

.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.admin-head h1 { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions form { margin: 0; }

.error, .notice { margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.error { color: var(--danger); background: rgba(255, 107, 122, .1); border: 1px solid rgba(255, 107, 122, .3); }
.notice { color: var(--accent-2); background: rgba(94, 230, 200, .08); border: 1px solid rgba(94, 230, 200, .25); margin-bottom: 16px; }

.video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
}

.license {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 87, .35);
  background: rgba(255, 200, 87, .07);
  font-size: 13px;
  line-height: 1.5;
}
.license strong { color: #ffc857; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.license-ok { color: #8ff0da; }
.license-no { color: #ff9aa5; }
.foot-license { display: inline-block; margin-top: 6px; font-size: 12px; color: #6f778a; }

.who { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.role {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #0b0d12;
  background: linear-gradient(135deg, #ffc857, #ff9f43);
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 22px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.tab span { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--bg-2); }
.tab:hover { color: var(--text); border-color: rgba(139, 124, 255, .5); }
.tab.active { color: #0b0d12; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.tab.active span { background: rgba(11, 13, 18, .2); }

.cover { position: relative; }
.cat-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(11, 13, 18, .75);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
}
.badge-cat { color: var(--accent-2); background: rgba(94, 230, 200, .1); border-color: rgba(94, 230, 200, .3); }

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form input { min-width: 0; padding: 7px 10px; }
.add-cat { margin-top: 12px; max-width: 520px; }

.section-title { margin: 32px 0 10px; font-size: 18px; }
.section-title + .hint { margin-bottom: 12px; }
.table-wrap + .hint { margin-top: 10px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.hint a { color: var(--accent); }
.center { text-align: center; }
.info .hint { margin-top: 10px; }
.link-danger { color: var(--danger); font-size: 13px; }

.stars { display: inline-flex; align-items: center; gap: 2px; margin: 6px 0 0; }
.star { color: #3a4152; font-size: 20px; line-height: 1; }
.star.on { color: #ffc857; }
.star.half {
  background: linear-gradient(90deg, #ffc857 50%, #3a4152 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stars-label { margin-left: 8px; color: var(--muted); font-size: 13px; }
.stars-small .star { font-size: 15px; }
.stars-small .stars-label { font-size: 12px; }

.rate-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.rate-title { color: var(--muted); font-size: 14px; }
.rate { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label {
  color: #3a4152;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  transition: color .1s ease, transform .1s ease;
}
.rate label:hover, .rate label:hover ~ label, .rate input:checked ~ label { color: #ffc857; }
.rate label:hover { transform: scale(1.12); }
.rate input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }
.js .js-hide { display: none; }

.comments h2 { margin-bottom: 16px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.comment-form .btn { align-self: flex-end; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.comment p { margin: 8px 0 0; color: #c9cdd8; overflow-wrap: anywhere; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; }
.comment-head time { color: var(--muted); font-size: 12px; }
.comment-head form { margin: 0 0 0 auto; }
.comment-stars { color: #ffc857; font-size: 13px; letter-spacing: 1px; }
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

@media (max-width: 760px) {
  main, .top { padding-left: 16px; padding-right: 16px; }
  .top { padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
  .top nav { gap: 12px; font-size: 13px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 30px; height: 30px; }
  .hero { padding: 18px 0 20px; }
  .hero p { font-size: 14px; }
  .search { max-width: none; font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .detail { grid-template-columns: 1fr; gap: 18px; }
  .info h1 { font-size: 24px; }
  .facts { gap: 18px; flex-wrap: wrap; }
  .description { padding: 18px 16px; }
  .panel { padding: 20px 16px; }
  .narrow { margin: 16px auto; }
  input, textarea { font-size: 16px; }
  .rate label { font-size: 34px; padding: 4px; }
  .comment-form .btn { align-self: stretch; }
  .actions { flex-direction: column; align-items: stretch; }
  .thumb { width: 76px; }
}

@media (max-width: 380px) {
  .top nav .btn { padding: 6px 10px; }
  .stars-label { display: block; margin: 4px 0 0; width: 100%; }
  .stars { flex-wrap: wrap; }
}

/* Statut "En construction" */
.badge-soon { color: #fbbf24; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .4); }
.btn-soon { cursor: not-allowed; background: repeating-linear-gradient(135deg, rgba(251, 191, 36, .18) 0 14px, rgba(0, 0, 0, .25) 14px 28px); color: #fbbf24; border: 1px dashed rgba(251, 191, 36, .6); box-shadow: none; }
.btn-soon:hover { transform: none; filter: none; }

/* Licence revendeur + scripts payants */
.btn-buy { background: linear-gradient(135deg, #22c55e, #16a34a); }
.license-key { color: #fbbf24; }
.license-key a { color: inherit; text-decoration: underline; }
.lic-ok { font-size: 22px; font-weight: 700; color: #3ddc84; margin: 0; }
.lic-bad { font-size: 22px; font-weight: 700; color: #ef4444; margin: 0; }
.lic-list { margin: 0; padding-left: 20px; line-height: 1.7; }
.lic-key-big code { font-size: 22px; letter-spacing: 2px; padding: 8px 14px; border-radius: 10px; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); color: #fbbf24; display: inline-block; }
.licence-page h2 { margin-top: 10px; font-size: 18px; }
code { font-family: ui-monospace, Consolas, monospace; }

.copy-link { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); color: #fbbf24; cursor: text; }

.lic-credit code { display: inline-block; padding: 8px 12px; border-radius: 10px; background: rgba(61, 220, 132, .1); border: 1px solid rgba(61, 220, 132, .4); color: #3ddc84; }
