@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07090d; --surface: #0f1218; --surface-2: #161b24; --surface-3: #1d2330;
  --border: rgba(255,255,255,.08); --border-2: rgba(255,255,255,.14);
  --text: #f5f7fa; --muted: #8b94a7; --muted-2: #5b6474;
  --accent: #5b8cff; --accent-2: #8fb0ff; --lime: #c6ff3d; --green: #2ed47a; --amber: #ffb020; --red: #ff5c5c; --violet: #a78bfa;
  --radius: 18px; --radius-s: 12px; --shadow: 0 20px 60px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.pill.live .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(46,212,122,.18); animation: pulse 1.6s infinite; }
.pill.paused .dot { background: var(--amber); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,212,122,.35); } 70% { box-shadow: 0 0 0 8px rgba(46,212,122,0); } 100% { box-shadow: 0 0 0 0 rgba(46,212,122,0); } }

.btn { appearance: none; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: transform .08s ease, background .15s ease, border-color .15s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--surface-3); border-color: rgba(255,255,255,.22); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--text); color: #0b0d12; border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.accent { background: var(--accent); border-color: transparent; color: #fff; }
.btn.lime { background: var(--lime); border-color: transparent; color: #0b0d12; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; padding: 14px; font-size: 16px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card.flat { box-shadow: none; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi .value.good { color: var(--green); } .kpi .value.bad { color: var(--red); } .kpi .value.warn { color: var(--amber); } .kpi .value.accent { color: var(--accent-2); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: rgba(7,9,13,.72); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: conic-gradient(from 210deg, var(--accent), var(--lime), var(--accent)); display: grid; place-items: center; color: #0b0d12; font-weight: 900; font-size: 15px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }

.clock { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.clock small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 8px; }

/* Cartes MapLibre */
.map { position: absolute; inset: 0; background: #0b0e14; }
.maplibregl-ctrl-attrib { background: rgba(7,9,13,.6) !important; color: var(--muted) !important; font-size: 10px !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

/* Téléphone */
.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.phone { position: relative; width: 390px; height: 844px; border-radius: 54px; background: #0a0a0c; box-shadow: 0 0 0 2px #2a2f3a, 0 0 0 10px #0d0f14, 0 0 0 11px #2a2f3a, 0 40px 100px rgba(0,0,0,.7); overflow: hidden; }
.phone .notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 120px; height: 34px; background: #000; border-radius: 22px; z-index: 5; }
.phone .status { position: absolute; top: 16px; left: 28px; right: 28px; display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; z-index: 5; pointer-events: none; }
.phone .screen { position: absolute; inset: 0; background: #0b0e14; overflow: hidden; }
.phone .screen .content { position: absolute; inset: 0; overflow-y: auto; padding: 68px 20px 28px; scrollbar-width: none; }
.phone .screen .content::-webkit-scrollbar { display: none; }
.phone .minimap { position: relative; height: 320px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: #0b0e14; }
.phone .minimap .map { position: absolute; inset: 0; }
.phone .homebar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.55); z-index: 5; }
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; margin-top: 14px; }
.sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.sheet .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.sheet .row:first-of-type { border-top: 0; }
.big { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.huge { font-size: 64px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.ticket { background: linear-gradient(135deg, #14203d, #0f1626); border: 1px solid rgba(91,140,255,.35); border-radius: 22px; padding: 20px; position: relative; overflow: hidden; }
.ticket::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(198,255,61,.25), transparent 70%); }
.ticket .zone { font-size: 13px; color: var(--accent-2); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plate { display: inline-block; background: #fff; color: #111; font-weight: 800; letter-spacing: .06em; padding: 8px 12px; border-radius: 8px; border: 3px solid #1a3fb0; font-size: 20px; font-family: 'Inter', monospace; white-space: nowrap; }
.code { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 24px; background: var(--lime); color: #0b0d12; font-size: 44px; font-weight: 900; letter-spacing: -.02em; }
.stars { display: flex; gap: 6px; font-size: 28px; color: var(--amber); }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--lime)); border-radius: 3px; transition: width .4s ease; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); font: inherit; padding: 13px 14px; border-radius: 12px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.segment { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.segment button { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.segment button.active { background: var(--text); color: #0b0d12; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.badge.taxi { background: #ffd54a; color: #1a1400; } .badge.vtc { background: var(--accent); color: #fff; }
.badge.green { background: rgba(46,212,122,.18); color: var(--green); } .badge.amber { background: rgba(255,176,32,.18); color: var(--amber); } .badge.red { background: rgba(255,92,92,.18); color: var(--red); } .badge.blue { background: rgba(91,140,255,.18); color: var(--accent-2); }

.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c); vertical-align: middle; }

.log { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow: auto; }
.log div { display: flex; gap: 10px; }
.log .t { color: var(--muted); min-width: 44px; }

input[type=range] { width: 100%; accent-color: var(--accent); }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.slider label { font-size: 13px; color: var(--muted); font-weight: 600; }
.slider .v { font-weight: 800; font-size: 14px; min-width: 64px; text-align: right; }
.slider input { grid-column: 1 / -1; }

.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.blink { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
/* Grand texte (nuit, conduite) : tout grossit d'un cran, les boutons deviennent plus hauts */
html.big body { font-size: 18px; }
html.big .btn { padding: 14px 18px; font-size: 17px; } html.big .btn.block { padding: 18px; font-size: 19px; }
html.big .sheet h2 { font-size: 24px; } html.big .sheet .row { padding: 13px 0; } html.big .small { font-size: 15px; }
html.big .rank .n { font-size: 110px; } html.big .call .z { font-size: 34px; } html.big .huge { font-size: 76px; } html.big .big { font-size: 52px; }
html.big .code { width: 108px; height: 108px; font-size: 52px; } html.big .plate { font-size: 26px; padding: 10px 14px; }
/* Carte en plein écran (bouton sur la carte) */
.minimap .full { position: absolute; top: 10px; right: 10px; z-index: 5; }
.minimap.fs { position: fixed !important; inset: 0 !important; height: auto !important; border-radius: 0 !important; z-index: 60; margin: 0 !important; }
.minimap .fsinfo { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 5; display: none; }
.minimap.fs .fsinfo { display: block; }
.toolbar { display: flex; gap: 6px; align-items: center; }
.toolbar button { appearance: none; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); border-radius: 10px; padding: 6px 9px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.toolbar button.on { color: var(--text); border-color: var(--accent); }
/* Sur un vrai téléphone : l'application occupe tout l'écran, sans cadre ni panneaux latéraux */
@media (max-width: 600px) {
  .stage { display: block !important; padding: 0 !important; }
  .stage .side { display: none !important; }
  .phone-wrap { gap: 0; }
  .phone { width: 100vw; height: calc(100dvh - 56px); border-radius: 0; box-shadow: none; }
  .phone .notch, .phone .status, .phone .homebar { display: none; }
  .phone .screen .content { padding: 14px 16px 24px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .brand small, .topbar .clock, .topbar #status, .topbar #next { display: none; }
  .topbar .btn.sm { padding: 7px 10px; }
}
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: #0b0d12; padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); }
