/* =====================================================================
   PARADISE ESCAPE — style.css
   Sections : Base / Vidéo de fond / Écran d'accueil / Écran de
   sélection de niveau / Compte à rebours / HUD / Pastilles de sons /
   Vignettes-cibles / Écran de fin / Effets & animations / Bouton
   plein écran / Texte en haut à gauche / Responsive.
   ===================================================================== */

/* ---------------------------------------------------------------------
   BASE & VARIABLES
   --------------------------------------------------------------------- */
:root {
    --couleur-verte: #00ff00;
    --couleur-rouge: #ff4d4d;
    --couleur-orange: #ffa500;
}
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: white;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

/* ---------------------------------------------------------------------
   VIDÉO DE FOND
   --------------------------------------------------------------------- */
.video-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.game-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.08);
    z-index: 1;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   ÉCRAN D'ACCUEIL (welcome-screen) — difficulté + bouton WELCOME
   --------------------------------------------------------------------- */
#welcome-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
#welcome-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#welcome-screen h1 {
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 10px;
    font-size: 2.2rem;
}
.welcome-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 50px;
}
.difficulty-section {
    margin-bottom: 40px;
}
.difficulty-label {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;
}
.difficulty-slider {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}
.difficulty-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-family: inherit;
    -webkit-appearance: none;
 }
.difficulty-btn .level-num {
    font-size: 1.6rem;
    font-weight: 300;
}
.difficulty-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.7);
}
.difficulty-btn.active {
    border-color: var(--couleur-verte);
    color: var(--couleur-verte);
    background: rgba(0,255,0,0.08);
    box-shadow: 0 0 25px rgba(0,255,0,0.15);
}
.difficulty-btn[data-level="1"] .level-num {
    color: var(--couleur-verte);
}
.difficulty-btn[data-level="2"] .level-num {
    color: var(--couleur-orange);
}
.difficulty-btn[data-level="3"] .level-num {
    color: var(--couleur-rouge);
}
#start-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 15px 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: inherit;
    -webkit-appearance: none;
}
#start-btn:hover {
    background: white;
    color: black;
}

/* ---------------------------------------------------------------------
   COMPTE À REBOURS (countdown-screen)
   --------------------------------------------------------------------- */
#countdown-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 90;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#countdown-screen.visible {
    opacity: 1;
    visibility: visible;
}
.countdown-text {
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 30px;
    text-align: center;
    padding: 0 20px;
}
.countdown-number {
    font-size: 8rem;
    font-weight: 300;
    color: var(--couleur-verte);
    text-shadow: 0 0 60px rgba(0,255,0,0.4);
    animation: countPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@keyframes countPop {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.breath-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid rgba(0,255,0,0.15);
    animation: breathe 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes breathe {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.4); opacity: 0.8; }
}

/* ---------------------------------------------------------------------
   HUD — niveau / minuteur / score (barre du haut)
   --------------------------------------------------------------------- */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#hud.visible {
    opacity: 1;
}
.hud-item {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.hud-timer {
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
    font-weight: 300;
    min-width: 70px;
    text-align: center;
}
.hud-timer.warning {
    color: #fbbf24;
    animation: pulse 1s ease infinite;
}
.hud-timer.danger {
    color: #f87171;
    animation: pulse 0.5s ease infinite;
}
.hud-score {
    font-variant-numeric: tabular-nums;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--couleur-verte);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------------------------------------------------------------------
   PASTILLES DE SONS ACTIFS (bas de l'écran)
   --------------------------------------------------------------------- */
.active-sounds-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.active-sounds-indicator.visible {
    opacity: 1;
}
.sound-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}
.sound-dot.active {
    background: var(--couleur-verte);
    box-shadow: 0 0 10px rgba(0,255,0,0.5);
    animation: dotPulse 1.2s ease infinite;
}
@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* ---------------------------------------------------------------------
   VIGNETTES — cibles cliquables qui apparaissent à l'écran
   --------------------------------------------------------------------- */
.vignette {
    position: absolute;
    width: 100px;
    height: 100px;
    z-index: 40;
    transition: transform 0.15s ease;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIyMiIgZmlsbD0icmdiYSgxMjAsMTIwLDEyMCwwLjcwKSIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMjUpIiBzdHJva2Utd2lkdGg9IjEiLz48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIxNiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmYwMDAwIiBzdHJva2Utd2lkdGg9IjIuNSIvPjxsaW5lIHgxPSIyNCIgeTE9IjIiIHgyPSIyNCIgeTI9IjE0IiBzdHJva2U9IiNmZjAwMDAiIHN0cm9rZS13aWR0aD0iMi41Ii8+PGxpbmUgeDE9IjI0IiB5MT0iMzQiIHgyPSIyNCIgeTI9IjQ2IiBzdHJva2U9IiNmZjAwMDAiIHN0cm9rZS13aWR0aD0iMi41Ii8+PGxpbmUgeDE9IjIiIHkxPSIxNiIgeDI9IjE0IiB5Mj0iMjQiIHN0cm9rZT0iI2ZmMDAwMCIgc3Ryb2tlLXdpZHRoPSIyLjUiLz48bGluZSB4MT0iMzQiIHkxPSIxNiIgeDI9IjQ2IiB5Mj0iMTYiIHN0cm9rZT0iI2ZmMDAwMCIgc3Ryb2tlLXdpZHRoPSIyLjUiLz48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIzIiBmaWxsPSIjZmYwMDAwIi8+PC9zdmc+") 24 24, crosshair;
}
.vignette:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.7));
    z-index: 45;
}
.vignette.removing {
    animation: popOut 0.25s ease forwards;
    pointer-events: none;
}
@keyframes popIn {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes popOut {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0) rotate(180deg); opacity: 0; }
}
.vignette-inner {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* ---------------------------------------------------------------------
   ÉCRAN DE FIN (end-screen)
   --------------------------------------------------------------------- */
#end-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s ease;
    text-align: center;
}
#end-screen.visible {
    opacity: 1;
    visibility: visible;
}
.end-title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 12px;
    color: var(--couleur-verte);
}
.end-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.end-big-score {
    font-size: 6rem;
    font-weight: 300;
    color: white;
    text-shadow: 0 0 40px rgba(0,255,0,0.3);
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}
.end-stats {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 40px;
    letter-spacing: 1px;
}
#restart-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 15px 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: inherit;
    -webkit-appearance: none;
    margin-top: 40px;
}
#restart-btn:hover {
    background: white;
    color: black;
}
.level-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.level-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}
.level-dot.active {
    background: var(--couleur-verte);
    box-shadow: 0 0 8px rgba(0,255,0,0.5);
}
.high-score {
    font-size: 1rem;
    color: var(--couleur-orange);
    margin-top: 80px;
    animation: pulseScore 1s ease infinite;
}
@keyframes pulseScore {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.game-intro {
    margin-bottom: 30px;
    text-align: center;
}
.game-intro h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--couleur-verte);
}
.game-intro p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    font-style: italic;
}

