/* Naruto RP — site règlement & lore. Variables en haut pour changer les couleurs facilement. */
:root {
  /* Style par défaut (accueil, règlement, archives, lore global) : rouge sombre */
  --bg: #0a0607;
  --card: rgba(255, 215, 215, 0.05);
  --border: rgba(255, 200, 200, 0.11);
  --text: #efe8e8;
  --muted: #a39494;
  --accent: #dc2626;
  --accent-light: #f87171;
  --danger: #7f1d1d;
  --ok: #4ade80;
  --glow: #2a0a0a;
  --radius: 12px;
  --glow-rgb: 220, 38, 38;
}

/* Thème feu (Konoha) — uniquement sur la page du village de Konoha */
:root[data-theme="fire"] {
  --bg: #07070b;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ece8e1;
  --muted: #9a958c;
  --accent: #ff7a1a;
  --accent-light: #ffa24d;
  --danger: #e63946;
  --glow: #2a1305;
  --glow-rgb: 255, 122, 26;
}

/* Thème pluie (Amegakure) — uniquement sur la page du village d'Ame */
:root[data-theme="rain"] {
  --bg: #05080d;
  --card: rgba(160, 200, 230, 0.06);
  --border: rgba(150, 190, 220, 0.16);
  --text: #dbe7f0;
  --muted: #8296a8;
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --danger: #6366f1;
  --glow: #0c2233;
  --glow-rgb: 56, 189, 248;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  background: radial-gradient(ellipse at 50% -10%, var(--glow) 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent-light); }
h1, h2, h3 { font-family: Impact, "Arial Narrow Bold", sans-serif; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.container { width: min(1100px, 100% - 32px); margin: 0 auto; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 7, 11, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.logo { font-family: Impact, sans-serif; font-size: 1.4rem; letter-spacing: .06em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  color: var(--muted); text-decoration: none; padding: 6px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
nav a:hover, nav a:focus-visible { color: var(--text); background: var(--card); outline: none; }
nav a.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--danger)); font-weight: 600; }

/* ---------- Bandeau titre ---------- */
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--muted); max-width: 640px; margin: 14px auto 0; }
.btn {
  display: inline-block; margin-top: 24px; padding: 11px 26px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--danger)); color: #fff; font-weight: 700; text-decoration: none;
  transition: transform .15s, box-shadow .2s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(var(--glow-rgb), .35); outline: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); margin-left: 8px; }

/* ---------- Cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 24px 0 60px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; border-top: 3px solid var(--c, var(--accent));
}
.card h3 { font-size: 1.15rem; margin-bottom: 4px; color: var(--c, var(--text)); }
.card .tag { font-size: .8rem; color: var(--muted); margin-bottom: 8px; display: block; }
.card p { font-size: .95rem; color: #d3cfc7; }

/* ---------- Page à sommaire (règlement / lore) ---------- */
.doc { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 20px 0 70px; align-items: start; }
.toc {
  position: sticky; top: 84px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.toc h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.toc a:hover, .toc a.current { color: var(--text); background: rgba(var(--glow-rgb), .12); }
.toc a.current { border-left: 3px solid var(--accent); }
#search {
  width: 100%; margin-bottom: 12px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .35); color: var(--text); font: inherit;
}
#search:focus { outline: 2px solid var(--accent); }

