/* ---------- Écran de chargement ---------- */
.boot { position: fixed; inset: 0; z-index: 500; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--ink-0); transition: opacity .35s; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-mark, .brand-mark { display: block; background: center / contain no-repeat url("/img/noctis-logo.svg?v=8"); }
.boot-mark { width: 64px; height: 64px; border-radius: 16px; animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(139, 108, 239, .2); }

.screen { position: fixed; inset: 0; z-index: 1; overflow: auto; }

/* ---------- Connexion ---------- */
.auth-screen { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); }
.auth-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px;
  background:
    radial-gradient(ellipse 60% 50% at 30% 30%, rgba(139, 108, 239, .16), transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 90%, rgba(142, 44, 51, .22), transparent 70%),
    linear-gradient(160deg, #15110d, #0a0908 70%);
  border-right: 1px solid var(--line);
}
.auth-hero::after {
  content: ""; position: absolute; right: -180px; top: 50%; width: 620px; height: 620px; transform: translateY(-50%);
  border-radius: 50%; border: 1px solid rgba(139, 108, 239, .12);
  box-shadow: 0 0 0 40px rgba(139, 108, 239, .025), 0 0 0 90px rgba(139, 108, 239, .02), inset 0 0 120px rgba(139, 108, 239, .06);
}
.auth-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-brand span { font: 700 20px var(--font-display); letter-spacing: .32em; }
.auth-pitch { position: relative; z-index: 1; max-width: 520px; }
.auth-pitch h1 { margin: 0 0 18px; font: 600 clamp(34px, 4vw, 52px)/1.08 var(--font-display); letter-spacing: .02em; }
.auth-pitch h1 em { font-style: normal; color: var(--gold-2); }
.auth-pitch p { margin: 0; color: var(--text-2); font: 400 17px/1.6 var(--font-serif); max-width: 440px; }
.auth-features { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 620px; }
.auth-feature { padding: 14px; border-radius: var(--r-3); border: 1px solid var(--line); background: rgba(21, 23, 26, .6); backdrop-filter: blur(4px); }
.auth-feature .icon { color: var(--gold); margin-bottom: 10px; }
.auth-feature strong { display: block; font-size: 13px; margin-bottom: 4px; }
.auth-feature span { color: var(--text-3); font-size: 12px; line-height: 1.45; }

.auth-side { display: grid; place-items: center; padding: 40px 28px; background: var(--ink-1); }
.auth-card { width: min(380px, 100%); }
.auth-card h2 { margin: 0 0 6px; font: 600 24px var(--font-display); letter-spacing: .04em; }
.auth-card > p { margin: 0 0 24px; color: var(--text-3); }
.auth-card .segmented { margin-bottom: 22px; }
.auth-card .btn.primary { margin-top: 6px; }
.auth-foot { margin-top: 22px; color: var(--text-4); font-size: 12px; text-align: center; }

/* ---------- Salle des campagnes ---------- */
.lobby-screen { background: radial-gradient(ellipse 70% 40% at 50% -10%, rgba(139, 108, 239, .1), transparent 70%), var(--ink-0); }
.lobby-top { position: sticky; top: 0; z-index: 5; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(10, 9, 8, .85); backdrop-filter: blur(10px); }
.lobby-top .brand-name { font: 700 15px var(--font-display); letter-spacing: .3em; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 5px; border-radius: 40px; border: 1px solid var(--line-2); background: var(--ink-2); }
.user-chip:hover { border-color: #3d424a; }
.user-chip strong { font-size: 13px; font-weight: 600; }
.lobby-main { max-width: 1180px; margin: 0 auto; padding: 46px 28px 80px; position: relative; z-index: 1; }
.lobby-hero { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.lobby-hero h1 { margin: 6px 0 0; font: 600 34px/1.1 var(--font-display); letter-spacing: .03em; }
.lobby-hero .spacer { flex: 1; }
.lobby-actions { display: flex; gap: 10px; }

.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.campaign-card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--r-4); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--ink-2); box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; cursor: pointer;
}
.campaign-card:hover { transform: translateY(-3px); border-color: var(--line-gold); box-shadow: 0 20px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(139, 108, 239, .12); }
.campaign-cover {
  position: relative; height: 136px; overflow: hidden;
  background:
    radial-gradient(circle at 78% 30%, hsla(var(--hue), 55%, 55%, .35), transparent 45%),
    radial-gradient(circle at 15% 100%, hsla(calc(var(--hue) + 40), 45%, 35%, .5), transparent 55%),
    linear-gradient(140deg, hsl(var(--hue), 25%, 14%), #0f0d0b);
}
.campaign-cover::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(rgba(255, 255, 255, .7) .7px, transparent 1px); background-size: 34px 34px; background-position: 7px 11px; mask-image: linear-gradient(transparent, #000 40%, transparent); }
.campaign-cover::after { content: ""; position: absolute; right: 28px; top: 24px; width: 58px; height: 58px; border-radius: 50%; box-shadow: -12px 8px 0 0 hsla(var(--hue), 40%, 80%, .55); opacity: .85; }
.campaign-cover .badge { position: absolute; left: 16px; top: 16px; backdrop-filter: blur(6px); background: rgba(10, 9, 8, .55); }
.campaign-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.campaign-body h3 { margin: 0; font: 600 18px/1.25 var(--font-display); letter-spacing: .03em; }
.campaign-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-3); font-size: 12px; }
.campaign-meta span { display: inline-flex; align-items: center; gap: 6px; }
.campaign-meta .icon { width: 14px; height: 14px; }
.campaign-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.campaign-foot .spacer { flex: 1; }
.campaign-online { color: var(--emerald-2); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.campaign-online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(108, 194, 139, .15); }

