* {
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

:root {
    --bg: #04010b;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --accent: #00ff9f;
    --danger: #ff5c5c;
    --info: #7ec0ff;
    --gold: #ffd166;
    font-size: 16px;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Cinzel", serif;
    line-height: 1.5rem;
}

/* ====== CLASES DE FUENTES (usadas por SettingsManager) ====== */
.font-medieval {
    font-family: "MedievalSharp", cursive;
}

.font-cinzel {
    font-family: "Cinzel", serif;
}

.font-gothic {
    font-family: "UnifrakturMaguntia", cursive;
}

.font-retro {
    font-family: "Press Start 2P", monospace;
}

.font-monospace {
    font-family: "Source Code Pro", monospace;
}

.font-roboto-mono {
    font-family: "Roboto Mono", monospace;
}

.font-jetbrains {
    font-family: "JetBrains Mono", monospace;
}

.font-syne {
    font-family: "Syne Mono", monospace;
}

body.font-retro .console,
body.font-retro .hud,
body.font-retro .action-btn {
    font-size: 0.85em;
}

body.font-retro .console {
    line-height: 2;
}

body.font-gothic .console,
body.font-gothic .hud {
    font-size: 0.9em;
    line-height: 1.4;
}

/* ====== ANIMACIONES DE TEXTO EN CONSOLA ====== */
.line {
    animation: textAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
    margin-top: 2px;
    /* padding: 10px 5px;
    border-radius: 20px;
    background-color: #151515; */
    /*color: #000000 !important;*/
}

@keyframes textAppear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay escalonado para líneas consecutivas */
.line:nth-child(1) {
    animation-delay: 0.1s;
}

.line:nth-child(2) {
    animation-delay: 0.2s;
}

.line:nth-child(3) {
    animation-delay: 0.3s;
}

.line:nth-child(4) {
    animation-delay: 0.4s;
}

.line:nth-child(5) {
    animation-delay: 0.5s;
}

.line:nth-child(6) {
    animation-delay: 0.6s;
}

.line:nth-child(7) {
    animation-delay: 0.7s;
}

.line:nth-child(8) {
    animation-delay: 0.8s;
}

.line:nth-child(9) {
    animation-delay: 0.9s;
}

.line:nth-child(10) {
    animation-delay: 1s;
}

.line:nth-child(n + 11) {
    animation-delay: 0.3s;
}

.line.sys {
    animation-duration: 0.8s;
    animation-timing-function: ease-in-out;
}

.line.important {
    animation: importantAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes importantAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    50% {
        opacity: 0.7;
        transform: translateY(-5px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.line.combat {
    animation: combatAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes combatAppear {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(1.1);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.line.damage {
    animation: damageAppear 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes damageAppear {
    0% {
        opacity: 0;
        transform: translateX(10px) scale(1.2);
        color: #ff4444;
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.line.heal {
    animation: healAppear 0.7s ease-out forwards;
}

@keyframes healAppear {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.8);
        filter: brightness(1.5);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

.line.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent);
    white-space: nowrap;
    animation:
        typewriter 2s steps(40, end),
        blinkCursor 0.8s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent);
    }
}

.line.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.line.new-message::before {
    content: "●";
    color: var(--accent);
    margin-right: 8px;
    font-size: 0.8em;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ====== ANIMACIONES DE TEXTO POR COLOR ====== */
.color-danger {
    color: var(--danger);
    animation: dangerShake 3s ease-in-out infinite;
    display: inline-block;
    transform-origin: center;
}

@keyframes dangerShake {

    0%,
    100% {
        transform: translateX(0) scale(1);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-1px) scale(1.02);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(1px) scale(1.02);
    }

    15%,
    45%,
    75% {
        transform: translateY(-1px);
    }

    25%,
    55%,
    85% {
        transform: translateY(1px);
    }
}

.color-gold {
    color: var(--gold);
    animation: goldPulse 2.5s ease-in-out infinite;
    display: inline-block;
    text-shadow: 0 0 5px rgba(255, 209, 102, 0.3);
}

@keyframes goldPulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 209, 102, 0.3);
    }

    50% {
        transform: scale(1.05);
        text-shadow:
            0 0 10px rgba(255, 209, 102, 0.6),
            0 0 15px rgba(255, 209, 102, 0.4);
    }
}

.color-accent {
    color: var(--accent);
    animation: floatUp 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0);
        text-shadow: 0 0 5px rgba(0, 255, 159, 0.3);
    }

    50% {
        transform: translateY(-2px);
        text-shadow:
            0 0 10px rgba(0, 255, 159, 0.6),
            0 0 15px rgba(0, 255, 159, 0.4);
    }
}

.color-info {
    color: var(--info);
    animation: waveFlow 4s ease-in-out infinite;
    display: inline-block;
}

@keyframes waveFlow {

    0%,
    100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 0 3px rgba(126, 192, 255, 0.3);
    }

    33% {
        transform: translateY(-1px) scale(1.02);
        text-shadow: 0 0 6px rgba(126, 192, 255, 0.5);
    }

    66% {
        transform: translateY(1px) scale(0.98);
        text-shadow: 0 0 4px rgba(126, 192, 255, 0.4);
    }
}

.color-warning {
    color: #ffa500;
    animation: warningBlink 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes warningBlink {

    0%,
    50%,
    100% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
    }

    25%,
    75% {
        opacity: 0.7;
        text-shadow: 0 0 2px rgba(255, 165, 0, 0.3);
    }
}

.color-purple {
    color: #b967ff;
    animation: mysticGlow 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes mysticGlow {

    0%,
    100% {
        text-shadow:
            0 0 5px #b967ff,
            0 0 10px rgba(185, 103, 255, 0.3);
        transform: scale(1);
    }

    50% {
        text-shadow:
            0 0 10px #b967ff,
            0 0 20px rgba(185, 103, 255, 0.6),
            0 0 30px rgba(185, 103, 255, 0.4);
        transform: scale(1.03);
    }
}

.color-legendary {
    color: #ff8c00;
    animation: legendaryPulse 2s ease-in-out infinite;
    display: inline-block;
    font-weight: bold;
}

@keyframes legendaryPulse {

    0%,
    100% {
        text-shadow:
            0 0 5px #ff8c00,
            0 0 10px rgba(255, 140, 0, 0.5);
        transform: scale(1);
    }

    50% {
        text-shadow:
            0 0 15px #ff8c00,
            0 0 25px rgba(255, 140, 0, 0.8),
            0 0 35px rgba(255, 140, 0, 0.6);
        transform: scale(1.05);
    }
}

/* ====== ANIMACIONES PARA RAREZAS DE ITEMS ====== */
.rarity-common {
    color: #969696;
}

.rarity-uncommon {
    color: #1eff00;
}

.rarity-rare {
    color: #0070dd;
}

.rarity-epic {
    color: #a335ee;
}

.rarity-legendary {
    color: #ff8000;
}

.rarity-epic {
    font-weight: bold;
    text-shadow: 0 0 5px #a335ee;
    animation: epicVibrate 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes epicVibrate {

    0%,
    100% {
        text-shadow:
            0 0 5px #a335ee,
            0 0 10px rgba(163, 53, 238, 0.4);
        transform: translateX(0);
    }

    25% {
        transform: translateX(-0.5px) translateY(-0.5px);
    }

    50% {
        transform: translateX(0.5px) translateY(0.5px);
    }

    75% {
        transform: translateX(-0.3px) translateY(0.3px);
    }
}

.rarity-legendary {
    font-weight: bold;
    text-shadow: 0 0 8px #ff8000;
    animation: glowLegendary 3s ease-in-out infinite alternate;
    display: inline-block;
}

@keyframes glowLegendary {
    from {
        text-shadow: 0 0 5px #ff8000;
        transform: scale(1) rotateY(0deg);
    }

    to {
        text-shadow:
            0 0 15px #ff8000,
            0 0 20px #ff8000;
        transform: scale(1.05) rotateY(30deg);
    }
}

.rarity-rare {
    animation: rareShimmer 4s ease-in-out infinite;
    display: inline-block;
}

@keyframes rareShimmer {

    0%,
    100% {
        text-shadow: 0 0 3px rgba(0, 112, 221, 0.4);
        opacity: 1;
    }

    50% {
        text-shadow:
            0 0 8px rgba(0, 112, 221, 0.8),
            0 0 12px rgba(0, 112, 221, 0.6);
        opacity: 0.9;
    }
}

.rarity-uncommon {
    animation: uncommonBreathe 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes uncommonBreathe {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 3px rgba(30, 255, 0, 0.3);
    }

    50% {
        transform: scale(1.02);
        text-shadow: 0 0 6px rgba(30, 255, 0, 0.6);
    }
}

.rarity-common {
    animation: commonFade 5s ease-in-out infinite;
    display: inline-block;
}

@keyframes commonFade {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* ====== SISTEMA DE ESTADÍSTICAS EN GRID ====== */

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-name {
    text-align: left;
}

.stat-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 370px;
    /* ancho de las imagenes */
    height: 150px;
    /* alto de las imagenes */
    gap: 80px;
    margin: 0 auto;
    margin-bottom: 10px;
}

.stat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* instead of cover */
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.stat-image img:hover {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transform: scale(1.04);
    transition: transform 0.3s ease-in-out;
}

.stat-image img:active {
    animation: clickEffect 0.3s ease-in-out forwards;
}

@keyframes clickEffect {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    }

    100% {
        transform: scale(0.96);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }
}

.extra-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background-color: #1b1b1b;
    padding: 0px 2px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    gap: 10px;
    width: 100%;
}

.stat-group:hover {
    background-color: #2a2a2a;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* HEADERS - Fila 1 */
.stat-header:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

/* Vida */
.stat-header:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

/* Ataque */
.stat-header:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

/* Defensa */

/* HEADERS - Fila 2 */
.stat-header:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

/* Oro */
.stat-header:nth-child(5) {
    grid-column: 2 / span 2;
    grid-row: 2;
}

/* Ubicación - OCUPA 2 COLUMNAS */

/* VALUES - Fila 1 */
.stat-value:nth-child(6) {
    grid-column: 1;
    grid-row: 1;
    margin-top: 25px;
}

/* hp */
.stat-value:nth-child(7) {
    grid-column: 2;
    grid-row: 1;
    margin-top: 25px;
}

/* atk */
.stat-value:nth-child(8) {
    grid-column: 3;
    grid-row: 1;
    margin-top: 25px;
}

/* def */

/* VALUES - Fila 2 */
.stat-value:nth-child(9) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 25px;
}

