/* Cucumber World RPG Styles */

.cucumber-world-container {
    margin: 3rem 0;
    padding: 0;
    background: linear-gradient(135deg, #a8e6cf, #88d8a3);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.cucumber-world-game {
    width: 100%;
    min-height: 700px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    display: flex;
    flex-direction: column;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #228B22;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-header h2 {
    margin: 0;
    color: #2d5016;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 0;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.cw-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cw-btn:hover {
    background: linear-gradient(145deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.cw-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cw-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    position: relative;
}

#cw-game-canvas {
    border: 3px solid #2F4F2F;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: #87CEEB;
    width: 100%;
    max-width: 1200px;
    height: auto;
    min-height: 600px;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.ui-overlay .clickable {
    pointer-events: auto;
}

.game-footer {
    background: rgba(45, 80, 22, 0.9);
    color: white;
    padding: 1rem;
    text-align: center;
}

.status-bar {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    opacity: 0.8;
}

/* Game intro section */
.rpg-intro {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.rpg-intro h2 {
    color: #2d5016;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #a8e6cf;
    padding-bottom: 0.5rem;
}

.rpg-intro p {
    font-size: 1.2rem;
    color: #4a7c59;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.rpg-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #a8e6cf;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.feature-card .emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #2d5016;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #4a7c59;
    font-size: 0.95rem;
    margin: 0;
}

.start-game-btn {
    background: linear-gradient(145deg, #FF6347, #FF4500);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    margin: 1rem;
}

.start-game-btn:hover {
    background: linear-gradient(145deg, #FF4500, #DC143C);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.start-game-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error states */
.error-message {
    background: #ff6b6b;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: bold;
}

/* Success states */
.success-message {
    background: #51cf66;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: bold;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cucumber-world-container {
        margin: 2rem 0;
    }
    
    .game-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-header h2 {
        font-size: 1.5rem;
    }
    
    .game-content {
        padding: 1rem;
    }
    
    #cw-game-canvas {
        width: 100%;
        max-width: 100%;
        min-height: 400px;
    }
    
    .rpg-intro h2 {
        font-size: 2rem;
    }
    
    .rpg-features {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .start-game-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .game-header h2 {
        font-size: 1.3rem;
    }
    
    .cw-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .rpg-intro {
        padding: 1.5rem;
    }
    
    .rpg-intro h2 {
        font-size: 1.8rem;
    }
    
    .rpg-intro p {
        font-size: 1rem;
    }
}

/* Hide game initially */
.cucumber-world-game.hidden {
    display: none;
}

/* Show loading state */
.cucumber-world-game.loading .game-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}