.doc section { margin-bottom: 40px; }
.doc section > h2 { font-size: 1.7rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.doc section > h2 small { color: var(--accent); font-size: .9rem; margin-right: 8px; }
.intro { color: var(--muted); margin-bottom: 16px; }

.rule {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; margin: 12px 0;
}
.rule h3 { font-size: 1.05rem; margin-bottom: 4px; }
.rule h3 .num { color: var(--accent); margin-right: 8px; }
.rule p, .rule li { color: #d3cfc7; font-size: .96rem; }
.rule ul { padding-left: 20px; margin-top: 6px; }
.rule.grave { border-left-color: var(--danger); }
.sanction { display: inline-block; font-size: .75rem; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(230, 57, 70, .15); color: #ff8b94; }
.hidden { display: none !important; }
.empty { color: var(--muted); text-align: center; padding: 30px; }

.lore-block p { margin: 10px 0; color: #d3cfc7; }
.timeline { border-left: 2px solid var(--border); margin: 16px 0 0 8px; padding-left: 20px; }
.timeline div { margin-bottom: 16px; position: relative; }
.timeline div::before { content: ""; position: absolute; left: -27px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline strong { color: var(--accent-light); }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--c); }

/* ---------- Pied de page ---------- */
footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer a { color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Onglets, accordéons, archives ---------- */
.center { text-align: center; }
.eyebrow { color: var(--accent); letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; margin-bottom: 8px !important; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0 20px; }
.tab {
  font: inherit; cursor: pointer; padding: 9px 20px; border-radius: 10px; color: var(--accent-light);
  background: transparent; border: 1px solid var(--accent); transition: background .2s, box-shadow .2s;
}
.tab:hover, .tab:focus-visible { background: rgba(var(--glow-rgb), .12); outline: none; }
.tab.on { background: linear-gradient(135deg, var(--accent), var(--danger)); color: #fff; font-weight: 700; box-shadow: 0 0 22px rgba(var(--glow-rgb), .35); }
#search.wide { display: block; width: min(640px, 100%); margin: 0 auto 14px; padding: 12px 16px; }
#accordion { max-width: 860px; margin: 0 auto 30px; }
.acc { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; margin-bottom: 10px; }
.acc summary { cursor: pointer; padding: 14px 18px; list-style: none; font-weight: 600; display: flex; align-items: center; gap: 14px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "›"; margin-left: auto; font-size: 1.4rem; color: var(--accent); transition: transform .2s; }
.acc[open] summary::after { transform: rotate(90deg); }
.acc summary:hover { background: rgba(255, 255, 255, .03); }
.acc .n { color: var(--accent); font-family: Impact, sans-serif; opacity: .8; }
.acc-body { padding: 4px 18px 16px 18px; color: #d3cfc7; font-size: .96rem; }
.acc-body ul { padding-left: 20px; margin-top: 6px; }
.acc-body li { margin: 4px 0; }
.acc-body code { background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 4px; }
.notice { max-width: 860px; margin: 0 auto 60px; background: rgba(var(--glow-rgb), .08); border: 1px solid rgba(var(--glow-rgb), .3); border-radius: var(--radius); padding: 18px 22px; }
.notice h3 { font-size: 1.05rem; margin-bottom: 4px; }

.lore-card { text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; display: block; }
.lore-card:hover, .lore-card:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); outline: none; }
.lore-card .tag { margin: 10px 0 0; color: var(--c); }
.kanji { font-size: 4rem; line-height: 1; color: var(--c, var(--accent)); opacity: .9; }
.kanji.sm { font-size: 2.4rem; margin-bottom: 8px; }
.reader { max-width: 760px; margin: 0 auto; padding: 40px 0 70px; }
.reader h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 6px 0; }
.back { display: inline-block; margin-bottom: 20px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent-light); }
.reader .intro { margin-bottom: 20px; }

/* ---------- Lecture d'un registre ---------- */
.reader { max-width: 780px; }
.reader .eyebrow { color: var(--c); margin-top: 6px; }
.reader .lead { font-size: 1.1rem; color: #e3dfd6; border-left: 3px solid var(--c); padding-left: 16px; margin: 14px 0 34px; }
.chapter { margin-bottom: 34px; }
.chapter h2 { font-size: 1.5rem; margin-bottom: 10px; }
.chapter h2 small { color: var(--c); margin-right: 10px; font-size: 1rem; }
.chapter p { margin: 10px 0; color: #d3cfc7; }
.others-title { margin: 50px 0 0; color: var(--muted); font-size: .9rem; letter-spacing: .15em; }

/* ---------- Thème : bouton + particules ---------- */
#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* Cartes de clans dans un chapitre de lore */
.clan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.clan-list .card p { color: #d3cfc7; font-size: .93rem; margin: 0; }

/* Carte de clan cliquable (c'est un <button> stylé comme une carte) */
button.card.clan { font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; width: 100%; transition: transform .2s, box-shadow .2s, border-color .2s; }
button.card.clan:hover, button.card.clan:focus-visible { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 8px 26px rgba(0, 0, 0, .4), 0 0 18px color-mix(in srgb, var(--c) 35%, transparent); outline: none; }
.clan .more { display: block; margin-top: 12px; color: var(--c); font-size: .85rem; font-weight: 600; }

/* Fenêtre de fiche de clan */
.clan-dialog { margin: auto; width: min(680px, calc(100% - 24px)); max-height: 88vh; padding: 0; border: 1px solid var(--c); border-top-width: 4px; border-radius: var(--radius); background: #0d0d13; color: var(--text); box-shadow: 0 0 60px color-mix(in srgb, var(--c) 30%, transparent); overflow: hidden; }
:root[data-theme="rain"] .clan-dialog { background: #08111a; }
.clan-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); }
.cd-body { padding: 28px 28px 30px; max-height: 88vh; overflow-y: auto; }
.cd-body .eyebrow { color: var(--c); }
.cd-body h2 { font-size: 2.2rem; margin: 2px 0 8px; color: var(--c); }
.cd-body .lead { font-size: 1.02rem; border-left: 3px solid var(--c); padding-left: 14px; margin: 10px 0 18px; color: #e3dfd6; }
.cd-body h3 { font-size: .9rem; letter-spacing: .12em; color: var(--c); margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.cd-body p { margin: 8px 0; color: #d3cfc7; }
.cd-body ul { padding-left: 20px; }
.cd-body li { margin: 5px 0; color: #d3cfc7; }
.cd-close { position: absolute; top: 12px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: rgba(0, 0, 0, .5); color: var(--text); font-size: 1rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.cd-close:hover, .cd-close:focus-visible { border-color: var(--c); color: var(--c); outline: none; }
.cd-body h3 .num { font-family: Impact, sans-serif; margin-right: 10px; opacity: .7; letter-spacing: .05em; }
.clan-dialog { width: min(760px, calc(100% - 24px)); }