/* gold */
.stat-value:nth-child(10) {
    grid-column: 2 / span 2;
    grid-row: 2;
    margin-top: 25px;
}

/* location - OCUPA 2 COLUMNAS */

.stat-header {
    background: rgba(61, 61, 61, 0.451);
    padding: 1px 4px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px 6px 0 0;
}

.stat-value {
    background: rgba(0, 0, 0, 0.644);
    padding: 5px 4px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
    border: none;
}

/* Estilos específicos para cada stat */
#hp {
    color: #5cff5c;
    animation: heartbeat 2s ease-in-out infinite;
}

/* Estilos dinámicos para HP */
.hp-high {
    color: #5cff5c !important;
    animation: heartbeat 2s ease-in-out infinite !important;
}

.hp-medium {
    color: #ffa500 !important;
    /* Naranja */
    animation: pulseWarning 1.5s ease-in-out infinite !important;
}

.hp-low {
    color: var(--danger) !important;
    /* Rojo */
    animation: pulseDanger 1s ease-in-out infinite !important;
}

/* Animaciones para los estados de HP */
@keyframes pulseWarning {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 10px rgba(255, 165, 0, 0.8);
    }
}

@keyframes pulseDanger {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 92, 92, 0.5);
    }

    50% {
        transform: scale(1.08);
        text-shadow: 0 0 15px rgba(255, 92, 92, 0.9);
    }
}

#atk {
    color: var(--danger);
    animation: attackPulse 1.5s ease-in-out infinite;
}

#def {
    color: var(--info);
    animation: shieldGlow 3s ease-in-out infinite;
}

#gold {
    color: var(--gold);
    animation: goldSparkle 4s ease-in-out infinite;
}

#location {
    color: #b967ff;
    font-style: italic;
}

/* ====== ANIMACIONES PARA ESTADÍSTICAS EN HUD ====== */

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.05);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.03);
    }
}

@keyframes attackPulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 3px rgba(255, 92, 92, 0.3);
    }

    50% {
        transform: scale(1.08);
        text-shadow: 0 0 8px rgba(255, 92, 92, 0.6);
    }
}

@keyframes shieldGlow {

    0%,
    100% {
        text-shadow: 0 0 3px rgba(126, 192, 255, 0.3);
    }

    50% {
        text-shadow:
            0 0 10px rgba(126, 192, 255, 0.7),
            0 0 15px rgba(126, 192, 255, 0.4);
    }
}

@keyframes goldSparkle {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 3px rgba(255, 209, 102, 0.3);
    }

    25% {
        transform: scale(1.04);
        text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
    }

    75% {
        transform: scale(1.02);
        text-shadow: 0 0 5px rgba(255, 209, 102, 0.4);
    }
}

/* ====== ESTILOS BASE DEL JUEGO ====== */
.error-overlay {
    font-size: 14px;
}

.error-overlay h2 {
    font-size: 1.5em;
    text-align: center;
}

.error-overlay button {
    flex: 1;
    min-width: 150px;
    font-size: 14px;
}

.xp-progress {
    background: #333;
    border-radius: 3px;
    height: 6px;
    margin-top: 2px;
    overflow: hidden;
}

.xp-progress-bar {
    background: linear-gradient(90deg, #00ff9f, #00cc7f);
    height: 100%;
    transition: width 0.3s ease;
}

.luck-indicator {
    font-size: 0.8em;
    color: #b967ff;
}

#name {
    font-size: 1.25rem;
}

#title {
    font-size: 0.8rem;
}

.black-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #000000 0%, #000000c4 5%, transparent 25%, transparent 60%, transparent 60%, transparent 100%);
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.wrap {
    display: grid;
    grid-template-columns: 1fr 30em;
    gap: 12px;
    height: 100vh;
    padding: 12px;
    box-sizing: border-box;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    color: #888;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: #9f7cff;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Estilos Base Actualizados */
.console-top {
    display: flex;
    position: sticky;
    top: 0px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Permite que los elementos bajen si no caben */
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 15px;
    border: 2px solid #250e40;
    border-bottom: 2px solid #452264;
    background-color: #09060d;
    border-radius: 12px;
    z-index: 1000;
}

.console-logo {
    width: 130px;
    /* Un poco más pequeño para mobile */
    height: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: antiquewhite;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-link:hover {
    color: rgb(124, 68, 255);
}

.version-info {
    color: antiquewhite;
    font-size: 0.65rem;
    text-align: right;
    padding-right: 10px;
    border-right: 1px solid rgb(124, 68, 255);
    line-height: 1.2;
}

/* --- MEDIA QUERIES (RESPONSIVE) --- */

@media (max-width: 600px) {
    .console-top {
        flex-direction: column;
        /* Apila los elementos en vertical */
        text-align: center;
        padding: 15px;
    }

    .nav-menu {
        order: 2;
        /* Ponemos el menú en medio */
        gap: 25px;
        display: none;
    }

    .version-info {
        display: none;
        text-align: center;
        border-right: none;
        border-top: 1px solid rgba(124, 68, 255, 0.3);
        padding: 10px 0 0 0;
        width: 100%;
    }

    .console-logo {
        order: 1;
        width: 110px;
    }
}

.console {
    background: #070109;
    /* #050505 */
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 6px 24px rgba(29, 1, 31, 0.7);
    overflow: auto;
    border: 2px solid #250e40;
    border-bottom: 2px solid #452264;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #9c4ae8 rgba(81, 41, 112, 0.2);
}

.console-inner {
    min-height: 0;
}

.line .time {
    color: var(--muted);
    font-size: 0.85em;
    margin-right: 8px;
}

.line .sys {
    color: var(--muted);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.action-btn {
    background: #3d3d3d;
    color: #fff;
    border: 2px solid #242424;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    min-height: 45px;
    display: flex;
    align-items: center;
}

/* Índice del botón (número) — más pequeño y menos opaco */
.btn-index {
    font-size: 0.75em;
    opacity: 0.45;
    margin-right: 6px;
    font-weight: 400;
    min-width: 16px;
    flex-shrink: 0;
}

/* Icono del botón (imagen SVG) */
.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

/* Texto del botón */
.btn-label {
    flex: 1;
}

.console {
    font-size: 1rem;
    line-height: 1.4;
    overflow-x: hidden;
}

.action-btn:hover {
    background: #243947;
    border-color: #135f8b;
}

.action-btn:active {
    transform: translateY(2px);
}

/* Botones que ocupan 2 columnas */
.action-btn.full-width {
    grid-column: 1 / -1;
}

/* Contenedor de la cuadrícula */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }

    .action-btn {
        grid-column: 1 / -1;
    }
}

.action-bucket {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#character-img {
    border-radius: 24px;
    border: 5px solid #383539;
    border-bottom: 10px solid #231359;
}

#target-img {
    border-radius: 24px;
    border: 5px solid #383539;
    border-bottom: 10px solid #383539;
}

.hud {
    background: #0a0213;
    /*070707*/
    border: 2px solid #250e40;
    border-bottom: 2px solid #452264;
    border-radius: 12px;
    padding: 12px;
    min-height: 500px;
    color: var(--muted);
    user-select: none;
    z-index: 2;
}

.small {
    font-size: 0.9em;
    color: var(--muted);
}

.choice {
    cursor: pointer;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.hint {
    color: var(--muted);
    font-size: 0.9em;
}

.screen-controls {
    display: flex;
    gap: 6px;
}

.console::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.console::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 6px;
}

.console::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.console::-webkit-scrollbar-track {
    background: #111;
}

.big-btn {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    margin-top: 1rem;
    background: #222;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.big-btn:hover {
    background: #444;
}

/* ====== POPUP DE INICIO - FONDO ANIMADO DETRÁS ====== */
#startPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* Fondo negro estático base */
#startPopup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    background-image: url("https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fnaturaleza.animalesbiologia.com%2Fwp-content%2Fuploads%2F2022%2F10%2Fbosque-mesofilo-de-montana-o-niebla.jpg&f=1&nofb=1&ipt=0cffdf04f5a5a70c2c100444a4d6553616ec3f6561cbf7dc0919960b9a5e843b");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(2px) hue-rotate(220deg);
    z-index: -2;
}

/* Degradado animado encima del fondo negro */
#startPopup::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(43, 24, 3, 0.95) 0%,
            rgba(36, 31, 17, 0.8) 25%,
            rgba(14, 11, 6, 0.98) 50%,
            rgba(41, 19, 4, 0.8) 75%,
            rgba(41, 17, 8, 0.95) 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    z-index: -1;
    filter: blur(2px) hue-rotate(220deg);
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.popup-content {
    filter: blur(0px) hue-rotate(220deg);
    background: linear-gradient(180deg,
            rgba(46, 24, 3, 0.9) 0%,
            rgba(32, 9, 1, 0.9) 100%);
    border: 1px solid #8d6248;
    border-radius: 0 45px 45px 0 !important;
    flex: 1;
    padding: 35px;
    width: 90%;
    max-width: 480px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.8),
        0 2px 8px rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
    text-align: center;
    position: relative;
    animation: popupEntrance 0.4s ease-out;
    backdrop-filter: blur(5px);
    /* overflow-y: auto;
    margin: 0 !important; */
}

.popup-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    background-image: url("https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fpng.pngtree.com%2Fthumb_back%2Ffw800%2Fbackground%2F20240912%2Fpngtree-burning-paper-texture-background-image_16164008.jpg&f=1&nofb=1&ipt=3a638ad4ad37cbc3045bc02aa320ac2359d1b5e07a09e58346c7de6c19a80ea5");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.9;
    /*girar el fondo*/
    transform: rotateX(180deg);
    filter: blur(1px) hue-rotate(0deg);
    z-index: -2;
    border: 1px solid #8d6248;
    border-radius: 0 45px 45px 0 !important;
}

