/* ═══════════════════════════════════════════════
   Ligne de Vie v0.4 — Thème parchemin / militaire
   ═══════════════════════════════════════════════ */

:root {
    --bg: #f0ebe3;
    --bg-dark: #e0d9cd;
    --brown: #5c4033;
    --brown-light: #8b6f5e;
    --olive: #4a6741;
    --olive-light: #6b8f5e;
    --red: #a63d2f;
    --red-light: #d9534f;
    --amber: #b8860b;
    --gold: #d4a017;
    --orange: #d2691e;
    --blue: #4169e1;
    --text: #2c2417;
    --text-light: #6b5d4f;
    --card-bg: #faf6ef;
    --shadow: rgba(92, 64, 51, 0.15);
    --munitions: #d2691e;
    --carburant: #a63d2f;
    --rations: #4a6741;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

#app {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

/* ─── Header ──────────────────────────────────── */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--brown);
    color: var(--bg);
    border-radius: 8px;
    margin-bottom: 1rem;
}

header h1 { font-size: 1.4rem; letter-spacing: 0.05em; }
header h1 small { font-size: 0.7rem; opacity: 0.7; }

#header-info { display: flex; align-items: center; gap: 1rem; }
#turn-display { font-size: 1rem; opacity: 0.9; }
#deck-info { font-size: 0.75rem; opacity: 0.75; }
#act-display {
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
#act-display.act-ii {
    background: var(--amber);
    color: #fff;
    font-weight: bold;
}

/* ─── Boutons ─────────────────────────────────── */

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-new { background: var(--olive); color: #fff; }
.btn-new:hover { background: var(--olive-light); }

.btn-action {
    background: var(--brown);
    color: #fff;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
}
.btn-action:hover { background: var(--brown-light); }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-choice {
    background: var(--amber);
    color: #fff;
    margin: 0.3rem;
    padding: 0.6rem 1.2rem;
}
.btn-choice:hover { background: var(--gold); }

.btn-cancel {
    background: var(--bg-dark);
    color: var(--text);
    padding: 0.5rem 1.2rem;
}
.btn-cancel:hover { background: #ccc; }

/* ─── Barre de phases (7 étapes) ─────────────── */

#phase-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.phase-step {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.1rem;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 0.68rem;
    font-weight: bold;
    transition: all 0.3s;
}
.phase-step.active    { background: var(--olive); color: #fff; }
.phase-step.completed { background: var(--olive-light); color: #fff; opacity: 0.7; }

/* ─── Zone OKH ──────────────────────────────── */

#okh-zone { margin-bottom: 1rem; }
#okh-zone h3 { font-size: 0.85rem; color: var(--brown); margin-bottom: 0.4rem; }
#okh-action { margin-top: 0.75rem; }
.okh-card {
    background: var(--card-bg);
    border: 2px solid var(--amber);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    display: inline-block;
}
.okh-name      { font-weight: bold; font-size: 0.9rem; color: var(--brown); }
.okh-resources { font-size: 0.85rem; margin-top: 0.2rem; }
.okh-desc      { font-size: 0.7rem; color: var(--text-light); margin-top: 0.2rem; font-style: italic; }

/* ─── Zone Allocation ─────────────────────────── */

#allocation-zone {
    margin-bottom: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--bg-dark);
    border-radius: 10px;
    padding: 1rem;
}
#allocation-zone h3 {
    font-size: 0.9rem;
    color: var(--brown);
    margin-bottom: 0.6rem;
}

.info-banner {
    background: #fff3cd;
    border: 1px solid var(--amber);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: var(--brown);
    margin-bottom: 0.6rem;
    font-style: italic;
}

.allocation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}
.allocation-table thead th {
    background: var(--brown);
    color: #fff;
    padding: 0.35rem 0.5rem;
    font-size: 0.73rem;
    text-align: center;
}
.allocation-table tbody td {
    padding: 0.35rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid var(--bg-dark);
    vertical-align: middle;
}
.allocation-table tbody tr:hover { background: rgba(0,0,0,0.02); }

