/* ═══════════════════════════════════════════
   GEO.CSS — styles du jeu J3xplore
   Utilise les variables de main.css du site
═══════════════════════════════════════════ */

/* ── SETUP SCREEN ── */
#setup-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5rem 2rem 2rem; /* 5rem top = nav height + breathing room */
    text-align: center;
    position: relative;
    z-index: 1;
}

#setup-screen::before {
    content: "🌍";
    position: fixed;
    font-size: 40vw;
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(2px);
}

.setup-tag {
    font-family: var(--mono);
    color: var(--blue);
    font-size: 0.75rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.1s forwards;
}

.setup-title {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    margin-bottom: 0.4rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.25s forwards;
}

.setup-title .accent {
    color: var(--blue);
    text-shadow:
        0 0 40px var(--blue-glow),
        0 0 80px rgba(0, 170, 255, 0.15);
}

.setup-sub {
    font-family: var(--mono);
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.4s forwards;
}

.setup-stats {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.55s forwards;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--blue);
    display: block;
    text-shadow: 0 0 20px var(--blue-glow);
}

.stat-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stat-divider {
    width: 1px;
    background: rgba(0, 170, 255, 0.2);
    align-self: stretch;
}

#start-btn {
    opacity: 0;
    animation: fadeUp 0.6s 0.7s forwards;
    /* utilise la classe .btn de main.css */
    font-size: 0.9rem;
    padding: 0.9rem 2.5rem;
    letter-spacing: 4px;
    cursor: pointer;
}

/* ── LOADING SCREEN ── */
#loading-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1.5rem;
}

.loading-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--blue);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.loading-sub {
    font-family: var(--mono);
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.loading-sub::after {
    content: "...";
    animation: dots 1.2s infinite;
}

.spinner-ring {
    width: 56px;
    height: 56px;
    border: 2px solid rgba(0, 170, 255, 0.15);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    box-shadow: 0 0 20px var(--blue-glow);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── GAME SCREEN ── */
#game-screen {
    display: none;
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#street-view {
    position: absolute;
    inset: 0;
}

/* ── HUD ── */
#hud {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.hud-pill {
    background: rgba(5, 8, 16, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.18);
    border-radius: 2px;
    padding: 6px 16px;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

#score-pill {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}
#round-pill {
    color: var(--blue);
}

/* ── MINI-MAP ── */
#map-wrap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 300px;
    transition:
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#map-wrap:hover {
    width: 520px;
}

#map-container {
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-bottom: none;
    height: 220px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

#map-wrap:hover #map-container {
    height: 380px;
}

#map-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

/* ── INDICATEUR DE DIRECTION (haut droite) ── */
#compass {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    pointer-events: none;
    background: rgba(5, 8, 16, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.25);
    border-radius: 6px;
    box-shadow: 0 0 18px rgba(0, 170, 255, 0.12);
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 56px;
}

#compass-label {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: #00aaff;
    text-shadow: 0 0 12px rgba(0, 170, 255, 0.7);
    letter-spacing: 1px;
}

#compass-deg {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: rgba(0, 170, 255, 0.55);
    letter-spacing: 1px;
}

#guess-btn {
    background: var(--blue);
    color: #050810;
    border: none;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    padding: 13px 12px;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: all 0.18s;
    width: 100%;
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 10px 100%);
    box-shadow: 0 4px 20px var(--blue-glow);
}

#guess-btn:hover:not(:disabled) {
    background: #33bbff;
    box-shadow: 0 4px 32px rgba(0, 170, 255, 0.55);
    transform: translateY(-1px);
}

#guess-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--blue-glow);
}

#guess-btn:disabled {
    background: rgba(0, 170, 255, 0.18);
    color: rgba(0, 170, 255, 0.35);
    cursor: not-allowed;
    box-shadow: none;
    border-top-color: transparent;
}

/* ── RESULT SCREEN ── */
#result-screen {
    display: none;
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#result-map {
    position: absolute;
    inset: 0;
}

#result-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(5, 8, 16, 0.97) 30%);
    padding: 4rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

