/* ========================================
   BAKUGO CLICKER - STYLE.CSS
   Estilos base del juego
   ======================================== */

/* ========== FONTS (PRIMERO) ========== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');

/* ========== RESET Y BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Bangers', cursive;
    background: #000;
    color: #fff;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ========== FONDO Y OVERLAY ========== */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.3;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(255, 119, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

/* ========== POWER MODE ========== */
.power-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
}

.power-mode.active {
    opacity: 1;
    background: radial-gradient(
        circle at center,
        rgba(255, 119, 0, 0.3) 0%,
        rgba(255, 0, 0, 0.2) 50%,
        transparent 100%
    );
    animation: power-pulse 1s ease-in-out infinite;
}

@keyframes power-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ========== CONTENEDOR DEL JUEGO ========== */
.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 80px 340px 40px 340px;
    overflow: hidden;
}

/* ========== ZONA DE BAKUGO ========== */
.bakugo-zone {
    cursor: pointer;
    transition: transform 0.1s;
    margin-bottom: 15px;
    position: relative;
    z-index: 10;
}

.bakugo-zone:hover {
    transform: scale(1.05);
}

.bakugo-zone:active,
.bakugo-zone.clicking {
    transform: scale(0.95);
}

.bakugo-image {
    width: clamp(180px, 25vw, 280px);
    height: clamp(180px, 25vw, 280px);
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid rgba(255, 119, 0, 0.8);
    box-shadow: 
        0 0 30px rgba(255, 119, 0, 0.8),
        0 0 60px rgba(255, 119, 0, 0.6),
        0 0 90px rgba(255, 119, 0, 0.4),
        inset 0 0 30px rgba(255, 119, 0, 0.3);
    transition: all 0.3s;
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(255, 119, 0, 0.8),
            0 0 60px rgba(255, 119, 0, 0.6),
            0 0 90px rgba(255, 119, 0, 0.4),
            inset 0 0 30px rgba(255, 119, 0, 0.3);
        border-color: rgba(255, 119, 0, 0.8);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(255, 119, 0, 1),
            0 0 80px rgba(255, 119, 0, 0.8),
            0 0 120px rgba(255, 119, 0, 0.6),
            inset 0 0 40px rgba(255, 119, 0, 0.5);
        border-color: rgba(255, 119, 0, 1);
    }
}

.bakugo-zone:hover .bakugo-image {
    transform: scale(1.05);
    box-shadow: 
        0 0 50px rgba(255, 119, 0, 1),
        0 0 100px rgba(255, 119, 0, 0.8),
        0 0 150px rgba(255, 119, 0, 0.6),
        inset 0 0 50px rgba(255, 119, 0, 0.5);
}

.bakugo-zone:active .bakugo-image,
.bakugo-zone.clicking .bakugo-image {
    transform: scale(0.95);
    box-shadow: 
        0 0 60px rgba(255, 119, 0, 1),
        0 0 120px rgba(255, 119, 0, 1),
        0 0 180px rgba(255, 119, 0, 0.8),
        inset 0 0 60px rgba(255, 119, 0, 0.7);
}

/* ========== SECCIÓN DE COMBO ========== */
.combo-section {
    text-align: center;
    margin-bottom: 10px;
    z-index: 10;
}

.combo-display {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 119, 0, 1);
    font-weight: normal;
    letter-spacing: 2px;
}

.combo-bar-container {
    width: clamp(300px, 50vw, 600px);
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 119, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
}

.combo-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ffdd00);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 20px rgba(255, 119, 0, 0.8);
}

/* ========== BOTÓN REINICIAR CENTRO ========== */
.btn-restart-center {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    position: relative;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.5);
    font-weight: normal;
}

.btn-restart-center:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.8);
}

.btn-restart-center:active {
    transform: scale(0.95);
}

