/* 3D Coconut Cutter - Tropical Theme Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #F0E68C 100%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
}

.coconut-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.coconut-spin {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.coconut-slice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background: #FFD700;
    animation: slice 0.8s ease-in-out infinite alternate;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slice {
    0% { width: 0px; }
    100% { width: 40px; }
}

.loading-content h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-content p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Game UI */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ui-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ui-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.score-display, .combo-display, .level-display, 
.coconuts-display, .fps-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.combo-display {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    animation: comboGlow 0.5s ease-in-out;
}

@keyframes comboGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.label {
    font-weight: bold;
    margin-right: 8px;
    font-size: 0.9em;
}

.value {
    font-size: 1.2em;
    font-weight: bold;
    color: #2C3E50;
}

.combo-display .value {
    color: white;
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.5s ease-out;
}

.start-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

.start-content h1 {
    font-size: 4em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.subtitle {
    font-size: 1.5em;
    margin-bottom: 40px;
    opacity: 0.9;
}

.controls-info {
    margin-bottom: 40px;
    text-align: left;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.key {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
    min-width: 120px;
    text-align: center;
}

.desc {
    font-size: 1.1em;
}

.start-btn, .restart-btn, .menu-btn, .help-btn, .tutorial-btn {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 10px;
}

.start-btn:hover, .restart-btn:hover, .menu-btn:hover, .help-btn:hover, .tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.help-btn {
    background: linear-gradient(45deg, #45B7D1, #96CEB4);
}

.tutorial-btn {
    background: linear-gradient(45deg, #FECA57, #FF9FF3);
}

.start-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2C3E50, #34495E, #7F8C8D);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.game-over-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

.game-over-content h2 {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.final-stats {
    margin-bottom: 40px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.stat .label {
    font-size: 1.1em;
}

.stat .value {
    font-size: 1.3em;
    font-weight: bold;
    color: #F39C12;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pause Screen */
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.pause-content {
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.pause-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: none;
    z-index: 150;
}

.control-hint {
    font-size: 1.1em;
    font-weight: bold;
    color: #2C3E50;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .start-content h1 {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.2em;
    }
    
    .ui-top, .ui-bottom {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .score-display, .combo-display, .level-display, 
    .coconuts-display, .fps-display {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .start-btn, .restart-btn, .menu-btn {
        width: 200px;
        margin: 5px;
    }
}

@media (max-width: 480px) {
    .start-content {
        padding: 20px;
    }
    
    .start-content h1 {
        font-size: 2em;
    }
    
    .control-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .key {
        min-width: auto;
    }
}

/* Canvas Styling */
canvas {
    display: block;
    cursor: crosshair;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

/* Particle Effects */
.particle-burst {
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

.coconut-slice-line {
    position: absolute;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    height: 3px;
    border-radius: 2px;
    box-shadow: 0 0 10px #FFD700;
    pointer-events: none;
    z-index: 50;
    animation: sliceFade 0.5s ease-out forwards;
}

@keyframes sliceFade {
    0% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0); }
}

@keyframes pulse {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(0) scale(1.1); }
    100% { transform: translateX(0) scale(1); }
}

/* Enhanced notification style */
.notification {
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInRight {
    0% { transform: translateX(100%) scale(0.8); opacity: 0; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}