#result-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

#result-dist {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

#result-pts {
    font-size: 3rem;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px var(--blue-glow);
    letter-spacing: -1px;
}

#next-btn {
    /* utilise .btn de main.css */
    font-size: 0.8rem;
    padding: 0.8rem 2rem;
    cursor: pointer;
    letter-spacing: 3px;
}

/* ── END SCREEN ── */
#end-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

#end-screen::before {
    content: "🏆";
    position: fixed;
    font-size: 40vw;
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(2px);
}

.end-label {
    font-family: var(--mono);
    color: var(--blue);
    font-size: 0.75rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

#end-screen h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 2rem;
}

#final-score {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    color: var(--blue);
    letter-spacing: -3px;
    line-height: 1;
    text-shadow: 0 0 60px var(--blue-glow);
    margin-bottom: 0.5rem;
}

#final-max {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

#final-msg {
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

#restart-btn {
    font-size: 0.8rem;
    padding: 0.9rem 2.5rem;
    cursor: pointer;
    letter-spacing: 4px;
}

/* ── TOAST ── */
#toast {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 8, 16, 0.95);
    border: 1px solid rgba(0, 170, 255, 0.4);
    color: var(--blue);
    padding: 10px 24px;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 2px;
    z-index: 9999;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    box-shadow: 0 0 20px var(--blue-glow);
}

/* ── CURSOR GLOW (jeu) ── */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(0, 170, 255, 0.06) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition:
        left 0.1s,
        top 0.1s;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    /* Map */
    #map-wrap {
        width: 200px;
        bottom: 10px;
        right: 10px;
    }
    #map-wrap:hover {
        width: calc(100vw - 20px);
    }
    #map-container {
        height: 160px;
    }
    #map-wrap:hover #map-container {
        height: 240px;
    }

    /* HUD — plus petit, evite chevauchement */
    #hud {
        top: 8px;
        left: 8px;
        gap: 5px;
    }
    .hud-pill {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    /* Boussole — plus petite, moins haute */
    #compass {
        top: 8px;
        right: 8px;
        width: 56px;
        height: 56px;
    }

    /* Regle de cap — centree, reduite, evite overlap avec boussole */

    /* Guess btn */
    #guess-btn {
        font-size: 0.78rem;
        padding: 10px 8px;
        letter-spacing: 2px;
    }
}

/* ── NAV BAR ── */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 3rem;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 170, 255, 0.15);
    pointer-events: none;
}

#topbar-home {
    font-family: var(--mono);
    font-size: 1.2rem;
    color: var(--blue);
    letter-spacing: 2px;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.15s;
    pointer-events: all;
}
#topbar-home:hover { opacity: 1; }
.topbar-gt  { color: var(--blue); }
.topbar-cur { color: var(--blue); }
.topbar-sep {
    color: rgba(0, 170, 255, 0.3);
    font-family: var(--mono);
    font-size: 0.85rem;
}
#topbar-current {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

/* La nav est fixed, le setup-screen utilise padding-top natif */

/* ── MODE SELECTOR ── */
.mode-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.75s forwards;
}

.mode-btn {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(0, 170, 255, 0.2);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

.mode-btn:hover {
    color: var(--blue);
    border-color: rgba(0, 170, 255, 0.4);
}

.mode-btn.active {
    background: rgba(0, 170, 255, 0.12);
    border-color: var(--blue);
    color: var(--blue);
}

/* ── COUNTRY PANEL ── */
#country-panel {
    display: none;
    flex-direction: column;
    width: 320px;
    margin-bottom: 1.5rem;
    position: relative;
    opacity: 0;
    animation: fadeUp 0.3s forwards;
}

#country-search {
    background: rgba(5, 8, 16, 0.8);
    border: 1px solid rgba(0, 170, 255, 0.3);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 1px;
    padding: 0.6rem 1rem;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

#country-search::placeholder {
    color: var(--text-dim);
}
#country-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 12px var(--blue-glow);
}

