/* ============================================================
   RESET
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: "Orbitron";
    src: url("../assets/fonts/Orbitron.ttf") format("truetype");
}

/* ============================================================
   PAGE
============================================================ */

body {
    min-height: 100vh;
    font-family: "Orbitron", sans-serif;

    background:
        radial-gradient(circle at top, #2a2b3d 0%, #171720 45%, #09090d 100%);

    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;

    color: #4d5268;
}

/* ============================================================
   APPLICATION / ÉCRAN MOBILE
============================================================ */

#menu {
    width: min(100%, 430px);
    height: 100vh;

    position: relative;
    overflow: visible;

    background: #ffffff;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

    animation: menuAppear 0.7s ease-out;
}

/* Sur desktop : effet smartphone */
@media (min-width: 600px) {
    #menu {
        height: min(92vh, 850px);
        border-radius: 28px;
    }
}

/* ============================================================
   PARTIE HAUTE (IMAGE)
============================================================ */

#menu-top {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 55%; /* moitié haute */

    background:
        url("../assets/img/menu-top.jpg")
        center center / cover
        no-repeat;

    z-index: 1; /* derrière le panneau blanc */
}

/* Léger filtre lumineux */
#menu-top::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.05) 0%,
            rgba(255,255,255,0) 50%,
            rgba(255,255,255,0.08) 100%
        );
}

/* ============================================================
   PARTIE BASSE (PANNEAU ARRONDI PAR-DESSUS)
============================================================ */

#menu-bottom {
    position: absolute;
    left: 0;
    bottom: -30px;

    width: 100%;
    height: 55%;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fafafa 100%
        );

    /* ARRONDI PAR-DESSUS L’IMAGE — EXACTEMENT COMME LA MAQUETTE */
    border-radius: 80% 80% 0 0 / 9% 9% 0 0;

    z-index: 2; /* AU-DESSUS DE L’IMAGE */

    padding: 48px 28px 35px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================================
   TITRE
============================================================ */

#menu-bottom h1 {
    margin-top: 5px;

    font-size: clamp(26px, 7vw, 36px);
    font-weight: 700;

    letter-spacing: 3px;

    color: #5d637a;

    text-align: center;
}

/* ============================================================
   SOUS-TITRE
============================================================ */

.menu-subtitle {
    margin-top: 18px;

    max-width: 260px;

    text-align: center;

    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 0.5px;

    color: #a0a4b2;
}

/* ============================================================
   BOUTONS (STYLE EXACT MAQUETTE)
============================================================ */

.menu-btn {
    width: min(100%, 300px);
    min-height: 52px;

    margin-top: 16px;
    padding: 14px 25px;

    border: none;
    border-radius: 30px;

    background:
        linear-gradient(
            135deg,
            #ffb347 0%,
            #ffcc33 100%
        );

    color: #ffffff;

    font-family: "Orbitron", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;

    cursor: pointer;

    box-shadow:
        0 8px 20px
        rgba(255, 180, 70, 0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

/* Premier bouton un peu plus bas */
.menu-btn:first-of-type {
    margin-top: 32px;
}

/* Hover */
.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 25px
        rgba(255, 180, 70, 0.35);
}

/* Click mobile */
.menu-btn:active {
    transform: scale(0.97);
}

/* ============================================================
   CANVAS
============================================================ */

#gameCanvas {
    display: none;
    max-width: 100%;
    max-height: 100vh;
    margin: auto;
    border-radius: 20px;
}

/* ============================================================
   HUD
============================================================ */

#hud {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    gap: 20px;

    padding: 10px 20px;

    background: rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    backdrop-filter: blur(8px);

    color: #00ffff;
    font-size: 14px;

    z-index: 50;
}

/* ============================================================
   UI OVERLAYS
============================================================ */

#ui-loading,
#ui-popup,
#ui-message {
    position: fixed;
    inset: 0;
    z-index: 999;
}

#ui-loading {
    display: none;
    justify-content: center;
    align-items: center;
}

#ui-popup {
    display: none;
    justify-content: center;
    align-items: center;
}

#ui-message {
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 30px;
}

/* ============================================================
   ANIMATION
============================================================ */

@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#menu.hidden {
    opacity: 0;
    pointer-events: none;
}