.popup-content::after {
    content: "";
    position: absolute;
    border: 1px solid #8d6248;
    border-radius: 0 45px 45px 0 !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(20, 11, 1, 0.85) 0%,
            rgba(20, 13, 5, 0.95) 25%,
            rgba(26, 21, 10, 0.9) 50%,
            rgba(51, 24, 6, 0.95) 75%,
            rgba(31, 11, 11, 0.9) 100%);
    background-size: 400% 400%;
    z-index: -1;
    filter: blur(0) hue-rotate(0deg);
}

@keyframes popupEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-title {
    font-size: 2.4rem;
    margin-top: 20px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -4px;
    line-height: 0.1;
    margin-bottom: 20px;
}

.popup-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
    color: #b0b0b0;
    line-height: 1.2;
    transform: perspective(300px) rotateX(55deg) scale(1.2, 2);
    transform-origin: center;
    border-top: 1px solid transparent;
    background-image: linear-gradient(to right,
            transparent 0%,
            transparent 15%,
            #fff 50%,
            transparent 85%,
            transparent 100%);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
}

.form-group {
    margin-bottom: 12px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccaa4b;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    background: #1b1002;
    border: 2px solid #8d6f48;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #c09c4f;
    background: #311e04;
    box-shadow: 0 0 2px 1px rgba(223, 186, 132, 0.726);
}

.form-select option {
    background: #311e04;
    color: #ffffff;
}

#playerClass {
    filter: grayscale(1);
}

.character-preview {
    background: #1b1002;
    color: #ccaa4b;
    border: 2px solid #8d6f48;
    padding: 8px;
    margin: 20px 0;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    justify-content: center;
}

.character-preview:hover {
    background: #8d6f48;
    color: #fff;
}

.preview-title {
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 18px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.preview-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9rem;
}

.preview-stats div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #312a20;
}

.preview-stats b {
    color: rgb(214, 197, 174);
    font-weight: 600;
}

.start-button {
    background: #332008;
    border: 2px solid #8d6f48;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.start-button:hover {
    background: #e2e1e1;
    color: #353434;
    border: 2px solid #e2e1e1;
    font-size: 1.3rem;
    letter-spacing: 2px;
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.start-button:active {
    transform: translateY(0) scale(0.9);
    opacity: 0.5;
    transition: all 0.1s ease-in-out;
}

.start-button.loading {
    background: #666666;
    color: #cccccc;
    pointer-events: none;
}

.title-header {
    display: flex;
    margin: 0 auto;
    margin-bottom: 1rem;
    min-height: 150px;
    max-height: 150px;
    justify-content: center;
    /*border-bottom: 1px solid var(--accent-orange);*/
}

.title-logo {
    filter: hue-rotate(-220deg);
    height: 150px;
    margin: 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.title-logo:hover {
    transform: translateY(-5px) scale(1.05);
    transition: all 0.3s ease;
}

/* Animación de salida */
.fade-out {
    animation: smoothExit 0.9s ease-in-out forwards !important;
}

@keyframes smoothExit {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1) rotate(2deg);
        filter: blur(1px);
    }

    100% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
        filter: blur(20px);
    }
}

/* Animación de salida2 */
.fade-out-2 {
    animation: smoothExit2 0.9s ease-in-out forwards !important;
}

@keyframes smoothExit2 {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.1) rotate(-4deg);
        filter: blur(1px);
    }

    100% {
        opacity: 0;
        transform: scale(0.5) rotate(10deg);
        filter: blur(40px);
    }
}

/* Estados de focus */
.form-input:focus,
.form-select:focus {
    transform: translateY(-1px);
}

/* Efectos hover sutiles */
.form-input:hover,
.form-select:hover {
    border-color: #666666;
}

/* Responsive */
@media (max-width: 600px) {
    .popup-content {
        padding: 25px;
        margin: 15px;
    }

    .popup-title {
        font-size: 2rem;
    }

    .popup-subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    .start-button {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .preview-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .popup-content {
        padding: 20px;
    }

    .popup-title {
        font-size: 1.8rem;
    }

    .form-input,
    .form-select {
        padding: 12px 14px;
    }
}

/* Contenedor relativo para que el popup se posicione respecto a él */
.character-preview {
    position: relative;
    margin: 10px 0;
    text-align: center;
}

/* El botón que dispara las estadísticas */
.preview-trigger {
    color: #ccaa4b;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    justify-content: center;
}

.preview-trigger:hover {
    background: #8d6f48;
    color: #fff;
}

/* El mini-popup de estadísticas */
.stats-floating-pane {
    display: none;
    /* Se activa con JS */
    position: absolute;
    top: 120%;
    /* Aparece arriba del botón */
    left: -10%;
    transform: translateX(-50%);
    width: 220px;
    background: #1b1002;
    border: 2px solid #ccaa4b;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

/* Pequeña flecha debajo del popup */
.stats-floating-pane::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 80%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #ccaa4b;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Ajuste de los items de stats para que sean más compactos */
.stats-grid-startup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
}

.stat-item {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    filter: hue-rotate(-220deg);
}

.stat-label {
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.image-upload-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 10px auto;
    cursor: pointer;
}

/* El input oculto que detecta el click */
.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    /* Siempre encima para capturar el click */
}

/* El contenedor visual */
.image-custom-display {
    width: 100%;
    height: 100%;
    border: 2px dashed #7d488d;
    border-radius: 15px;
    /* O 50% para circular */
    background: #10021b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
    filter: hue-rotate(-220deg);
}

.image-upload-wrapper:hover .image-custom-display {
    border-color: #a462ca;
    background: #1c052a;
    transform: scale(1.05);
}

#previewImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Importante para que no se deforme la foto */
}

.upload-placeholder {
    color: #6e488d;
    font-size: 0.8rem;
    text-align: center;
}

/* Contenedor principal de la ficha - Modernizado */
#traitsSheetOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #120b22 0%, #09060d 100%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e0e0e0;
}