/* ---------------------------------------------------------------------
   ÉCRAN DE SÉLECTION DE NIVEAU (level-select-screen)
   --------------------------------------------------------------------- */
#level-select-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 101;
    text-align: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
#level-select-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.level-btn {
    background: rgba(0,255,0,0.08);
    border: 2px solid var(--couleur-verte);
    color: var(--couleur-verte);
    padding: 15px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: inherit;
    -webkit-appearance: none;
    margin: 10px;
    min-width: 200px;
}
.level-btn:hover {
    background: var(--couleur-verte);
    color: black;
}
.level-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
}

/* ---------------------------------------------------------------------
   EFFETS & ANIMATIONS (combo, avertissement, sprint final)
   --------------------------------------------------------------------- */
.blink {
    animation: blink 0.5s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.combo-effect {
    animation: comboPulse 0.3s infinite;
}
@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.dramatic-effect {
    animation: dramaticPulse 0.3s infinite;
}
@keyframes dramaticPulse {
    0%, 100% { transform: scale(1); color: white; }
    50% { transform: scale(1.1); color: #ff4d4d; }
}
.combo-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.8);
    z-index: 300;
    font-size: 5rem;
    font-weight: bold;
    color: #ff4d4d;
    text-shadow: 0 0 20px #ff4d4d;
    animation: comboFlash 1s infinite;
}
@keyframes comboFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ---------------------------------------------------------------------
   BOUTON PLEIN ÉCRAN — visible uniquement hors plein écran (bas droite)
   Le z-index élevé (1000) le garde cliquable au-dessus de TOUS les
   écrans (welcome 100, level-select 101, end-screen 200, combo 300).
   --------------------------------------------------------------------- */
#fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0,255,0,0.1);
    border: 1px solid var(--couleur-verte);
    color: var(--couleur-verte);
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: none;
    font-family: inherit;
    -webkit-appearance: none;
}
#fullscreen-btn.visible {
    display: block;
}
#fullscreen-btn:hover {
    background: var(--couleur-verte);
    color: black;
}

/* ---------------------------------------------------------------------
   TEXTE EN HAUT À GAUCHE
   --------------------------------------------------------------------- */
.top-left-text {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    letter-spacing: 1px;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   RESPONSIVE — mobile portrait
   --------------------------------------------------------------------- */
@media (max-width: 600px) and (orientation: portrait) {
    #welcome-screen h1 { font-size: 1.6rem; letter-spacing: 2px; }
    .welcome-subtitle { font-size: 0.7rem; letter-spacing: 3px; }
    .difficulty-btn { width: 55px; height: 55px; font-size: 0.55rem; }
    .difficulty-btn .level-num { font-size: 1.2rem; }
    #start-btn { padding: 12px 36px; font-size: 0.9rem; }
    .hud-item { padding: 6px 14px; font-size: 0.75rem; }
    .hud-timer { font-size: 1.1rem; min-width: 55px; }
    .countdown-number { font-size: 5rem; }
    .end-title { font-size: 1.4rem; }
    .end-big-score { font-size: 4rem; }
    .breath-ring { width: 150px; height: 150px; }
}
