/* ═══════════════════════════════════════
   SimShields — Mission Styles
   ═══════════════════════════════════════ */

:root {
    --bg: #060a0f;
    --panel: rgba(6,10,15,0.95);
    --text: #c8e6dc;
    --muted: #6b8a7e;
    --dim: #3a5548;
    --cyber: #00ffaa;
    --cyber2: #00cc88;
    --warn: #ff6b35;
    --danger: #ff3355;
    --info: #00d9ff;
    --gold: #ffd700;
    --star-empty: #1a2a22;
    --line: rgba(0,255,170,0.06);
    --card-border: rgba(255,255,255,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Noise grain */
body::before {
    content: ""; position: fixed; inset: 0; z-index: 150;
    pointer-events: none; opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ─── TOP BAR ─── */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 56px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.top-bar .brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Syne', sans-serif;
    font-weight: 800; font-size: 16px;
    color: var(--cyber); letter-spacing: 3px;
    text-transform: uppercase;
}
.top-bar .brand-icon { font-size: 20px; }

.hud-center {
    display: flex; align-items: center; gap: 6px;
}

.hud-item {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--muted);
    padding: 6px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
}

.hud-item .val {
    color: var(--cyber);
    font-size: 17px; font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-width: 48px; text-align: center;
}

.hud-item.timer .val { color: var(--warn); }
.hud-item.timer.critical .val { color: var(--danger); animation: blink 500ms infinite; }

@keyframes blink { 50% { opacity: 0.4; } }

.hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-sm {
    padding: 6px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-sm:hover {
    color: var(--cyber);
    border-color: rgba(0,255,170,0.2);
    background: rgba(0,255,170,0.04);
}

/* ─── MAIN LAYOUT ─── */
.game-layout {
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-rows: 1fr auto;
}

.map-container {
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ─── INCIDENT PANEL ─── */
.incident-panel {
    position: fixed; top: 56px; right: 0;
    width: 390px; bottom: 110px;
    background: var(--panel);
    border-left: 1px solid var(--line);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.16,1,0.3,1);
    z-index: 80;
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.incident-panel.open { transform: translateX(0); }

.incident-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 10px;
}
.incident-title {
    font-size: 18px; font-weight: 800;
    color: #fff; margin-bottom: 6px;
}
.incident-severity {
    padding: 4px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px; flex-shrink: 0;
}
.severity-low { background: rgba(0,255,170,0.12); color: var(--cyber); border: 1px solid rgba(0,255,170,0.2); }
.severity-medium { background: rgba(255,215,0,0.12); color: var(--gold); border: 1px solid rgba(255,215,0,0.2); }
.severity-high { background: rgba(255,107,53,0.12); color: var(--warn); border: 1px solid rgba(255,107,53,0.2); }
.severity-critical { background: rgba(255,51,85,0.12); color: var(--danger); border: 1px solid rgba(255,51,85,0.2); }

.incident-body {
    padding: 16px 18px;
    flex: 1;
}

.context-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 14px;
    margin-bottom: 16px;
}
.context-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 2px; color: var(--cyber);
    margin-bottom: 8px;
}

.context-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.context-text .caller {
    color: var(--cyber);
    font-weight: 700;
}

.actions-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 10px;
}

.action-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-choice {
    padding: 14px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.action-choice:hover {
    border-color: rgba(0,255,170,0.2);
    background: rgba(0,255,170,0.03);
}
.action-choice.selected {
    border-color: rgba(0,255,170,0.3);
    border-left: 3px solid var(--cyber);
    background: rgba(0,255,170,0.05);
}

.action-choice.selected::after {
    content: '\2713';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cyber);
    font-weight: 700;
    font-size: 16px;
}

.act-title {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    margin-bottom: 3px;
}

