/* Socle : variables, remise a zero, typographie et composants communs.
   Le jeu est volontairement sombre : le canvas doit dominer, l'interface
   ne sert qu'a lire des chiffres vite. */

:root {
  --bg: #0d1014;
  --bg-2: #141920;
  --panel: rgba(18, 23, 30, 0.94);
  --panel-solid: #12171e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #e8edf3;
  --text-dim: #93a1b0;
  --text-faint: #5d6b7a;

  --gold: #f2b134;
  --gold-dim: #8a6a25;
  --blood: #e6484f;
  --steel: #9aa7b4;
  --jade: #3fd39b;
  --azure: #3fa7ff;
  --violet: #b980ff;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Le jeu se joue a la souris : pas de selection de texte intempestive */
body { user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }

#scene, #overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#scene {
  cursor: crosshair;
  background: var(--bg);
}

/* La surcouche 2D ne doit jamais intercepter la souris :
   les clics appartiennent au canvas 3D en dessous. */
#overlay {
  pointer-events: none;
  z-index: 10;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 2.6rem; letter-spacing: 0.08em; }
h2 { font-size: 1.35rem; }
h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
p { margin: 0 0 0.7em; line-height: 1.55; }

/* --- Ecrans plein cadre --- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(242, 177, 52, 0.09), transparent 60%),
    linear-gradient(160deg, #0b0e12, #10151c 60%, #0b0e12);
}

/* --- Boutons --- */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold), #d99a22);
  border-color: #f7c85e;
  color: #221803;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #f9c353, #e5a628); }

.btn-big { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* --- Champs --- */
.field { display: block; margin-bottom: 18px; }
.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
}

input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
}
input[type="text"]:focus { outline: none; border-color: var(--gold); }

.check { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 0.88rem; cursor: pointer; }

.row { display: flex; gap: 10px; align-items: center; }
.row-end { justify-content: flex-end; }

/* Separateur « ou » */
.sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-faint); font-size: 0.8rem; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --- Perte de connexion --- */
.conn-lost {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  text-align: center;
  background: rgba(8, 10, 13, 0.93);
  backdrop-filter: blur(6px);
}
.conn-lost h2 { margin-bottom: 8px; color: var(--blood); }
.conn-lost p { color: var(--text-dim); margin-bottom: 18px; }

/* --- Barre de defilement discrete --- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.13); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }
