/* =======================================
   ESTILOS GENERALES
   ======================================= */
body {
    font-family: Arial, sans-serif;
    background: #e8faff;
    background: linear-gradient(180deg, rgba(232, 250, 255, 1) 0%, rgba(191, 255, 255, 1) 100%);
    box-sizing: border-box;
    margin: 0;
    min-height: 100vh;
}

header {
    background: linear-gradient(100deg, #29fff8 10%, #32b5d9 100%);
    color: #333;
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 40px;
    width: 100%;
}

header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem); 
}

header p {
    margin: 10px 0 0 0;
    font-size: clamp(1rem, 2vw, 1.4rem);
}

/* =======================================
   ESTILOS DEL JUEGO (ARRIBA)
   ======================================= */
#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 95%; 
    max-width: 800px; 
}

#game-container {
    width: 100%;
    height: 200px;
    border: 2px solid #333;
    border-radius: 10px;
    background-color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* NUEVA PARTE: Diseño del marcador de puntos */
#score {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    background-color: #29fff833;
    border: none;
    padding: 4px;
    border-radius: 8px;
    z-index: 10;
    font-family: 'Courier New', Courier, monospace;
}

#suelo {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    background-color: #795548;
}

#dino {
    position: absolute;
    transform: scaleX(-1);
    bottom: 20px;
    left: 10%; 
    font-size: 50px;
    line-height: 50px;
    z-index: 2;
}

.agachado {
    transform: scaleX(-1) scaleY(0.6) !important;
    transform-origin: bottom; 
}

#obstaculo {
    position: absolute;
    bottom: 17px;
    right: -60px;
    font-size: 50px;
    line-height: 50px;
    z-index: 1;
}

#explosion {
    position: absolute;
    bottom: 20px;
    left: 10%;
    font-size: 60px; 
    line-height: 50px;
    z-index: 3;
    display: none;
}

.animacion-salto {
    animation: saltar 0.5s linear;
}

@keyframes saltar {
    0% { bottom: 20px; }
    40% { bottom: 110px; }
    50% { bottom: 120px; }
    60% { bottom: 110px; }
    100% { bottom: 20px; }
}

.animacion-obstaculo {
    animation: moverObstaculo 0.9s infinite linear;
}

@keyframes moverObstaculo {
    0% { right: -60px; }
    100% { right: calc(100% + 60px); } 
}

.animacion-explosion {
    animation: boom 0.3s ease-out forwards;
}

@keyframes boom {
    0% { transform: scale(0.5); opacity: 1; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* =======================================
   ESTILOS DEL CÓDIGO EN VIVO
   ======================================= */
#codigo-container {
    width: 100%;
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
    margin-top: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(12px, 3vw, 15px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    height: 180px;
    overflow-y: auto; 
}

.keyword { color: #569cd6; }
.function { color: #dcdcaa; }
.string { color: #ce9178; }
.comment { color: #6a9955; }

.btn-r {
    padding: 15px 30px;
    font-size: 1.2em;
    background-color: #042792;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 20px 0;
    width: 100%; 
    max-width: 300px;
}

.btn-r:hover {
    background-color: #007bf7;
}