:root {
    --isaac-red: #b22222;
    --charge-green: #32cd32;
    --bg-dark: #121212;
    --dmg-color: #ff4d4d;
    --tears-color: #4da6ff;
    --luck-color: #d9d9d9;
    --reset-yellow: #f1c40f;
}
#foto{
    text-align: center;
    width: 200px;
    border-radius: 25px;
}


body {
    background: var(--bg-dark);
    color: white;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-height: 100vh;
}

/* NUEVO: Contenedor principal para layout lateral */
#main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* El juego central manteniendo su estilo */
#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 460px;
}

/* NUEVO: Panel lateral de explicación */
#sidebar {
    width: 300px;
    background: #1a1a1a;
    border: 2px solid #444;
    padding: 20px;
    border-radius: 8px;
    font-size: 12px;
    color: #ccc;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#sidebar h2 {
    color: #fff;
    font-size: 16px;
    text-align: center;
    margin-top: 0;
    text-transform: uppercase;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar li {
    margin-bottom: 15px;
    line-height: 1.4;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

#sidebar b {
    color: #fff;
    text-transform: uppercase;
}

#player-stats-panel {
    background: #0a0a0a;
    border: 2px solid #444;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
    font-size: 13px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.pedestal {
    width: 100%;
    padding: 30px;
    border: 4px solid #333;
    background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.reroll-active {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% {
        filter: brightness(3);
    }

    100% {
        filter: brightness(1);
    }
}

#item-name {
    color: #ffd700;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

#item-desc {
    color: #888;
    font-style: italic;
    font-size: 16px;
    margin-bottom: 20px;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 30px;
}

.stat-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    background: #333;
    border: 1px solid #555;
}

.stat-up {
    border-color: var(--charge-green);
    color: var(--charge-green);
}

.stat-down {
    border-color: var(--isaac-red);
    color: var(--isaac-red);
}

.charge-bar {
    width: 100%;
    height: 25px;
    background: #222;
    border: 3px solid #000;
    margin-top: 20px;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
}

#charge-fill {
    height: 100%;
    width: 0%;
    background: var(--charge-green);
    transition: width 0.2s;
}

.full {
    background: #fff !important;
    box-shadow: 0 0 10px #fff;
}

.btns {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    font-weight: bold;
    border-radius: 5px;
    transition: 0.2s;
}

#btn-room {
    background: #555;
    color: white;
}

#btn-room:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #555 !important;
}

#btn-d6 {
    background: var(--isaac-red);
    color: white;
}

#btn-d6:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

#btn-pickup {
    background: #b8860b;
    color: white;
}

#btn-pickup:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
}

/* NUEVO ESTILO: Botón de Reinicio */
#btn-reset {
    background: var(--reset-yellow);
    color: #000;
}

#btn-reset:hover {
    background: #fff;
}

#minigame-ui {
    margin-top: 15px;
    width: 100%;
    text-align: center;
    display: none;
    background: #111;
    border: 2px dashed #555;
    padding: 10px;
    border-radius: 8px;
    box-sizing: border-box;
}

#target-keys {
    font-size: 26px;
    letter-spacing: 10px;
    font-weight: bold;
    word-wrap: break-word;
    line-height: 1.5;
}

#minigame-timer {
    height: 6px;
    background: var(--isaac-red);
    margin-top: 10px;
    width: 100%;
}

#pool-container {
    margin-top: 20px;
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    color: #aaa;
    text-align: left;
    box-sizing: border-box;
}

.pool-item {
    display: inline-block;
    background: #222;
    padding: 2px 6px;
    margin: 3px;
    border-radius: 3px;
    border: 1px solid #333;
}

@keyframes error-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
        background-color: #500;
    }

    75% {
        transform: translateX(5px);
        background-color: #500;
    }
}

.error {
    animation: error-shake 0.2s;
}