.alloc-corps-name {
    text-align: left !important;
    font-weight: bold;
    font-size: 0.78rem;
}
.alloc-stock {
    font-weight: normal;
    color: var(--text-light);
    font-size: 0.68rem;
}
.alloc-needs {
    font-weight: normal;
    font-size: 0.68rem;
}
.alloc-input {
    width: 52px;
    padding: 0.25rem 0.3rem;
    border: 1px solid var(--brown-light);
    border-radius: 4px;
    background: #fff;
    text-align: center;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
}
.alloc-input:focus {
    outline: none;
    border-color: var(--olive);
    box-shadow: 0 0 0 2px rgba(74, 103, 65, 0.25);
}
.alloc-input.alloc-error {
    border-color: var(--red);
    background: #fde8e8;
}
.alloc-total {
    font-weight: bold;
    font-size: 0.9rem;
}
.alloc-total.alloc-error { color: var(--red); }
.alloc-cap {
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
}
.alloc-error { color: var(--red) !important; font-weight: bold; }

.allocation-totals { font-size: 0.8rem; margin-top: 0.3rem; }
.alloc-depot-row {
    margin-bottom: 0.2rem;
    color: var(--text-light);
}
.alloc-totals-row {
    font-size: 0.78rem;
    color: var(--text-light);
}
.alloc-remaining-row {
    font-size: 0.82rem;
    font-weight: bold;
    margin-top: 0.15rem;
}

#action-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* ─── Graphe en étoile ──────────────────────── */

#graph-zone { margin-bottom: 1rem; }
#graph-zone h3 { font-size: 0.85rem; color: var(--brown); margin-bottom: 0.4rem; }

#supply-graph {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--bg-dark);
    border-radius: 10px;
    padding: 1rem;
    align-items: flex-start;
}

.star-depot {
    flex: 0 0 180px;
    background: var(--bg);
    border: 3px solid var(--brown);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    align-self: center;
}

#corps-nodes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.corps-branch {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.branch-arc {
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.branch-arc .arc-line {
    width: 100%;
    height: 3px;
    background: var(--brown-light);
    border-radius: 2px;
}

.corps-node {
    flex: 1;
    background: var(--bg);
    border: 2px solid var(--brown-light);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
}
.corps-node.node-danger {
    border-color: var(--red-light);
    box-shadow: 0 0 6px rgba(166, 61, 47, 0.3);
}

.kleist-node {
    border-color: var(--amber);
    background: #fdf6e3;
}

.kleist-branch.kleist-inactive {
    opacity: 0.35;
    filter: grayscale(1);
    pointer-events: none;
}

.node-label {
    font-weight: bold;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brown);
    margin-bottom: 0.2rem;
}

.node-resources {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
}
.res   { font-size: 0.75rem; }
.res b { font-size: 0.85rem; }
.res-m { color: var(--munitions); }
.res-c { color: var(--carburant); }
.res-r { color: var(--rations); }
.cap   { font-size: 0.65rem; color: var(--text-light); }

.corps-col-cap {
    font-size: 0.62rem;
    color: var(--text-light);
    margin-top: 0.1rem;
    font-style: italic;
}

.corps-needs {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}
.needs-label { font-weight: bold; }

/* ─── Pistes de stress ──────────────────────── */

