* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5em;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.score-label {
    font-size: 1.2em;
    font-weight: 700;
    color: #ffd93d;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 3em;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.per-second {
    font-size: 1.1em;
    color: #6bcf7f;
    font-weight: 700;
}

.game-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.click-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.click-button-container {
    position: relative;
}

.click-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff6b6b, #ee5a24);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(238, 90, 36, 0.5);
    position: relative;
    overflow: hidden;
}

.click-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(238, 90, 36, 0.7);
}

.click-button:active {
    transform: scale(0.95);
}

.click-icon {
    font-size: 4em;
    animation: bounce 2s infinite;
}

.click-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.click-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.click-effect {
    position: absolute;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.5em;
    color: #ffd93d;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.8);
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

.game-tabs {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab-button.active {
    background: linear-gradient(145deg, #4ecdc4, #44a3aa);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.tab-content {
    min-height: 400px;
}

.tab-panel {
    display: none;
}

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

.tab-panel h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #ffd93d;
    text-align: center;
}

.shop-grid, .pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.shop-item, .pet-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.shop-item:hover, .pet-item:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #4ecdc4;
    transform: translateY(-3px);
}

.shop-item.owned, .pet-item.owned {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

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

.item-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #fff;
}

.item-icon {
    font-size: 1.5em;
}

.item-description {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.4;
}

.item-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-effect {
    color: #6bcf7f;
    font-weight: 700;
    font-size: 0.9em;
}

.item-cost {
    font-family: 'Orbitron', monospace;
    color: #ffd93d;
    font-weight: 700;
}

.item-level {
    font-size: 0.8em;
    color: #4ecdc4;
    font-weight: 700;
}

.buy-button {
    width: 100%;
    padding: 8px;
    background: linear-gradient(145deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-button:hover:not(:disabled) {
    background: linear-gradient(145deg, #ee5a24, #ff6b6b);
    transform: translateY(-2px);
}

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

.events-log {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.event-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
    background: rgba(255, 255, 255, 0.1);
}

.event-positive {
    border-left-color: #6bcf7f;
}

.event-negative {
    border-left-color: #ff6b6b;
}

.event-neutral {
    border-left-color: #ffd93d;
}

.event-time {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 5px;
}

.event-description {
    font-size: 0.9em;
    line-height: 1.4;
}

.current-event {
    padding: 20px;
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.3), rgba(78, 205, 196, 0.3));
    border-radius: 15px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 2px solid rgba(78, 205, 196, 0.5);
}

.stat-label {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.8em;
    font-weight: 700;
    color: #ffd93d;
}

.floating-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #4ecdc4;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.notification.success {
    border-left-color: #6bcf7f;
}

.notification.error {
    border-left-color: #ff6b6b;
}

.notification.warning {
    border-left-color: #ffd93d;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive design */
@media (max-width: 1024px) {
    .game-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .score-value {
        font-size: 2.2em;
    }
    
    .click-button {
        width: 140px;
        height: 140px;
    }
    
    .click-icon {
        font-size: 2.5em;
    }
    
    .tab-buttons {
        justify-content: center;
    }
    
    .shop-grid, .pets-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .game-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .tab-button {
        font-size: 0.8em;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .score-value {
        font-size: 2em;
    }
    
    .per-second {
        font-size: 1em;
    }
    
    .click-button {
        width: 120px;
        height: 120px;
    }
    
    .click-icon {
        font-size: 2em;
    }
    
    .click-value {
        font-size: 1.2em;
    }
    
    .tab-buttons {
        gap: 5px;
    }
    
    .tab-button {
        font-size: 0.7em;
        padding: 8px 12px;
    }
    
    .shop-grid, .pets-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .game-tabs {
        padding: 15px;
    }
    
    .tab-panel h2 {
        font-size: 1.4em;
    }
    
    .item-name {
        font-size: 1em;
    }
    
    .item-description {
        font-size: 0.8em;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.4em;
    }
    
    .floating-notifications {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        max-width: none;
        font-size: 0.9em;
    }
}

/* Optimización para dispositivos móviles */
.mobile-device {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-device .click-button {
    cursor: default;
}

.mobile-device .shop-item,
.mobile-device .pet-item {
    cursor: default;
}

.mobile-device .tab-button {
    cursor: default;
}

.mobile-device .buy-button {
    cursor: default;
}

/* Reducción de movimiento para mejor rendimiento */
.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.reduced-motion .click-icon {
    animation: none;
}

/* Optimización para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .click-button {
        transform: scale(1);
    }
    
    .click-button:active {
        transform: scale(0.9);
    }
    
    .shop-item:hover, .pet-item:hover {
        transform: none;
    }
    
    .shop-item:active, .pet-item:active {
        transform: scale(0.98);
    }
    
    .tab-button:hover {
        transform: none;
    }
    
    .buy-button:hover:not(:disabled) {
        transform: none;
    }
    
    .buy-button:active:not(:disabled) {
        transform: scale(0.95);
    }
}

/* Optimización para pantallas táctiles grandes */
@media (min-width: 768px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .click-button {
        width: 180px;
        height: 180px;
    }
    
    .shop-grid, .pets-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}
