/* ===== Le Vœu d'Aélise — thème parchemin & taverne ===== */
:root {
  --bois: #221610;          /* fond : table de taverne */
  --bois-2: #2d1d13;        /* navbar : bois sombre */
  --bois-bord: #4a3220;
  --parchemin: #ede0c2;     /* cartes : parchemin */
  --parchemin-2: #e2d2ab;   /* blocs internes */
  --parchemin-3: #f4ebd6;   /* champs de saisie */
  --encre: #3a2a17;         /* texte principal */
  --encre-2: #7d6748;       /* texte secondaire */
  --liseret: #a58b58;       /* bordures dorées */
  --or: #8a6d2f;            /* doré ancien */
  --or-clair: #d9b969;      /* doré sur bois */
  --sceau: #8b2f23;         /* rouge cire */
  --pv: #9e3b2c;
  --pm: #33538a;
  --vert: #4a6b3a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bois);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.7 0 0 0 0 0.45 0 0 0 0.04 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>"),
    radial-gradient(circle at 50% -10%, #31211462 0%, transparent 60%);
  color: var(--encre);
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  min-height: 100vh;
}

/* ── Navbar : poutre de taverne ── */
.navbar {
  display: flex; align-items: center; gap: 22px;
  padding: 12px 24px;
  background-color: var(--bois-2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.7 0 0 0 0 0.45 0 0 0 0.04 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  border-bottom: 3px double var(--liseret);
  flex-wrap: wrap;
}
.nav-brand {
  font-weight: bold; font-size: 1.2em; color: var(--or-clair);
  letter-spacing: 1px; font-variant: small-caps;
}
.nav-links { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.nav-links a {
  color: #cbb890; text-decoration: none; padding: 5px 11px;
  border-radius: 3px; font-variant: small-caps; letter-spacing: 0.5px;
}
.nav-links a:hover { color: var(--or-clair); background: #3d2a1b; }
.nav-mj { color: var(--or-clair) !important; }
.nav-sep { width: 1px; height: 20px; background: var(--liseret); }
.nav-user { display: flex; align-items: center; gap: 10px; color: #cbb890; }
.avatar-mini { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--liseret); }
.btn-logout { color: #a08a66; font-size: 0.85em; text-decoration: none; }
.btn-logout:hover { color: var(--sceau); }

/* ── Layout ── */
.contenu { max-width: 1100px; margin: 26px auto; padding: 0 16px; }
.carte, .login-box {
  position: relative;
  background-color: var(--parchemin);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.22 0 0 0 0 0.09 0 0 0 0.07 0'/></filter><rect width='220' height='220' filter='url(%23g)'/></svg>"),
    radial-gradient(ellipse at 15% 8%, rgba(122, 90, 40, 0.10), transparent 55%),
    radial-gradient(ellipse at 88% 94%, rgba(105, 72, 32, 0.12), transparent 50%),
    radial-gradient(ellipse at 75% 15%, rgba(110, 80, 38, 0.06), transparent 45%),
    radial-gradient(ellipse at 50% 45%, rgba(255, 250, 235, 0.40), transparent 75%);
  border: 1px solid var(--liseret);
  border-radius: 3px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.carte::before, .login-box::before {
  content: ""; position: absolute; inset: 5px; pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><g fill='none' stroke='%238a6d2f'><path d='M43 3H12Q3 3 3 12V43' stroke-width='2'/><path d='M43 8H14Q8 8 8 14V43' opacity='.5'/></g><path d='M11 5.5L16 11L11 16.5L6 11Z' fill='%238a6d2f'/><circle cx='11' cy='11' r='1.7' fill='%238b2f23'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><g transform='rotate(90 22 22)'><g fill='none' stroke='%238a6d2f'><path d='M43 3H12Q3 3 3 12V43' stroke-width='2'/><path d='M43 8H14Q8 8 8 14V43' opacity='.5'/></g><path d='M11 5.5L16 11L11 16.5L6 11Z' fill='%238a6d2f'/><circle cx='11' cy='11' r='1.7' fill='%238b2f23'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><g transform='rotate(180 22 22)'><g fill='none' stroke='%238a6d2f'><path d='M43 3H12Q3 3 3 12V43' stroke-width='2'/><path d='M43 8H14Q8 8 8 14V43' opacity='.5'/></g><path d='M11 5.5L16 11L11 16.5L6 11Z' fill='%238a6d2f'/><circle cx='11' cy='11' r='1.7' fill='%238b2f23'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><g transform='rotate(270 22 22)'><g fill='none' stroke='%238a6d2f'><path d='M43 3H12Q3 3 3 12V43' stroke-width='2'/><path d='M43 8H14Q8 8 8 14V43' opacity='.5'/></g><path d='M11 5.5L16 11L11 16.5L6 11Z' fill='%238a6d2f'/><circle cx='11' cy='11' r='1.7' fill='%238b2f23'/></g></svg>");
  background-position: top left, top right, bottom right, bottom left;
  background-repeat: no-repeat;
}
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .grille-2 { grid-template-columns: 1fr; } }
h1 {
  font-size: 1.55em; margin-bottom: 4px; color: #e8d9b0;
  font-variant: small-caps; letter-spacing: 1px; font-weight: 600;
}
.carte h1 { color: var(--encre); }
h2::before { content: "\2767  "; color: var(--or); font-size: 0.9em; }
h2 {
  font-size: 1.02em; color: var(--sceau); margin-bottom: 12px;
  font-variant: small-caps; letter-spacing: 1.5px;
  border-bottom: 1px solid var(--liseret); padding-bottom: 5px;
}
.sous-titre { color: #b09a72; margin-bottom: 8px; font-style: italic; }
.carte .sous-titre, .carte p { color: var(--encre-2); }
.carte p strong { color: var(--encre); }

/* ── Fiche ── */
.fiche-entete { display: flex; gap: 20px; align-items: center; }
.avatar-perso {
  width: 88px; height: 88px; border-radius: 3px; object-fit: cover;
  border: 2px solid var(--liseret); box-shadow: 0 0 0 1px var(--encre-2);
}
.badge {
  display: inline-block; padding: 2px 11px; border-radius: 2px;
  font-size: 0.72em; margin-right: 6px; margin-top: 6px;
  font-variant: small-caps; letter-spacing: 1px; border: 1px solid;
}
.badge-actif { background: #dde4cd; color: #3d5a2e; border-color: #8ba372; }
.badge-mort  { background: #e6cfc9; color: #7c261b; border-color: #b3766b; }
.badge-etat  { background: #efe3bc; color: #7c5b16; border-color: #bfa15c; }
.badge-equipe{ background: #d5dcE8; color: #2c4a7c; border-color: #8399bd; }
.badge-type  { background: #e4d8c4; color: #6b4f2a; border-color: #b49b6c; }
.alerte { color: var(--sceau); margin-bottom: 12px; font-style: italic; }

.barre-label { font-size: 0.85em; color: var(--encre-2); margin: 8px 0 4px; }
.barre {
  height: 11px; background: #cbb890; border-radius: 2px; overflow: hidden;
  margin-bottom: 8px; border: 1px solid #a08a5f;
}
.barre-pv { height: 100%; background: var(--pv); }
.barre-pm { height: 100%; background: var(--pm); }

.stats-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--parchemin-2); border: 1px solid var(--liseret);
  border-radius: 2px; padding: 10px; text-align: center;
}
.stat span {
  display: block; font-size: 0.7em; color: var(--encre-2);
  font-variant: small-caps; letter-spacing: 2px;
}
.stat strong { font-size: 1.45em; color: var(--encre); }
.stat small { color: var(--or); display: block; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #cbb890; color: var(--encre); }
th {
  color: var(--encre-2); font-size: 0.78em; font-variant: small-caps;
  letter-spacing: 1.5px; border-bottom: 2px solid var(--liseret);
}
small { color: var(--encre-2); }

/* ── Inventaire / objets ── */
.grille-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.item { border-left: 4px solid #b49b6c; }
.item-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-titre strong { color: var(--encre); }
.item-meta { color: var(--encre-2); font-size: 0.8em; margin: 4px 0; font-style: italic; }
.item-desc { font-size: 0.9em; color: var(--encre); }
.rarete-rare { border-left-color: var(--pm); }
.rarete-epique { border-left-color: #6b3f8a; }
.rarete-legendaire { border-left-color: #b8860b; }
.rarete-artefact { border-left-color: var(--sceau); }

/* ── Panel MJ ── */
.grille-mj { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.mj-carte { margin-bottom: 0; }
.mj-mort { opacity: 0.6; }
.mj-entete { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.mj-entete > div { flex: 1; }
.mj-entete strong { display: block; color: var(--encre); }
.mj-form { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mj-form input { width: 80px; }
.mj-form button {
  background: var(--sceau); color: #f4ebd6; border: 1px solid #6b2419;
  border-radius: 2px; padding: 6px 12px; cursor: pointer; font-size: 0.85em;
  font-family: inherit; font-variant: small-caps; letter-spacing: 1px;
}
.mj-form button:hover { background: #a03a2c; }

/* ── Formulaires ── */
input[type="text"], input[type="number"], select, textarea {
  background: var(--parchemin-3); color: var(--encre);
  border: 1px solid var(--liseret); border-radius: 2px;
  padding: 7px 10px; font-size: 0.92em; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--or); }
textarea { resize: vertical; }
.input-qte { width: 70px; }

.btn {
  display: inline-block; background: var(--sceau); color: #f4ebd6;
  border: 1px solid #6b2419; border-radius: 2px; padding: 8px 18px;
  cursor: pointer; font-size: 0.9em; text-decoration: none;
  font-family: inherit; font-variant: small-caps; letter-spacing: 1px;
}
.btn:hover { background: #a03a2c; }
.btn:disabled { background: #b09a72; border-color: #93805e; cursor: not-allowed; }
.btn-mini {
  background: var(--parchemin-2); color: var(--encre);
  border: 1px solid var(--liseret); border-radius: 2px;
  padding: 3px 10px; cursor: pointer; font-size: 0.8em; font-family: inherit;
}
.btn-mini:hover { border-color: var(--sceau); color: var(--sceau); }
.btn-danger { color: var(--sceau); }

.form-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-top: 10px; }
.form-grille label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8em; color: var(--encre-2); font-variant: small-caps; letter-spacing: 1px; }
.form-grille .pleine { grid-column: 1 / -1; }
.form-grille button { justify-self: start; }
@media (max-width: 700px) { .form-grille { grid-template-columns: 1fr; } }

.sous-form { border: 1px solid var(--liseret); border-radius: 2px; padding: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: var(--parchemin-2); }
.sous-form legend { color: var(--sceau); font-size: 0.85em; padding: 0 8px; font-variant: small-caps; letter-spacing: 1px; }
@media (max-width: 700px) { .sous-form { grid-template-columns: 1fr 1fr; } }

.form-repli { margin-top: 14px; }
.form-repli summary { cursor: pointer; color: var(--sceau); font-size: 0.92em; font-variant: small-caps; letter-spacing: 1px; }
.form-danger { margin-top: 14px; text-align: right; }
.form-inline { display: inline-flex; gap: 5px; align-items: center; font-size: 0.85em; color: var(--encre-2); flex-wrap: wrap; }
.form-achat { display: flex; gap: 6px; margin-top: 8px; align-items: center; }

.filtres { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filtres label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78em; color: var(--encre-2); font-variant: small-caps; letter-spacing: 1px; }

.entete-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.entete-actions a { color: #cbb890; }

/* ── Compétences D&D ── */
.grille-comp { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 700px) { .grille-comp { grid-template-columns: 1fr; } }
.comp {
  display: flex; align-items: center; gap: 8px;
  background: var(--parchemin-2); border: 1px solid #cbb890;
  border-radius: 2px; padding: 6px 10px; font-size: 0.88em;
}
.comp span { flex: 1; color: var(--encre); }
.comp strong { color: var(--sceau); }
.comp form { margin: 0; }

/* ── Quêtes ── */
.grille-quetes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .grille-quetes { grid-template-columns: 1fr; } }
.quete-verrou { opacity: 0.6; }

.lien-carte { text-decoration: none; color: inherit; display: block; }
.lien-carte:hover { border-color: var(--sceau); }

/* ── Divers ── */
.flash {
  background: #dde4cd; color: #3d5a2e; border: 1px solid #8ba372;
  border-radius: 2px; padding: 10px 16px; margin-bottom: 14px;
  font-size: 0.9em; font-style: italic;
}
.note { color: #b09a72; font-size: 0.82em; margin-top: 10px; font-style: italic; }
.carte .note { color: var(--encre-2); }

/* ── Login ── */
.login-box {
  max-width: 420px; margin: 10vh auto; text-align: center;
  border-radius: 3px; padding: 44px 32px;
}
.login-box h1 { color: var(--encre); }
.login-box p { color: var(--encre-2); margin-bottom: 20px; font-style: italic; }
.btn-discord {
  display: inline-block; background: #5865F2; color: #fff;
  padding: 12px 28px; border-radius: 3px; text-decoration: none; font-weight: bold;
}
.btn-discord:hover { filter: brightness(1.1); }
.login-note { font-size: 0.8em; margin-top: 16px; }