.act-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.incident-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    display: flex; gap: 10px;
}
.btn-action {
    flex: 1; padding: 12px;
    border: 1px solid var(--card-border);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700; font-size: 13px;
    letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s;
}
.btn-dispatch {
    background: var(--cyber); color: var(--bg);
    border-color: var(--cyber);
}
.btn-dispatch:hover { box-shadow: 0 8px 24px rgba(0,255,170,0.2); }
.btn-dispatch:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; }
.btn-close-panel {
    background: transparent; color: var(--muted);
}
.btn-close-panel:hover { color: #fff; }

/* ─── TEAM BAR ─── */
.team-bar {
    height: 110px;
    background: var(--panel);
    border-top: 1px solid var(--line);
    display: flex; align-items: center;
    padding: 0 16px; gap: 10px;
    overflow-x: auto;
    backdrop-filter: blur(20px);
}
.team-card {
    flex-shrink: 0; width: 110px; height: 88px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px; cursor: pointer;
    transition: all 0.2s; position: relative;
}
.team-card:hover {
    border-color: rgba(0,255,170,0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.team-card.selected {
    border-color: rgba(0,255,170,0.3);
    background: rgba(0,255,170,0.04);
}
.team-card.busy { opacity: 0.35; cursor: not-allowed; }

.team-icon { font-size: 28px; }

.team-name {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text);
}
.team-status {
    position: absolute; top: 4px; right: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px; padding: 2px 6px;
    font-weight: 700; text-transform: uppercase;
}
.status-available { background: rgba(0,255,170,0.12); color: var(--cyber); }
.status-busy { background: rgba(255,107,53,0.12); color: var(--warn); }

/* ─── OVERLAYS ─── */
.overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(6,10,15,0.92);
    backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 300ms;
}
.overlay.active { opacity: 1; pointer-events: all; }
.overlay-box {
    background: var(--panel);
    border: 1px solid var(--card-border);
    padding: 48px;
    text-align: center;
    max-width: 520px; width: 90%;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}
.overlay-box h2 {
    font-size: 28px; font-weight: 800;
    margin-bottom: 6px; color: #fff;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.star {
    font-size: 48px;
    color: var(--star-empty);
    transition: color 500ms, transform 500ms;
}

.star.earned {
    color: var(--gold);
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.4));
}

.score-detail {
    margin: 16px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--muted);
    line-height: 2;
}

.score-val { color: var(--cyber); font-weight: 700; }

.btn-lg {
    margin-top: 24px;
    padding: 16px 36px;
    border: none;
    background: var(--cyber); color: var(--bg);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 14px;
    letter-spacing: 1.5px; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s;
}
.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,255,170,0.25);
}
.btn-lg.secondary-lg {
    background: transparent; color: var(--cyber);
    border: 1px solid rgba(0,255,170,0.3);
    margin-left: 8px;
}

.mission-brief {
    text-align: left; margin: 24px 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--cyber);
    padding: 18px; font-size: 14px;
    line-height: 1.7; color: var(--text);
}

.brief-caller { color: var(--cyber); font-weight: 700; }
.brief-warn { color: var(--warn); }

.start-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--muted);
}

/* ─── TOAST ─── */
.toast-container {
    position: fixed;
    top: 62px; left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700; font-size: 13px;
    letter-spacing: 0.5px;
    border: 1px solid var(--card-border);
    animation: toastIn 250ms ease-out, toastOut 250ms ease-in 2700ms forwards;
    white-space: nowrap;
}
.toast-alert { background: rgba(255,51,85,0.12); color: var(--danger); border-color: rgba(255,51,85,0.2); }
.toast-success { background: rgba(0,255,170,0.12); color: var(--cyber); border-color: rgba(0,255,170,0.2); }
.toast-info { background: rgba(0,217,255,0.12); color: var(--info); border-color: rgba(0,217,255,0.2); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ─── LOG PANEL ─── */
.log-panel {
    position: fixed; left: 0; top: 56px; bottom: 110px;
    width: 300px; z-index: 85;
    background: var(--panel);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16,1,0.3,1);
    display: flex; flex-direction: column;
}
.log-panel.open { transform: translateX(0); }
.log-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 3px;
    color: var(--cyber); text-transform: uppercase;
}

