@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;
}


#game-zone {
    width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 95vh;
    justify-content: flex-end;
}


#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 {
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8));
    opacity: 0;
    position: relative;
    z-index: 1;
    display: block;
}

#character-image-robot {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8));
    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);
}

.text-box {
    width: 100%;
    padding: 20px;
    min-height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
    z-index: 10;
    position: relative;
}

#dialogue {
    margin: 0;
    font-size: 1.2em;
    color: #3e2723;
    line-height: 1.3;
}


#controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 20;
    position: relative;
    padding-bottom: 20px;
}

.btn-choix {
    width: 190px;
    height: 80px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    transition: transform 0.2s, background-color 0.2s;
    padding: 10px;
    border: none;
}

.btn-choix:hover {
    transform: translateY(-5px);
    background-color: #fbe9a7;
}

.btn-text {
    font-size: 1em;
    font-weight: bold;
    color: #3e2723;
    text-align: center;
}


#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;
}

.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.75);
    max-width: 600px;
    width: 90%;
}

.sim-header {
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: #00ff41;
    margin-bottom: 1rem;
    animation: clignoter 1s step-end infinite;
}

.sim-unit {
    font-size: 0.85rem;
    color: #aaffcc;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.sim-stats {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: rgba(0,255,65,0.7);
    margin-bottom: 1.5rem;
    text-align: left;
    padding-left: 1rem;
    border-left: 2px solid rgba(0,255,65,0.3);
}

.sim-footer {
    font-size: 0.85rem;
    color: rgba(0,255,65,0.6);
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.rouge { color: #ff4444; font-weight: bold; }

.btn-retry-sim {
    background: transparent;
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 0.6rem 1.8rem;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.2s;
}

.btn-retry-sim:hover { background: #00ff41; color: #000; }

@keyframes clignoter {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Fins survie ── */
.survie-content {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
}

.survie-titre {
    font-family: 'MedievalSharp', serif;
    font-size: 2em;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.survie-texte {
    font-family: 'MedievalSharp', serif;
    font-size: 1.2em;
    color: #cccccc;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.btn-retry-survie {
    background: none;
    border: 2px solid;
    padding: 10px 25px;
    font-size: 1em;
    cursor: pointer;
    font-family: 'MedievalSharp', serif;
    transition: all 0.2s;
}

.btn-retry-survie:hover {
    opacity: 0.7;
}