/* Deus : socle (couleurs, typographies, mise en page, boutons, modale) */
:root {
  --nuit: #0b0907;
  --suie: #14100c;
  --bitume: #1f1812;
  --brun: #2c2118;
  --terre: #4a3524;
  --ocre: #a87634;
  --or: #d6ac57;
  --or-clair: #f2d991;
  --or-pale: #fff1c4;
  --parchemin: #e8dcc0;
  --encre: #efe4cc;
  --encre-2: #c9b998;
  --encre-3: #8f7f63;
  --sang: #9b2f1f;
  --sang-clair: #e0573c;
  --lapis: #2e4f86;
  --jade: #2f9c85;
  --foi: #ffb547;
  --ray: #ffd56b;
  --fer: #8fd0ff;
  --fid: #f4e6c4;
  --ombre: 0 18px 40px rgba(0, 0, 0, .55);
  --rayon: 14px;
  --titre: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --texte: 'Cormorant Garamond', Georgia, serif;
  --ancien: 'IM Fell English', 'Cormorant Garamond', Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--nuit);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body::before { /* grain de toile ancienne, sur tout le site */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1000; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .35 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: var(--or-clair); text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; flex: none; }
h1, h2, h3, h4 { font-family: var(--titre); font-weight: 700; letter-spacing: .06em; line-height: 1.15; margin: 0 0 .5em; color: var(--or-clair); }
h1 { font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: 900; letter-spacing: .14em; }
h2 { font-size: clamp(1.45rem, 4.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.ancien { font-family: var(--ancien); font-style: italic; }

/* ─── En-tête et navigation ─── */
#app { min-height: 100%; display: flex; flex-direction: column; }
.site-head {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: calc(10px + var(--safe-t)) 20px 10px; background: linear-gradient(180deg, rgba(11, 9, 7, .96), rgba(11, 9, 7, .78));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(214, 172, 87, .18);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 900; letter-spacing: .3em; font-size: 1.25rem; color: var(--or-clair); }
.brand-sceau { width: 34px; height: 34px; color: var(--or); filter: drop-shadow(0 0 8px rgba(242, 217, 145, .35)); }
.site-nav { display: flex; gap: 6px; margin-left: auto; }
.site-nav a { font-family: var(--titre); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--encre-2); padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.site-nav a:hover { color: var(--or-clair); }
.site-nav a.on { color: var(--nuit); background: linear-gradient(180deg, var(--or-clair), var(--or)); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(214, 172, 87, .35); background: rgba(31, 24, 18, .7); color: var(--or-clair); cursor: pointer; font-size: 22px; transition: transform .15s, background .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn:hover { background: rgba(74, 53, 36, .8); }
main#view { flex: 1; }

.tabbar { display: none; }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-head { padding: calc(8px + var(--safe-t)) 14px 8px; }
  .son-btn { margin-left: auto; }
  main#view { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: linear-gradient(180deg, rgba(20, 16, 12, .92), rgba(11, 9, 7, .98)); border-top: 1px solid rgba(214, 172, 87, .22);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--encre-3); font-family: var(--titre); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
  .tabbar a svg { font-size: 23px; }
  .tabbar a.on { color: var(--or-clair); }
  .tabbar a.on svg { filter: drop-shadow(0 0 6px rgba(242, 217, 145, .6)); }
  .tabbar .tab-jouer svg { font-size: 30px; color: var(--foi); }
}
body.en-partie .site-head, body.en-partie .tabbar { display: none; }
body.en-partie main#view { padding: 0; }

/* ─── Boutons ─── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 26px;
  border-radius: 999px; border: 1px solid rgba(255, 233, 170, .55); cursor: pointer; overflow: hidden;
  font-family: var(--titre); font-weight: 700; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase;
  color: #2a1a06; background: linear-gradient(180deg, #ffeaa8 0%, #e2b55b 45%, #b9812f 100%);
  box-shadow: 0 2px 0 rgba(255, 255, 255, .35) inset, 0 -3px 0 rgba(0, 0, 0, .25) inset, 0 10px 24px rgba(0, 0, 0, .45), 0 0 22px rgba(242, 190, 90, .25);
  transition: transform .12s, filter .2s; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); transition: transform .7s; }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(.96); }
.btn:disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
.btn svg { font-size: 1.25em; }
.btn.sombre { color: var(--or-clair); background: linear-gradient(180deg, #3a2c1f, #1d1610); border-color: rgba(214, 172, 87, .45); text-shadow: none; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 8px 20px rgba(0, 0, 0, .45); }
.btn.sang { color: #ffe9dc; background: linear-gradient(180deg, #d9573a, #8e2716); border-color: rgba(255, 180, 150, .5); text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.btn.petit { min-height: 40px; padding: 8px 16px; font-size: .78rem; }
.btn.large { width: 100%; }

/* ─── Modale ─── */
.modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 18px; background: rgba(5, 4, 3, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fondu .25s ease; }
.modal[hidden] { display: none; }
.modal-boite { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 36px); overflow: auto; padding: 26px 22px 22px; border-radius: 20px;
  background: radial-gradient(120% 80% at 50% 0%, #3a2b1d, #17110c 70%); border: 1px solid rgba(214, 172, 87, .4); box-shadow: var(--ombre), 0 0 0 6px rgba(214, 172, 87, .06); }
.modal-fermer { position: absolute; top: 10px; right: 10px; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }

/* ─── Petits utilitaires ─── */
.ornement { display: flex; align-items: center; gap: 14px; color: var(--or); margin: 10px auto 18px; max-width: 320px; }
.ornement::before, .ornement::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--or), transparent); }
.ornement svg { width: 22px; height: 22px; }
.pastille { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-family: var(--titre); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid rgba(214, 172, 87, .35); color: var(--or-clair); background: rgba(31, 24, 18, .7); }
.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 950; width: max-content; max-width: min(92vw, 460px); text-align: center; padding: 10px 18px; border-radius: 16px; background: rgba(20, 16, 12, .96); border: 1px solid rgba(214, 172, 87, .5); font-family: var(--texte); font-weight: 600; font-size: 1.02rem; line-height: 1.3; letter-spacing: 0; color: var(--or-clair); box-shadow: var(--ombre); animation: fondu .2s; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Écran d'entrée */
.entree { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; cursor: pointer; text-align: center;
  background: radial-gradient(60% 50% at 50% 45%, rgba(120, 80, 30, .35), transparent 70%), radial-gradient(130% 90% at 50% 50%, #1c140d, #060403); transition: opacity .9s ease, filter .9s ease; }
.entree.sortie { opacity: 0; filter: blur(8px) brightness(1.6); }
.entree-boite { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: fondu 1.4s ease; }
.entree-sceau { width: 120px; height: 120px; color: var(--or); filter: drop-shadow(0 0 24px rgba(255, 200, 100, .45)); animation: respire 3.2s ease-in-out infinite; }
.entree-titre { font-family: var(--titre); font-weight: 900; font-size: clamp(2.6rem, 12vw, 4.6rem); letter-spacing: .35em; padding-left: .35em; color: var(--or-clair); text-shadow: 0 0 30px rgba(255, 200, 100, .35); }
.entree-sous { font-family: var(--ancien); font-style: italic; font-size: 1.15rem; color: var(--encre-2); animation: pulse 2.4s ease-in-out infinite; }
@keyframes respire { 50% { transform: scale(1.06); filter: drop-shadow(0 0 40px rgba(255, 210, 120, .7)); } }
