/* Airblyx Dashboard — repris de la bannière Airblyx
   VOIX   : vif, sûr de lui, un peu anime
   IDÉE   : la bannière : aplats noirs, bleu roi et bleu ciel coupés en diagonale
   IMAGE  : la mascotte détourée dans un grand bloc en biais, losanges du logo
   COULEUR: noir #000, bleu roi #1f2c9c, bleu vif #2f4fe0, bleu ciel #8ab4f8, blanc
   TYPO   : Kanit (titres gras en italique), Open Sans (texte, slogan en italique) */

:root {
  color-scheme: dark;
  --black: #000;
  --ink: #04060f;
  --navy: #0a1033;
  --navy-2: #0f1a4a;
  --royal: #1f2c9c;
  --blue: #2f4fe0;
  --blue-hover: #3d5cf0;
  --sky: #8ab4f8;
  --sky-2: #b9d2ff;
  --line: rgba(138, 180, 248, .16);
  --line-2: rgba(138, 180, 248, .28);
  --text: #ffffff;
  --muted: #a9b6dc;
  --subtle: #6f7ba3;
  --green: #4ade80;
  --red: #ff5c6c;
  --cut: 18px;
  --display: "Kanit", "Arial Black", system-ui, sans-serif;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; min-width: 0; }

html, body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.spinner { width: 30px; height: 30px; background: var(--blue); animation: spin 1s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes spin { to { transform: rotate(405deg); } }

/* Icônes SVG */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.with-ic { display: flex; align-items: center; gap: 10px; }
.with-ic .ic { color: var(--sky); width: 22px; height: 22px; }

.eyebrow .ic { width: .8em; height: .8em; margin-right: 6px; vertical-align: -.05em; }

.eyebrow {
  margin: 0 0 8px; font: italic 700 14px/1 var(--font);
  letter-spacing: .04em; color: var(--sky);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(0, 0, 0, .86);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--royal) 0 40%, var(--blue) 40% 75%, var(--sky) 75%);
}
.site-header .nav {
  height: 60px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}
.site-header .brand { display: flex; align-items: center; gap: 10px; font: italic 800 21px/1 var(--display); letter-spacing: -.01em; }
.site-header .brand img { height: 30px; width: auto; display: block; }
.site-header .menu { flex: 1; display: flex; justify-content: flex-end; gap: 26px; font-size: 14px; font-weight: 600; color: var(--muted); }
.site-header .menu a { transition: color .2s; }
.site-header .menu a:hover { color: #fff; }

.login-button {
  display: inline-flex; align-items: center; height: 36px; padding: 0 18px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 14px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: background .2s;
}
.login-button:hover { background: var(--blue-hover); }

.account-area { display: flex; align-items: center; gap: 14px; flex: none; }
.account-button { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.account-button img, .account-button .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--sky); }
.account-button .avatar-fallback { display: grid; place-items: center; font-size: 13px; }
.account-button .name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link { color: var(--muted); font-size: 13px; }
.logout-link:hover { color: var(--red); }

.avatar-fallback, .logo-fallback, .guild-icon.fallback {
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--royal)); color: #fff;
  font: italic 700 18px/1 var(--display);
}

/* ---------- Boutons en biais ---------- */