.campaign-new { display: grid; place-items: center; min-height: 290px; border: 1px dashed var(--line-2); border-radius: var(--r-4); color: var(--text-3); background: transparent; transition: border-color .2s, color .2s, background .2s; }
.campaign-new:hover { border-color: var(--gold-3); color: var(--gold-2); background: rgba(139, 108, 239, .03); }
.campaign-new div { display: grid; justify-items: center; gap: 10px; }
.campaign-new .icon { width: 28px; height: 28px; }

.template-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.template-pick label { position: relative; display: grid; gap: 6px; padding: 14px; border-radius: var(--r-3); border: 1px solid var(--line-2); background: var(--ink-1); cursor: pointer; transition: border-color .15s, background .15s; }
.template-pick input { position: absolute; opacity: 0; }
.template-pick label:has(input:checked) { border-color: var(--gold-3); background: rgba(139, 108, 239, .07); box-shadow: 0 0 0 3px var(--gold-glow); }
.template-pick strong { font: 600 13.5px var(--font-display); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.template-pick strong .icon { color: var(--gold); }
.template-pick span { color: var(--text-3); font-size: 12px; line-height: 1.45; }

.code-input { text-align: center; text-transform: uppercase; letter-spacing: .3em; font: 600 22px var(--font-display) !important; height: 56px !important; }

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .lobby-main { padding: 28px 16px 60px; }
  .lobby-top { padding: 0 16px; }
  .lobby-hero h1 { font-size: 26px; }
}
.template-pick label.disabled { opacity: .4; cursor: not-allowed; }
.system-pick label:has(input[value=vtm5]:checked) { border-color: #b3263a; background: rgba(179, 38, 58, .08); box-shadow: 0 0 0 3px rgba(179, 38, 58, .25); }
.system-pick label:has(input[value=vtm5]) strong .icon { color: #d9415a; }
.campaign-cover .badge + .badge { margin-left: 6px; }
.lobby-foot { margin-top: 28px; text-align: center; font: 500 11.5px var(--font-mono); color: var(--text-4); }

/* Inscription : rappel des règles du serveur */
.auth-note { margin: -4px 0 10px; color: var(--text-3); font-size: 12px; line-height: 1.45; }

/* Administration du serveur */
.admin section { margin-bottom: 20px; }
.admin h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; }
.admin-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.admin-row-head h3 { margin: 0; }
.admin-modes { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.admin-users { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-users th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.admin-users td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-acts { text-align: right; white-space: nowrap; }
.temp-pass { text-align: center; margin: 16px 0; }
.temp-pass code { font-size: 22px; letter-spacing: .08em; padding: 10px 16px; border-radius: 10px; background: var(--ink-3); user-select: all; }
@media (max-width: 640px) { .admin-users th:nth-child(3), .admin-users td:nth-child(3), .admin-users th:nth-child(4), .admin-users td:nth-child(4) { display: none; } }

/* Espace de stockage d'une campagne */
.storage-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.storage-bar span { display: block; height: 100%; background: var(--violet); border-radius: inherit; }
.storage .btn { margin-top: 6px; }

/* Bannière personnalisée */
.campaign-cover.has-image { background-repeat: no-repeat; }
.campaign-cover.has-image::before, .campaign-cover.has-image::after { display: none; }
.campaign-cover.has-image .badge { z-index: 1; }
.cover-preview { height: 150px; border-radius: var(--r-3); margin-bottom: 14px; cursor: grab; border: 1px solid var(--line-2); touch-action: none; }
.cover-preview:active { cursor: grabbing; }

.lobby-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 8px; font: 500 12px var(--font-ui); }
.lobby-legal a { color: var(--text-3); text-decoration: none; }
.lobby-legal a:hover { color: var(--text); }
