@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,500&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #100c08;
  --wood: #1b130d;
  --wood-light: #2b1c11;
  --gold: #c99342;
  --gold-light: #f2d184;
  --paper: #d8bf8f;
  --paper-light: #f1dfb8;
  --cream: #fff4d4;
  --muted: #c7b99f;
  --line: rgba(210, 161, 82, .52);
  --green: #183b2a;
  --shadow: 0 18px 45px rgba(0, 0, 0, .52);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font: 16px/1.55 "Crimson Pro", Georgia, serif;
  background: #0b0806;
  background-image:
    linear-gradient(rgba(9, 6, 4, .72), rgba(9, 6, 4, .82)),
    url("hero-sunset.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 13, 8, .98), rgba(10, 7, 5, .94));
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.nav { min-height: 76px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font: 700 1.25rem Cinzel, serif; color: var(--gold-light); }
.brand img { width: 58px; height: 58px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 12px 11px; font: 500 .88rem Cinzel, serif; color: #e8d5b0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--gold-light); border-bottom-color: var(--gold); background: rgba(201, 147, 66, .08); }
.nav-links a[data-page="staff"] { margin-left:8px; border:1px solid rgba(201,147,66,.55); padding-inline:14px; background:rgba(18,13,9,.48); }
.nav-links a[data-page="staff"]::before { content:"♜"; margin-right:7px; color:var(--gold); }
.nav-links a[data-page="staff"]:hover { border-color:var(--gold-light); background:rgba(201,147,66,.14); }
.menu-toggle { display: none; border: 0; background: none; color: var(--gold-light); font-size: 1.55rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid #d7a54d;
  border-radius: 2px;
  background: linear-gradient(#6e4318, #35200f);
  box-shadow: inset 0 0 0 2px rgba(255, 221, 145, .12), 0 6px 16px rgba(0,0,0,.28);
  color: #fff1cb;
  font: 600 .85rem Cinzel, serif;
  text-transform: uppercase;
  cursor: pointer;
  transition: .2s ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.15); }
.button.dark { background: linear-gradient(#172c43, #0c1726); border-color: #637991; }

.hero {
  min-height: 650px;
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  border-bottom: 5px solid #2c1b0f;
  background-image:
    linear-gradient(180deg, rgba(5,8,14,.14), rgba(5,7,10,.12) 48%, rgba(8,5,3,.78)),
    url("hero-sunset.png");
  background-size: cover;
  background-position: center 34%;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(transparent, rgba(12,8,5,.85)); }
.hero-content { position: relative; z-index: 2; width: min(760px, calc(100% - 32px)); padding: 74px 0 50px; }
.hero-logo { width: clamp(150px, 22vw, 235px); filter: drop-shadow(0 12px 24px #000); margin-bottom: -30px; }
.hero h1 { margin: 0; font: 700 clamp(4.2rem, 11vw, 8rem)/.9 Cinzel, serif; letter-spacing: .02em; color: var(--paper-light); text-shadow: 0 4px 0 #472910, 0 8px 20px #000; }
.hero-kicker { margin: 18px 0 0; color: var(--gold-light); font: 600 1rem Cinzel, serif; letter-spacing: .38em; }
.hero-quote { font-size: clamp(1.25rem, 3vw, 1.8rem); font-style: italic; margin: 32px auto 20px; max-width: 620px; text-shadow: 0 2px 6px #000; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.ip-chip { margin: 20px auto 0; width: max-content; max-width: 100%; padding: 8px 16px; border: 1px solid var(--line); background: rgba(10,8,6,.78); color: #f0ddba; font-family: Cinzel, serif; cursor: pointer; }
.lore-note { position: absolute; z-index: 3; right: max(24px, calc((100vw - 1180px)/2)); bottom: 34px; width: 235px; padding: 22px; transform: rotate(1deg); color: #2b1b0d; background: var(--paper-light); box-shadow: var(--shadow); font-size: 1.08rem; font-style: italic; text-align: left; clip-path: polygon(2% 3%,98% 0,100% 95%,93% 100%,4% 97%,0 9%); }

.parchment {
  color: #2b1b0d;
  background:
    radial-gradient(circle at 12% 20%, rgba(117,74,29,.12), transparent 28%),
    linear-gradient(110deg, #c9a978, #f1dfb8 28%, #dec293 72%, #bc9867);
  border-block: 1px solid #6f451e;
  box-shadow: inset 0 0 45px rgba(83, 47, 15, .28);
}
.section { padding: 64px 0; }
.section-title { margin: 0 0 8px; text-align: center; font: 700 clamp(2rem, 5vw, 3.2rem) Cinzel, serif; }
.section-subtitle { margin: 0 auto 36px; text-align: center; font: 500 .92rem Cinzel, serif; letter-spacing: .16em; }
.ornament { width: 100px; height: 1px; margin: 18px auto 28px; background: #8a5b25; position: relative; }
.ornament::after { content: "◆"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #e2c895; padding: 0 8px; color: #7d4e1e; }
.story-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.story-step { text-align: center; position: relative; }
.story-step:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 78px; font-size: 1.8rem; }
.story-image { height: 150px; border: 2px solid #765029; box-shadow: 0 8px 18px rgba(60,35,13,.24); background-image: url("medieval-bg.png"); background-size: 540%; }
.story-image-1 { background-position: 3% 68%; }
.story-image-2 { background-position: 34% 58%; }
.story-image-3 { background-position: 65% 56%; }
.story-image-4 { background-position: 95% 22%; }
.story-step span { display: block; margin-top: 14px; color: #8c5b23; font: 600 .75rem Cinzel, serif; }
.story-step h3 { margin: 2px 0; font: 700 1rem Cinzel, serif; text-transform: uppercase; }
.story-step p { margin: 0; }

.pillar-bar { border-block: 1px solid var(--line); background: rgba(13,9,6,.94); box-shadow: inset 0 0 40px #000; }
.pillars { display: grid; grid-template-columns: repeat(3,1fr); }
.pillar { padding: 36px 26px; text-align: center; border-right: 1px solid rgba(201,147,66,.24); }
.pillar:last-child { border-right: 0; }
.pillar-icon { font-size: 2.6rem; color: var(--gold-light); text-shadow: 0 3px 10px #000; }
.pillar h3 { margin: 12px 0 8px; color: var(--gold-light); font: 600 1.05rem Cinzel, serif; text-transform: uppercase; }
.pillar p { margin: 0; color: var(--muted); }

.projects { padding: 66px 0 76px; }
.projects .section-title { color: var(--gold-light); }
.project-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.project-card { min-height: 250px; padding: 30px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(29,57,42,.94), rgba(12,19,15,.97)); box-shadow: var(--shadow), inset 0 0 26px rgba(0,0,0,.3); position: relative; overflow: hidden; }
.project-card::after { content: "♜"; position: absolute; right: 18px; bottom: -24px; font-size: 7rem; color: rgba(214,174,94,.08); }
.project-number { color: #cdb478; font: 600 .74rem Cinzel, serif; letter-spacing: .14em; }
.project-card h3 { color: var(--gold-light); font: 700 1.35rem Cinzel, serif; text-transform: uppercase; }
.project-card p { color: #e0d5c0; font-size: 1.06rem; }

.site-footer { padding: 36px 0; border-top: 1px solid var(--line); background: #0b0806; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-brand { display: flex; align-items: center; gap: 15px; }
.footer-brand img { width: 76px; height: 76px; object-fit: contain; }
.footer-brand strong { display: block; color: var(--gold-light); font: 700 1.6rem Cinzel, serif; }
.footer-brand .copyright { font-size: 1.15rem; letter-spacing: .08em; white-space: nowrap; }
.footer-brand span { color: var(--muted); letter-spacing: .12em; }
.social h3 { margin: 0 0 12px; font: 500 .9rem Cinzel, serif; color: var(--gold-light); }
.social-links { display: flex; gap: 10px; }
.social-links a { width: 48px; height: 48px; display: grid; place-items: center; padding: 10px; border: 1px solid var(--line); color: #ecd8b1; background: #17100b; transition: .2s ease; }
.social-links a:hover { color: var(--gold-light); border-color: var(--gold-light); transform: translateY(-2px); }
.social-links svg { width: 25px; height: 25px; display: block; }

/* Les textes, liens et contenus sont pilotés depuis config.js. */
.copyright { color: var(--gold-light); font: 700 1.15rem Cinzel, serif; letter-spacing: .08em; white-space: nowrap; }
.rule-number { color: var(--gold); font: 600 .75rem Cinzel, serif; letter-spacing: .14em; }

.page-hero { min-height: 310px; display: grid; place-items: center; text-align: center; background: linear-gradient(rgba(7,7,7,.38),rgba(8,5,3,.78)),url("medieval-bg.png") center 33%/cover; border-bottom: 3px solid #422914; }
.page-hero { background-image: linear-gradient(rgba(7,7,7,.35),rgba(8,5,3,.76)),url("hero-sunset.png"); }

/* Accueil inspiré de la nouvelle direction : port au couchant et parchemin. */
body[data-page="home"] .site-header {
  position: absolute;
  inset: 0 0 auto;
  background: linear-gradient(180deg, rgba(7, 10, 18, .8), rgba(7, 10, 18, .2));
  border-bottom-color: rgba(242, 209, 132, .16);
  box-shadow: none;
}
body[data-page="home"] .nav { justify-content: center; }
body[data-page="home"] .brand { position: absolute; left: 28px; top: 7px; }
body[data-page="home"] .brand span { display: none; }
body[data-page="home"] .brand img { width: 72px; height: 72px; }
body[data-page="home"] .hero {
  min-height: min(760px, 86vh);
  background-position: center 54%;
  border-bottom: 0;
}
body[data-page="home"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,16,.16), rgba(4,5,8,.02) 45%, rgba(8,5,3,.48));
}
body[data-page="home"] .hero-content { padding-top: 120px; }
body[data-page="home"] .hero-logo { display: none; }
body[data-page="home"] .hero h1 {
  font-size: clamp(4.3rem, 10vw, 7.8rem);
  color: #f4dfb8;
  letter-spacing: .08em;
  text-shadow: 0 3px 0 #5f3519, 0 10px 30px #080706;
}
body[data-page="home"] .hero-kicker { margin-top: 8px; }
body[data-page="home"] .hero-quote { margin-top: 24px; }
body[data-page="home"] .hero-actions { flex-direction: column; align-items: center; }
body[data-page="home"] .hero-actions .button { min-width: 230px; }
body[data-page="home"] .lore-note {
  right: 50%;
  bottom: 34px;
  width: min(480px, 80vw);
  padding: 0;
  transform: translateX(50%);
  color: #f5e5c5;
  background: none;
  box-shadow: none;
  clip-path: none;
  text-align: center;
  text-shadow: 0 2px 7px #000;
}
body[data-page="home"] main { display: flex; flex-direction: column; }
body[data-page="home"] .hero { order: 1; }
body[data-page="home"] .pillar-bar {
  order: 2;
  position: relative;
  margin-top: -1px;
  color: #321b0d;
  background:
    radial-gradient(circle at 18% 25%, rgba(116,72,29,.12), transparent 25%),
    linear-gradient(95deg, #c9a878, #f2deb4 25%, #e2c18f 70%, #b98f5e);
  border-color: #70451e;
  box-shadow: inset 0 0 35px rgba(77,43,13,.3), 0 10px 28px rgba(0,0,0,.3);
}
body[data-page="home"] .parchment { order: 3; }
body[data-page="home"] .projects { order: 4; }
body[data-page="home"] .pillar { padding-block: 30px; border-right-color: rgba(91,51,20,.22); }
body[data-page="home"] .pillar-icon { color: #4b2916; text-shadow: none; }
body[data-page="home"] .pillar h3 { color: #4b2916; }
body[data-page="home"] .pillar p { color: #553923; }
.page-hero h1 { margin: 0; color: var(--paper-light); font: 700 clamp(2.8rem, 7vw, 5.6rem) Cinzel, serif; text-shadow: 0 4px 14px #000; }
.page-hero p { margin: 10px 0 0; font-size: 1.25rem; font-style: italic; }
.content-wrap { padding: 60px 0 80px; }
.panel { padding: 30px; border: 1px solid var(--line); background: rgba(19,13,9,.94); box-shadow: var(--shadow); }
.rules-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.rule h2 { color: var(--gold-light); font: 600 1.1rem Cinzel, serif; }
.rule p { color: #d4c8b3; }
.form-card { max-width: 820px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field label { color: #e8d8b8; font: 600 .82rem Cinzel, serif; }
.field input, .field textarea, .field select { width: 100%; padding: 13px 14px; border: 1px solid #745129; border-radius: 0; outline: none; background: #120d09; color: var(--cream); font-family: Inter, sans-serif; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(201,147,66,.12); }
.field textarea { min-height: 120px; resize: vertical; }
.form-actions { margin-top: 20px; display: flex; align-items: center; gap: 16px; }
.form-status { display: none; padding: 12px; border: 1px solid var(--line); color: #ead9b8; }
.form-status.show { display: block; }
.form-status.success { border-color: #5d8a66; }
.form-status.error { border-color: #9b5144; }
.vote-panel { max-width: 650px; margin: 0 auto; text-align: center; padding: 54px 34px; }
.vote-panel .sigil { font-size: 4rem; color: var(--gold-light); }
.vote-panel h2 { font: 700 1.7rem Cinzel, serif; color: var(--gold-light); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; opacity: 0; transform: translateY(10px); pointer-events: none; padding: 12px 18px; background: #1b120b; border: 1px solid var(--gold); transition: .25s; }
.toast.show { opacity: 1; transform: none; }

.news-section { padding: 38px 0 44px; background: linear-gradient(rgba(7,9,14,.87),rgba(7,6,5,.96)),url("medieval-bg.png") center/cover; }
body[data-page="home"] .news-section { order: 3; }
.news-section .section-title { color: var(--gold-light); font-size:clamp(1.65rem,3.5vw,2.45rem); }
.news-section .section-subtitle { color: var(--muted); margin-bottom:24px; font-size:.78rem; }
.news-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(235px,300px)); justify-content:center; gap:18px; }
.news-card { overflow:hidden; border:1px solid var(--line); background:rgba(19,13,9,.96); box-shadow:var(--shadow); }
.news-card img { width:100%; height:150px; object-fit:cover; display:block; }
.news-card-body { padding:17px 18px 19px; }
.news-card time { color:var(--gold); font:600 .78rem Cinzel,serif; }
.news-card h2,.news-card h3 { margin:7px 0; color:var(--gold-light); font:700 1.02rem Cinzel,serif; }
.news-card p { margin:7px 0 12px; color:#d4c8b3; }
.news-card a { color:var(--gold-light); font-weight:600; }
.center { text-align:center; margin:24px 0 0; }
.empty-state { text-align:center; color:var(--muted); }
.page-hero.compact { min-height:260px; }
.article { max-width:900px; }
.article-cover { width:100%; max-height:480px; object-fit:cover; margin-bottom:24px; }
.article-summary { color:var(--gold-light); font-size:1.3rem; font-style:italic; }
.article-content { color:#e5d8c0; font-size:1.1rem; line-height:1.8; }
.admin-shell { min-height:100vh; display:grid; place-items:center; padding:32px 16px; }
.admin-card { width:min(760px,100%); }
.admin-card h1,.admin-title h1 { color:var(--gold-light); font:700 2rem Cinzel,serif; }
.login-card { max-width:480px; text-align:center; }
.login-card img { width:120px; }
.alert { padding:13px 16px; border:1px solid var(--line); background:#17100b; }
.alert.success { border-color:#5d8a66; color:#bfe0c5; }
.alert.error { border-color:#9b5144; color:#f0b8ae; }
.admin-header { min-height:74px; display:flex; align-items:center; justify-content:space-between; padding:10px max(20px,calc((100vw - 1180px)/2)); border-bottom:1px solid var(--line); background:#0b0806; }
.admin-header>a { display:flex; align-items:center; gap:10px; color:var(--gold-light); font:700 1.2rem Cinzel,serif; }
.admin-header img { width:52px; height:52px; object-fit:contain; }
.admin-header .admin-logo { width:58px; justify-content:center; }
.admin-header nav { display:flex; align-items:center; flex-wrap:wrap; gap:20px; }
.admin-main { width:min(1120px,calc(100% - 32px)); margin:45px auto 80px; }
.admin-title { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.admin-title p { margin:0; color:var(--gold); font:600 .8rem Cinzel,serif; letter-spacing:.15em; }
.admin-title h1 { margin:4px 0 0; }
.admin-table-wrap { overflow:auto; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th,.admin-table td { padding:15px; border-bottom:1px solid rgba(201,147,66,.22); text-align:left; }
.admin-table th { color:var(--gold-light); font:600 .8rem Cinzel,serif; }
.status { display:inline-block; padding:4px 9px; border:1px solid var(--line); }
.status.published { border-color:#5d8a66; color:#bfe0c5; }
.actions { display:flex; gap:14px; }
.actions form { display:inline; }
.actions button { border:0; padding:0; background:none; color:#e6a99d; cursor:pointer; }
.editor-form { max-width:850px; }
.editor-form .field { margin-bottom:18px; }
.editor-form textarea.large { min-height:300px; }
.editor-preview { width:min(320px,100%); max-height:200px; object-fit:cover; margin-top:10px; }
.editor-actions { display:flex; gap:12px; margin-top:24px; }
.staff-layout { display:grid; grid-template-columns:minmax(280px,.8fr) minmax(340px,1.2fr); gap:22px; align-items:start; }
.staff-layout h2 { color:var(--gold-light); font:600 1.15rem Cinzel,serif; }
.staff-layout .field { margin-bottom:16px; }
.staff-member { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid rgba(201,147,66,.2); }
.staff-member div { display:grid; }
.staff-member span { color:var(--muted); }
.staff-member button { border:0; background:none; color:#e6a99d; cursor:pointer; }
.streamer-section { background:linear-gradient(rgba(7,9,14,.9),rgba(7,6,5,.96)),url("medieval-bg.png") center/cover fixed; }
.streamer-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:26px; }
.streamer-card { padding:22px; border:1px solid var(--line); background:rgba(15,10,7,.96); box-shadow:var(--shadow); }
.streamer-profile { display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.streamer-profile img { width:72px; height:72px; border-radius:50%; object-fit:cover; border:2px solid var(--gold); }
.streamer-profile h2 { margin:0 0 6px; color:var(--gold-light); font:700 1.25rem Cinzel,serif; }
.platform { display:inline-block; padding:3px 9px; border:1px solid var(--line); font:600 .75rem Inter,sans-serif; }
.platform.twitch { color:#cbb5ff; border-color:#7657b8; }
.platform.youtube { color:#ffb4aa; border-color:#a94a40; }
.streamer-player { position:relative; aspect-ratio:16/9; overflow:hidden; background:#050505; border:1px solid rgba(201,147,66,.35); }
.streamer-player iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.streamer-message { min-height:48px; margin:17px 0; color:#ead9b8; font-size:1.08rem; font-style:italic; text-align:center; }
.streamer-watch { width:100%; }
.streamer-admin { grid-template-columns:minmax(320px,.9fr) minmax(380px,1.1fr); }
.streamer-avatar-preview { width:90px; height:90px; margin-top:10px; border-radius:50%; object-fit:cover; border:2px solid var(--gold); }
.check-field { display:flex; align-items:center; gap:9px; margin-top:12px; color:#e8d8b8; }
.streamer-member>div:first-child { display:flex; grid-template-columns:none; align-items:center; gap:12px; }
.streamer-member img { width:48px; height:48px; border-radius:50%; object-fit:cover; }
.streamer-member span { display:grid; }
.streamer-admin-actions { display:flex !important; gap:12px; align-items:center; }
.streamer-admin-actions form { margin:0; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 70px; left: 16px; right: 16px; flex-direction: column; align-items: stretch; padding: 10px; background: #150f0a; border: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { text-align: center; }
  .nav-links a[data-page="staff"] { margin-left:0; }
  .nav .button { display: none; }
  .lore-note { display: none; }
  .story-grid, .project-grid { grid-template-columns: repeat(2,1fr); }
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: 0; border-bottom: 1px solid rgba(201,147,66,.24); }
  body[data-page="home"] .site-header { position: absolute; }
  body[data-page="home"] .nav { justify-content: flex-end; }
  body[data-page="home"] .brand { left: 16px; }
}
@media (max-width: 620px) {
  body { background-attachment: scroll; }
  .hero { min-height: 600px; }
  .hero h1 { font-size: 3.4rem; }
  .hero-kicker { letter-spacing: .2em; }
  .story-grid, .project-grid, .rules-grid, .form-grid { grid-template-columns: 1fr; }
  .story-step:not(:last-child)::after { display: none; }
  .field.full { grid-column: auto; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-brand { flex-direction: column; }
  .news-grid { grid-template-columns:1fr; }
  .admin-header,.admin-title { align-items:flex-start; flex-direction:column; }
  .admin-table { min-width:680px; }
  .staff-layout { grid-template-columns:1fr; }
  .streamer-grid { grid-template-columns:1fr; }
  .streamer-admin { grid-template-columns:1fr; }
}