/* Cabecera más épica */
.traits-header {
    text-align: center;
    border-bottom: 2px solid #452264;
    padding-bottom: 30px;
    margin-bottom: 40px;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.traits-header h2 {
    font-size: 3.2rem;
    font-weight: bold;
    font-family: Georgia, "Times New Roman", Times, serif;
    margin: 0;
    padding-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bd9c55;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.total-points-badge {
    background: rgba(37, 14, 64, 0.8);
    padding: 12px 30px;
    border-radius: 50px;
    border: 2px solid #7c44ff;
    font-weight: bold;
    color: #ccaa4b;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(124, 68, 255, 0.3);
    backdrop-filter: blur(5px);
}

/* Grid Ajustado a 3 Columnas */
.traits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Forzamos 3 columnas en desktop */
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 120px;
}

/* Tarjetas de Categoría Modernizadas */
.category-card {
    background: rgba(8, 6, 11, 0.8);
    border: 2px solid #554172;
    border-radius: 36px;
    padding: 25px;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 400px;
    transition: transform 0.4s ease-in-out;
}

.category-card:hover {
    border-color: #7c44ff;
    transform: translateY(-5px);
    background: rgba(22, 17, 27, 0.9);
}

.category-card h3 {
    margin: 0;
    color: #7c44ff;
    font-size: 1.4rem;
    border-bottom: 1px solid #452264;
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-card h3 small {
    font-size: 0.9rem;
    background: #09060d;
    padding: 4px 12px;
    border-radius: 10px;
    color: #ccaa4b;
}

/* Filas de Rasgos más espaciosas */
.trait-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(55, 55, 55, 0.352);
    border: 1px solid #4f4157;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.trait-row:hover {
    background: rgba(124, 68, 255, 0.1);
}

.trait-row span {
    font-weight: 600;
    text-transform: capitalize;
    font-size: 1rem;
    color: #d1d1d1;
}

/* Controles más Grandes y Modernos */
.trait-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-point {
    background: #250e40;
    border: 2px solid #452264;
    color: white;
    width: 36px;
    /* Más grande */
    height: 36px;
    /* Más grande */
    cursor: pointer;
    border-radius: 50%;
    /* Circulares */
    display: flex;
    align-items: center;
    scale: 1.2;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-point:hover:not(:disabled) {
    background: #7c44ff;
    border-color: #fff;
    box-shadow: 0 0 10px #7c44ff;
    transform: scale(1.1);
}

.btn-point:active {
    transform: scale(0.9);
}

.btn-point:disabled {
    opacity: 0.1;
    cursor: not-allowed;
    border-color: #222;
}

.trait-val {
    width: 20px;
    text-align: center;
    font-size: 1.5rem;
    /* Más grande */
    font-weight: 800;
    color: #ccaa4b;
    font-family: "Courier New", Courier, monospace;
}

/* Footer de Confirmación Estilizado */
.confirm-traits-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(to top, #09060d 70%, transparent);
    text-align: center;
    z-index: 5;
}

.btn-save-traits {
    background: linear-gradient(135deg, #452264 0%, #7c44ff 100%);
    color: white;
    border: none;
    padding: 18px 60px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(124, 68, 255, 0.4);
}

.btn-save-traits:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(124, 68, 255, 0.7);
    letter-spacing: 4px;
}

/* Ajustes Responsive para que no se rompa en móvil */
@media (max-width: 1000px) {
    .traits-grid {
        grid-template-columns: 1fr;
        padding-bottom: 150px;
    }

    #traitsSheetOverlay {
        padding: 20px;
    }
}

/* Contenedor Maestro */
.startup-wrapper {
    display: flex;
    max-width: 900px;
    width: 95%;
    height: 85vh;
    max-height: 700px;
    animation: popupEntrance 0.5s ease-out;
}

/* SIDEBAR STYLES */
.startup-sidebar {
    width: 320px;
    background: rgba(15, 10, 20, 0.95);
    border: 2px solid #4a2e82;
    border-right: none;
    border-radius: 45px 0 0 45px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.sidebar-logo {
    width: 180px;
    margin: 0 auto 30px;
    filter: drop-shadow(0 0 10px #572db7b7);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.nav-item {
    color: antiquewhite;
    text-decoration: none;
    padding: 12px 20px;
    background: rgba(124, 68, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(124, 68, 255, 0.25);
    border-left: 3px solid #7c44ff;
    padding-left: 25px;
}

.sidebar-info {
    margin-top: 0;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.sidebar-info h3 {
    color: #ccaa4b;
    font-size: 1rem;
    margin-bottom: 10px;
}

.patch-note {
    margin-top: 15px;
    padding: 10px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 1px solid #333;
    overflow-y: auto;
    max-height: 200px;
}

.traits-btn {
    width: 100%;
    padding: 14px;
    background: #1b1002;
    border: 1px dashed #ff8c44;
    color: #ff8c44;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    transition: 0.3s;
}

.traits-btn:hover {
    background: #2a1805;
    transform: scale(1.02);
}

/* Estilo para la sección de carga en el inicio */
.sidebar-load-section {
    background: rgba(204, 170, 75, 0.05);
    border: 1px solid rgba(204, 170, 75, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}

.sidebar-load-section h3 {
    font-size: 0.8rem;
    color: #ccaa4b;
    margin-top: 0;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.sidebar-load-section p {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 12px;
}

.load-file-btn {
    background: rgba(204, 170, 75, 0.1) !important;
    border: 1px solid #ccaa4b !important;
    color: #ccaa4b !important;
    justify-content: center !important;
    font-size: 0.9rem !important;
    cursor: pointer;
}

.load-file-btn:hover {
    background: #ccaa4b !important;
    color: #000 !important;
}

.traits-btn-trigger {
    width: 100%;
    padding: 20px;
    background: #1b1002;
    border: 1px dashed rgb(68, 230, 255);
    border-radius: 8px;
    color: rgb(68, 252, 255);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 40px;
}

.traits-btn-trigger:hover {
    background: rgba(68, 236, 255, 0.1);
    transform: translateY(-2px);
}

.footer-version {
    font-size: 11px;
    color: #555;
    margin-top: 15px;
}

/* Responsive para Móviles */
@media (max-width: 800px) {
    .startup-wrapper {
        flex-direction: column;
        height: 95vh;
        overflow-y: auto;
    }

    .startup-sidebar {
        width: 100%;
        border-radius: 45px 45px 0 0;
        border-right: 1px solid #452264;
        border-bottom: none;
    }

    .popup-content {
        width: 100% !important;
        border-radius: 0 0 45px 45px !important;
    }
}

/* ====== SISTEMA DE CÓDIGOS PROMOCIONALES ====== */
.promo-toggle-btn {
    position: fixed;
    top: 25px;
    right: 90px;
    width: 50px;
    height: 45px;
    padding: 8px;
    background: #2a2a2a;
    border: 2px solid #cd7f32;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.promo-toggle-btn:hover {
    background: #cd7f32;
    transform: scale(1.1);
}

.promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.promo-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #222222 100%);
    border: 3px solid #cd7f32;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 0 30px rgba(205, 127, 50, 0.5);
    color: #e0e0e0;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.promo-header {
    background: linear-gradient(90deg, #8b4513, #cd7f32);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promo-header h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.promo-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.promo-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.promo-body {
    padding: 20px;
}

.promo-input {
    width: 100%;
    padding: 12px;
    background: #2a2a3a;
    border: 2px solid #8b4513;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    margin: 10px 0;
    font-family: inherit;
    text-transform: uppercase;
    transition: all 1s ease;
}

.promo-input:focus {
    outline: none;
    border-color: #cd7f32;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
    transition: all 0.3s ease;
}

.redeem-button {
    width: 100%;
    background: linear-gradient(135deg, #8b4513, #cd7f32);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.redeem-button:hover {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    transform: translateY(-2px);
}

.redeem-button:active {
    transform: translateY(0);
}

.promo-result {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translate(-50%, -50%);
    /* background: #1a1a2e;
    border: 2px solid #cd7f32; */
    width: 400px;
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    min-height: 20px;
    font-size: 1.1rem;
}

.promo-success {
    color: #00ff9f;
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid rgba(0, 255, 159, 0.3);
    padding: 10px;
    border-radius: 4px;
    animation: successPulse 0.6s ease-in-out;
}

.promo-error {
    color: #ff5c5c;
    background: rgba(255, 92, 92, 0.1);
    border: 1px solid rgba(255, 92, 92, 0.3);
    padding: 10px;
    border-radius: 4px;
}

.promo-processing {
    color: #7ec0ff;
    font-style: italic;
}

.promo-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
}

.promo-hint {
    color: #b0b0b0;
    font-size: 0.85rem;
    text-align: center;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ====== SISTEMA DE NOTAS DE PARCHE ====== */
.patch-toggle-btn {
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    bottom: 25px;
    right: 220px;
    width: 50px;
    height: 50px;
    padding: 10px;
    border: 2px solid #4a86e8;
    border-radius: 50%;
    background: #4a86e8;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    /* Importante para posicionar el badge */
}

.patch-toggle-btn:hover {
    background: #3a76d8;
    transform: scale(1.1);
}

/* Indicador de notificación */
.patch-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}


.patch-toggle-btn.has-updates {
    animation: pulse 2s infinite;
    border-color: #ff6b6b;
    background: #3a2a2a;
}

/* Animación de pulso para llamar la atención */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

.patch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.patch-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #222222 100%);
    border: 3px solid #4a86e8;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 780px;
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(74, 134, 232, 0.5);
    color: #e0e0e0;
    animation: modalAppear 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.patch-header {
    background: linear-gradient(90deg, #2d5aa0, #4a86e8);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.patch-header h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.patch-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.patch-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.patch-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    font-family: "Courier New", Courier, monospace;
}

.patch-version-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.patch-version-selector label {
    font-weight: bold;
    color: #b0b0b0;
}

.version-select {
    background: #2a2a3a;
    border: 2px solid #4a86e8;
    border-radius: 100px;
    color: #fff;
    padding: 5px 10px;
    font-family: inherit;
}

.patch-content {
    line-height: 1.2;
}

.patch-version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.patch-version-header h3 {
    margin: 0;
    color: #4a86e8;
}

.important-badge {
    background: #ff3e3e;
    color: white;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    animation: glowImportant 2s ease-in-out infinite alternate;
    cursor: pointer;
    transition: transform 0.8s ease;
}

.important-badge:hover {
    transform: scale(1.1);
    transition: all 0.5s ease;
}

.important-badge:active {
    transform: scale(1.25);
    transition: all 0.1s ease;
}

@keyframes glowImportant {
    from {
        box-shadow: 0 0 5px #ff2121;
    }

    to {
        box-shadow: 0 0 15px #ff3939;
    }
}

.patch-date {
    color: #b0b0b0;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 0.8rem;
}

.patch-features {
    min-height: 350px;
    /* Altura mínima */
    max-height: 350px;
    /* Altura máxima */
    overflow-y: auto;
    /* Scroll vertical cuando el contenido excede la altura máxima */
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(74, 134, 232, 0.3);
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 0.8rem;
    margin-right: 3px;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;

    /* Estilos opcionales para mejorar la apariencia del scroll */
    scrollbar-width: thin;
    scrollbar-color: #4a86e8 rgba(255, 255, 255, 0.1);

    user-select: none;
}

/* Personalización del scroll para navegadores WebKit (Chrome, Safari, Edge) */
.patch-features::-webkit-scrollbar {
    width: 8px;
}

.patch-features::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.patch-features::-webkit-scrollbar-thumb {
    background: #4a86e8;
    border-radius: 4px;
}

.patch-features::-webkit-scrollbar-thumb:hover {
    background: #3a76d8;
}

.patch-features h4 {
    color: #4a86e8;
    margin-bottom: 10px;
    margin-top: 0;
    border-bottom: 2px solid #4a86e8;
    border-radius: 10px 10px 0 0;
    padding: 10px;
    position: sticky;
    /* Opcional: mantener el título visible al hacer scroll */
    top: 0;
    background-color: #292929;
    z-index: 1;
}

.patch-features ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    list-style: none;
    /*white-space: pre-line;*/
}

.patch-features li {
    margin-bottom: 12px;
    position: relative;
    transition: all 0.8s ease;
}

.patch-features li:hover {
    color: #4a86e8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.patch-features li::before {
    content: "";
    position: absolute;
    left: -20px;
}

.patch-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mark-read-button {
    background: linear-gradient(135deg, #2d5aa0, #4a86e8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mark-read-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #4a86e8, #2d5aa0);
    transform: translateY(-1px);
}

.mark-read-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.patch-game-version {
    color: #b0b0b0;
    font-size: 0.85rem;
}

.patch-error {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}

.dungeon-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 90px;
    /* Ajustado para no solapar con otros botones */
    background: #1a120b;
    border: 2px solid #ccaa4b;
    border-radius: 100px;
    width: 50px;
    height: 50px;
    padding: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.dungeon-toggle-btn:hover {
    transform: scale(1.1);
    border-color: rgb(238, 255, 112);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(238, 255, 112, 0.5);
}

.dungeon-close-btn {
    position: fixed;
    top: 50px;
    right: 50px;
    background: #1a120b;
    border: 2px solid #ccaa4b;
    border-radius: 100px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dungeon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.dungeon-modal-content {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    /* Altura fija para el modal */
    background: #0d0a08;
    border: 3px solid #4b3621;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.dungeon-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 2px solid #4b3621;
}

.dungeon-tab-btn {
    background: none;
    border: none;
    color: #555;
    font-weight: bold;
    cursor: pointer;
    margin-right: 20px;
}

.dungeon-body {
    flex: 1;
    /* Esto obliga al cuerpo a estirarse */
    display: flex;
    overflow: hidden;
    position: relative;
}

.dungeon-tab-btn.active {
    color: #ccaa4b;
    border-bottom: 2px solid #ccaa4b;
}

.dungeon-tab-content {
    display: none;
    width: 100%;
    height: 100%;
    /* Ahora sí funcionará porque el padre tiene flex: 1 */
}

.dungeon-tab-content.active {
    display: flex;
}

/* Mazmorras Mensuales */
.monthly-container {
    display: flex;
    width: 100%;
    height: 100%;
    /* Garantiza que ocupe todo el body */
}

.monthly-column {
    flex: 1;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    border-right: 2px solid #1a120b;
    transition: flex 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
}

/* Efecto Hover opcional para que se sienta más "Mazmorra" */
.monthly-column:hover {
    flex: 1.2;
}

.column-overlay {
    background: linear-gradient(to top,
            rgba(0, 0, 0, 1) 20%,
            rgba(0, 0, 0, 0.8) 50%,
            transparent);
    padding: 30px 15px;
    text-align: center;
}

.column-overlay h3 {
    font-size: 2rem;
    line-height: normal;
    letter-spacing: -2px;
    font-family: sans-serif;
}

.column-overlay p {
    font-size: 0.9rem;
    line-height: normal;
}

/* Grid */
.dungeons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    width: 100%;
}

.dungeon-card {
    background: #1a120b;
    border: 1px solid #4b3621;
    border-radius: 18px;
    padding: 20px;
    max-height: 450px;
}

.dungeon-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.dungeon-action-btn {
    background: #4b3621;
    color: white;
    border: 1px solid #ccaa4b;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    margin-top: 10px;
}

.dungeon-action-btn.disabled {
    background: #222;
    color: #555;
    border-color: #333;
    cursor: not-allowed;
}

/* Contador de tiempo */
.dungeon-timer {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid #8b0000;
    color: #ff4d4d;
    padding: 8px;
    border-radius: 4px;
    margin: 10px 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px black;
}

/* Overlay de Confirmación */
.dungeon-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.dungeon-confirm-box {
    background: #1a120b;
    border: 3px solid #ccaa4b;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 1);
    animation: medievalPop 0.3s ease-out;
}

.dungeon-confirm-box h3 {
    color: #ccaa4b;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.dungeon-confirm-box p {
    color: #a6a6a6;
    font-size: 0.9rem;
    line-height: 1.4;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.confirm-btn-dungeon {
    flex: 1;
    padding: 12px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: 0.2s;
}

.confirm-btn-dungeon.proceed {
    background: #4b3621;
    color: #ccaa4b;
    border: 1px solid #ccaa4b;
}

.confirm-btn-dungeon.proceed:hover {
    background: #ccaa4b;
    color: #1a120b;
}

.confirm-btn-dungeon.cancel {
    background: #222;
    color: #888;
    border: 1px solid #444;
}

@keyframes medievalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== CONTROLES DE AUDIO ====== */
.audio-controls {
    display: flex;
    /*muestra u oculta controles*/
    position: fixed;
    bottom: 50px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #32b8cd;
    border-radius: 8px;
    padding: 1px 10px;
    z-index: 999;
    font-size: 0.8rem;
    cursor: pointer;
}

.audio-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.audio-control-group label {
    color: #e0e0e0;
    min-width: 70px;
}

.audio-controls input[type="range"] {
    width: 80px;
}

.audio-controls button {
    background: #333;
    border: 1px solid #555;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.audio-controls button:hover {
    background: #444;
}

/* ====== ESTILOS PARA BUFFOS Y EFECTOS ====== */
.buffs-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.178);
    border-radius: 6px;
    padding: 0px;
    margin-top: 10px;
}

.buffs-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 100px;
    overflow-y: auto;
}

.buff-item {
    animation: buffPulse 2s ease-in-out infinite;
    border-left: 3px solid;
}

@keyframes buffPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.buff-turns {
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 4px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.205);
    font-weight: bold;
}

/* Colores para diferentes tipos de buffos */
.buff-item.color-danger {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, rgba(255, 92, 92, 0.1), transparent);
}

.buff-item.color-info {
    border-left-color: var(--info);
    background: linear-gradient(90deg, rgba(126, 192, 255, 0.1), transparent);
}

.buff-item.color-warning {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, rgba(255, 165, 0, 0.1), transparent);
}

.buff-item.color-gold {
    border-left-color: var(--gold);
    background: linear-gradient(90deg, rgba(255, 209, 102, 0.1), transparent);
}

/* Scrollbar personalizado para buffos */
.buffs-container::-webkit-scrollbar {
    width: 4px;
}

.buffs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ====== SISTEMA DE GESTIÓN DE GUARDADOS ====== */
.save-manager-toggle-btn {
    position: fixed;
    top: 25px;
    right: 155px;
    width: 50px;
    height: 45px;
    padding: 8px;
    background: #2a2a2a;
    border: 2px solid #4caf50;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.save-manager-toggle-btn:hover {
    background: #4caf50;
    transform: scale(1.1);
}

.save-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.save-manager-content {
    background: #0d0a0e;
    border: 2px solid #452264;
    border-radius: 15px;
    width: 95%;
    max-width: 550px;
    min-height: 530px;
    overflow: hidden;
    /* Para que las pestañas no se salgan del borde */
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(124, 68, 255, 0.2);
}

/* Pestañas */
.save-tabs {
    display: flex;
    background: #1a1520;
    border-bottom: 1px solid #332a40;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s;
    text-transform: uppercase;
}

.tab-btn.active {
    color: #ccaa4b;
    background: #0d0a0e;
    border-bottom: 2px solid #ccaa4b;
}

.tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(124, 68, 255, 0.1);
}

/* Contenido de Pestañas */
.tab-content {
    display: none;
    padding: 25px;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botones Estilizados */
.save-btn-pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 25px;
    margin: 10px 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    color: white;
    font-size: 1rem;
}

.btn-save {
    background: linear-gradient(135deg, #1b3a1b, #2e7d32);
}

.btn-load {
    background: linear-gradient(135deg, #1a2a4a, #1976d2);
}

.btn-reload {
    background: linear-gradient(135deg, #1b3a1b, #2e7d32);
    filter: grayscale(1);
}

.btn-danger {
    background: linear-gradient(135deg, #4a1a1a, #c62828);
}

.save-btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.save-info-text {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
}

.save-manager-header {
    background: linear-gradient(90deg, #472e7d, #9e4caf);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-manager-header h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.save-manager-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 120px;
    height: 30px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.save-manager-close-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    color: black;
    font-weight: bold;
}

.save-manager-body {
    padding: 20px;
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.save-manager-main {
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.save-manager-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.save-manager-section:last-of-type {
    border-bottom: none;
}

.save-manager-section h3 {
    margin: 0 0 10px 0;
    color: #4caf50;
    font-size: 1.1rem;
}

.save-manager-section p {
    margin: 0 0 15px 0;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.save-manager-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.export-button {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
}

.export-button:hover {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    transform: translateY(-2px);
}

.import-button {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: white;
}

.import-button:hover {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    transform: translateY(-2px);
}

.import-confirm-button {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
}

.import-confirm-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff5722, #ff9800);
    transform: translateY(-2px);
}

.import-confirm-button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.file-input-container {
    margin-bottom: 5px;
}

.file-name {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    text-align: center;
}

.save-manager-result {
    display: none;
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    min-height: 20px;
    font-size: 0.9rem;
}

.save-manager-result.success {
    display: block;
    color: #00ff9f;
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid rgba(0, 255, 159, 0.3);
}

.save-manager-result.error {
    display: block;
    color: #ff5c5c;
    background: rgba(255, 92, 92, 0.1);
    border: 1px solid rgba(255, 92, 92, 0.3);
}

/* Añadir al CSS existente */
.save-manager-result.corrupted {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.save-manager-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
    margin-top: 5px;
    color: #ff9800;
    font-size: 0.9rem;
    text-align: center;
    line-height: normal;
}

.new-game-button {
    background: linear-gradient(135deg, #e81818, #ff4e4e);
    border: 1px solid #ff4747;
}

.new-game-button:hover {
    background: linear-gradient(135deg, #ff4e4e, #e81818);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.new-game-button:active {
    transform: translateY(0);
}

.confirmation-warning {
    text-align: center;
    padding: 20px;
    margin: 0;
    line-height: 1.2;
}

.confirmation-warning h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
}

.confirmation-warning p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.current-game-info {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.current-game-info h4 {
    color: #ff6b6b;
    margin-top: 0;
    border-bottom: 1px solid #ff6b6b;
    padding-bottom: 8px;
}

.current-game-info p {
    margin: 8px 0;
    font-size: 14px;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.confirmation-buttons button {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirmation-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.luck-neutral {
    color: #888;
}

.luck-lucky {
    color: #4caf50;
    font-weight: bold;
    animation: glowGreen 2s infinite;
}

.luck-unlucky {
    color: #f44336;
    font-weight: bold;
    animation: glowRed 2s infinite;
}

@keyframes glowGreen {

    0%,
    100% {
        text-shadow: 0 0 5px #4caf50;
    }

    50% {
        text-shadow:
            0 0 15px #4caf50,
            0 0 20px #4caf50;
    }
}

@keyframes glowRed {

    0%,
    100% {
        text-shadow: 0 0 5px #f44336;
    }

    50% {
        text-shadow:
            0 0 15px #f44336,
            0 0 20px #f44336;
    }
}

/* Añadir al CSS existente */
#restCooldown {
    font-size: 0.9rem;
    margin-top: 5px;
    padding: 3px 8px;
    background: rgba(255, 165, 0, 0.2);
    border-radius: 4px;
    border: 1px solid #ffa500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/*BOTONES CUSTOM*/

.navigation-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #202e48, #121526);
    border: 2px solid #625c8e;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(114, 107, 255, 0.4);
}

.navigation-btn:hover {
    background: linear-gradient(135deg, #202543, #32476f);
    border: 2px solid #948ec6;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(114, 107, 255, 0.6);
    transition: all 0.3s ease;
}

.cancel-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #682e2e, #321313);
    border: 2px solid #874848;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #541818, #ac3d3d);
    border: 2px solid #d96363;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    transition: all 0.3s ease;
}

.confirm-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #33682e, #173213);
    border: 2px solid #48874a;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(110, 255, 107, 0.4);
}

.confirm-btn:hover {
    background: linear-gradient(135deg, #2e5418, #3dac3d);
    border: 2px solid #63d963;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(110, 255, 107, 0.6);
    transition: all 0.3s ease;
}

.ability-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #222b3c, #171a2a);
    border: 2px solid #625c8e;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(114, 107, 255, 0.4);
}

.ability-btn:hover {
    background: linear-gradient(135deg, #202543, #343e54);
    border: 2px solid #948ec6;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(114, 107, 255, 0.6);
    transition: all 0.3s ease;
}

.attack-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #682e2e, #321313);
    border: 2px solid #874848;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.attack-btn:hover {
    background: linear-gradient(135deg, #541818, #ac3d3d);
    border: 2px solid #d96363;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    transition: all 0.3s ease;
}

.attack-btn:active {
    transform: translateY(2px);
}

.disabled-button {
    width: 100%;
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #151535, #13131e);
    border: 2px solid #251d38;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(20, 14, 39, 0.4);
}

.disabled-button:hover {
    background: linear-gradient(135deg, #13131e, #151535);
    border: 2px solid #251d38;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(14, 7, 30, 0.6);
    transition: all 0.3s ease;
}

.reliq-btn {
    margin-top: 0px;
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #642e68, #2c1332, #642e68);
    background-size: 200% 200%;
    border: 2px solid #784887;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(220, 107, 255, 0.5);
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 500px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);

    /* Animaciones combinadas */
    animation:
        gradientShift 4s ease infinite,
        gentlePulsePurple 3s ease-in-out infinite,
        subtleFloat 6s ease-in-out infinite;
}

/* Efecto de brillo energético (Opción 4) */
.reliq-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 50%),
        radial-gradient(circle at 70% 70%,
            rgba(188, 107, 255, 0.1) 0%,
            transparent 50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    animation: energyPulse 3s ease-in-out infinite;
}

/* Efecto de barrido luminoso (Opción 3) */
.reliq-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.7s ease;
}

.reliq-btn:hover::after {
    left: 100%;
}

.reliq-btn:hover {
    /* Transformaciones 3D (Opción 3) */
    transform: translateY(-4px) rotateX(3deg) rotateY(2deg) scale(1.08);

    /* Gradiente mejorado (Opción 1) */
    background: linear-gradient(135deg, #401e57, #843eaa, #401e57);
    background-size: 200% 200%;

    /* Efectos visuales mejorados */
    border: 2px solid #d963bd;
    box-shadow:
        0 12px 30px rgba(188, 107, 255, 0.8),
        0 0 0 3px rgba(217, 99, 189, 0.4),
        inset 0 0 25px rgba(255, 255, 255, 0.1);

    /* Texto más brillante */
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(188, 107, 255, 0.6);

    /* Animaciones más rápidas al hover */
    animation:
        gradientShift 2s ease infinite,
        gentlePulsePurple 1.5s ease-in-out infinite,
        subtleFloat 3s ease-in-out infinite;

    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reliq-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(188, 107, 255, 0.6),
        0 0 0 2px rgba(217, 99, 189, 0.3);
    transition: all 0.1s ease;
}

/* Animación de gradiente (Opción 1) */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animación de pulso suave (Opción 1) */
@keyframes gentlePulsePurple {

    0%,
    100% {
        box-shadow: 0 4px 10px rgba(220, 107, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(220, 107, 255, 0.7);
    }
}

/* Animación de flotación sutil (Nueva) */
@keyframes subtleFloat {

    0%,
    100% {
        transform: translateY(0) rotateX(0) rotateY(0) rotateZ(0) scale(1);
    }

    33% {
        transform: translateY(-2px) rotateX(2deg) rotateY(-1deg) rotateZ(0.5deg) scale(1.01);
    }

    66% {
        transform: translateY(-1px) rotateX(-1deg) rotateY(2deg) rotateZ(-0.5deg) scale(1.005);
    }
}

/* Animación de energía pulsante (Opción 4) */
@keyframes energyPulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

/* Versión responsive */
@media (max-width: 480px) {
    .reliq-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

.continue-story {
    margin-top: 0px;
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #684e2e, #472413, #68602e);
    background-size: 200% 200%;
    border: 2px solid #7e6136;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(255, 184, 107, 0.5);
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 500px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);

    /* Animaciones combinadas */
    animation:
        gradientShift 4s ease infinite,
        gentlePulseOrange 3s ease-in-out infinite,
        subtleFloat 6s ease-in-out infinite;
}

/* Efecto de brillo energético (Opción 4) */
.continue-story::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 50%),
        radial-gradient(circle at 70% 70%,
            rgba(255, 147, 107, 0.1) 0%,
            transparent 50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    animation: energyPulse 3s ease-in-out infinite;
}

/* Efecto de barrido luminoso (Opción 3) */
.continue-story::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.7s ease;
}

.continue-story:hover::after {
    left: 100%;
}

.continue-story:hover {
    /* Transformaciones 3D (Opción 3) */
    transform: translateY(-4px) rotateX(3deg) rotateY(2deg) scale(1.08);

    /* Gradiente mejorado (Opción 1) */
    background: linear-gradient(135deg, #5a3215, #89692d, #6d3b1b);
    background-size: 200% 200%;

    /* Efectos visuales mejorados */
    border: 2px solid #d9b863;
    box-shadow:
        0 12px 30px rgba(255, 181, 107, 0.8),
        0 0 0 3px rgba(201, 217, 99, 0.4),
        inset 0 0 25px rgba(255, 255, 255, 0.1);

    /* Texto más brillante */
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 218, 107, 0.6);

    /* Animaciones más rápidas al hover */
    animation:
        gradientShift 2s ease infinite,
        gentlePulseOrange 1.5s ease-in-out infinite,
        subtleFloat 3s ease-in-out infinite;

    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.continue-story:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(255, 208, 107, 0.6),
        0 0 0 2px rgba(217, 142, 99, 0.3);
    transition: all 0.1s ease;
}

@keyframes gentlePulseOrange {

    0%,
    100% {
        box-shadow: 0 4px 10px rgba(255, 164, 107, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 188, 107, 0.7);
    }
}

/* @media (max-width: 1000px) {
    .wrap {
        grid-template-columns: 1fr 30em;
        height: 100vh;
        padding: 0;
        gap: 10px;
    }
} */

/* Estilos para la tienda */
.shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: inherit;
}

.payment-content {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #4cc9f0;
    max-width: 500px;
    width: 90%;
    color: white;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #4cc9f0;
    padding-bottom: 10px;
}

.payment-info {
    margin-bottom: 20px;
}

.payment-info p {
    margin: 5px 0;
}

.payment-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.payment-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#confirmPayment {
    background: #4cc9f0;
    color: white;
}

#confirmPayment:hover {
    background: #3aa8c9;
}

#cancelPayment {
    background: #ff6b6b;
    color: white;
}

#cancelPayment:hover {
    background: #e55a5a;
}

/* Estilos para elementos de Stripe */
.StripeElement {
    padding: 10px;
    border: 1px solid #4cc9f0;
    border-radius: 5px;
    background: #0f3460;
    margin-bottom: 10px;
}

/* Añade esto a tu style.css */
.skip-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffa500;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
    border: 1px solid #ffa500;
}

.skip-button {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: black;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
}

.skip-button:hover {
    background: linear-gradient(135deg, #ff8c00, #ff6b00);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .wrap {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 50vh;
        height: 100vh;
        padding: 0;
        gap: 0;
    }

    .stat-image {
        display: none;
    }

    .console {
        min-height: 50vh;
        max-height: 50vh;
        height: 50vh;
        padding: 10px;
        border-radius: 0;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .hud {
        order: 2;
        width: 100%;
        min-height: 50vh;
        max-height: 50vh;
        height: 50vh;
        padding: 10px;
        font-size: 0.85rem;
        border-radius: 0;
    }

    .action-btn {
        flex: 1 1 100%;
        font-size: 1rem;
        padding: 6px 8px;
    }

    .action-bucket {
        flex-direction: column;
        gap: 4px;
    }

    .line {
        font-size: 0.9rem;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .font-toggle-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 1rem;
    }

    .promo-toggle-btn {
        top: 10px;
        right: 60px;
        color: #e0e0e0;
        padding: 4px 10px;
    }

    .font-selector {
        top: 50px;
        right: 10px;
        min-width: 180px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .wrap {
        grid-template-rows: 40vh 60vh;
    }

    .console {
        min-height: 40vh;
        max-height: 40vh;
        height: 40vh;
        padding: 8px 15px 15px 15px;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .hud {
        font-size: 0.75rem;
        min-height: 60vh;
        height: 60vh;
        padding: 8px;
    }

    #name {
        font-size: 18px;
    }

    .small,
    .hint {
        font-size: 0.7rem;
    }

    .action-btn {
        font-size: 1rem;
        padding: 10px;
    }

    .big-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    .action-bucket {
        gap: 3px;
    }

    .footer {
        font-size: 0.7rem;
    }

    .console::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .line .time {
        font-size: 0.7em;
    }

    .important-badge {
        padding: 4px 4px;
    }
}

/* Optimizaciones de rendimiento para animaciones */
@media (prefers-reduced-motion: reduce) {

    .color-danger,
    .color-gold,
    .color-accent,
    .color-info,
    .color-warning,
    .color-purple,
    .color-legendary,
    .rarity-epic,
    .rarity-rare,
    .rarity-uncommon,
    .rarity-common,
    #hp,
    #atk,
    #def,
    #gold,
    .line,
    .line.sys,
    .line.important,
    .line.combat,
    .line.damage,
    .line.heal {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Suavizar las animaciones para móviles */
@media (max-width: 600px) {

    .color-danger,
    .color-gold,
    .color-accent,
    .color-info,
    .color-warning,
    .color-purple,
    .color-legendary {
        animation-duration: 1.5s !important;
    }
}

/* Responsive - mismo layout para todas las resoluciones */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-header,
    .stat-value {
        padding: 6px 3px;
    }

    .stat-value {
        font-size: 0.8rem;
    }

    .stat {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 4px;
    }

    .stat-name {
        text-align: left;
    }

    .extra-stats {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-header {
        font-size: 0.7rem;
        padding: 5px 2px;
    }

    .stat-value {
        font-size: 0.75rem;
        padding: 7px 2px;
    }

    .stat {
        justify-content: center;
        align-items: center;
    }

    .extra-stats {
        gap: 10px;
    }

    .stat-group {
        height: 30px;
        margin: 0;
        padding: 0px 5px;
        align-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        gap: 10px;
    }

    .stat-name {
        display: none;
    }
}

@media (max-width: 600px) {
    .popup-content {
        padding: 20px;
        margin: 10px;
    }

    .popup-title {
        font-size: 1.8rem;
    }

    .popup-subtitle {
        font-size: 1rem;
    }

    .start-button {
        padding: 12px 20px;
        font-size: 1.1rem;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .promo-toggle-btn {
        top: 55px;
        right: 10px;
        padding: 6px 10px;
        font-size: 1rem;
    }

    .promo-modal-content {
        width: 95%;
        margin: 10px;
    }

    .promo-header h2 {
        font-size: 1.1rem;
    }

    .promo-body {
        padding: 15px;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .patch-toggle-btn {
        top: 105px;
        right: 12px;
        padding: 6px 10px;
        font-size: 1rem;
        width: 40px;
        height: 40px;
    }

    .patch-notification-badge {
        width: 15px;
        height: 15px;
        top: -3px;
        right: -3px;
        background: #ff4444;
        color: white;
        border-radius: 50%;
        font-size: 12px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        animation: pulse 2s infinite;
    }

    .patch-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 70vh;
    }

    .patch-version-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .patch-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .audio-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        font-size: 0.7rem;
    }

    .audio-control-group {
        flex-wrap: wrap;
    }

    .patch-features ul {
        font-size: 0.6rem;
    }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .wrap {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 50vh;
        height: 100vh;
        padding: 0;
        gap: 0;
    }

    .console {
        min-height: 50vh;
        max-height: 50vh;
        height: 50vh;
        padding: 10px;
        border-radius: 0;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .hud {
        order: 2;
        width: 100%;
        min-height: 50vh;
        max-height: 50vh;
        height: 60vh;
        padding: 10px;
        font-size: 0.85rem;
        border-radius: 0;
    }

    .action-btn {
        flex: 1 1 100%;
        font-size: 1rem;
        padding: 6px 8px;
    }

    .action-bucket {
        flex-direction: column;
        gap: 4px;
    }

    .line {
        font-size: 0.9rem;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .font-toggle-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 1rem;
    }

    .promo-toggle-btn {
        top: 10px;
        right: 60px;
        color: #e0e0e0;
        padding: 4px 10px;
    }

    .save-manager-toggle-btn {
        top: 10px;
        right: 115px;
        color: #e0e0e0;
        padding: 4px 10px;
    }

    .font-selector {
        top: 50px;
        right: 10px;
        min-width: 180px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .wrap {
        grid-template-rows: 40vh 60vh;
    }

    .console {
        min-height: 40vh;
        max-height: 40vh;
        height: 40vh;
        padding: 8px 15px 15px 15px;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .hud {
        font-size: 0.75rem;
        min-height: 60vh;
        height: 60vh;
        padding: 8px;
    }

    #name {
        font-size: 18px;
    }

    .small,
    .hint {
        font-size: 0.7rem;
    }

    .action-btn {
        font-size: 1rem;
        padding: 10px;
    }

    .big-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    .action-bucket {
        gap: 3px;
    }

    .footer {
        font-size: 0.7rem;
    }

    .console::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .line .time {
        font-size: 0.7em;
    }

    .important-badge {
        padding: 4px 4px;
    }
}

/* Optimizaciones de rendimiento para animaciones */
@media (prefers-reduced-motion: reduce) {

    .color-danger,
    .color-gold,
    .color-accent,
    .color-info,
    .color-warning,
    .color-purple,
    .color-legendary,
    .rarity-epic,
    .rarity-rare,
    .rarity-uncommon,
    .rarity-common,
    #hp,
    #atk,
    #def,
    #gold,
    .line,
    .line.sys,
    .line.important,
    .line.combat,
    .line.damage,
    .line.heal {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Suavizar las animaciones para móviles */
@media (max-width: 600px) {

    .color-danger,
    .color-gold,
    .color-accent,
    .color-info,
    .color-warning,
    .color-purple,
    .color-legendary {
        animation-duration: 1.5s !important;
    }
}

/* Responsive - mismo layout para todas las resoluciones */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-header,
    .stat-value {
        padding: 6px 3px;
    }

    .stat-value {
        font-size: 0.8rem;
    }

    .stat {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 4px;
    }

    .stat-name {
        text-align: left;
    }

    .extra-stats {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-header {
        font-size: 0.7rem;
        padding: 5px 2px;
    }

    .stat-value {
        font-size: 0.75rem;
        padding: 7px 2px;
    }

    .stat {
        justify-content: center;
        align-items: center;
    }

    .extra-stats {
        gap: 10px;
    }

    .stat-group {
        height: 30px;
        margin: 0;
        padding: 0px 5px;
        align-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        gap: 10px;
    }

    .stat-name {
        display: none;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .promo-toggle-btn {
        top: 55px;
        right: 10px;
        padding: 6px 10px;
        font-size: 1rem;
    }

    .promo-modal-content {
        width: 95%;
        margin: 10px;
    }

    .promo-header h2 {
        font-size: 1.1rem;
    }

    .promo-body {
        padding: 15px;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .patch-toggle-btn {
        opacity: 0.5;
        top: 11px;
        right: 62px;
        padding: 6px 6px;
        font-size: 0.9rem;
        width: 35px;
        height: 35px;
    }

    .patch-notification-badge {
        width: 15px;
        height: 15px;
        top: -3px;
        right: -3px;
        background: #ff4444;
        color: white;
        border-radius: 50%;
        font-size: 12px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        animation: pulse 2s infinite;
    }

    .patch-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 70vh;
    }

    .patch-version-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .patch-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .audio-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        font-size: 0.7rem;
    }

    .audio-control-group {
        flex-wrap: wrap;
    }

    .patch-features ul {
        font-size: 0.6rem;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .save-manager-toggle-btn {
        top: 100px;
        right: 10px;
        padding: 6px 10px;
        font-size: 1rem;
    }

    .save-manager-content {
        width: 95%;
        margin: 10px;
    }

    .save-manager-header h2 {
        font-size: 1.1rem;
    }

    .save-manager-body {
        padding: 15px;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.save-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2a7a2a;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ====== SISTEMA DE DIFICULTAD UI ====== */
.difficulty-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 155px;
    /* A la izquierda del botón de mazmorras (90px) */
    background: #1a120b;
    border: 2px solid #a6a6a6;
    padding: 8px;
    /* Color plata/neutro */
    border-radius: 100px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.difficulty-toggle-btn:hover {
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.difficulty-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2005;
    /* Por encima de mazmorras */
    backdrop-filter: blur(5px);
}

.difficulty-modal-content {
    width: 90%;
    max-width: 500px;
    background: #151515;
    border: 2px solid #ccc;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    animation: modalSlideIn 0.3s ease-out;
}

.difficulty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #222;
    border-bottom: 1px solid #333;
    border-radius: 24px 24px 0 0;
}

.difficulty-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.2rem;
}

.difficulty-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.difficulty-close-btn:hover {
    color: white;
}

.difficulty-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.difficulty-selector-container {
    margin-bottom: 20px;
}

.difficulty-select {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #444;
    color: white;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
}

.difficulty-description {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #a6a6a6;
    min-height: 80px;
    font-style: italic;
    color: #ccc;
    margin-bottom: 25px;
}

/* Colores dinámicos para la descripción */
.difficulty-description.diff-narrative {
    border-left-color: #4caf50;
}

.difficulty-description.diff-balanced {
    border-left-color: #2196f3;
}

.difficulty-description.diff-hard {
    border-left-color: #ff9800;
}

.difficulty-description.diff-nightmare {
    border-left-color: #f44336;
}

.difficulty-save-btn {
    background: #e0e0e0;
    color: #111;
    border: none;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-save-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== CHARACTER SELECTOR MODAL (Full Screen) ====== */
.character-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    /* Super high Z */
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.char-selector-content {
    width: 90%;
    max-width: 900px;
    height: 80%;
    background: #151515;
    border: 1px solid #333;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 50px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(100, 100, 255, 0.1);
    position: relative;
    padding: 30px;
}

.char-selector-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
}

.char-selector-header h2 {
    font-size: 2rem;
    color: #ffd700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.char-selector-header p {
    color: #888;
    margin-top: 5px;
}

.char-grid {
    display: grid;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    overflow-y: auto;
    padding: 10px;
    flex: 1;
}

.char-card-big {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 250px;
    position: relative;
}

.char-card-big:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffd700;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.char-card-big .char-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.char-card-big .char-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.char-card-big .char-details {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.4;
}

.char-card-big .btn-delete-float {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
}

.char-card-big .btn-delete-float:hover {
    color: #ff4444;
    opacity: 1;
    transform: scale(1.2);
}

.char-selector-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.char-selector-close:hover {
    color: white;
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-align: center;
    color: #666;
    font-size: 1.2rem;
}

/* ====== CHARACTER IMAGE IN SELECTOR ====== */
.char-image-container {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    position: relative;
    border-radius: 50%;
    border: 3px solid #444;
    overflow: hidden;
    background: #000;
    transition: all 0.3s ease;
}

.char-card-big:hover .char-image-container {
    border-color: #ffd700;
    transform: scale(1.05);
}

.char-img-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-role-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    border: 1px solid #666;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ======== PANTALLA DE BIENVENIDA - BOTÓN JUGAR ======== */

#arandor-splash-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 70%, #000 100%);
    opacity: 0;
    filter: brightness(1);
    transition: opacity 0.5s ease;
}

#arandor-splash-screen.active {
    opacity: 1;
    filter: brightness(1);
}

#arandor-splash-screen.splash-fade-out {
    filter: brightness(0);
    transition: opacity 0.4s ease;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.splash-logo {
    width: 400px;
    max-width: 80vw;
    filter: drop-shadow(0 0 30px rgba(25, 0, 200, 0.3));
    animation: splash-logo-float 3s ease-in-out infinite;
}

@keyframes splash-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.splash-play-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 3rem;
    font-family: sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #e8e0ff;
    background: linear-gradient(135deg, #7c4dff 0%, #6a3de8 50%, #5535d4 100%);
    border: 2px solid #7c4dff;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(124, 77, 255, 0.4),
        0 0 60px rgba(124, 77, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    text-transform: uppercase;
    animation: splash-btn-glow 2s ease-in-out infinite;
}

@keyframes splash-btn-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(124, 77, 255, 0.4), 0 0 60px rgba(124, 77, 255, 0.15); }
    50% { box-shadow: 0 0 30px rgba(124, 77, 255, 0.6), 0 0 80px rgba(124, 77, 255, 0.25); }
}

.splash-play-btn:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 35px rgba(124, 77, 255, 0.6),
        0 0 100px rgba(124, 77, 255, 0.3);
    background: linear-gradient(135deg, #9370ff 0%, #7c5af0 50%, #6a48e0 100%);
}

.splash-play-btn:active {
    transform: scale(0.96);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.3);
}

.splash-play-icon {
    width: 50px;
    font-size: 2rem;
}

.splash-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
    animation: splash-hint-pulse 2.5s ease-in-out infinite;
}

@keyframes splash-hint-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ======== PANTALLA DE CARGA - AUDIO PRELOADER ======== */

#arandor-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg,
            #0a0a0f 0%,
            #131320 40%,
            #1a0f1a 70%,
            #0d0d15 100%);
    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
}

#arandor-loading-screen.loading-fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 90%;
    max-width: 480px;
    text-align: center;
}

.loading-logo {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(20, 0, 200, 0.3));
    animation: loadingLogoPulse 3s ease-in-out infinite;
}

@keyframes loadingLogoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(20, 0, 200, 0.3));
    }

    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 30px rgba(20, 0, 200, 0.5));
    }
}

