/* ===== COREBALL WIDGET - ESTILOS COMPLETAMENTE AISLADOS ===== */
/* Prefix: cbw- (coreball widget) para evitar conflictos [web:103][web:126] */

.coreball-widget {
    /* Reset específico y aislamiento total */
    all: initial;
    display: block;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 600px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #ffffff;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    border-radius: 8px;
    overflow: hidden;
    /* Prevenir herencia de estilos externos [web:124] */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Reset completo para todos los elementos internos [web:126] */
.coreball-widget *,
.coreball-widget *::before,
.coreball-widget *::after {
    all: unset;
    box-sizing: border-box;
    display: revert;
}

/* Contenedor principal */
.coreball-widget .cbw-main-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    color: #ffffff;
}

/* Pantallas del juego */
.coreball-widget .cbw-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    padding: 20px;
}

.coreball-widget .cbw-hidden {
    display: none !important;
}

/* Tipografía aislada */
.coreball-widget .cbw-title {
    font-family: Arial, sans-serif;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin: 0 0 2rem 0;
    padding: 0;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #667eea; /* Fallback */
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.coreball-widget .cbw-subtitle {
    font-family: Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 0 0 1.5rem 0;
    padding: 0;
    color: #667eea;
}

/* Botones aislados */
.coreball-widget .cbw-button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.coreball-widget .cbw-button {
    display: inline-block;
    padding: 12px 24px;
    margin: 0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: normal;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    white-space: nowrap;
}

.coreball-widget .cbw-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.coreball-widget .cbw-button:active {
    transform: scale(0.98);
}

/* Skins layout */
.coreball-widget .cbw-skins-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 0;
}

.coreball-widget .cbw-skin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.coreball-widget .cbw-skin-card:hover,
.coreball-widget .cbw-skin-card.cbw-selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.coreball-widget .cbw-skin-display {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

.coreball-widget .cbw-skin-classic {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #c23616);
}

.coreball-widget .cbw-skin-neon {
    background: linear-gradient(135deg, #00ff41, #00d4ff, #ff00ff);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.coreball-widget .cbw-skin-galaxy {
    background: linear-gradient(135deg, #4b0082, #8a2be2, #da70d6);
    position: relative;
}

.coreball-widget .cbw-skin-galaxy::before {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

.coreball-widget .cbw-skin-fire {
    background: linear-gradient(135deg, #ff4500, #ff6347, #ffa500);
    animation: cbw-fireGlow 2s ease-in-out infinite alternate;
}

@keyframes cbw-fireGlow {
    from { box-shadow: 0 0 10px rgba(255, 69, 0, 0.5); }
    to { box-shadow: 0 0 25px rgba(255, 69, 0, 0.8); }
}

.coreball-widget .cbw-skin-label {
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    color: #ffffff;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* Logros */
.coreball-widget .cbw-achievements-wrapper {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    max-width: 500px;
    padding: 0 10px;
    margin: 0;
}

.coreball-widget .cbw-achievement-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: none;
}

.coreball-widget .cbw-achievement-item.cbw-unlocked {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
}

.coreball-widget .cbw-achievement-medal {
    font-size: 1.8rem;
    margin: 0 1rem 0 0;
    padding: 0;
}

.coreball-widget .cbw-achievement-info h3 {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    color: #667eea;
    margin: 0 0 0.25rem 0;
    padding: 0;
}

.coreball-widget .cbw-achievement-info p {
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    padding: 0;
}

/* HUD del juego */
.coreball-widget .cbw-hud {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.coreball-widget .cbw-stat {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    margin: 0;
    border-radius: 20px;
    border: none;
    white-space: nowrap;
}

.coreball-widget .cbw-pause {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 8px 12px;
    margin: 0;
    border-radius: 20px;
    cursor: pointer;
}

/* Barra de progreso */
.coreball-widget .cbw-progress {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.coreball-widget .cbw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
    margin: 0;
    padding: 0;
}

/* Canvas */
.coreball-widget .cbw-canvas {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    background: radial-gradient(circle at center, #0a1428, #000612);
    cursor: crosshair;
    margin: 0;
    padding: 0;
    max-width: 100%;
    max-height: calc(200% - 300px);
}

/* Instrucciones */
.coreball-widget .cbw-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 0;
    padding: 0;
    max-width: 80%;
}

/* Overlays */
.coreball-widget .cbw-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 25px;
    margin: 0;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
    max-width: 90%;
}

.coreball-widget .cbw-overlay-title {
    font-family: Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 0 0 1rem 0;
    padding: 0;
}

.coreball-widget .cbw-overlay-text {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

/* Notificaciones */
.coreball-widget .cbw-notification {
    position: fixed;
    top: 80px;
    right: -350px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 8px;
    padding: 0.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: right 0.5s ease;
    z-index: 1001;
    min-width: 250px;
}

.coreball-widget .cbw-notification.cbw-show {
    right: 20px;
}

.coreball-widget .cbw-notification-icon {
    font-size: 1.5rem;
    margin: 0 0.8rem 0 0;
    padding: 0;
}

.coreball-widget .cbw-notification-title {
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffffff;
    margin: 0 0 0.25rem 0;
    padding: 0;
}

.coreball-widget .cbw-notification-desc {
    font-family: Arial, sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    padding: 0;
}

/* Partículas */
.coreball-widget .cbw-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    margin: 0;
    padding: 0;
}

.coreball-widget .cbw-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

/* Animaciones con prefijo */
@keyframes cbw-bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0, 0, 0); }
    40%, 43% { transform: translate3d(0, -20px, 0); }
    70% { transform: translate3d(0, -10px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

@keyframes cbw-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes cbw-explosion {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.coreball-widget .cbw-bounce-animation {
    animation: cbw-bounce 0.6s ease-out;
}

.coreball-widget .cbw-pulse-animation {
    animation: cbw-pulse 0.3s ease-out;
}

.coreball-widget .cbw-explosion-animation {
    animation: cbw-explosion 0.5s ease-out;
}

/* Responsive específico */
@media (max-width: 768px) {
    .coreball-widget .cbw-title {
        font-size: 2rem;
    }
    
    .coreball-widget .cbw-skins-layout {
        gap: 1rem;
    }
    
    .coreball-widget .cbw-skin-display {
        width: 50px;
        height: 50px;
    }
    
    .coreball-widget .cbw-hud {
        gap: 15px;
    }
    
    .coreball-widget .cbw-stat {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .coreball-widget .cbw-progress {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .coreball-widget .cbw-title {
        font-size: 1.5rem;
    }
    
    .coreball-widget .cbw-button {
        min-width: 150px;
        font-size: 14px;
        padding: 10px 18px;
    }
    
    .coreball-widget .cbw-overlay {
        padding: 20px;
        font-size: 16px;
    }
    
    .coreball-widget .cbw-achievements-wrapper {
        max-height: 250px;
    }
}