.log-entries {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-entry {
    font-size: 11px; padding: 8px 10px;
    background: rgba(255,255,255,0.02);
    border-left: 2px solid rgba(0,255,170,0.15);
    font-family: 'JetBrains Mono', monospace;
    color: var(--muted); line-height: 1.4;
}

.log-time { color: var(--cyber); margin-right: 6px; }

/* ─── DEBRIEF BOX ─── */
.debrief-box {
    text-align: left; margin: 16px 0; padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--cyber);
    font-size: 13px; line-height: 1.6;
    color: var(--text);
    max-height: 250px; overflow-y: auto;
}
.debrief-title {
    font-weight: 800; color: var(--cyber);
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 2px;
    text-transform: uppercase;
}

.debrief-item { margin-bottom: 10px; }
.debrief-item b { color: #fff; }

/* ─── RESPONSIVE ─── */
@media (max-width: 700px) {
    .incident-panel { width: 100%; }
    .hud-center { gap: 4px; }
    .hud-item { font-size: 10px; padding: 4px 8px; }
    .hud-item .val { font-size: 15px; min-width: 36px; }
    .team-card { width: 90px; height: 76px; }
    .team-bar { height: 90px; }
    .overlay-box { padding: 28px; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0,255,170,0.2); }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,170,0.4); }
/* ═══════════════════════════════════════
   AJOUT — Selection action + selection equipe
   (a coller a la FIN de mission.css)
   ═══════════════════════════════════════ */

/* ─── Action survolee / selectionnee (panneau de droite) ─── */
.action-choice {
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.action-choice:hover {
    border-color: rgba(0, 255, 170, 0.5);
}
.action-choice.selected {
    border-color: var(--cyber, #00ffaa);
    background: rgba(0, 255, 170, 0.12);
    box-shadow: 0 0 0 1px var(--cyber, #00ffaa), 0 0 16px rgba(0, 255, 170, 0.25);
}
.action-choice.selected .act-title { color: var(--cyber, #00ffaa); }
.action-choice.selected .act-title::after {
    content: " \2713";
    color: var(--cyber, #00ffaa);
    font-weight: 700;
}

/* Label equipe (affiche en NIVEAU 1 seulement, comme indice) */
.act-team {
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(0, 255, 170, 0.65);
}

/* ─── Choix d'equipe dans la barre du bas (NIVEAU 2/3) ─── */
/* Carte cliquable : curseur + petit feedback hover */
.team-card.team-clickable {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.team-card.team-clickable:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 255, 170, 0.6);
}

/* Carte equipe SELECTIONNEE : bien visible (glow cyan + leger zoom) */
.team-card.team-selected {
    border-color: var(--cyber, #00ffaa) !important;
    background: rgba(0, 255, 170, 0.14);
    box-shadow: 0 0 0 2px var(--cyber, #00ffaa), 0 0 18px rgba(0, 255, 170, 0.35);
    transform: translateY(-3px);
}
.team-card.team-selected .team-name {
    color: var(--cyber, #00ffaa);
    font-weight: 700;
}
/* petite pastille "choisie" en haut de la carte */
.team-card.team-selected::after {
    content: "\2713 CHOISIE";
    position: absolute;
    top: -9px; left: 50%; transform: translateX(-50%);
    background: var(--cyber, #00ffaa);
    color: #04130d;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 6px; border-radius: 4px;
    white-space: nowrap;
}
/* la carte doit etre en position relative pour la pastille */
.team-card { position: relative; }

/* Ligne d'aide dans le panneau d'incident (optionnelle, voir HTML) */
.panel-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: rgba(0, 255, 170, 0.55);
    margin: 6px 0 2px;
}