.loading-title {
    margin: 0;
    font-size: 1.3rem;
    color: #e0d8c8;
    font-family: "Cinzel", serif;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loading-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* Barra de progreso */
.loading-progress-container {
    width: 100%;
    margin-top: 8px;
}

.loading-progress-bar {
    position: relative;
    width: 100%;
    height: 18px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.loading-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa, #c084fc);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.loading-progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
            transparent 60%,
            rgba(255, 255, 255, 0.25));
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: progressGlowShimmer 2s ease-in-out infinite;
}

@keyframes progressGlowShimmer {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.loading-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
}

.loading-file-name {
    color: #999;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
}

.loading-percent {
    color: #c084fc;
    font-weight: bold;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
}

.loading-stats {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

.loading-stats span {
    color: #a78bfa;
    font-weight: bold;
}

.loading-tip {
    margin: 0;
    margin-top: 12px;
    font-size: 0.7rem;
    color: #555;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Responsive loading screen */
@media (max-width: 600px) {
    .loading-logo {
        width: 120px;
    }

    .loading-title {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .loading-subtitle {
        font-size: 0.75rem;
    }

    .loading-progress-bar {
        height: 14px;
    }
}


/* ======== SISTEMA DE CINEMÁTICAS ======== */

#cinematic-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: all;
    overflow: hidden;
}

/* Paneles del telón - clip-path diagonal */
.cinematic-curtain {
    position: absolute;
    inset: 0;
    background: #000000;
    will-change: clip-path;
}

/* Panel superior-izquierdo: crece desde esquina top-left */
.cinematic-curtain-tl {
    clip-path: polygon(0 0, 0 0, 0 0);
    z-index: 1;
}

.cinematic-curtain-tl.curtain-closing {
    animation: curtainCloseTL forwards ease-in-out;
}

.cinematic-curtain-tl.curtain-opening {
    animation: curtainOpenTL forwards ease-in-out;
}

/* Panel inferior-derecho: crece desde esquina bottom-right */
.cinematic-curtain-br {
    clip-path: polygon(100% 100%, 100% 100%, 100% 100%);
    z-index: 1;
}

.cinematic-curtain-br.curtain-closing {
    animation: curtainCloseBR forwards ease-in-out;
}

.cinematic-curtain-br.curtain-opening {
    animation: curtainOpenBR forwards ease-in-out;
}

/* Animaciones de CIERRE */
@keyframes curtainCloseTL {
    0% {
        clip-path: polygon(0 0, 0 0, 0 0);
    }

    50% {
        clip-path: polygon(0 0, 100% 0, 0 100%);
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes curtainCloseBR {
    0% {
        clip-path: polygon(100% 100%, 100% 100%, 100% 100%);
    }

    50% {
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Animaciones de APERTURA (inversa) */
@keyframes curtainOpenTL {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    50% {
        clip-path: polygon(0 0, 100% 0, 0 100%);
    }

    100% {
        clip-path: polygon(0 0, 0 0, 0 0);
    }
}

@keyframes curtainOpenBR {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    50% {
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
    }

    100% {
        clip-path: polygon(100% 100%, 100% 100%, 100% 100%);
    }
}

/* Escenario (contenido sobre el telón) */
.cinematic-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    pointer-events: none;
}

/* Texto dramático */
.cinematic-text {
    color: #e8e0d0;
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    text-align: center;
    max-width: 750px;
    line-height: 1.6;
    letter-spacing: 1px;
    white-space: pre-line;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    animation: cinematicFadeIn ease forwards;
    opacity: 0;
}

@keyframes cinematicFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes cinematicFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
        filter: blur(4px);
    }
}

/* Imagen en cinemática */
.cinematic-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: cinematicFadeIn ease forwards;
    opacity: 0;
}

.cinematic-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.cinematic-caption {
    color: #999;
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
    margin: 0;
}

/* Vídeo en cinemática */
.cinematic-video-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    animation: cinematicFadeIn 600ms ease forwards;
    opacity: 0;
    pointer-events: auto;
}

.cinematic-video {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

/* Hint para saltar */
.cinematic-skip-hint {
    position: absolute;
    bottom: 30px;
    right: 40px;
    z-index: 3;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
    transition: opacity 0.5s ease;
    animation: skipHintFadeIn 2s ease forwards;
    opacity: 0;
    pointer-events: none;
}

.cinematic-skip-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: inherit;
}

@keyframes skipHintFadeIn {
    0% {
        opacity: 0;
    }

    70% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Responsive cinemáticas */
@media (max-width: 600px) {
    .cinematic-text {
        font-size: 1.1rem;
        padding: 0 10px;
        letter-spacing: 0;
    }

    .cinematic-stage {
        padding: 20px;
    }

    .cinematic-image {
        max-width: 95%;
    }

    .cinematic-skip-hint {
        bottom: 15px;
        right: 15px;
        font-size: 0.65rem;
    }
}


/* ======== SISTEMA DE MINIJUEGOS ======== */

#minigame-overlay {
    position: fixed;
    inset: 0;
    z-index: 90000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: all;
}

#minigame-overlay.active {
    opacity: 1;
}

