.planetes-depart-form { display:flex; align-items:end; gap:10px; flex-wrap:wrap; padding:14px; margin-bottom:18px; border:1px solid var(--line); border-radius:6px; background:rgba(255,255,255,.025); }
.planetes-depart-intro { display:flex; flex-direction:column; gap:3px; min-width:210px; margin-right:auto; }
.planetes-depart-intro strong { color:var(--text); font-size:13px; }
.planetes-depart-intro span, .planetes-depart-statut { color:var(--muted); font-size:10px; }
.planetes-depart-form label { display:flex; flex-direction:column; gap:4px; color:var(--muted); font-size:10px; font-weight:700; }
.planetes-depart-form input { width:105px; height:34px; box-sizing:border-box; border:1px solid var(--line); border-radius:5px; background:rgba(2,8,18,.65); color:var(--text); padding:0 8px; font:11px Consolas,'Courier New',monospace; }
.planetes-depart-form input:focus { outline:none; border-color:var(--accent); }
.planetes-depart-form input[aria-invalid="true"] { border-color:#e74c3c; }
.planetes-depart-form button { height:34px; border:1px solid var(--accent); border-radius:5px; background:rgba(93,214,199,.14); color:var(--accent); padding:0 13px; font-weight:700; cursor:pointer; }
.planetes-depart-form button:disabled { opacity:.5; cursor:wait; }
.planetes-depart-statut { flex-basis:100%; min-height:14px; }
.planetes-depart-statut.erreur { color:#ff8f86; }
@media (max-width:620px) { .planetes-depart-intro { flex-basis:100%; } .planetes-depart-form label, .planetes-depart-form input { width:100%; } }
:root {
    color-scheme: dark;
    --bg: #09111f;
    --bg2: #111a2d;
    --panel: rgba(10, 18, 34, 0.84);
    --line: rgba(255, 255, 255, 0.08);
    --text: #ebf0ff;
    --muted: #9aa7c2;
    --accent: #5dd6c7;
    --accent-2: #7c8cff;
    --danger: #ff6b6b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html,
body {
    max-width: 100%;
}

main,
.shell,
.card,
.group-card,
.input-card,
.source-summary,
.table-wrap {
    min-width: 0;
    max-width: 100%;
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

html { font-size: 80%; }

/* ── Navigation bar ───────────────────────────────────── */
.uranos-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(6, 12, 24, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--accent);
}
.uranos-nav-inner {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 0;
    height: 44px;
}
.uranos-nav-brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-right: 12px;
    white-space: nowrap;
}
.uranos-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.uranos-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}
.uranos-nav-link.active {
    background: rgba(93,214,199,0.12);
    color: var(--accent);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(93, 214, 199, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(124, 140, 255, 0.16), transparent 30%),
        linear-gradient(160deg, var(--bg), var(--bg2));
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 85%);
}

.shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 10px;
    letter-spacing: 0.28em;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

h1, h2 {
    margin: 0;
}

h1 {
    font-size: clamp(32px, 5vw, 58px);
    line-height: 0.98;
}

.lede {
    max-width: 720px;
    color: var(--muted);
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.65;
}

.badge-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.badge-panel span,
.status,
button {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-radius: 999px;
}

.badge-panel span {
    padding: 10px 14px;
    backdrop-filter: blur(16px);
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    border-radius: 24px;
}

.input-card {
    padding: 20px;
    margin-bottom: 16px;
}

.source-summary {
    padding: 18px 20px;
    margin-bottom: 16px;
}

.source-summary p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.reference-grid {
    display: grid;
    grid-template-columns: minmax(180px, 320px) minmax(160px, 240px);
    gap: 12px;
    margin-bottom: 14px;
}

.reference-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reference-field label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reference-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(2, 8, 18, 0.6);
    color: var(--text);
    outline: none;
    font: 14px/1.2 Arial, Helvetica, sans-serif;
}

.reference-field input:focus {
    border-color: rgba(93, 214, 199, 0.55);
    box-shadow: 0 0 0 4px rgba(93, 214, 199, 0.08);
}

