body {
    margin: 0;
    background: black;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.hidden { display: none !important; }

#loading-screen, #victory-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 100000; background: black;
    display: flex; align-items: center; justify-content: center;
}

.fullscreen-img {
    width: 100%; height: 100%; object-fit: fill;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
    pointer-events: none;
}

#video-layer {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 99999;
    background: black;
}
video {
    width: 100%; height: 100%;
    object-fit: fill;
    display: none;
}

#main-menu {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('assets/images/menu1.jpg');
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; z-index: 500;
}
#main-menu h1 {
    font-size: 8vw;
    text-shadow: 2px 2px red; margin-bottom: 20px; text-align: center;
}
.menu-btn {
    padding: 15px 30px; font-size: 1.5rem; cursor: pointer;
    background: #333; color: white; border: 2px solid white;
    transition: 0.2s; margin-top: 10px; text-decoration: none; display: inline-block;
}
.menu-btn:active { background: darkred; transform: scale(0.95); }

.nightmare-btn {
    border-color: red;
    color: red;
    font-weight: bold;
    text-shadow: 0 0 5px darkred;
    animation: glitchText 2s infinite;
}

.nightmare-btn:hover, .nightmare-btn:active {
    background: darkred;
    color: black;
    box-shadow: 0 0 20px red;
}

@keyframes glitchText {
    0% { transform: skewX(0deg); opacity: 1; }
    5% { transform: skewX(10deg); opacity: 0.8; }
    10% { transform: skewX(-5deg); opacity: 1; }
    90% { transform: skewX(0deg); }
    95% { transform: skewX(-10deg); }
    100% { transform: skewX(0deg); }
}

#game-screen { position: relative; width: 100vw; height: 100vh; overflow: hidden; }

#office-layer {
    width: 100%; height: 100%;
    background-image: url('assets/images/office.jpg');
    background-size: 100% 100%;
    background-position: center;
    position: absolute; z-index: 0;
}

#bonnie-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 140;
    background-image: url('assets/images/office_toybonnie.png');
    background-size: 100% 100%;
    pointer-events: none;
    animation: flicker 0.1s infinite;
}
@keyframes flicker { 0% { opacity: 1; } 50% { opacity: 0.9; } 100% { opacity: 1; } }

#controls-ui {
    position: absolute;
    bottom: 20px;
    left: 0; right: 0;
    z-index: 450;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.game-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: inherit;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
    width: 40%;
    max-width: 200px;
}

.game-btn:active, .game-btn.active {
    background: rgba(0, 255, 0, 0.4);
    border-color: lime;
}

#mask-layer {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 150;
    pointer-events: none;
    background-image: url('assets/images/mask_overlay.png');
    background-size: 100% 100%;
}

#camera-system {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: black;
    z-index: 200;
    border: 5px solid #333; box-sizing: border-box;
}

#camera-screen {
    width: 95%; height: 65%;
    margin: 2% auto;
    position: relative;
    border: 2px solid white;
    background: #111;
}

#cam-display { width: 100%; height: 100%; object-fit: fill; display: block; }

#cam12-ui {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    background: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cam12-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    opacity: 0.5;
}

.cam12-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
}

#btn-cam12-action {
    background: rgba(255, 0, 0, 0.3);
    border: 3px solid red;
    color: red;
    font-size: 20px;
    padding: 20px 40px;
    width: auto;
    max-width: none;
    box-shadow: 0 0 15px darkred;
    animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
    from { box-shadow: 0 0 10px darkred; transform: scale(1); }
    to { box-shadow: 0 0 25px red; transform: scale(1.05); }
}

#static-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: url('assets/images/static.gif');
    opacity: 0.3; pointer-events: none;
    z-index: 200;
}

#foxy-gauge-container {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #555;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 0 10px red;
}

#foxy-gauge-fill {
    width: 100%;
    height: 0%;
    background-color: #ff0000;
    transition: height 0.1s linear;
}

#chica-warning {
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
    color: yellow;
    text-shadow: 0 0 15px red;
    animation: blink 0.5s infinite;
    z-index: 25;
    pointer-events: none;
}
@keyframes blink { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }

#feed-ui {
    position: absolute;
    bottom: 10px; left: 50%; transform: translateX(-50%);
    z-index: 30;
    width: 100%; text-align: center;
}
#btn-feed {
    padding: 10px 20px;
    font-size: 18px; font-weight: bold;
    background: #ffaa00;
    color: black;
    border: 3px solid white;
    box-shadow: 0 0 10px orange;
}
#btn-feed:active { background: #cc8800; transform: scale(0.95); }

#music-box-ui {
    position: absolute;
    top: 60%; left: 10px;
    display: flex; flex-direction: column; align-items: flex-start;
    z-index: 300;
}
#music-bar-container {
    width: 150px; height: 15px;
    border: 2px solid white;
    margin-bottom: 5px;
    background: black;
}
#music-bar {
    width: 100%; height: 100%;
    background: white;
    transition: width 0.1s linear;
}
#btn-rewind, #btn-repel {
    padding: 8px 15px; font-size: 14px; font-weight: bold;
    cursor: pointer;
    background: white; color: black; border: 2px solid red;
    font-family: inherit;
}

#btn-repel {
    position: absolute;
    top: 60px;
    right: 10px;
    z-index: 301;
}

#map-ui {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 250px;
    z-index: 300;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border: 2px solid #555;
}

.cam-btn {
    background: #222; color: #fff;
    border: 1px solid #666;
    padding: 10px 0;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
}
.cam-btn.active { background: #0f0; color: #000; font-weight: bold; }

.cam-btn[data-cam="12"].active {
    background: red;
    color: black;
    box-shadow: 0 0 10px red;
}

.map-you {
    grid-column: span 4;
    text-align: center;
    color: yellow;
    font-weight: bold;
    font-size: 12px;
    margin-top: 5px;
}

#cam-label {
    position: absolute; top: 10px; left: 50px;
    color: white; font-size: 24px; font-weight: bold;
    text-shadow: 2px 2px black; pointer-events: none;
    z-index: 400;
}
#clock {
    position: absolute; top: 15px; right: 15px;
    color: white; font-size: 30px;
    z-index: 400;
    font-weight: bold;
    text-shadow: 2px 2px black;
}

body {
  /* Chemin vers l'image + position du clic (16 16 pour centrer) + repli obligatoire */
  cursor: url('assets/images/cursor.svg') 16 16, auto;
}

/* Optionnel : changer le curseur au survol des liens ou boutons */
a, button {
  cursor: url('assets/images/cursor.svg') 16 16, pointer;
}
