@font-face {
    font-family: 'MedievalSharp';
    src: url('MedievalSharp-Regular.ttf') format('truetype');
}

* {
    box-sizing: border-box;
}

body {
    background-image: url('Fondsalle.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'MedievalSharp', serif;
    overflow: hidden;
}

p {
    white-space: pre-line;
}

#game-zone {
    width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 100vh; 
    justify-content: flex-end; 
    padding-bottom: 20px; 
}

#card-container {
    width: 400px;
    height: 620px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1;
    position: absolute;
    bottom: 140px;
    overflow: visible;
}

#img-wrapper {
    position: relative;
    height: 100%;
    width: auto;
    display: flex;
    align-items: flex-end;
}

#character-image, #character-image-robot {
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8));
    position: relative;
}

#character-image {
    opacity: 0;
    z-index: 1;
}

#character-image-robot {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.05s;
}

#character-image-robot.glitch-flash {
    opacity: 1;
}

.fade-in {
    animation: fadeInSlide 0.6s ease-out forwards;
}

@keyframes fadeInSlide {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}


.parchment {
    background-color: #f3e5ab;
    border: 2px solid #8d6e63;

    box-shadow: 2px 4px 15px rgba(0,0,0,0.6), inset 0 0 25px rgba(139,69,19,0.2);
    border-radius: 8px; 
}


.text-box {
    width: 100%;
    padding: 15px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    position: relative;
    margin-bottom: 0; 
}

#dialogue {
    margin: 0;
    font-size: 1.4em; 
    color: #3e2723;
    line-height: 1.2;
}

#controls {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 20;
    position: relative;
    margin-top: 15px; 
}
.btn-choix {
    width: 190px;
    height: 75px; 
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: transform 0.2s;
    padding: 10px;
    font-family: 'MedievalSharp', serif;
}

.btn-choix:hover {
    transform: translateY(-5px);
    background-color: #fbe9a7;
    box-shadow: 2px 8px 20px rgba(0,0,0,0.7), inset 0 0 30px rgba(139,69,19,0.3);
}

.btn-text {
    font-size: 1.05em; 
    font-weight: bold;
    color: #3e2723;
    text-align: center;
    line-height: 1.1;
}

#game-over-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: black;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.death-content {
    text-align: center;
    color: #ff0000;
    font-family: 'MedievalSharp', serif;
}

.death-content h1 { font-size: 3em; margin-bottom: 20px; }
.death-content p   { font-size: 1.5em; margin-bottom: 40px; }

.btn-retry {
    background: none;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    font-family: 'MedievalSharp', serif;
    transition: 0.3s;
}

.btn-retry:hover {
    background-color: #ff0000;
    color: black;
}


#game-over-screen[data-type="simulation"] {
    background: #000 !important;
    font-family: 'Courier New', monospace;
}

.sim-content {
    position: relative;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#matrix-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.45;
}

.sim-text-box {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #00ff41;
    padding: 2rem 3rem;
    border: 1px solid rgba(0,255,65,0.3);
    background: rgba(0,0,0,0.85);
    max-width: 600px;
    width: 90%;
}

.btn-retry-sim {
    background: transparent;
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'MedievalSharp';
    font-size: 0.9rem;
    padding: 0.6rem 1.8rem;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    margin-top: 15px;
}

.btn-retry-sim:hover { background: #00ff41; color: #000; }


.survie-content { text-align: center; padding: 3rem; max-width: 600px; }
.survie-titre { font-family: 'MedievalSharp', serif; font-size: 2em; color: white; }
.survie-texte { font-family: 'MedievalSharp', serif; font-size: 1.2em; color: #cccccc; line-height: 1.8; }

