/* Bayview — menus façon garage de course de rue nocturne : ruelle, néon rouge, bandeau d'icônes, plateau tournant. */
:root {
  --text: #f1f3f5; --muted: #a9b1b8; --title: #dcf27c; --lime: #b8d96a; --silver: #cfd4d8;
  --strip: rgba(196, 200, 204, .38); --panel: rgba(18, 20, 22, .78); --line: rgba(207, 212, 216, .28);
  --red: #ff4d5a; --orange: #ffaa2b; --green: #9fd84a;
  --cond: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: #0b0c0e; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.45 system-ui, sans-serif; padding-bottom: 84px;
  background:
    radial-gradient(40% 35% at 88% 38%, rgba(255, 40, 60, .38), transparent 70%),          /* néon rouge à droite */
    radial-gradient(30% 25% at 50% 30%, rgba(255, 220, 170, .10), transparent 70%),        /* lampadaire */
    linear-gradient(180deg, transparent 0 62%, rgba(0,0,0,.55) 62% 100%),                 /* sol */
    repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 22px),          /* joints de briques */
    repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 2px, transparent 2px 46px),
    linear-gradient(90deg, #241a17 0%, #17181c 40%, #1b1416 75%, #2a1216 100%);
  background-attachment: fixed;
}
main { max-width: 1000px; margin: 0 auto; padding: 0 14px 14px; }
a { color: var(--title); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--title); outline-offset: 2px;
}
h1, h2, h3, .brand, .screen, .pick, .pill, button, .btn, .badge, th, .stats small, .plate b {
  font-family: var(--cond); font-style: italic; font-stretch: condensed;
}

/* En-tête : nom à gauche, écran courant à droite */
.hud { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; max-width: 1000px;
       margin: 0 auto; padding: 18px 14px 8px; }