/* Header: aviso + timer */
.minigame-header {
    flex-shrink: 0;
    padding: 16px 24px 8px;
    text-align: center;
    transition: opacity 0.4s ease;
}

.minigame-warning {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff4444;
    text-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    margin-bottom: 10px;
    animation: minigameWarningPulse 1s ease-in-out infinite;
}

@keyframes minigameWarningPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.minigame-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.minigame-counter {
    color: #ffd166;
}

.minigame-time {
    color: #e8e0d0;
}

/* Barra de tiempo */
.minigame-timer-bar-container {
    width: 100%;
    max-width: 500px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.minigame-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff9f, #7ec0ff);
    border-radius: 3px;
    transition: width 0.05s linear;
}

.minigame-timer-bar.warning {
    background: linear-gradient(90deg, #ffa500, #ffcc00);
}

.minigame-timer-bar.critical {
    background: linear-gradient(90deg, #ff2222, #ff6644);
    animation: timerCriticalPulse 0.5s ease-in-out infinite;
}

@keyframes timerCriticalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Arena de objetos */
.minigame-arena {
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

/* Objetos flotantes / clickables */
.minigame-object {
    position: absolute;
    cursor: pointer;
    animation: minigameFloat var(--float-duration, 3s) ease-in-out infinite;
    transition: transform 0.15s ease, filter 0.15s ease;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
}

.minigame-object img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(255, 100, 50, 0.4));
    border-radius: 8px;
}

.minigame-sprite {
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(255, 100, 50, 0.4));
    border-radius: 8px;
    background-repeat: no-repeat;
}