/* ========== BANNER PUBLICITARIO LATERAL IZQUIERDO ========== */
.ad-banner-left {
    position: fixed;
    left: 20px;
    top: 100px;
    width: 280px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 2px solid rgba(255, 119, 0, 0.6);
    border-radius: 12px;
    padding: 15px;
    z-index: 900;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.ad-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.ad-banner-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.ad-banner-image {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
}

.ad-banner-image img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-banner-title {
    font-size: 1.3rem;
    color: #ff6b35;
    margin-bottom: 10px;
    text-align: center;
    font-weight: normal;
}

.ad-banner-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin-bottom: 15px;
    text-align: center;
    font-weight: normal;
}

.ad-banner-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

.ad-banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.6);
}

/* ========== PANEL DE STATS LATERAL DERECHO ========== */
.stats-panel-right {
    position: fixed;
    right: 20px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 900;
}

.stat-box-right {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 119, 0, 0.6);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    min-width: 160px;
    backdrop-filter: blur(10px);
}

.stat-label-right {
    font-size: 1.1rem;
    color: #ff6b35;
    margin-bottom: 10px;
    font-weight: normal;
}

.stat-value-right {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 119, 0, 0.8);
    font-weight: normal;
}

/* ========== RÉCORD PERSONAL TOOLTIP ========== */
.personal-record-tooltip {
    position: fixed;
    top: 100px;
    left: 75%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 119, 0, 0.7);
    border-radius: 12px;
    padding: 10px 20px;
    z-index: 950;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.record-content {
    text-align: center;
}

.record-title {
    font-size: 1.2rem;
    color: #ff6b35;
    margin-bottom: 10px;
    font-weight: normal;
}

.record-stats-inline {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.record-stat-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.record-label-inline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: normal;
}

.record-value-inline {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 119, 0, 0.8);
    font-weight: normal;
}

.record-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: rgba(255, 119, 0, 0.7);
    margin-top: 5px;
}

/* ========== PANEL DE STATS INFERIOR (SOLO DESKTOP USADO ANTERIORMENTE) ========== */
.stats-panel {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    border: 2px solid rgba(255, 119, 0, 0.5);
    z-index: 100;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.stat-box {
    text-align: center;
    min-width: 80px;
}

.stat-label {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.stat-value {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 119, 0, 0.8);
}

/* ========== FRASES FLOTANTES ========== */
.phrase {
    position: fixed;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 119, 0, 1),
        0 0 20px rgba(255, 119, 0, 0.8),
        2px 2px 5px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
    animation: float-up 1.5s ease-out forwards;
    font-weight: bold;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* ========== ACHIEVEMENTS ========== */
.achievement {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 119, 0, 0.95));
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 20px 30px;
    z-index: 2000;
    animation: slide-in 0.5s ease-out;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 215, 0, 0.6);
    max-width: 300px;
}

@keyframes slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-title {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.achievement-desc {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.8);
}

/* ========== MODAL DE NIVEL ========== */
.level-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fade-in 0.3s;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 4px solid rgba(255, 119, 0, 0.8);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 119, 0, 0.6);
}

.modal-sparks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    animation: spark-fly 1s ease-out forwards;
}

@keyframes spark-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.modal-explosion {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 20px;
    animation: explosion-bounce 0.6s ease-out;
    position: relative;
    z-index: 2;
}

@keyframes explosion-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.modal-level {
    font-size: 3rem;
    color: #ff6b35;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 119, 0, 1);
    position: relative;
    z-index: 2;
}

.modal-message {
    font-size: 1.5rem;
    color: #f7931e;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.modal-stat {
    background: rgba(255, 119, 0, 0.1);
    border: 2px solid rgba(255, 119, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.modal-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.modal-stat-value {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 119, 0, 0.8);
}

.modal-close-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.modal-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.8);
}

/* ========== PANEL DE STATS MOBILE (NUEVO) ========== */
.stats-panel-mobile {
    display: none;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 119, 0, 0.6);
    border-radius: 12px;
    padding: 8px 15px;
    z-index: 900;
    backdrop-filter: blur(10px);
    width: calc(100% - 20px);
    max-width: 500px;
}

