/* Hexapolis — habillage plat, lisible sur téléphone comme sur écran large */

:root {
  --fond: #12171f;
  --fond2: #1b222d;
  --trait: #2c3543;
  --texte: #e8edf4;
  --dim: #8794a6;
  --bleu: #4a9eff;     /* joueur */
  --rouge: #ff5a4a;    /* adversaire */
  --or: #ffc43a;
  --vert: #5fd07a;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--fond);
  color: var(--texte);
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
}

#app { height: 100%; display: flex; align-items: center; justify-content: center; }

.screen {
  width: 100%;
  max-width: 460px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.screen.full { max-width: none; width: 100%; height: 100%; padding: 0; gap: 0; }

.screen.overlay {
  position: fixed;
  inset: 0;
  max-width: none;
  background: rgba(10, 14, 20, .94);
  justify-content: center;
  z-index: 40;
  overflow-y: auto;
}

.hidden { display: none !important; }

h1 { font-size: clamp(30px, 9vw, 52px); letter-spacing: 6px; color: var(--or); font-weight: 800; }
h2 { font-size: clamp(20px, 5vw, 30px); letter-spacing: 3px; }
.subtitle { color: var(--dim); letter-spacing: 1px; font-size: 14px; }
.hint { color: var(--dim); font-size: 13px; line-height: 1.5; margin-top: 8px; }
.version { color: var(--dim); opacity: .45; font-size: 11px; margin-top: 10px; }

.options { display: flex; flex-direction: column; gap: 8px; width: 100%; }

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

.toggle {
  width: 100%;
  padding: 11px;
  background: var(--fond2);
  border: 1px solid var(--trait);
  border-radius: 10px;
  letter-spacing: 1px;
  font-size: 14px;
}
.toggle:active { background: var(--trait); }

.role {
  width: 100%;
  padding: 16px;
  background: var(--fond2);
  border: 1px solid var(--trait);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.role span { font-size: 17px; letter-spacing: 2px; font-weight: 700; }
.role small { color: var(--dim); font-size: 12px; }
.role:active { background: var(--trait); }
.role.wide { max-width: 340px; }

.mini {
  padding: 7px 12px;
  background: var(--fond2);
  border: 1px solid var(--trait);
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 1px;
}

/* HUD */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: rgba(18, 23, 31, .92);
  border-bottom: 1px solid var(--trait);
  z-index: 20;
}
.stat { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
#hud-gold { color: var(--or); }
#hud-gold::before { content: "◈ "; }
.stat.dim { color: var(--dim); font-weight: 400; font-size: 13px; }
#hud-turn { margin-left: auto; color: var(--dim); font-weight: 400; font-size: 13px; }

canvas { display: block; touch-action: none; }

/* Panneau contextuel */
.panel {
  position: fixed;
  left: 8px; right: 8px; bottom: 8px;
  background: rgba(27, 34, 45, .97);
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 12px;
  z-index: 25;
  max-height: 44vh;
  overflow-y: auto;
  padding-bottom: 108px;
}
.panel h3 { font-size: 15px; letter-spacing: 1px; margin-bottom: 2px; }
.panel .sub { color: var(--dim); font-size: 12px; margin-bottom: 10px; }
.panel .row { display: flex; flex-wrap: wrap; gap: 6px; }
.act {
  padding: 9px 11px;
  background: var(--fond);
  border: 1px solid var(--trait);
  border-radius: 9px;
  font-size: 13px;
}
.act:active { background: var(--trait); }
.act[disabled] { opacity: .35; }
.act .cost { color: var(--or); }

.endturn {
  position: fixed;
  right: 10px; bottom: 10px;
  padding: 14px 18px;
  background: var(--bleu);
  color: #0b1017;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 26;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.endturn.busy { background: var(--trait); color: var(--dim); }
/* Tant qu'il reste des unités à jouer, le bouton de fin de tour s'efface
   au profit de SUIVANT : la couleur pleine signale « tout est joué ». */
.endturn.attente { background: var(--fond2); color: var(--dim); border: 1px solid var(--trait); }

.nextbtn {
  position: fixed;
  right: 10px; bottom: 62px;
  padding: 12px 16px;
  background: var(--or);
  color: #0b1017;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 26;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.nextbtn span { opacity: .7; }
/* Le rappel du raccourci n'a de sens qu'au clavier : masqué sur écran tactile. */
.nextbtn kbd {
  font: inherit;
  font-size: 11px;
  padding: 1px 5px;
  margin: 0 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .22);
}
@media (hover: none) { .nextbtn kbd { display: none; } }
.nextbtn.vide { display: none; }

.toast {
  position: fixed;
  top: 58px; left: 50%;
  transform: translateX(-50%);
  background: rgba(27, 34, 45, .97);
  border: 1px solid var(--trait);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  z-index: 30;
  pointer-events: none;
}

/* Arbre de compétences */
.tech-list { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 420px; }
.tech {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: var(--fond2);
  border: 1px solid var(--trait);
  border-radius: 10px;
  text-align: left;
}
.tech .nom { font-size: 14px; font-weight: 600; }
.tech .eff { color: var(--dim); font-size: 12px; }
.tech .prix { margin-left: auto; color: var(--or); font-weight: 700; font-size: 14px; }
.tech.acquise { border-color: var(--vert); opacity: .75; }
.tech.acquise .prix { color: var(--vert); }
.tech.bloquee { opacity: .4; }

.lv-choices { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