.stress-track {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.2rem;
}
.stress-label {
    font-size: 0.6rem;
    color: var(--text-light);
    font-weight: bold;
    margin-right: 0.2rem;
}
.stress-cell {
    width: 20px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    border-radius: 3px;
    background: var(--bg-dark);
    color: var(--text-light);
    transition: all 0.3s;
}
.stress-cell.stress-filled.stress-green  { background: var(--olive); color: #fff; }
.stress-cell.stress-filled.stress-amber  { background: var(--amber); color: #fff; }
.stress-cell.stress-filled.stress-red    { background: var(--red); color: #fff; }
.stress-cell.stress-filled.stress-black  { background: #222; color: #fff; }
.stress-cell.stress-current              { box-shadow: 0 0 0 2px var(--brown); }

/* ─── Progression Kleist ────────────────────── */

.kleist-progression-track {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.2rem;
}
.progression-label {
    font-size: 0.6rem;
    color: var(--text-light);
    font-weight: bold;
    margin-right: 0.2rem;
}
.progression-bar { display: flex; gap: 2px; }
.progression-cell {
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    border-radius: 3px;
    background: var(--bg-dark);
    color: var(--text-light);
    transition: all 0.3s;
}
.progression-cell.prog-filled  { background: var(--brown); color: #fff; }
.progression-cell.prog-victory { background: var(--gold); color: #fff; }

/* ─── Zone livraisons ───────────────────────── */

#deliveries-zone { margin-bottom: 1rem; }
#deliveries-zone h3 { font-size: 0.85rem; color: var(--brown); margin-bottom: 0.3rem; }
.deliveries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    background: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
}
.deliveries-table th,
.deliveries-table td {
    padding: 0.3rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--bg-dark);
}
.deliveries-table th {
    background: var(--brown);
    color: #fff;
    font-size: 0.7rem;
}
.deliveries-table td:first-child { text-align: left; font-weight: bold; }
.status-ok      { color: var(--olive); font-weight: bold; }
.status-missing { color: var(--red); font-weight: bold; }

/* ─── Info bar ───────────────────────────────── */

#info-bar {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: var(--brown);
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ─── Journal ─────────────────────────────────── */

#log-zone { margin-bottom: 2rem; }
#log-zone h3 { font-size: 0.85rem; color: var(--brown); margin-bottom: 0.3rem; }

#log-list {
    background: var(--card-bg);
    border: 1px solid var(--bg-dark);
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.5;
}

.log-entry { padding: 0.1rem 0; }
.log-entry.log-gain   { color: var(--olive); }
.log-entry.log-loss   { color: var(--red); }
.log-entry.log-event  { color: var(--amber); font-weight: bold; }
.log-entry.log-okh    { color: var(--blue); }
.log-entry.log-stress { color: var(--orange); }
.log-entry.log-phase  { color: var(--brown); font-weight: bold; margin-top: 0.3rem; }
.log-entry.log-turn {
    color: var(--brown);
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--bg-dark);
    padding-top: 0.4rem;
}

/* ─── Modale ──────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: var(--card-bg);
    border: 3px solid var(--brown);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 520px;
    width: 92%;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}
.modal h2 { color: var(--brown); margin-bottom: 0.5rem; font-size: 1.1rem; }
.modal p  { margin-bottom: 0.75rem; color: var(--text-light); font-size: 0.9rem; }

#modal-body    { margin-bottom: 1rem; text-align: left; }
#modal-buttons { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

.choice-desc {
    display: block;
    font-weight: normal;
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 0.15rem;
}

/* Rapport de situation Ia — preview deck OKH */
.rapport-cards {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.rapport-okh-card {
    flex: 1;
    min-width: 130px;
    background: var(--bg);
    border: 2px solid var(--amber);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}
.rapport-card-pos {
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber);
    margin-bottom: 0.25rem;
}
.rapport-card-name {
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--brown);
    margin-bottom: 0.2rem;
}
.rapport-card-res { font-size: 0.8rem; }
.rapport-notice {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* ─── Pop-up carte événement ─────────────────── */

.event-card-modal {
    border-color: var(--amber);
    max-width: 440px;
    text-align: center;
}
.event-card-tag {
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.6rem;
}
.event-card-modal h2 {
    color: var(--brown);
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}
.event-card-modal p {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.2rem;
}

/* ─── Récapitulatif fin de tour ──────────────── */

.turn-summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.turn-summary-box {
    background: var(--card-bg);
    border: 3px solid var(--brown);
    border-radius: 14px;
    padding: 1.5rem 2rem;
    max-width: 560px;
    width: 94%;
    max-height: 85vh;
    overflow-y: auto;
}

.turn-summary-box h2 {
    color: var(--brown);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.04em;
}

.summary-section {
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--bg-dark);
}
.summary-section:last-of-type { border-bottom: none; margin-bottom: 0.5rem; }

.summary-section-title {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brown);
    margin-bottom: 0.5rem;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.summary-table thead th {
    background: var(--brown);
    color: #fff;
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    text-align: center;
}
.summary-table thead th:first-child { text-align: left; }
.summary-table tbody td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--bg-dark);
    text-align: center;
    vertical-align: middle;
}
.summary-table tbody tr:last-child td { border-bottom: none; }

.summary-row-label {
    text-align: left !important;
    color: var(--text-light);
    font-size: 0.78rem;
}

.summary-okh-row td { color: var(--blue); }
.summary-okh-row .summary-row-label { color: var(--blue); }
.summary-delivered-row td { color: var(--red); }
.summary-delivered-row .summary-row-label { color: var(--red); }
.summary-end-row td { background: rgba(74, 103, 65, 0.07); }

.summary-stress-worse { color: var(--red);   font-weight: bold; }
.summary-stress-better { color: var(--olive); font-weight: bold; }
.summary-stress-same   { color: var(--text-light); }