.cta, .btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; white-space: nowrap; font-weight: 700;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: background .2s, color .2s, transform .15s, opacity .2s;
}
.cta { min-height: 54px; padding: 0 34px; font-size: 16px; }
.cta:active, .btn:active:not([disabled]) { transform: translateY(1px); }
.cta-primary { background: var(--blue); color: #fff; }
.cta-primary:hover { background: var(--blue-hover); }
.cta-ghost { background: var(--sky); color: var(--ink); }
.cta-ghost:hover { background: var(--sky-2); }

.btn { min-height: 42px; padding: 0 24px; font-size: 14px; background: var(--navy-2); color: #fff; }
.btn:hover:not([disabled]) { background: #172468; }
.btn-primary, .btn-success { background: var(--blue); }
.btn-primary:hover:not([disabled]), .btn-success:hover:not([disabled]) { background: var(--blue-hover); }
.btn-link { background: none; color: var(--sky); clip-path: none; padding: 0 10px; font-weight: 600; }
.btn-link:hover:not([disabled]) { background: none; color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Accueil : la bannière en grand ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate; background: #000;
  min-height: min(820px, calc(100vh - 60px));
  display: flex; align-items: center;
}
.hero-bg {
  position: absolute; top: 0; right: 0; z-index: -2; width: 70%; height: 100%;
  object-fit: cover; object-position: 62% 30%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, #000 0%, #000 30%, transparent 44%),
              linear-gradient(0deg, #000 0%, transparent 18%);
}
.hero-copy { position: relative; width: 100%; max-width: 1200px; margin: 0 auto; padding: 72px 24px; }
.hero-copy > * { max-width: 520px; }
.hero-copy .eyebrow { font-size: 15px; margin-bottom: 14px; }
.wordmark { margin: 0; font: italic 800 clamp(64px, 9vw, 128px)/.9 var(--display); letter-spacing: -.03em; }
.tag { margin: 10px 0 0; font: italic 700 clamp(22px, 2.6vw, 32px)/1.1 var(--font); color: var(--sky); }
.sub { margin: 22px 0 0; max-width: 440px; color: var(--muted); font-size: 17px; text-shadow: 0 1px 12px #000; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.alert {
  margin: 0 0 20px; padding: 12px 16px; font-size: 14px; text-align: left;
  border-left: 4px solid var(--red); background: rgba(255, 92, 108, .1); color: #ffc2c8;
}
.alert.warn { border-left-color: #fbbf24; background: rgba(251, 191, 36, .08); color: #fde68a; }

/* Cartes "ce que tu peux régler" */
.features { max-width: 1200px; margin: 0 auto; padding: 96px 24px 110px; }
.features h2 { margin: 0 0 40px; font: italic 800 clamp(34px, 4.4vw, 56px)/1 var(--display); letter-spacing: -.02em; }
.features .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.features .card {
  position: relative; padding: 28px 24px 26px; min-height: 200px;
  background: linear-gradient(160deg, var(--navy-2), var(--navy) 60%, var(--ink));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  border-top: 3px solid var(--sky);
}
.features .card .num { font: italic 800 44px/1 var(--display); color: rgba(138, 180, 248, .22); }
.features .card .feat-ic { position: absolute; top: 28px; right: 26px; width: 30px; height: 30px; color: var(--sky); }
.features .card strong { display: block; margin-top: 18px; font: italic 700 24px/1.1 var(--display); }
.features .card p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Pages connectées : fond en diagonales ---------- */

.page, .layout { position: relative; isolation: isolate; }
.page::before, .layout::before {
  content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 62%, rgba(31, 44, 156, .5) 62% 80%, rgba(138, 180, 248, .14) 80% 83%, rgba(47, 79, 224, .35) 83%),
    var(--black);
}

.page { max-width: 1200px; margin: 0 auto; padding: 64px 24px 110px; min-height: calc(100vh - 60px); }
.page h1 { margin: 0; font: italic 800 clamp(46px, 6vw, 80px)/.95 var(--display); letter-spacing: -.02em; }
.page .subtitle { color: var(--muted); font-size: 18px; margin: 12px 0 44px; }

.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.guild-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 34px 20px 22px;
  background: linear-gradient(165deg, var(--navy-2), var(--navy) 55%, rgba(4, 6, 15, .95));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: transform .25s;
}
.guild-card::before { content: ""; position: absolute; left: 0; top: 0; width: 46%; height: 4px; background: var(--sky); }
.guild-card:hover { transform: translateY(-4px); }
.guild-top { margin-bottom: 22px; }

/* Icône dans un losange, comme le logo */
.diamond {
  width: 74px; height: 74px; transform: rotate(45deg); overflow: hidden;
  outline: 3px solid var(--sky); outline-offset: 4px; background: var(--navy-2);
}
.diamond .guild-icon { width: 106px; height: 106px; margin: -16px; transform: rotate(-45deg); object-fit: cover; display: grid; place-items: center; font-size: 24px; }
.guild-card.absent .diamond { outline-color: var(--subtle); }
.guild-card.absent .guild-icon { filter: grayscale(1); opacity: .5; }

.guild-body { display: flex; flex-direction: column; gap: 18px; width: 100%; flex: 1; }
.guild-name { font: italic 700 22px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-status { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; background: var(--green); transform: rotate(45deg); flex: none; }
.guild-card.absent .dot { background: var(--subtle); }
.guild-body .btn { margin-top: auto; width: 100%; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--navy); }

/* ---------- Réglages d'un serveur ---------- */

.layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px;
  max-width: 1200px; margin: 0 auto; padding: 44px 24px 0; min-height: calc(100vh - 60px);
}
.sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-select { display: none; }
.sidebar .back { display: inline-flex; align-items: center; gap: 4px; color: var(--sky); font-size: 14px; font-weight: 600; margin-bottom: 26px; }
.sidebar .back:hover { color: #fff; }
.sidebar .guild-head { display: flex; align-items: center; gap: 18px; margin: 0 0 28px 6px; }
.sidebar .guild-head .guild-icon { width: 54px; height: 54px; font-size: 18px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); object-fit: cover; }
.sidebar .guild-head strong { display: block; font: italic 700 22px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .guild-head > div span { font-size: 13px; color: var(--muted); }
.nav-title { font: italic 700 12px/1 var(--font); color: var(--sky); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px 4px; opacity: .8; }
.sidebar .nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 6px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 20px;
  color: var(--muted); font-weight: 600; background: rgba(10, 16, 51, .6);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: background .2s, color .2s;
}
.sidebar .nav a:hover { color: #fff; background: var(--navy-2); }
.sidebar .nav a.active { background: var(--blue); color: #fff; }
.ico { display: grid; place-items: center; width: 22px; }
.ico .ic { width: 20px; height: 20px; }
.sidebar .nav a .ico { color: var(--sky); }
.sidebar .nav a.active .ico { color: #fff; }

.content { padding-bottom: 160px; max-width: 760px; }
.content h2 { margin: 0; font: italic 800 clamp(40px, 5vw, 64px)/.95 var(--display); letter-spacing: -.02em; }
.content .lead { color: var(--muted); font-size: 17px; margin: 14px 0 34px; }

.card {
  position: relative; margin-bottom: 18px; padding: 26px 26px 22px;
  background: linear-gradient(165deg, rgba(15, 26, 74, .92), rgba(10, 16, 51, .92) 50%, rgba(4, 6, 15, .94));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--sky), var(--blue)); }
.card h3 { margin: 0 0 4px; font: italic 700 23px/1.15 var(--display); }
.card .hint { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.field-label { display: block; margin: 20px 0 8px; font: italic 700 13px/1 var(--font); color: var(--sky); letter-spacing: .03em; }

select, textarea, input[type="text"], input[type="number"] {
  width: 100%; border: 1px solid var(--line-2); border-radius: 0; outline: none;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
select {
  height: 50px; padding: 0 44px 0 16px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238ab4f8' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
select option, select optgroup { background: #0a1033; color: #fff; }
textarea { min-height: 110px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
input[type="text"] { height: 46px; padding: 0 14px; }
input[type="number"] { width: 84px; height: 42px; padding: 0 10px; text-align: center; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { opacity: .5; }
select:focus, textarea:focus, input[type="text"]:focus, input[type="number"]:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(138, 180, 248, .2); }

.row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 0; border-top: 1px solid var(--line); }
.card > .row:first-child { border-top: 0; padding-top: 0; }
.row .info { flex: 1; min-width: 0; }
.row .name { font-family: var(--mono); font-size: 14px; font-weight: 600; color: #fff; }
.row .title { font-weight: 700; }
.row .desc { margin-top: 2px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

/* Langue : losange qui se remplit */
.group { display: grid; gap: 8px; }
.lang-row {
  position: relative; padding: 12px 18px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .35); transition: background .2s;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.lang-row:hover { background: rgba(47, 79, 224, .18); }
.lang-row input { position: absolute; opacity: 0; pointer-events: none; }
.lang-row .flag { width: 30px; height: 20px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.lang-row .check { width: 16px; height: 16px; transform: rotate(45deg); border: 2px solid var(--subtle); margin-right: 8px; transition: all .2s; }
.lang-row.selected { background: rgba(47, 79, 224, .35); }
.lang-row.selected .check { background: var(--sky); border-color: var(--sky); box-shadow: 0 0 12px rgba(138, 180, 248, .7); }
.lang-row:focus-within { outline: 2px solid var(--sky); outline-offset: -2px; }

/* Interrupteurs */
.switch { position: relative; display: inline-block; width: 56px; height: 28px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; background: #1a2250; pointer-events: none; transition: background .25s;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.switch span::after {
  content: ""; position: absolute; left: 7px; top: 4px; width: 20px; height: 20px; background: #c6cff0;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); transition: transform .25s cubic-bezier(.3, 1.3, .5, 1), background .25s;
}
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--sky); outline-offset: 3px; }

.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.cat-head h3 { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; padding: 6px 14px; cursor: pointer; font: 600 12px/1.3 var(--mono);
  background: rgba(138, 180, 248, .14); color: var(--sky-2);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); transition: background .2s;
}
.chip:hover { background: rgba(138, 180, 248, .28); color: #fff; }

/* Aperçu tel qu'il s'affichera dans Discord */
.preview { background: #313338; color: #dbdee1; border-radius: 8px; padding: 14px 16px; display: flex; gap: 14px; }
.preview img, .preview .avatar-fallback { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.preview .meta { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.preview .author { font-weight: 600; color: #f2f3f5; }
.preview .bot-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.preview .time { color: #949ba4; font-size: 12px; }
.preview .msg { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.4; }
.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }

/* ---------- Notifications ---------- */

.badge-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center;
  background: #ed4245; color: #fff; font-size: 12px; font-weight: 800; transform: skewX(-10deg);
}
.notif { padding: 20px 22px; }
.notif.unread::before { background: linear-gradient(#ed4245, var(--blue)); width: 4px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.notif-type { display: inline-flex; align-items: center; gap: 8px; font: italic 700 14px/1 var(--font); color: var(--sky); }
.notif-type .ic { width: 18px; height: 18px; }
.notif-time { font-size: 12px; color: var(--subtle); white-space: nowrap; }
.thread { display: grid; gap: 10px; }
.bubble-row { display: flex; align-items: flex-end; gap: 10px; }
.bubble-row.me { justify-content: flex-end; }
.bubble-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--sky); }
.bubble { max-width: 78%; padding: 11px 15px; font-size: 15px; line-height: 1.45; }
.bubble.bot { background: rgba(0, 0, 0, .45); border-left: 3px solid var(--sky); }
.bubble.me { background: var(--blue); color: #fff; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); padding-left: 20px; }
.bubble strong { color: #fff; }
.choices { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.empty-notif { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.empty-notif .ic { width: 34px; height: 34px; color: var(--sky); flex: none; }
.empty-notif p { margin: 0; }

/* ---------- Anti-raid ---------- */

.ar-body { padding-top: 6px; }
.ar-body select { margin-top: 4px; }
.sentence { color: var(--muted); font-size: 15px; line-height: 2.6; }
.sentence input[type="number"] { width: 72px; height: 38px; margin: 0 4px; vertical-align: middle; color: #fff; font-weight: 700; }
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.limit { padding: 10px 14px 4px; background: rgba(0, 0, 0, .35); border-left: 3px solid var(--sky); }
.limit-name { display: block; font-weight: 700; font-size: 14px; }
.limit .sentence { font-size: 14px; }

/* ---------- Vérification ---------- */

.link { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: #fff; }
.alert .ic { color: #fbbf24; margin-right: 4px; }
.steps { margin: 4px 0 4px; padding-left: 22px; display: grid; gap: 14px; color: var(--muted); font-size: 15px; }
.steps strong { color: #fff; }
.steps li::marker { color: var(--sky); font-weight: 800; }
code { font-family: var(--mono); font-size: .92em; background: rgba(138, 180, 248, .14); color: var(--sky-2); padding: 1px 6px; }
.mapping { display: grid; grid-template-columns: 120px minmax(0, 1fr) 34px; align-items: center; gap: 10px; margin-top: 8px; }
.mapping > span { font-size: 13px; }
.mapping .target { display: block; padding: 8px 10px; background: rgba(0, 0, 0, .45); overflow-wrap: anywhere; }

/* ---------- Auto-modération ---------- */

.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; align-items: start; }
.rule-card { padding: 14px 14px 16px; background: rgba(0, 0, 0, .35); border-left: 3px solid var(--subtle); transition: border-color .2s; }
.rule-card.on { border-left-color: var(--sky); }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 34px; }
.rule-name { font-weight: 700; font-size: 15px; }
.rule-card:not(.on) .rule-name { color: var(--muted); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--sky); transition: all .15s;
}
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn:hover, .icon-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rule-card select { height: 46px; font-size: 14px; }
.rule-settings { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: grid; gap: 10px; }
.rule-settings .field-label { margin: 0; }
.rule-settings textarea { min-height: 90px; }
.rule-settings .hint { margin: 0; font-size: 13px; }
.num-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; color: var(--muted); }
.num-wrap { display: inline-flex; align-items: center; gap: 8px; }
.num-wrap em { font-style: normal; color: var(--text); font-weight: 600; }

/* ---------- Tickets ---------- */

/* Choix du mode d'ouverture */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  padding: 28px 26px 24px; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(165deg, var(--navy-2), var(--navy) 55%, var(--ink));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: transform .2s, background .2s;
}
.mode-card::before { content: ""; position: absolute; left: 0; top: 0; width: 46%; height: 4px; background: var(--sky); }
.mode-card:hover { transform: translateY(-4px); background: linear-gradient(165deg, #1a2a78, var(--navy-2) 55%, var(--ink)); }
.mode-icon { color: var(--sky); }
.mode-icon .ic { width: 40px; height: 40px; }
.mode-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: italic 800 26px/1.1 var(--display); }
.mode-badge {
  font: italic 700 12px/1 var(--font); padding: 6px 12px; background: var(--sky); color: var(--ink);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.mode-desc { color: var(--muted); font-size: 15px; line-height: 1.5; }
.mode-go { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 8px; color: var(--sky); font-weight: 700; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.segmented button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: 1 1 200px; min-height: 46px; padding: 0 18px; border: 0; cursor: pointer; font-weight: 700; font-size: 14px;
  background: rgba(0, 0, 0, .4); color: var(--muted);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: background .2s, color .2s;
}
.segmented button:hover { color: #fff; background: var(--navy-2); }
.segmented button.on { background: var(--blue); color: #fff; }

.stats { display: flex; gap: 12px; margin: -10px 0 24px; }
.stats div {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 22px 10px 18px;
  background: rgba(15, 26, 74, .8); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.stats strong { font: italic 800 26px/1 var(--display); }
.stats span { color: var(--muted); font-size: 13px; }

.role-list { display: flex; flex-wrap: wrap; gap: 8px; }
.role {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.role i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.role:hover { color: #fff; border-color: var(--sky); }
.role.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.types { display: grid; gap: 8px; }
.type-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 8px; }
.type-row .emoji-in { text-align: center; font-size: 20px; padding: 0; }
.type-row .remove {
  display: grid; place-items: center;
  height: 46px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.type-row .remove:hover:not([disabled]) { color: #fff; background: #c22a3f; border-color: #c22a3f; }
.type-row .remove[disabled] { opacity: .3; cursor: not-allowed; }
.add-type { margin-top: 12px; }

.publish { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.publish .hint { margin: 0; }

/* Aperçu d'embed Discord */
.dc-embed { margin-top: 4px; padding: 10px 14px 12px; background: #2b2d31; border-left: 4px solid #2f4fe0; border-radius: 4px; max-width: 460px; }
.dc-title { font-weight: 700; color: #f2f3f5; margin-bottom: 4px; }
.dc-desc { font-size: 14px; color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
.dc-foot { margin-top: 8px; font-size: 12px; color: #949ba4; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 16px; background: #5865f2; color: #fff; font-size: 14px; font-weight: 500; border-radius: 4px; }
.dc-select { display: flex; justify-content: space-between; margin-top: 8px; max-width: 460px; padding: 9px 12px; background: #1e1f22; color: #949ba4; font-size: 14px; border-radius: 4px; }
.dc-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; color: #b5bac1; }
.dc-options span { background: #1e1f22; padding: 3px 8px; border-radius: 4px; }

.muted-block { opacity: .4; pointer-events: none; transition: opacity .2s; }

/* Barre "non enregistré" */
.savebar {
  position: fixed; left: 50%; bottom: 22px; z-index: 20;
  transform: translate(-50%, 160%); opacity: 0;
  width: min(700px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 26px;
  background: rgba(10, 16, 51, .96); border-top: 3px solid var(--sky);
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  transition: transform .4s cubic-bezier(.2, .9, .25, 1.15), opacity .25s;
}
.savebar.show { transform: translate(-50%, 0); opacity: 1; }
.savebar.shake { animation: shake .45s; }
.savebar p { margin: 0; flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar .short { display: none; }
@keyframes shake {
  0%, 100% { transform: translate(-50%, 0); }
  25% { transform: translate(calc(-50% - 10px), 0); background: #4a0f1c; }
  75% { transform: translate(calc(-50% + 10px), 0); }
}

.toast {
  position: fixed; left: 50%; top: 76px; z-index: 1100; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  padding: 12px 26px; font-weight: 700; font-size: 14px;
  background: var(--blue); color: #fff;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: opacity .2s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #c22a3f; }

/* ---------- Footer ---------- */

.site-footer { position: relative; background: var(--black); color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 30px 24px 34px; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.footer-links a:hover { color: #fff; }
.footer-inner p { margin: 0; color: var(--subtle); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tablette et téléphone ---------- */

@media (max-width: 960px) {
  .features .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 24px; }
  .sidebar { position: static; }
  .sidebar .back { margin-bottom: 16px; }
  .sidebar .guild-head { margin-bottom: 16px; }
  .sidebar { max-height: none; overflow: visible; padding-bottom: 0; }
  .sidebar .nav { display: none; }
  .nav-select { display: block; }
  .nav-select select { height: 50px; font-weight: 700; background-color: var(--blue); border-color: var(--blue); }
  .sidebar .nav a { flex: none; min-height: 42px; padding: 0 18px; white-space: nowrap; }
}

@media (max-width: 760px) {
  .site-header .nav { padding: 0 16px; gap: 14px; height: 56px; }
  .site-header .menu { gap: 16px; font-size: 13px; }
  .site-header .brand img { height: 24px; }
  .site-header .menu a:not(:first-child) { display: none; }
  .account-button .name, .logout-link { display: none; }

  .hero { display: block; min-height: 0; }
  .hero-bg { position: relative; display: block; width: 100%; height: 92vw; max-height: 520px; object-position: 64% 30%; }
  .hero::before { background: linear-gradient(0deg, #000 0%, transparent 22%); height: 92vw; max-height: 520px; }
  .hero-copy { margin-top: -20px; padding: 0 20px 56px; }
  .hero-actions { flex-direction: column; }
  .cta { width: 100%; }

  .features { padding: 64px 16px 80px; }
  .features .cards { grid-template-columns: minmax(0, 1fr); }
  .features .card { min-height: 0; }
  .page { padding: 40px 16px 80px; }
  .page::before, .layout::before { background: linear-gradient(115deg, transparent 0 70%, rgba(31, 44, 156, .45) 70%), var(--black); }
  .guild-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .guild-card { padding: 28px 12px 16px; }
  .diamond { width: 56px; height: 56px; }
  .diamond .guild-icon { width: 80px; height: 80px; margin: -12px; font-size: 18px; }
  .guild-name { font-size: 18px; }
  .layout { padding: 20px 16px 0; }
  .type-row { grid-template-columns: 52px minmax(0, 1fr) 40px; }
  .mode-grid { grid-template-columns: minmax(0, 1fr); }
  .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .limits { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 88%; }
  .choices .btn { flex: 1 1 auto; }
  .mapping { grid-template-columns: minmax(0, 1fr) 34px; }
  .mapping > span { grid-column: 1 / -1; }
  .type-row input[data-type-field="description"] { grid-column: 1 / -1; grid-row: 2; }
  .type-row + .type-row { padding-top: 12px; border-top: 1px solid var(--line); }
  .types { gap: 12px; }
  .card { padding: 20px 18px 16px; }
  .savebar { padding-left: 22px; }
  .savebar .long { display: none; }
  .savebar .short { display: inline; }
}
