/* Reset and base styles */
@import url('animations.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #2c3e50;
    color: white;
    overflow: hidden;
}

/* Game Container */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen div {
    text-align: center;
    font-size: 24px;
    color: #fff;
}

/* Canvas */
canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20%;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 100;
    pointer-events: none;
}

.game-message {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    animation: fadeInOut 2s ease-in-out forwards;
}


/* Instructions */
.instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    z-index: 1000;
    transition: opacity 1s ease;
}

.instructions p {
    margin: 10px 0;
    font-size: 18px;
    line-height: 1.5;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
}

.game-over h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #fff;
}

.game-over button {
    padding: 15px 30px;
    font-size: 24px;
    background: #f1c40f;
    color: #2c3e50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-over button:hover {
    transform: scale(1.1);
    background: #f39c12;
}

/* Mineral and Effect Styles */
.mineral {
    font-size: 24px;
    position: absolute;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
}

.effect {
    font-size: 32px;
    line-height: 1;
    text-align: center;
    padding: 10px;
    transform-origin: center;
}

/* Animation Classes */
.effect.coin { animation: coin 1s ease-out forwards; }
.effect.damage { animation: damage 0.5s ease-out forwards; }
.effect.heal { animation: heal 1s ease-out forwards; }
.effect.shield { animation: shield 1s ease-out forwards; }
.effect.buff { animation: buff 0.8s ease-out forwards; }
.effect.sparkle { animation: sparkle 0.8s ease-out forwards; }
.effect.attract { animation: attract 1s ease-out forwards; }

.mineral.float { animation: float 2s ease-in-out infinite; }
.mineral.sparkle { animation: sparkle 1.5s ease-in-out infinite; }
.mineral.mineral-caught { animation: caught 0.5s ease-out forwards; }
.mineral.attract { animation: attractToMagnet 0.5s ease-in-out forwards; }

/* Status Effects Container */
.status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-top: 5px;
}

.status-effect {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    margin: 2px;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in-out;
}

/* Status Effect Colors */
.status-effect.attack { background: rgba(231, 76, 60, 0.7); }
.status-effect.defense { background: rgba(52, 152, 219, 0.7); }
.status-effect.heal { background: rgba(46, 204, 113, 0.7); }
.status-effect.shield { background: rgba(241, 196, 15, 0.7); }

/* Base Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .instructions {
        font-size: 16px;
        padding: 15px;
    }

    .game-over h1 {
        font-size: 36px;
    }

    .game-over button {
        padding: 12px 24px;
        font-size: 20px;
    }

    .status-effect {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .instructions {
        font-size: 14px;
        padding: 10px;
    }

    .game-over h1 {
        font-size: 28px;
    }

    .game-over button {
        padding: 10px 20px;
        font-size: 18px;
    }
}