/* Mini piste de stress (5 cases) */
.mini-stress-track { display: inline-flex; gap: 2px; }
.mini-stress-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    background: var(--bg-dark);
    display: inline-block;
}
.mini-stress-cell.mini-stress-green  { background: var(--olive); }
.mini-stress-cell.mini-stress-amber  { background: var(--amber); }
.mini-stress-cell.mini-stress-red    { background: var(--red); }
.mini-stress-cell.mini-stress-black  { background: #222; }

/* Mini piste de progression Kleist (0-5) */
.mini-prog-track { display: inline-flex; gap: 2px; }
.mini-prog-cell {
    width: 18px;
    height: 16px;
    border-radius: 2px;
    background: var(--bg-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    color: var(--text-light);
}
.mini-prog-cell.mini-prog-filled  { background: var(--brown); color: #fff; }
.mini-prog-cell.mini-prog-victory { background: var(--gold);  color: #fff; }

.summary-kleist-row {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.summary-kleist-noprog { color: var(--red); font-style: italic; }
.summary-prog-ok {
    color: var(--olive);
    font-weight: bold;
    font-size: 0.9rem;
}

#turn-summary-footer {
    text-align: center;
    margin-top: 1.2rem;
}

/* ─── Game Over ───────────────────────────────── */

.gameover-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.gameover-box {
    border-radius: 16px;
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 450px;
    width: 90%;
}
.gameover-box.end {
    background: linear-gradient(135deg, #fdf6e3, #fce8b2);
    border: 4px solid var(--gold);
}
.gameover-box.defeat {
    background: linear-gradient(135deg, #fde8e8, #f5c6c6);
    border: 4px solid var(--red);
}
.gameover-box h2         { font-size: 1.8rem; margin-bottom: 0.5rem; }
.gameover-box.end h2     { color: var(--gold); }
.gameover-box.defeat h2  { color: var(--red); }
.gameover-box p          { margin-bottom: 1rem; color: var(--text-light); font-size: 1rem; }

.score-breakdown {
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.score-breakdown div { margin-bottom: 0.3rem; }
.score-total {
    font-size: 1.1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg-dark);
}
.score-appreciation {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--brown);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ─── Bouton aide ────────────────────────────── */

.btn-help {
    background: rgba(255,255,255,0.15);
    color: var(--bg);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-help:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}

/* ─── Overlay d'accueil ──────────────────────── */

.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}

.welcome-box {
    background: var(--card-bg);
    border: 3px solid var(--brown);
    border-radius: 14px;
    padding: 2rem 2.25rem 1.5rem;
    max-width: 660px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.welcome-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-dark);
}

.welcome-subtitle {
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.3rem;
}

.welcome-title {
    font-size: 2rem;
    color: var(--brown);
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.welcome-period {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.welcome-intro {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
    margin-bottom: 1.25rem;
    text-align: center;
}

.welcome-columns {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.1rem;
}

.welcome-col {
    flex: 1;
}

.welcome-col-title {
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brown);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--bg-dark);
}

.welcome-res-list {
    list-style: none;
    margin-bottom: 0.75rem;
}

.welcome-res-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.res-badge {
    font-weight: bold;
    font-size: 0.8rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: var(--bg-dark);
    min-width: 1.4rem;
    text-align: center;
}

.welcome-note {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.45;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.welcome-phases {
    list-style: none;
    counter-reset: phase-counter;
    padding: 0;
}

.welcome-phases li {
    counter-increment: phase-counter;
    font-size: 0.82rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--bg-dark);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    line-height: 1.35;
}

.welcome-phases li:last-child { border-bottom: none; }

.welcome-phases li::before {
    content: counter(phase-counter) ".";
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--brown-light);
    min-width: 1rem;
    flex-shrink: 0;
}

.welcome-rules {
    background: var(--bg);
    border: 1px solid var(--bg-dark);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.welcome-rule {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.45;
}

.welcome-rule-label {
    display: inline-block;
    font-weight: bold;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brown);
    background: var(--bg-dark);
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.welcome-footer {
    text-align: center;
}

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 700px) {
    header { flex-direction: column; gap: 0.5rem; text-align: center; }
    #phase-bar { flex-wrap: wrap; }
    .phase-step { flex: 1 1 28%; font-size: 0.6rem; }
    #supply-graph { flex-direction: column; align-items: stretch; }
    .star-depot { flex: none; }
    .corps-branch { flex-direction: column; align-items: stretch; }
    .branch-arc { flex: none; height: 20px; }
    .branch-arc .arc-line { width: 3px; height: 100%; }
    .gameover-box { padding: 1.5rem; }
    .node-resources { flex-wrap: wrap; }
    .alloc-input { width: 44px; }
    .welcome-box { padding: 1.25rem 1rem 1rem; }
    .welcome-title { font-size: 1.5rem; }
    .welcome-columns { flex-direction: column; gap: 1rem; }
}
