:root {
  --bg: #0b1020;
  --panel: #141b34;
  --line: #2b3764;
  --text: #e8ecff;
  --dim: #98a2cf;
  --gold: #ffd60a;
  --gold-d: #9c6b00;
  --paper: #f3ecd8;
  --ink: #2a2418;
  --manila: #d9b877;
  --manila-d: #b8934f;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
.hidden { display: none !important; }
a { color: var(--gold); }

/* barre du haut */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px;
  background: rgba(11, 16, 32, .82);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(4px);
}
.nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.nav a { color: var(--dim); text-decoration: none; }
.nav a:hover { color: var(--gold); }

/* boutons en pixels */
.pxbtn {
  display: inline-block; font: inherit; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  color: #1b1400; background: var(--gold); border: 0; padding: 10px 18px;
  box-shadow: 0 4px 0 var(--gold-d), 0 0 0 2px #000 inset;
  transition: transform .08s, box-shadow .08s;
}
.pxbtn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-d), 0 0 0 2px #000 inset; }
.pxbtn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--gold-d), 0 0 0 2px #000 inset; }
.pxbtn.small { padding: 5px 10px; font-size: 12px; }
.pxbtn.big { font-size: clamp(22px, 5vw, 32px); padding: 16px 44px; margin: 22px 0 18px; box-shadow: 0 8px 0 var(--gold-d), 0 0 0 3px #000 inset; }
.pxbtn.big:hover { transform: translateY(4px); box-shadow: 0 4px 0 var(--gold-d), 0 0 0 3px #000 inset; }
.pxbtn.big:active { transform: translateY(8px); box-shadow: 0 0 0 var(--gold-d), 0 0 0 3px #000 inset; }
.linkbtn { font: inherit; color: var(--dim); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--gold); }

/* bandeau d'accueil */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; padding: 72px 16px 40px; }
#bgmap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: .42; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(11, 16, 32, .15) 0%, rgba(11, 16, 32, .85) 75%), linear-gradient(to bottom, rgba(11, 16, 32, 0) 70%, var(--bg) 100%); }
.hero-in { position: relative; z-index: 2; max-width: 720px; }
#logo { margin: 0; line-height: 0; }
.logo { width: min(92vw, 640px); height: auto; filter: drop-shadow(0 0 22px rgba(255, 214, 10, .18)); image-rendering: pixelated; }
.tagline { margin: 22px 0 6px; font-size: clamp(16px, 3.4vw, 22px); font-weight: 700; }
.sub { margin: 0; color: var(--dim); font-size: clamp(13px, 2.6vw, 16px); }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 4px 0 0; }
.chips li { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); border: 2px solid var(--line); background: rgba(20, 27, 52, .8); padding: 3px 9px; }

