/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    width: 100vw;
    height: 100vh;
}

/* ===== OVERLAY CONTAINER ===== */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 120px;
}

/* ===== MESSAGE BOX ===== */
#message-box {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 16px;
    font-size: 16px;
    text-align: center;
    max-width: 85%;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#message-box.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* ===== BOUTONS OVERLAY ===== */
.overlay-btn {
    pointer-events: auto;
    padding: 16px 48px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 16px;
}

.overlay-btn.hidden {
    display: none;
}

#btn-validate {
    background: linear-gradient(135deg, #00c853, #009624);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.4);
}

#btn-validate:active {
    transform: scale(0.95);
}

#btn-restart {
    background: linear-gradient(135deg, #ff6d00, #e65100);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 109, 0, 0.4);
}

#btn-restart:active {
    transform: scale(0.95);
}

/* ===== ÉCRAN DE FIN ===== */
#end-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

#end-screen.hidden {
    opacity: 0;
    display: none;
}

#end-screen h1 {
    font-size: 42px;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
    margin-bottom: 8px;
}

#end-screen p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.85);
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* ===== BADGE MODE 3D FALLBACK ===== */
#fallback-badge {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(15, 15, 15, 0.65);
    color: rgba(255, 255, 255, 0.6);
    padding: 5px 13px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Segoe UI', monospace;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1000;
}

#fallback-badge.hidden {
    display: none;
}

/* ===== AR BUTTON (Three.js injecté) ===== */
#ARButton {
    background: linear-gradient(135deg, #2979ff, #1565c0) !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 14px 36px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 20px rgba(41, 121, 255, 0.4) !important;
}
