/* Direction artistique : village caché du désert, au crépuscule.
   Sable, ocre, terre cuite, murs de pisé arrondis, soleil couchant et vent chargé de sable. */
:root {
  --bg: #140d08;
  --bg-2: #1d140d;
  --panel: rgba(38, 25, 15, 0.80);
  --panel-solid: #26190f;
  --panel-2: rgba(50, 33, 20, 0.84);
  --line: #47321f;
  --line-wet: rgba(245, 205, 145, 0.14);
  --text: #f4e8d4;
  --muted: #b89f7f;
  --accent: #e08a2e;
  --accent-soft: #f5b45c;
  --accent-ink: #1e1005;
  --glow: rgba(224, 138, 46, 0.42);
  --seal: #a8452a;
  --ok: #7da36a;

  --rank-D: #8a7d68;
  --rank-C: #2f9a96;
  --rank-B: #8a5cb0;
  --rank-A: #e08a2e;
  --rank-S: #c43a24;

  --radius: 10px;
  --font-title: 'Shippori Mincho B1', 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.01em; margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Décor : chaleur du désert en fond ---------- */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 50% at 50% 115%, rgba(224, 138, 46, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% -10%, rgba(196, 58, 36, 0.12), transparent 70%),
    repeating-radial-gradient(ellipse 140% 60% at 50% 120%, transparent 0 38px, rgba(245, 205, 145, 0.018) 38px 40px),
    linear-gradient(180deg, #1a100a 0%, #140d08 60%, #18100a 100%);
}

/* ---------- Sable & vent ---------- */
#sand {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.haze {
  position: fixed; inset: auto 0 0 0; height: 40vh; pointer-events: none; z-index: 0;
  background: linear-gradient(0deg, rgba(224, 160, 90, 0.09), transparent);
}
.gust {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(230, 170, 100, 0.10) 40%, rgba(230, 170, 100, 0.14) 55%, transparent 100%);
  background-size: 200% 100%;
}
.gust.on { animation: gust 3.2s ease-in-out; }
@keyframes gust {
  0% { opacity: 0; background-position: 100% 0; }
  25% { opacity: 1; }
  75% { opacity: 0.8; }
  100% { opacity: 0; background-position: -100% 0; }
}
body > header, body > main, body > footer, body > section, body > dialog { position: relative; z-index: 1; }

