/*
===============================================================================
Fichier : css/style.css
Description : interface de campagne H3.3 sans filtre ni composition instable.
Contexte : Army Rush — Mode Horde H3.3 Escalade totale.
Date : 2026-07-24
===============================================================================
*/

:root {
    color-scheme: dark;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #03090d;
    --accent: #48e9ef;
    --accent-warm: #ffb649;
    --danger: #ff5965;
    --panel: #10242c;
    --panel-strong: #07161d;
    --text: #f7fbfc;
    --muted: #a8bec6;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    background: #03090d;
}

body {
    min-height: 100dvh;
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    touch-action: manipulation;
}

[hidden] {
    display: none !important;
}

.app-shell {
    width: 100%;
    min-height: 100dvh;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100dvh;
}

.screen--active {
    display: flex;
}

.home-screen {
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background:
        linear-gradient(180deg, rgba(4, 19, 26, 0.2), rgba(4, 12, 17, 0.92)),
        linear-gradient(135deg, #1d6871, #965329 55%, #091820);
}

.home-card {
    width: min(720px, 100%);
    padding: clamp(24px, 6vw, 46px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: #0a1c24;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 0.98;
}

h1 {
    font-size: clamp(2.4rem, 10vw, 5.4rem);
}

h1 span {
    color: var(--accent-warm);
}

h2 {
    font-size: 2.2rem;
}

.intro {
    max-width: 650px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.mode-diagram {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0;
}

.mode-card {
    min-height: 92px;
    padding: 16px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: #142932;
    text-align: center;
}

.mode-card strong,
.mode-card span {
    display: block;
}

.mode-card strong {
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.mode-card span {
    color: var(--muted);
    font-size: 0.68rem;
}

.mode-card--left strong {
    color: var(--accent);
}

.mode-card--center strong {
    color: var(--danger);
}

.mode-card--right strong {
    color: var(--accent-warm);
}

.button {
    width: 100%;
    min-height: 52px;
    margin-top: 10px;
    border: 0;
    border-radius: 15px;
    color: var(--text);
    background: #1b3945;
    font-weight: 900;
    cursor: pointer;
}

.button--primary {
    color: #032027;
    background: var(--accent);
}

.button--secondary {
    background: #375060;
}

.button--ghost {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
}

.controls-summary {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.screen--game {
    position: relative;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

#gameCanvas {
    display: block;
    width: min(100vw, calc(100dvh * 0.5625));
    height: auto;
    max-width: 100vw;
    max-height: 100dvh;
    aspect-ratio: 720 / 1280;
    background: #c98243;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(2, 8, 12, 0.88);
}

.overlay-panel {
    width: min(420px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: #0b2029;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.test-setting {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.test-setting > span {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.test-setting input {
    width: 100%;
}

.result-stats {
    color: var(--muted);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 20;
    width: min(90vw, 520px);
    padding: 12px 16px;
    border-radius: 999px;
    color: #ffffff;
    background: #1d110b;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    margin-left: min(-45vw, -260px);
}

.toast--visible {
    opacity: 1;
}

.error-panel {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    padding: 14px;
    border-radius: 12px;
    color: #ffffff;
    background: #8f2030;
}

.diagnostic-report {
    display: none;
}

@media (max-width: 520px) {
    .home-card {
        padding: 22px 16px;
        border-radius: 20px;
    }

    .mode-diagram {
        gap: 6px;
    }

    .mode-card {
        min-height: 82px;
        padding: 13px 5px;
    }
}

/*
===============================================================================
Fin du fichier : css/style.css
===============================================================================
*/

/*
===============================================================================
H3.3 — CAMPAGNE, NIVEAUX ET VICTOIRE
===============================================================================
*/

.level-select {
    margin: 20px 0 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: #0d242d;
}

.level-select__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.level-select__header h2 {
    font-size: 1.2rem;
}

.level-select__header span {
    color: #ffd96f;
    font-weight: 900;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.level-button {
    min-width: 0;
    min-height: 82px;
    padding: 9px 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 13px;
    color: #ffffff;
    background: #17313b;
    cursor: pointer;
}

.level-button strong,
.level-button span,
.level-button small {
    display: block;
}

.level-button strong {
    color: #52edf2;
    font-size: 1.25rem;
}

.level-button span {
    margin-top: 4px;
    overflow: hidden;
    color: #c5d6dc;
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.level-button small {
    margin-top: 7px;
    color: #ffd96f;
    font-size: 0.65rem;
}

.level-button--selected {
    border-color: #52edf2;
    background: #164751;
    box-shadow: 0 0 0 2px rgba(82, 237, 242, 0.12);
}

.level-button--locked,
.level-button:disabled {
    color: #657982;
    background: #102027;
    cursor: not-allowed;
    opacity: 0.48;
}

.overlay-panel--victory {
    text-align: center;
}

.victory-stars {
    margin: 22px 0 10px;
    color: #ffd96f;
    font-size: 3rem;
    letter-spacing: 0.08em;
    text-shadow: 0 5px 24px rgba(255, 199, 56, 0.38);
}

@media (max-width: 520px) {
    .level-grid {
        gap: 5px;
    }

    .level-button {
        min-height: 72px;
        padding: 7px 3px;
    }

    .level-button span {
        font-size: 0.5rem;
    }

    .level-button small {
        font-size: 0.56rem;
    }
}

/*
===============================================================================
ARMY RUSH VISUAL V2 — COCKPIT MILITAIRE / BATTLEFIELD PREMIUM
===============================================================================
*/
:root {
    --v2-cyan: #38d8ff;
    --v2-orange: #ff9d1e;
    --v2-red: #ff434d;
    --v2-green: #68e85c;
    --v2-gold: #ffc236;
    --v2-steel: #31444f;
    --v2-ink: #050b0f;
}

body {
    background:
        radial-gradient(circle at 50% 25%, rgba(219, 116, 45, 0.17), transparent 45%),
        #020609;
}

.home-screen {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(3, 10, 15, 0.32), rgba(2, 7, 10, 0.94)),
        radial-gradient(circle at 50% 28%, rgba(255, 143, 48, 0.42), transparent 35%),
        repeating-linear-gradient(115deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 22px),
        linear-gradient(135deg, #132934 0%, #7d4328 52%, #06131a 100%);
}

.home-screen::before,
.home-screen::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.home-screen::before {
    inset: 0;
    background:
        linear-gradient(74deg, transparent 44%, rgba(255, 164, 69, 0.1) 44.5% 45%, transparent 45.5%),
        linear-gradient(-74deg, transparent 44%, rgba(80, 212, 255, 0.08) 44.5% 45%, transparent 45.5%);
    opacity: 0.75;
}

.home-screen::after {
    left: 50%;
    bottom: -18vh;
    width: min(760px, 100vw);
    height: 65vh;
    transform: translateX(-50%);
    clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
    background:
        repeating-linear-gradient(90deg, transparent 0 32%, rgba(255,255,255,0.06) 32% 32.7%, transparent 32.7% 67%, rgba(255,255,255,0.06) 67% 67.7%, transparent 67.7%),
        linear-gradient(#515253, #17191a);
    opacity: 0.5;
}

.home-card {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(85, 207, 255, 0.42);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(9, 22, 29, 0.97), rgba(2, 8, 12, 0.98));
    box-shadow:
        0 30px 100px rgba(0,0,0,0.68),
        inset 0 1px rgba(255,255,255,0.14),
        0 0 48px rgba(37, 178, 255, 0.12);
}

.home-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.035) 43%, transparent 44%),
        radial-gradient(circle at 50% 0, rgba(255, 169, 62, 0.12), transparent 38%);
}

.home-logo {
    display: block;
    width: min(390px, 82%);
    max-height: 126px;
    margin: -8px auto 6px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.75));
}

.home-card h1 {
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: clamp(2rem, 7vw, 4.2rem);
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 5px 0 rgba(0,0,0,0.5);
}

.home-card .eyebrow,
.home-card .intro {
    text-align: center;
}

.mode-card,
.level-select,
.level-button {
    border-color: rgba(91, 182, 225, 0.28);
    background:
        linear-gradient(180deg, rgba(26, 49, 59, 0.94), rgba(8, 22, 29, 0.96));
    box-shadow: inset 0 1px rgba(255,255,255,0.08);
}

.mode-card {
    position: relative;
    overflow: hidden;
}

.mode-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: currentColor;
    opacity: 0.65;
}

.button--primary {
    border: 2px solid #b8f6ff;
    color: #fff;
    background:
        linear-gradient(180deg, #188bb8, #075271);
    box-shadow:
        0 8px 0 #032f43,
        0 0 24px rgba(56, 216, 255, 0.35),
        inset 0 1px rgba(255,255,255,0.35);
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.button--primary:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #032f43, 0 0 18px rgba(56,216,255,0.28);
}

.screen--game {
    background:
        radial-gradient(circle at center, #1f2528, #000 70%);
}

#gameCanvas {
    border-inline: 1px solid rgba(98, 216, 255, 0.2);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 0 55px rgba(0,0,0,0.88),
        0 0 26px rgba(43, 180, 255, 0.11);
}

.overlay {
    background:
        radial-gradient(circle, rgba(15,34,43,0.94), rgba(1,5,8,0.98));
}

.overlay-panel {
    border: 2px solid rgba(70, 201, 255, 0.42);
    background: linear-gradient(180deg, #112a35, #050e13);
    box-shadow: 0 25px 90px rgba(0,0,0,0.7), inset 0 1px rgba(255,255,255,0.12);
}

.toast {
    border: 1px solid rgba(255, 190, 71, 0.55);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(44,27,15,0.97), rgba(15,9,6,0.98));
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 0 18px rgba(255,145,30,0.16);
    letter-spacing: 0.03em;
}

@media (max-width: 520px) {
    .home-logo {
        max-height: 94px;
    }

    .home-card h1 {
        font-size: clamp(1.8rem, 9vw, 2.7rem);
    }
}