.source-summary .count,
.source-summary span {
    color: var(--muted);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.card-header button,
.actions button {
    padding: 12px 16px;
    cursor: pointer;
}

.primary {
    background: linear-gradient(135deg, var(--accent), #85e8de);
    color: #031014;
    border: 0;
    font-weight: 700;
}

textarea {
    width: 100%;
    min-height: 280px;
    resize: vertical;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(2, 8, 18, 0.6);
    color: var(--text);
    padding: 16px;
    font: 13px/1.55 Consolas, 'Courier New', monospace;
    outline: none;
}

textarea:focus {
    border-color: rgba(93, 214, 199, 0.55);
    box-shadow: 0 0 0 4px rgba(93, 214, 199, 0.08);
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.hint,
.status {
    margin-top: 12px;
    color: var(--muted);
}

.status {
    padding: 14px 18px;
    border-radius: 18px;
}

.status.success { color: #ccfff7; border-color: rgba(93, 214, 199, 0.3); }
.status.error { color: #ffd3d3; border-color: rgba(255, 107, 107, 0.32); }

.results {
    display: grid;
    gap: 16px;
}

.group-card {
    padding: 18px;
}

.group-card .card-header {
    margin-bottom: 12px;
}

.count {
    color: var(--muted);
    font-size: 14px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.qi-table-wrap,
.qc-table-wrap,
.qr-wrap,
.qt-scroll-area,
.cibles-table-wrap,
.ia-table-wrap,
.ms-table-wrap,
.scroll-area,
.sc-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

th, td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Colonne planète : légèrement plus lumineuse */
tbody td:nth-child(2) {
    color: #dde6ff;
    font-weight: 500;
}

/* Colonne coordonnées : monospace + couleur accent */
tbody td:nth-child(3) {
    font-family: 'Consolas', 'Cascadia Code', 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.04em;
}

/* Colonne distance (tableau filtré) : mise en évidence */
tbody td:last-child:not(:nth-child(3)) {
    color: #a0b4d0;
    font-variant-numeric: tabular-nums;
}

tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

tr.row-dimmed td {
    opacity: 0.25;
}

tr.row-dimmed {
    background: rgba(0,0,0,0.25) !important;
}

th.col-check,
td.col-check {
    width: 28px;
    text-align: center;
    padding: 0 4px;
}

.dim-check {
    cursor: pointer;
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

tr.ref-row td {
    background: rgba(99, 179, 237, 0.08);
    border-top: 1px solid rgba(99, 179, 237, 0.35);
    border-bottom: 1px solid rgba(99, 179, 237, 0.35);
    color: #63b3ed;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.06em;
    padding: 5px 12px;
}

@media (max-width: 860px) {
    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge-panel {
        justify-content: flex-start;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE — Navigation burger
   ════════════════════════════════════════════ */

/* Liens groupe : flex row (style inline sur l'élément en fallback) */
.nav-links-group {
    display: flex !important;   /* override toute règle conflictuelle */
    flex-direction: row !important;
    flex: 1;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.nav-links-group::-webkit-scrollbar { display: none; }

/* Info utilisateur — TOUJOURS visible à droite de la nav */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 8px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,.08);
    margin-left: 4px;
}
.nav-user-name {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-user-link {
    color: var(--muted);
    opacity: .65;
    font-size: 14px;
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.nav-user-link:hover { opacity: 1; color: var(--text); }
.nav-logout { font-size: 16px; }
.nav-login-link { margin-left: auto; font-size: 11px; opacity: .65; }
/* Sur desktop : texte mobile masqué, icône visible */
.nav-text-mobile { display: none; }
.nav-icon-only   { display: inline; }

/* Bouton burger — masqué sur desktop */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    margin-left: 6px;
}
.nav-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: transform .22s, opacity .18s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ════════════════════════════════════════════
   BREAKPOINT : Grand écran réduit (≤ 1024 px)
   ════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .uranos-nav-inner { gap: 2px; }
    .uranos-nav-link  { padding: 6px 9px; font-size: 11px; }
}

/* ════════════════════════════════════════════
   BREAKPOINT : Tablette & petits écrans (≤ 900 px)
   Active le menu hamburger
   ════════════════════════════════════════════ */
@media (max-width: 900px), (max-width: 1024px) and (pointer: coarse) {
    .nav-burger { display: flex; }

    /* Menu déroulant tablette/mobile */
    .nav-links-group {
        display: none !important;
        position: fixed;
        top: 44px;
        left: 0; right: 0;
        background: rgba(6,12,24,.98);
        border-bottom: 2px solid var(--accent);
        flex-direction: column !important;
        align-items: stretch;
        padding: 8px 12px 14px;
        gap: 3px;
        z-index: 9999;
        overflow: hidden auto;
        max-height: calc(100svh - 44px);
        flex-wrap: nowrap !important;
        box-shadow: 0 12px 40px rgba(0,0,0,.65);
    }
    .nav-links-group.open { display: flex !important; }

    .uranos-nav-link {
        padding: 11px 14px;
        font-size: 13px;
        border-radius: 8px;
        width: 100%;
    }
    .nav-links-group > .ph-help-btn,
    .nav-links-group > .sc-trigger {
        width: 100%;
        padding: 11px 14px;
        border-radius: 8px;
        font-size: 13px;
        text-align: left;
    }

    /* Composants page — tablette */
    .scan-prog-grid { grid-template-columns: repeat(2,1fr) !important; }
    .player-stats   { gap: 8px; }
}

/* ════════════════════════════════════════════
   BREAKPOINT : Mobile (≤ 640 px)
   ════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* Base font : rétablir 100% pour mobile */
    html { font-size: 100%; }

    /* ── Navigation mobile ── */
    .uranos-nav { position: relative; }
    .uranos-nav-inner { height: 50px; padding: 0 8px; gap: 0; }
    .uranos-nav-brand { margin-right: 8px; font-size: 12px; }

    /* Ajustements dropdown sur mobile (override top/height du bloc 900px) */
    .nav-links-group { top: 50px; max-height: calc(100svh - 50px); }

    /* Liens plus grands pour le touch */
    .uranos-nav-link { font-size: 14px; }

    /* Info utilisateur en mobile : compact mais lisible */
    .nav-user-info {
        padding: 0 4px;
        border-left: none;
        margin-left: 0;
        gap: 2px;
    }
    .nav-user-name { display: none; }
    .nav-icon-only  { display: none; }       /* masquer icône, afficher texte */
    .nav-text-mobile { display: inline; }
    .nav-user-link {
        opacity: 1;
        color: var(--accent);
        font-size: 12px;
        font-weight: 600;
        padding: 6px 8px;
        border-radius: 6px;
        background: rgba(93,214,199,.1);
        border: 1px solid rgba(93,214,199,.25);
        min-width: 44px;
        min-height: 36px;
        justify-content: center;
    }
    .nav-logout {
        color: var(--danger) !important;
        background: rgba(255,107,107,.1) !important;
        border-color: rgba(255,107,107,.25) !important;
        font-size: 12px !important;
    }
    .nav-login-link { margin-left: 0; }

    /* ── Layout principal ── */
    .shell {
        width: calc(100vw - 24px);
        padding: 14px 0 40px;
    }

    /* ── Typographie ── */
    h1 { font-size: clamp(22px, 7vw, 38px); }
    h2 { font-size: clamp(16px, 4vw, 22px); }

    /* ── Cartes ── */
    .card, .input-card { border-radius: 16px; }
    .input-card { padding: 14px; }
    .card-header { align-items: flex-start; flex-wrap: wrap; }
    .card-header > * { min-width: 0; }

    /* ── Grille du portail ── */
    .portal-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    /* ── Tableaux : scroll horizontal natif ── */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    table { font-size: 12px; }
    th, td { padding: 7px 8px; }

    /* ── Formulaires ── */
    .reference-grid { grid-template-columns: 1fr; }
    .reference-field input { padding: 11px 12px; font-size: 14px; border-radius: 10px; }
    textarea { min-height: 180px; font-size: 13px; border-radius: 12px; padding: 12px; }

    /* ── Boutons ── */
    .actions { gap: 8px; }
    .actions button, .card-header button { padding: 11px 14px; font-size: 13px; }

    /* ── Bandeau accueil ── */
    .welcome-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    /* ── Hero ── */
    .hero { margin-bottom: 14px; gap: 12px; }
    .badge-panel span { padding: 7px 12px; font-size: 12px; }

    /* ── Filtres quetes/joueurs ── */
    .filter-bar { flex-wrap: wrap; gap: 8px; }
    .filter-bar select, .filter-bar input { min-width: 0; flex: 1 1 130px; font-size: 13px; }

    /* ── Stats boxes (joueurs) ── */
    .player-stats { gap: 6px; }
    .ps-box { min-width: 60px; padding: 8px 10px; }
    .ps-box .val { font-size: 18px; }
    .ps-box .lbl { font-size: 10px; }

    /* ── Onglets joueurs ── */
    .joueur-tab { padding: 5px 10px; font-size: 11px; }

    /* ── Modales ── */
    .modal-overlay { padding: 12px; }
    .modal-box {
        width: 100%;
        max-width: 100%;
        max-height: calc(100svh - 24px);
        overflow-y: auto;
        padding: 16px;
    }

    /* ── Grille scan progression → 1 colonne ── */
    .scan-prog-grid { grid-template-columns: 1fr !important; }

    /* ── Details / panels ── */
    .cmp-panel { padding: 10px 12px; }

    /* ── Colonnes non essentielles masquées sur mobile ── */
    .col-check { width: 28px; }
    .player-colonies { max-width: none; font-size: 10px; }

    /* ── Espionnage ── */
    .esp-section { padding: 10px; }

    /* ── Calculateur ── */
    .calc-grid { grid-template-columns: 1fr; }
    .calc-row  { flex-wrap: wrap; }
}