/* sections */
.block { max-width: 880px; margin: 0 auto; padding: 56px 18px 8px; }
.block h2 {
  margin: 0 0 22px; font-size: clamp(20px, 4vw, 28px); text-transform: uppercase; letter-spacing: .14em; color: var(--gold);
  text-shadow: 3px 3px 0 #000;
}
.block h2::after { content: ''; display: block; width: 72px; height: 6px; margin-top: 10px; background: repeating-linear-gradient(90deg, #e63946 0 12px, #2f6bff 12px 24px, #ff9f1c 24px 36px, #a64cff 36px 48px, #00e5ff 48px 60px); }
.story p { font-size: 1.05rem; margin: 0 0 14px; max-width: 62ch; }
.story p.last { color: var(--gold); font-weight: 700; font-size: 1.2rem; }
.hint { color: var(--dim); font-size: 13px; margin: 0 0 18px; }
.hint.equal { margin: 18px 0 0; text-align: center; }

/* le jeu en quatre gestes */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 2px solid var(--line); padding: 14px; box-shadow: 4px 4px 0 #000; }
.card h3 { margin: 12px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.card p { margin: 0; color: var(--dim); font-size: 13px; }
.pxnum { height: 26px; width: auto; }

/* dossiers des factions : une pochette cartonnée avec des onglets de couleur */
.folder { --fc: #e63946; position: relative; max-width: 760px; margin: 0 auto; padding-top: 58px; }
.folder-back { position: absolute; left: 0; right: 0; top: 58px; bottom: 0; background: linear-gradient(#e2c488, var(--manila)); border: 3px solid #6b5326; border-radius: 4px; box-shadow: 6px 6px 0 #000; }
.tabs { position: absolute; top: 0; left: 14px; right: 14px; display: flex; gap: 4px; z-index: 4; align-items: flex-end; }
.tab {
  flex: 1; min-width: 0; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font: inherit; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #fff;
  background: color-mix(in srgb, var(--c) 55%, #3a2f18); border: 3px solid #6b5326; border-bottom: 0; border-radius: 6px 6px 0 0; cursor: pointer; padding: 2px;
  transition: transform .18s, background .18s;
}
.tab .emb { background: rgba(0, 0, 0, .28); border-radius: 3px; padding: 1px; }
.tab:hover { transform: translateY(-3px); }
.tab[aria-selected='true'] { height: 56px; background: var(--c); transform: translateY(0); color: #111; }
.tab[aria-selected='true'] .emb { background: rgba(255, 255, 255, .6); }
.tabname { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.sheets { position: relative; z-index: 2; display: grid; margin: 0 16px; padding: 16px 0 76px; }
.sheet {
  grid-area: 1 / 1; position: relative; background: var(--paper); color: var(--ink); border: 2px solid #b9ad8a;
  padding: 16px 18px 20px; box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none; transform: translateY(70%) rotate(-2deg);
  transition: transform .55s cubic-bezier(.2, .9, .25, 1.05), opacity .25s;
  background-image: repeating-linear-gradient(transparent 0 25px, rgba(60, 90, 140, .12) 25px 26px);
}
.sheet.open { opacity: 1; pointer-events: auto; transform: translateY(0) rotate(0); z-index: 2; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.file { font-size: 12px; letter-spacing: .14em; color: #6b6248; }
.stamp { font-size: 14px; font-weight: 700; letter-spacing: .18em; color: #c1121f; border: 3px solid #c1121f; padding: 2px 8px; transform: rotate(-6deg); opacity: .85; }
.sheet-id { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px dashed #b9ad8a; }
.sheet-id .emb { flex: none; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .25)); }
.sheet-name h3 { margin: 0; font-size: clamp(17px, 4.2vw, 24px); letter-spacing: .08em; color: var(--c); text-shadow: 1px 1px 0 rgba(0, 0, 0, .35); }
.motto { font-size: 13px; font-style: italic; margin-top: 4px; }
.sheet-body p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.sheet-body .doctrine { font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.folder-front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74px; z-index: 3; pointer-events: none;
  background: linear-gradient(var(--manila-d), #a8843f); border: 3px solid #6b5326; border-radius: 0 0 4px 4px;
}
.folder-front::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 6px; background: var(--fc); opacity: .9; }

/* règles et confidentialité */
.doc h3 { margin: 22px 0 6px; color: var(--gold); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.doc p { margin: 0 0 8px; max-width: 70ch; font-size: 14px; color: #d2d8f3; }
.example { margin-top: 18px; padding: 10px 12px; background: var(--panel); border-left: 6px solid var(--gold); font-size: 13px; color: var(--dim); }

.foot { margin-top: 56px; padding: 22px 16px 36px; text-align: center; border-top: 2px solid var(--line); }
.foot-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 13px; }
.fine { color: var(--dim); font-size: 12px; margin: 10px 0 0; }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-card { background: var(--panel); border: 3px solid var(--line); box-shadow: 6px 6px 0 #000; max-width: 640px; width: 100%; max-height: 88vh; overflow: auto; padding: 18px; }
.modal-card h2 { margin: 0 0 8px; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-size: 20px; }
.modal-card .pxbtn { margin-top: 16px; }

@media (max-width: 560px) {
  .nav { gap: 9px; font-size: 10px; }
  .block { padding-top: 44px; }
  .sheet { padding: 12px 12px 16px; }
  .sheets { margin: 0 8px; }
  .tabs { left: 8px; right: 8px; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheet, .tab, .pxbtn { transition: none; }
}
