/* Theme sombre uniquement : l'app vit dans l'overlay d'un jeu. */
:root {
  --bg: #0f1115;
  --panel: #181b22;
  --raised: #222733;
  --line: #2f3542;
  --text: #eef0f5;
  --muted: #a0a8b8;
  --pistol: #5aa9ff;
  --eco: #ff7b7b;
  --force: #ffb454;
  --full: #4cd38b;
  --ct: #5aa9ff;
  --t: #ffb454;
  color-scheme: dark;
  font-size: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, "Segoe UI", sans-serif; line-height: 1.4; }
h2, h3, h4 { margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; cursor: pointer; }
button:hover { border-color: var(--muted); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--pistol); outline-offset: 2px; }
button.primary { background: var(--full); color: #07130d; border-color: var(--full); font-weight: 700; }
select, input[type=number] { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }

/* barre du haut */
#bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.side { font-weight: 800; min-width: 3.2rem; }
.side.CT { color: var(--ct); border-color: var(--ct); }
.side.T { color: var(--t); border-color: var(--t); }
.gsi { font-size: .8rem; color: var(--muted); }
.gsi.on { color: var(--full); }
.score { font-size: 1.15rem; margin-right: auto; }
.score b { font-size: 1.4rem; }
.score .vs { color: var(--muted); font-size: .8rem; }

/* cartes d'economie */
#eco { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .8rem 1rem 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: .7rem 1rem; }
.card.pistol { border-left-color: var(--pistol); }
.card.eco { border-left-color: var(--eco); }
.card.force { border-left-color: var(--force); }
.card.full { border-left-color: var(--full); }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; letter-spacing: .08em; color: var(--muted); }
.tag { font-size: 1.15rem; font-weight: 800; letter-spacing: 0; }
.pistol .tag { color: var(--pistol); } .eco .tag { color: var(--eco); } .force .tag { color: var(--force); } .full .tag { color: var(--full); }
.big { font-size: 1.7rem; font-weight: 700; }
.big small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: .85rem; }
.adjust { margin-top: .4rem; font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.adjust input { width: 7rem; padding: .2rem .4rem; }

/* phases */
#phases { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem 0; }
#phases button { font-weight: 600; }
#phases button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
#phases button .n { color: var(--muted); font-weight: 400; margin-left: .3rem; }
#phases button.on .n { color: #555; }
.star { color: var(--force); margin-right: .25rem; }

/* liste + detail */
#cols { display: grid; grid-template-columns: minmax(12rem, 20rem) 1fr; gap: .8rem; padding: .8rem 1rem 1.5rem; }
#list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; align-content: start; }
#list button { width: 100%; text-align: left; padding: .7rem .9rem; font-weight: 600; }
#list .sites { display: flex; gap: .4rem; }
#list .sites button { width: auto; flex: 1; text-align: center; }
#list button.on { border-color: var(--text); background: var(--raised); box-shadow: inset 4px 0 0 var(--text); }
#detail { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; min-width: 0; }
#detail h2 { font-size: 1.4rem; margin-bottom: .8rem; }
.empty { color: var(--muted); }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.info section { background: var(--raised); border-radius: 8px; padding: .5rem .8rem; }
h4 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
ul.items { margin: 0; padding-left: 1.1rem; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: .6rem; }
.steps > li { background: var(--raised); border-radius: 8px; padding: .6rem .9rem; }
.steps ul { list-style: none; margin: 0; padding: 0; }
.steps li li { padding: .15rem 0; font-size: 1.05rem; }
.role { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 .45rem; margin-right: .3rem; font-weight: 700; }
.media { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.media ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
figure { margin: 0; }
figure img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
a { color: var(--pistol); }
code { background: var(--bg); padding: 0 .3rem; border-radius: 4px; }

/* dialogues */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; width: min(34rem, 94vw); }
dialog::backdrop { background: #000a; }
dialog h2 { margin-bottom: .8rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 .7rem; padding: .5rem .8rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
legend { color: var(--muted); font-size: .8rem; padding: 0 .3rem; }
label { cursor: pointer; }
.row { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .8rem; }
.resume h1, .resume h2, .resume h3 { margin: .8rem 0 .3rem; font-size: 1.1rem; }
.resume ul { padding-left: 1.2rem; margin: .2rem 0; }
.resume .src { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 1rem; }

@media (max-width: 760px) {
  :root { font-size: 16px; }
  #eco, #cols { grid-template-columns: 1fr; }
}