/* ---------- En-tête ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(20, 13, 8, 0.80);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-seal {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c4643c, var(--seal));
  color: #fbe9cf;
  display: grid; place-items: center;
  font-family: var(--font-title); font-size: 18px;
  box-shadow: inset 0 0 0 2px rgba(255, 230, 190, 0.18), 0 0 16px var(--glow);
}
.brand-name { font-family: var(--font-title); font-size: 18px; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--text); }

/* ---------- Hero : le village au soleil couchant ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(78vh, 640px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: 120px; padding-bottom: 28px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('/img/village-sable.png') center 40% / cover no-repeat;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 13, 8, 0.15) 0%, rgba(20, 13, 8, 0.25) 35%, rgba(20, 13, 8, 0.88) 78%, var(--bg) 100%),
    linear-gradient(90deg, rgba(20, 13, 8, 0.75) 0%, rgba(20, 13, 8, 0.3) 55%, rgba(20, 13, 8, 0.05) 100%);
}
.hero > .wrap { position: relative; z-index: 1; width: 100%; }
.hero .kicker { color: var(--accent-soft); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 600; text-shadow: 0 0 12px var(--glow); }
.hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 10px 0 12px; line-height: 1.15; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7); }
.hero p { color: #d9c4a4; max-width: 640px; margin: 0; font-size: 16px; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }
.hero .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; backdrop-filter: blur(4px); }
.step b { display: block; font-family: var(--font-title); font-size: 15px; margin-bottom: 2px; }
.step span { color: var(--muted); font-size: 13.5px; }
.step .num { color: var(--accent); font-family: var(--font-title); margin-right: 6px; }


/* ---------- Filtres ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 26px; }
.count { color: var(--muted); font-size: 14px; }

.filters {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 12px;
  grid-template-columns: 1fr auto;
}
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; margin-right: 2px; }

.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 110px; }
.search { min-width: 220px; }

/* ---------- Cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 16px 0 40px; }
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  border-top: 2px solid var(--rank-color, var(--line));
  backdrop-filter: blur(5px);
  box-shadow: inset 0 1px 0 var(--line-wet), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, border-color 160ms ease;
}
/* Grain de sable et lumière chaude sur le pisé */
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(245, 180, 92, 0.07), transparent 70%),
    repeating-radial-gradient(circle at 20% 120%, transparent 0 14px, rgba(245, 205, 145, 0.025) 14px 15px);
}
.card:hover { transform: translateY(-2px); border-color: #6a4a2c; }
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.rank-seal {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-title); font-size: 22px; color: #fff;
  background: var(--rank-color);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.35), inset 0 0 0 2px rgba(255,255,255,0.18);
}
.card h3 { font-size: 18px; line-height: 1.3; }
.card .subject { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .summary { color: #dccbb0; margin: 0; white-space: pre-line; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.tag.org { color: #f0c88a; border-color: #6a4a22; }
.tag.joueur { color: #8fd3cc; border-color: #275752; }
.tag.village { color: #e8a08a; border-color: #6a3424; }
.tag.reservee { color: #e0b46a; border-color: #5e4a22; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.price { font-family: var(--font-title); font-size: 20px; }
.price small { font-family: var(--font-body); color: var(--muted); font-size: 12px; margin-left: 4px; }
.price-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.price.exchange { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.exchange-type { font-size: 15px; color: var(--accent-soft); line-height: 1.3; }
.exchange-note { font-family: var(--font-body); font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.stamp {
  position: absolute; bottom: 62px; right: 14px; pointer-events: none;
  transform: rotate(12deg);
  border: 3px solid var(--seal); color: var(--seal);
  font-family: var(--font-title); font-weight: 700; letter-spacing: 0.15em;
  padding: 2px 14px; border-radius: 4px; font-size: 16px;
  background: rgba(20, 13, 8, 0.6);
  box-shadow: 0 0 14px rgba(168, 69, 42, 0.4);
}
.card.sold .summary, .card.sold h3 { opacity: 0.55; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  border-radius: 8px; padding: 9px 14px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn { box-shadow: 0 0 12px rgba(224, 138, 46, 0.22); }
.btn:hover { filter: brightness(1.1); box-shadow: 0 0 20px var(--glow); }
.btn.ghost, .btn.danger { box-shadow: none; }
.step .num { color: var(--accent-soft); }
.card:hover { box-shadow: inset 0 1px 0 var(--line-wet), 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(224, 138, 46, 0.18); }
.rank-seal { box-shadow: 0 0 0 3px rgba(0,0,0,0.4), inset 0 0 0 2px rgba(255,255,255,0.18), 0 0 18px color-mix(in srgb, var(--rank-color) 45%, transparent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: transparent; color: #f08a80; border-color: #5a2a26; }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 48px;
}
.contact h2 { font-size: 26px; margin-bottom: 8px; }
.contact p { color: var(--muted); margin: 0 0 10px; }
.note { font-size: 13.5px; border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--bg-2); border-radius: 0 6px 6px 0; color: var(--muted); }
form .field { display: grid; gap: 5px; margin-bottom: 12px; }
form label { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: 14px; margin-top: 10px; min-height: 1.2em; }
.form-msg.ok { color: #8fd19e; }
.form-msg.err { color: #f08a80; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 32px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Admin ---------- */
.admin-main { padding-top: 28px; padding-bottom: 48px; }
.login-box { max-width: 380px; margin: 60px auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login-box h1 { font-size: 24px; margin-bottom: 6px; }
.login-box p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.badge { background: var(--seal); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .filters-row select, .toolbar .filters-row input { width: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-family: var(--font-title); font-size: 24px; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
td .muted { color: var(--muted); font-size: 12.5px; }
.mini-seal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-family: var(--font-title); background: var(--rank-color); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
td .actions { flex-wrap: nowrap; }

/* Onglet Statistiques */
.stats-title { font-size: 18px; margin: 6px 0 12px; }
.stats-title .hint { font-family: var(--font-body, inherit); font-size: 13px; font-weight: 400; }
.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 22px; }
.breakdown { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.breakdown h3 { font-size: 15px; margin: 0 0 8px; }
.breakdown table { font-size: 13px; }
.breakdown th, .breakdown td { padding: 7px 6px; background: none; }
.breakdown tr:last-child td { border-bottom: 0; }
.bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 5px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.counter { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.counter b { min-width: 22px; text-align: center; font-size: 15px; }
.counter button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; line-height: 1; }
.counter button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-soft); }
.counter button:disabled { opacity: 0.35; cursor: default; }
tfoot td { font-weight: 600; border-bottom: 0; background: var(--bg-2); }
.hidden-row td { opacity: 0.55; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(0,0,0,0.65); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
.pay-types { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; display: grid; gap: 6px; }
.pay-types legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 5px; }
.pay-types .check { font-size: 14px; }
.hint { color: var(--muted); font-size: 12.5px; }

.msg-list { display: grid; gap: 10px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg.unread { border-left: 3px solid var(--accent); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-head b { font-family: var(--font-title); font-size: 16px; }
.msg-body { white-space: pre-wrap; margin: 8px 0 10px; color: #dccbb0; }
.contact, .filters, .login-box, .stat, .msg, .table-wrap { backdrop-filter: blur(5px); }
.table-wrap { background: var(--panel); }
dialog { background: var(--panel-solid); }

@media (prefers-reduced-motion: reduce) {
  .card, .flash.on { transition: none; animation: none; }
}

/* ---------- Comptes, échanges et rendez-vous ---------- */
.small-tabs { margin-bottom: 14px; }
.small-tabs button { padding: 8px 12px; }
.account-box p { color: var(--muted); margin: 0 0 12px; }
.account-box b { color: var(--text); }
.account-main { padding-top: 28px; padding-bottom: 48px; }
.account-title { font-size: 28px; margin-bottom: 4px; }
.account-sub { margin: 0 0 18px; font-size: 14px; }
.account-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(5px); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 18px; margin: 0; }

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; min-height: 160px; overflow-y: auto; padding: 4px 2px 8px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.chat-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
.bubble { max-width: 85%; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.bubble.mine { align-self: flex-end; background: rgba(224, 138, 46, 0.14); border-color: rgba(224, 138, 46, 0.35); border-bottom-right-radius: 3px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 3px; }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.bubble-info { font-size: 12px; color: var(--accent-soft); margin-bottom: 3px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.chat-form textarea { min-height: 80px; }

.rdv-list { display: grid; gap: 10px; margin-bottom: 12px; }
.rdv { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; background: var(--bg-2); display: grid; gap: 4px; font-size: 14px; }
.rdv.status-accepte { border-left-color: #5fb87a; }
.rdv.status-refuse, .rdv.status-annule { border-left-color: var(--line); opacity: 0.6; }
.rdv.past { opacity: 0.6; }
.rdv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rdv-head b { font-family: var(--font-title); font-size: 15px; }
.rdv-status { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.rdv-status.propose { color: #e0b46a; border-color: #5e4a22; }
.rdv-status.accepte { color: #8fd19e; border-color: #2f5a3a; }
.rdv-note { color: #dccbb0; white-space: pre-wrap; }
.rdv .actions { margin-top: 4px; }
.rdv-propose summary { cursor: pointer; font-weight: 600; color: var(--accent-soft); padding: 6px 0; }
.rdv-propose form { margin-top: 10px; }

/* Espace gérant : clients */
.clients-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.client-list { display: grid; gap: 6px; }
.client-item { text-align: left; font: inherit; color: var(--text); cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; }
.client-item:hover { border-color: var(--muted); }
.client-item[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.client-item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.client-item b { font-family: var(--font-title); }
.client-item.blocked { opacity: 0.55; }
.client-item .row b { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag-todo { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid #e0b46a; color: #e0b46a; white-space: nowrap; }

/* Historique */
.hist-changes { font-size: 13.5px; min-width: 260px; }
.hist-changes > * + * { margin-top: 4px; }
.hist-changes summary { cursor: pointer; }
.hist-text { white-space: pre-wrap; margin-top: 4px; max-width: 560px; color: var(--muted); }
.hist-text b { color: var(--text); font-weight: 600; }
.confirm-dialog { width: min(440px, calc(100vw - 32px)); }
.confirm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.btn.btn-danger { background: #a8452a; color: #fff; box-shadow: none; }
.invite-link { display: flex; gap: 8px; margin-top: 10px; }
.invite-link input { flex: 1; min-width: 0; font-size: 12.5px; }
.invite-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.invite-row:last-child { border-bottom: 0; }
.bubble-del { float: right; margin: -2px -4px 0 8px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.bubble-del:hover { color: #f08a80; }
.thread-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }

[hidden] { display: none !important; }

/* ---------- Charte d'entrée (parchemin) ---------- */
html.gated:not(.gate-ok) body > header,
html.gated:not(.gate-ok) body > main,
html.gated:not(.gate-ok) body > footer { display: none; }
html.gated:not(.gate-ok) body { overflow: hidden; }
html.gate-ok .gate { display: none; }

.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px 16px; overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(20, 13, 8, 0.55), rgba(20, 13, 8, 0.92)),
    url('/img/village-sable.png') center / cover no-repeat;
}
.scroll { width: min(620px, 100%); animation: unroll 700ms ease-out both; }
@keyframes unroll {
  from { opacity: 0; transform: scaleY(0.6); }
  to { opacity: 1; transform: scaleY(1); }
}
.scroll-rod {
  height: 18px; margin: 0 -14px; border-radius: 9px;
  background: linear-gradient(180deg, #8a5a32, #4a2c16 60%, #2e1b0d);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  position: relative; z-index: 1;
}
.scroll-paper {
  position: relative;
  margin: -4px 0;
  padding: 34px 40px 30px;
  color: #3a2414;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(140, 90, 40, 0.25), transparent 55%),
    radial-gradient(ellipse at 0% 60%, rgba(140, 90, 40, 0.18), transparent 50%),
    linear-gradient(180deg, #f1dfb8, #e6cc98);
  box-shadow: inset 0 0 40px rgba(120, 70, 30, 0.35), 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.scroll-kanji {
  font-family: var(--font-title); font-size: 34px; line-height: 1;
  color: #a8452a; opacity: 0.85; margin-bottom: 8px;
}
.scroll-paper h1 { font-size: clamp(24px, 4vw, 30px); color: #2e1a0c; margin-bottom: 6px; }
.scroll-lead { margin: 0 0 18px; font-style: italic; color: #6a4a2c; }
.scroll-rules {
  text-align: left; margin: 0 0 18px; padding-left: 0; list-style: none;
  counter-reset: rule; display: grid; gap: 12px;
}
.scroll-rules li {
  counter-increment: rule; position: relative; padding-left: 38px;
  font-size: 15.5px; line-height: 1.6;
}
.scroll-rules li::before {
  content: counter(rule, cjk-ideographic);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-title); font-size: 14px;
  color: #f4e8d4; background: #a8452a;
}
.scroll-rules strong { color: #7a2a16; }
.scroll-sign { margin: 0; text-align: right; font-family: var(--font-title); color: #5a3a20; }
.scroll-seal {
  width: 54px; height: 54px; margin: 10px auto 18px; border-radius: 8px;
  display: grid; place-items: center; transform: rotate(-8deg);
  font-family: var(--font-title); font-size: 28px; color: #f6e2c4;
  background: radial-gradient(circle at 40% 35%, #c4502e, #8e2f1a);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 3px rgba(255, 230, 190, 0.25);
}
.scroll-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scroll-actions .btn { min-width: 200px; justify-content: center; padding: 11px 18px; font-size: 15px; }
.scroll-actions .btn.ghost { color: #4a2c16; border-color: rgba(74, 44, 22, 0.45); background: rgba(255, 255, 255, 0.15); }
.scroll-actions .btn.ghost:hover { border-color: #4a2c16; }

.gate-refused {
  text-align: center; max-width: 480px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 24px; backdrop-filter: blur(6px);
}
.gate-refused h1 { font-size: 26px; margin-bottom: 8px; }
.gate-refused p { color: var(--muted); margin: 0 0 16px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13.5px; }
.link-btn:hover { color: var(--text); }

@media (max-width: 560px) {
  .scroll-paper { padding: 26px 20px 24px; }
  .scroll-rod { margin: 0 -6px; }
  .scroll-actions .btn { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .scroll { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero { padding-top: 400px; min-height: 0; }
  .hero-bg { background-size: auto 360px; background-position: 50% 30px; background-color: var(--bg); }
  .hero-bg::after {
    background: linear-gradient(180deg, transparent 0, transparent 290px, rgba(20, 13, 8, 0.85) 360px, var(--bg) 392px);
  }
  .hero .steps { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding: 18px; }
  .account-grid, .clients-layout, .thread-grid { grid-template-columns: 1fr; }
  .bubble { max-width: 95%; }
  .two { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav a[href="#catalogue"] { display: none; }
  .brand-name { font-size: 16px; }
  .search { min-width: 0; }
  .grid { grid-template-columns: 1fr; }
}