.stats-grid-mobile {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}

.stat-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label-mobile {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
    font-weight: normal;
}

.stat-value-mobile {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 119, 0, 0.8);
    font-weight: normal;
}

/* ========== BANNER MOBILE (NUEVO) ========== */
.ad-banner-mobile {
    display: none;
    position: fixed;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 2px solid rgba(255, 119, 0, 0.6);
    border-radius: 10px;
    padding: 8px 15px;
    z-index: 850;
    width: calc(100% - 20px);
    max-width: 500px;
    text-align: center;
}

.ad-banner-mobile-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 1rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.ad-banner-mobile-text {
    font-size: 0.9rem;
    color: #ff6b35;
    margin-bottom: 5px;
    font-weight: normal;
}

.ad-banner-mobile-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Bangers', cursive;
    font-size: 0.9rem;
    padding: 6px 15px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

/* ========== RESPONSIVE TABLET ========== */
@media (max-width: 1200px) {
    .game-container {
        padding: 120px 20px 80px 20px;
    }

    .ad-banner-left,
    .stats-panel-right {
        display: none;
    }

    .personal-record-tooltip {
        top: 70px;
        width: calc(100% - 40px);
        max-width: 600px;
    }

    .record-stats-inline {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    .game-container {
        padding: 80px 10px 150px;
        justify-content: flex-start;
        padding-top: 80px;
    }

    /* Ocultar elementos laterales desktop */
    .ad-banner-left,
    .stats-panel-right {
        display: none;
    }

    /* Mostrar panel de stats mobile */
    .stats-panel-mobile {
        display: block;
    }

    /* Mostrar banner mobile */
    .ad-banner-mobile {
        display: block;
    }

    /* Récord más compacto */
    .personal-record-tooltip {
        top: 60px;
        padding: 8px 12px;
        width: calc(100% - 20px);
        left: 50%;
    }

    .record-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .record-stats-inline {
        gap: 8px;
    }

    .record-label-inline {
        font-size: 0.7rem;
    }

    .record-value-inline {
        font-size: 1rem;
    }

    .record-arrow {
        display: none;
    }

    /* Bakugo más pequeño en mobile */
    .bakugo-image {
        width: clamp(140px, 35vw, 200px);
        height: clamp(140px, 35vw, 200px);
    }

    /* Combo más compacto */
    .combo-section {
        margin-bottom: 8px;
    }

    .combo-display {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }

    .combo-bar-container {
        width: 90%;
        max-width: 350px;
        height: 16px;
    }

    /* Botón reiniciar más pequeño */
    .btn-restart-center {
        font-size: 1.1rem;
        padding: 10px 25px;
        margin-top: 10px;
    }

    /* Stats panel old (ocultar) */
    .stats-panel {
        display: none;
    }

    .stat-box {
        min-width: 60px;
    }

    /* Achievements más pequeños */
    .achievement {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 15px 20px;
    }

    .achievement-title {
        font-size: 1.2rem;
    }

    .achievement-desc {
        font-size: 0.9rem;
    }

    /* Modal más compacto */
    .modal-content {
        padding: 30px 20px;
    }

    .modal-explosion {
        font-size: 3.5rem;
    }

    .modal-level {
        font-size: 2.2rem;
    }

    .modal-message {
        font-size: 1.2rem;
    }

    .modal-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .modal-stat {
        padding: 10px;
    }

    .modal-stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .combo-display {
        font-size: 1.6rem;
    }

    .modal-explosion {
        font-size: 3rem;
    }

    .modal-level {
        font-size: 2rem;
    }

    .modal-message {
        font-size: 1.1rem;
    }

    .bakugo-image {
        width: 140px;
        height: 140px;
    }
}

/* ========== ACCESIBILIDAD ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== UTILIDADES ========== */
.hidden {
    display: none !important;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ========== SCROLLBAR PERSONALIZADO ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
}