#country-list {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.97);
    border: 1px solid rgba(0, 170, 255, 0.25);
    border-bottom: none;
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
}

#country-list::-webkit-scrollbar {
    width: 4px;
}
#country-list::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.3);
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.country-item:hover {
    background: rgba(0, 170, 255, 0.08);
    color: var(--blue);
}
.country-flag {
    font-size: 1.1rem;
}

/* ── HUD country pill ── */
#country-pill {
    color: #fff;
}

/* ── Cache la nav pendant la partie ── */
body.in-game #top-nav {
    display: none;
}

/* ── END SCREEN — layout carte + résumé ── */
#end-screen {
    display: none;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

#end-left {
    flex: 1;
    min-width: 0;
    position: relative;
}

#end-map {
    width: 100%;
    height: 100%;
}

#end-right {
    width: 340px;
    flex-shrink: 0;
    background: rgba(5, 8, 16, 0.97);
    border-left: 1px solid rgba(0, 170, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    gap: 0.4rem;
    overflow-y: auto;
    text-align: center;
}

#end-right .end-label {
    margin-bottom: 0;
}
#end-right h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}
#end-right #final-score {
    font-size: 3.5rem;
}
#end-right #final-max {
    margin-bottom: 0.2rem;
}
#end-right #final-msg {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
#end-right #restart-btn {
    margin-top: 1rem;
}

/* Tableau par manche */
#rounds-summary {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.round-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 170, 255, 0.05);
    border: 1px solid rgba(0, 170, 255, 0.12);
    border-radius: 3px;
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 0.72rem;
}

.rr-num {
    color: var(--blue);
    font-weight: 700;
    min-width: 22px;
}
.rr-dist {
    color: #ffd700;
    flex: 1;
    text-align: left;
}
.rr-time {
    color: var(--text-dim);
}
.rr-pts {
    color: var(--blue);
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

/* Mobile */
@media (max-width: 700px) {
    #end-screen {
        flex-direction: column;
    }
    #end-left {
        height: 45vh;
        flex: none;
    }
    #end-right {
        width: 100%;
        height: 55vh;
        padding: 1rem;
        justify-content: flex-start;
    }
    #end-right #final-score {
        font-size: 2.5rem;
    }
}

/* ── MUSIC BUTTON ── */
#music-btn {
    margin-left: auto;
    font-size: 1rem;
    background: rgba(0, 170, 255, 0.04);
    border: 1px solid rgba(0, 170, 255, 0.18);
    border-radius: 4px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    pointer-events: all;
    color: var(--text-dim);
}
#music-btn:hover {
    border-color: rgba(0, 170, 255, 0.5);
    background: rgba(0, 170, 255, 0.1);
}

/* ── CTRL+CLICK HINT ── */
.ctrl-hint {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* ── MOVEMENT MODE SELECTOR ── */
.movement-selector {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.85s forwards;
}

.move-btn {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(0, 170, 255, 0.2);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
}

.move-btn:hover {
    color: var(--blue);
    border-color: rgba(0, 170, 255, 0.4);
}

.move-btn.active {
    background: rgba(0, 170, 255, 0.12);
    border-color: var(--blue);
    color: var(--blue);
}

/* NMPZ active — accent rouge pour indiquer mode restrictif */
#move-nmpz.active {
    background: rgba(233, 64, 64, 0.12);
    border-color: #e94040;
    color: #e94040;
}

#move-nomove.active {
    background: rgba(255, 180, 0, 0.1);
    border-color: #ffb400;
    color: #ffb400;
}

/* HUD move pill */
#move-pill {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* ── HOME BUTTONS on result/end screens ── */
#result-panel {
    gap: 0.5rem;
}
#result-home-btn,
#end-home-btn {
    font-size: 0.72rem;
    padding: 0.5rem 1.2rem;
    opacity: 0.7;
    cursor: pointer;
}
#result-home-btn:hover,
#end-home-btn:hover {
    opacity: 1;
}

/* ── NMPZ overlay — bloque toute interaction sans cacher la vue ── */
#nmpz-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: not-allowed;
    background: transparent;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
