/* ═══════════════════════════════════════════════════════════
   AMBITION ESCAPE — socle visuel (charte AMBITION SCHOOL)
   Noir profond + vert signature. Modifier les tokens ici.
   ═══════════════════════════════════════════════════════════ */
@font-face { font-family: 'Chakra'; src: url('/fonts/chakra/chakra-petch-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Chakra'; src: url('/fonts/chakra/chakra-petch-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Chakra'; src: url('/fonts/chakra/chakra-petch-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra'; src: url('/fonts/chakra/chakra-petch-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/plex/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/plex/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --black: #030504;
  --ink: #070b09;
  --panel: rgba(8, 16, 12, 0.72);
  --panel-solid: #0a130e;
  --line: rgba(25, 226, 122, 0.18);
  --line-strong: rgba(25, 226, 122, 0.45);
  --green: #19e27a;          /* vert signature AMBITION SCHOOL */
  --green-hi: #7dffb7;
  --green-deep: #0b6b3b;
  --green-glow: rgba(25, 226, 122, 0.35);
  --text: #e6f2ea;
  --muted: #8aa596;
  --dim: #4f6658;
  --danger: #ff4d5e;
  --warn: #ffc53d;
  --radius: 4px;
  --display: 'Chakra', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Plex', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--black);
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--green); }
[hidden] { display: none !important; }
::selection { background: var(--green); color: var(--black); }

/* ── Texture écran : lignes de balayage + grain ── */
.crt::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 900;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.16) 3px);
}
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0,0,0,0.75) 100%); }

/* ── Typo ── */
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--green); }
.title-xl { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ── Panneau HUD à coins ── */
.hud {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud::before, .hud::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--green); border-style: solid;
}
.hud::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ── Boutons ── */
.btn {
  --c: var(--green);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 22px; border: 1px solid var(--c); background: transparent;
  color: var(--c); font-family: var(--display); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: 14px;
  cursor: pointer; position: relative; overflow: hidden; border-radius: var(--radius);
  transition: background .2s, color .2s, transform .12s, box-shadow .2s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover { background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--c) 30%, transparent); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.solid { background: var(--c); color: var(--black); }
.btn.solid:hover { background: var(--green-hi); }
.btn.danger { --c: var(--danger); }
.btn.warn { --c: var(--warn); }
.btn.ghost { --c: var(--muted); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn.big { min-height: 60px; font-size: 17px; padding: 0 30px; }

/* ── Champs ── */
.field { display: grid; gap: 6px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; min-height: 52px; padding: 0 16px; background: rgba(0,0,0,.55); border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--text); font-size: 18px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.input.code { font-family: var(--mono); letter-spacing: .4em; text-transform: uppercase; text-align: center; font-size: 26px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

/* ── Logo ── */
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 42px; width: auto; display: block; }
.brand .brand-txt { display: grid; line-height: 1.05; }
.brand .brand-txt b { font-weight: 700; letter-spacing: .14em; font-size: 15px; }
.brand .brand-txt span { font-family: var(--mono); font-size: 10px; letter-spacing: .3em; color: var(--green); }

/* ── Effet glitch texte ── */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: .8;
}
.glitch::before { color: #ff2e63; transform: translate(-2px, 0); clip-path: inset(0 0 60% 0); animation: glitchA 3.2s infinite steps(1); }
.glitch::after { color: #08d9d6; transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: glitchB 2.7s infinite steps(1); }
@keyframes glitchA { 0%, 92%, 100% { transform: translate(0); opacity: 0; } 93% { transform: translate(-4px, -1px); opacity: .9; } 96% { transform: translate(3px, 1px); opacity: .9; } }
@keyframes glitchB { 0%, 88%, 100% { transform: translate(0); opacity: 0; } 89% { transform: translate(4px, 2px); opacity: .9; } 94% { transform: translate(-3px, 0); opacity: .9; } }

/* ── Toasts ── */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { padding: 14px 18px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-left: 3px solid var(--green); font-size: 14px; animation: toastIn .3s ease-out; }
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ── Indicateur de connexion ── */
.netdot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); display: inline-block; }
.netdot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 999; padding: 8px; text-align: center; background: var(--danger); color: #fff; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; transform: translateY(-100%); transition: transform .3s; }
.net-banner.show { transform: none; }

/* ── Modale ── */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 950; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: min(440px, 100%); padding: 28px; display: grid; gap: 18px; }
.modal h3 { margin: 0; text-transform: uppercase; letter-spacing: .08em; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