.brand { font-size: 2rem; font-weight: 900; letter-spacing: .02em; text-decoration: none; text-transform: uppercase;
         background: linear-gradient(180deg, #fff 0%, #d9dde0 48%, #7d858c 52%, #eef0f2 100%);
         -webkit-background-clip: text; background-clip: text; color: transparent;
         filter: drop-shadow(1px 1px 0 #000) drop-shadow(0 0 1px #000); transform: skewX(-8deg); }
.screen { margin: 0; color: var(--title); font-size: 2rem; font-weight: 700; text-shadow: 2px 2px 0 #000; }

/* Barre de progression + bandeau d'icônes */
.rail { position: relative; height: 12px; margin: 4px 0 8px; border-radius: 6px; background: rgba(200,204,208,.55);
        box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.rail i { position: absolute; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; }
.p0 { left: 2%; } .p1 { left: 14%; } .p2 { left: 26%; } .p3 { left: 38%; } .p4 { left: 50%; } .p5 { left: 62%; }
.p6 { left: 74%; } .p7 { left: 84%; } .p8 { left: 92%; } .p9 { left: 97%; }
.strip { display: flex; gap: 14px; overflow-x: auto; padding: 14px; border-radius: 10px; background: var(--strip);
         backdrop-filter: blur(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(0,0,0,.45);
         scrollbar-width: thin; }
.tile { flex: 0 0 auto; display: grid; place-items: center; width: 104px; height: 82px; border-radius: 8px;
        color: #fff; opacity: .78; border: 3px solid transparent; transition: opacity .12s, border-color .12s; }
.tile svg { width: 56px; height: 56px; filter: drop-shadow(1px 2px 1px rgba(0,0,0,.6)); }
.tile img { width: 92px; height: 66px; object-fit: cover; border-radius: 4px; }
.tile:hover { opacity: 1; }
.tile.on { opacity: 1; background: linear-gradient(180deg, rgba(60,64,52,.92), rgba(28,30,24,.92));
           border-color: var(--lime); box-shadow: 0 0 0 1px #000, 0 0 12px rgba(184,217,106,.45); }
.pick { text-align: center; margin: 8px 0 14px; color: var(--title); font-size: 1.6rem; font-weight: 700;
        text-shadow: 2px 2px 0 #000; }

/* Plateau tournant */
.stage { position: relative; height: 300px; margin: 0 auto; max-width: 720px; }
.turntable { position: absolute; left: 4%; right: 4%; bottom: 8px; height: 34%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 45%, #5d615a 0%, #3c3f3a 55%, transparent 56%),
    repeating-conic-gradient(from 0deg, #e2b83a 0 10deg, #111 10deg 20deg);
  box-shadow: 0 14px 30px rgba(0,0,0,.8), inset 0 -6px 12px rgba(0,0,0,.6); }
.turntable::after { content: ""; position: absolute; inset: 9%; border-radius: 50%;
  background: radial-gradient(ellipse at 45% 35%, rgba(255,255,255,.12), transparent 60%), #4a4d47;
  box-shadow: inset 0 3px 10px rgba(0,0,0,.6); }
.car-on { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); width: 78%; z-index: 1; display: flex; justify-content: center; }
.car-on .silhouette { width: 100%; height: auto; filter: drop-shadow(0 10px 8px rgba(0,0,0,.7)); }
.car-on img { max-width: 100%; max-height: 230px; border-radius: 6px; box-shadow: 0 12px 24px rgba(0,0,0,.7); }

/* Fiche sous le plateau (garage) */
.plate { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; text-align: center;
         margin: 4px auto 0; color: var(--muted); }
.plate b { flex-basis: 100%; color: #fff; font-size: 1.4rem; }

/* Barre du bas : joueur à gauche, pilules à droite */
.dock { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
        padding: 10px 16px; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.85)); z-index: 5; }
.player { font-family: var(--cond); font-style: italic; font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none;
          background: rgba(0,0,0,.55); padding: 6px 22px; border-radius: 4px; }
.grow { flex: 1; }
.pill, button, .btn { display: inline-block; min-width: 120px; padding: 7px 22px; text-align: center; text-decoration: none;
  font-weight: 700; font-size: 1.05rem; color: #fff; cursor: pointer; border-radius: 9px;
  background: linear-gradient(180deg, #2a2d30 0%, #050506 55%); border: 2px solid var(--silver);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,255,255,.25); }
.pill:hover, button:hover, .btn:hover { border-color: var(--lime); box-shadow: 0 0 0 1px #000, 0 0 10px rgba(184,217,106,.5); }
.pill.hot { border-color: var(--lime); color: var(--title); }
button.link { min-width: 0; background: none; border: 0; box-shadow: none; padding: 2px 6px; color: var(--title); font-size: .9rem; }
button.danger { border-color: var(--red); color: #ffd6da; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px; }
form.inline input { width: auto; display: inline-block; margin: 0; }

/* Panneaux de contenu */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 14px 0;
        box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.narrow { max-width: 400px; margin-left: auto; margin-right: auto; }
.logo { text-align: center; font-size: 3rem; margin: 1.4em 0 .5em; font-family: var(--cond); font-style: italic; font-weight: 900;
        text-transform: uppercase; background: linear-gradient(180deg, #fff 0%, #d9dde0 48%, #7d858c 52%, #eef0f2 100%);
        -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(2px 2px 0 #000); }
h1 { font-size: 1.8rem; color: var(--title); text-shadow: 2px 2px 0 #000; margin: .4em 0; }
h2 { font-size: 1.35rem; color: var(--title); text-shadow: 1px 1px 0 #000; margin: 1.2em 0 .5em; }
.carname { text-align: center; color: #fff; font-size: 1.8rem; margin: .2em 0 0; }
.carname + .muted { text-align: center; margin-top: 0; }
.card h2 { margin-top: 0; }
h3 { color: var(--lime); margin: 1.1em 0 .3em; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: .8rem; word-break: break-all; }
.error { color: var(--red); font-weight: 700; }

label { display: block; margin: 10px 0; color: var(--muted); font-size: .85rem; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: var(--text);
  background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: .95rem; }
label.check input { width: auto; margin: 0; accent-color: var(--lime); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; } .row > * { flex: 1 1 160px; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 4px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge.red { background: var(--red); color: #fff; } .badge.orange { background: var(--orange); color: #1d1200; }
.badge.green { background: var(--green); color: #102000; } .badge.grey { background: #3a3e42; color: var(--text); }
.tag { font-size: .75rem; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stats small { display: block; color: var(--muted); font-size: .85rem; }
.stats b { font-family: var(--cond); font-style: italic; font-size: 1.4rem; color: #fff; }

/* SMS de Rachel */
.sms { margin: 10px 0; padding: 10px 14px; background: rgba(10,12,14,.82); border: 1px solid var(--line);
       border-left: 4px solid var(--lime); border-radius: 8px; }
.sms b { font-family: var(--cond); font-style: italic; color: var(--title); font-size: 1rem; }
.sms p { margin: 2px 0 0; }
.sms.retard { border-left-color: var(--red); } .sms.retard b { color: var(--red); }
.sms.bientot { border-left-color: var(--orange); } .sms.bientot b { color: var(--orange); }
.sms.inconnu { border-left-color: #555; opacity: .85; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; }
th { color: var(--title); font-size: 1rem; border-bottom: 2px solid var(--line); }
td, th { text-align: left; padding: 9px 8px; vertical-align: top; }
td { border-bottom: 1px solid var(--line); }

.event { display: flex; justify-content: space-between; gap: 8px; padding: 12px 12px; margin: 6px 0; background: var(--panel);
         border-radius: 8px; border-left: 4px solid var(--lime); }
.event p { margin: 4px 0; } .event.reading { color: var(--muted); border-left-color: #666; }
.chart { width: 100%; height: auto; color: var(--title); background: var(--panel); border-radius: 8px; border: 1px solid var(--line); }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; } .gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.gallery figcaption { font-size: .85rem; }
code, pre { background: rgba(0,0,0,.6); color: var(--title); padding: 4px 6px; border-radius: 4px; word-break: break-all; white-space: pre-wrap; }
ul { padding-left: 1.2em; } li::marker { color: var(--lime); }

@media (max-width: 560px) {
  .hud { padding-top: 12px; } .brand { font-size: 1.5rem; } .screen { font-size: 1.4rem; }
  .tile { width: 78px; height: 64px; } .tile svg { width: 42px; height: 42px; } .tile img { width: 70px; height: 50px; }
  .strip { gap: 8px; padding: 10px; } .pick { font-size: 1.3rem; }
  .stage { height: 210px; } .car-on { width: 88%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pill, .dock button { min-width: 0; padding: 6px 14px; font-size: .95rem; }
  .player { padding: 6px 12px; }
  td, th { padding: 7px 5px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 560px) {
  .dock { gap: 6px; padding: 8px 10px; flex-wrap: nowrap; }
  .dock .pill, .dock button { padding: 5px 10px; font-size: .85rem; border-radius: 7px; }
  .player { font-size: .95rem; padding: 5px 10px; }
}

/* Scène 3D : pleine largeur ; la silhouette et le plateau CSS ne servent que sans WebGL */
.stage { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); height: min(58vh, 520px); }
canvas.garage3d { display: none; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.stage.has3d canvas.garage3d { display: block; }
.stage.has3d .car-on, .stage.has3d .turntable { display: none; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; pointer-events: none;
                background: linear-gradient(180deg, transparent, #0b0c0e); }
@media (max-width: 560px) { .stage { height: 46vh; } }
.stage { height: clamp(240px, calc(100vh - 340px), 520px); }
@media (max-width: 560px) { .stage { height: 46vh; } }

/* stock de pièces */
td.qty { white-space: nowrap; text-align: center; }
td.qty b { display: inline-block; min-width: 2.2em; }
td.qty .link { font-size: 1.2rem; padding: 0 .5em; }
tr.empty td { opacity: .5; }

/* 1.0 : accidents, achats, rappels, IA */
.pre { white-space: pre-wrap; }
pre.wrap { white-space: pre-wrap; word-break: break-all; }
.event.accident { border-left-color: var(--orange); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; } .filters .pill { font-size: .9rem; padding: 4px 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chips .tag { text-decoration: none; padding: 2px 8px; }
.tag.on { border-color: var(--title); color: var(--title); }
details.card summary, details summary { cursor: pointer; padding: 4px 0; }
.pill.icon { min-width: 0; padding: 4px 8px; line-height: 0; } .pill.icon svg { width: 22px; height: 22px; }
/* crédit du modèle 3D importé (licence CC-BY), en bas du plateau */
.stage .credit { position: absolute; right: 12px; bottom: 6px; z-index: 2; font-size: .7rem; color: #8a9096; }