.minigame-object:hover {
    transform: scale(1.1);
    filter: brightness(1.3);
}

.minigame-object:active {
    transform: scale(0.95);
}

/* Destrucción al clickar */
.minigame-object.destroyed {
    pointer-events: none;
    animation: minigameDestroy 0.4s ease forwards !important;
}

@keyframes minigameFloat {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-12px) rotate(2deg); }
    75% { transform: translateY(8px) rotate(-2deg); }
}

@keyframes minigameDestroy {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    40% {
        transform: scale(1.4);
        opacity: 0.8;
        filter: brightness(2) saturate(0);
    }
    100% {
        transform: scale(0);
        opacity: 0;
        filter: brightness(3) saturate(0);
    }
}

/* Resultado */
.minigame-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: minigameResultIn 0.5s ease forwards;
    opacity: 0;
}

.minigame-result.success .minigame-result-title {
    color: #00ff9f;
    text-shadow: 0 0 30px rgba(0, 255, 159, 0.5);
}

.minigame-result.failure .minigame-result-title {
    color: #ff4444;
    text-shadow: 0 0 30px rgba(255, 68, 68, 0.5);
}

.minigame-result-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: minigameIconPulse 0.8s ease-in-out infinite;
}

.minigame-result-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.minigame-result-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #999;
}

@keyframes minigameResultIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes minigameIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Responsive minijuegos */
@media (max-width: 600px) {
    .minigame-warning {
        font-size: 1rem;
    }

    .minigame-result-title {
        font-size: 1.6rem;
    }

    .minigame-result-icon {
        font-size: 2.5rem;
    }

    .minigame-header {
        padding: 10px 12px 6px;
    }
}