/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Animated background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-10px); }
    50% { transform: translateX(20px) translateY(10px); }
    75% { transform: translateX(-10px) translateY(20px); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.title-icon {
    font-size: 3.5rem;
    animation: gemRotate 3s ease-in-out infinite;
}

@keyframes gemRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.title-subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.8;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Game controls */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.control-group label {
    color: white;
    font-weight: 500;
    margin-right: 10px;
}

.difficulty-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 15px;
    color: white;
    font-family: inherit;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.difficulty-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.difficulty-select option {
    background: #764ba2;
    color: white;
}

.game-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 500;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-game-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    border-radius: 15px;
    padding: 12px 25px;
    color: white;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.new-game-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Game board */
.game-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.game-board {
    display: grid;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.cell {
    width: 30px;
    height: 30px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cell:hover::before {
    left: 100%;
}

.cell:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cell.revealed {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
    color: #333;
    cursor: default;
    transform: scale(0.95);
}

.cell.revealed:hover {
    transform: scale(0.95);
}

.cell.flagged {
    background: linear-gradient(145deg, #ff6b6b, #ff5252);
    color: white;
    animation: flagPulse 1s ease-in-out infinite alternate;
}

@keyframes flagPulse {
    0% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.8); }
}

.cell.mine {
    background: linear-gradient(145deg, #ff4757, #ff3742);
    color: white;
    animation: mineExplode 0.5s ease-out;
}

@keyframes mineExplode {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Number colors */
.cell.revealed.num-1 { color: #2196F3; }
.cell.revealed.num-2 { color: #4CAF50; }
.cell.revealed.num-3 { color: #FF9800; }
.cell.revealed.num-4 { color: #9C27B0; }
.cell.revealed.num-5 { color: #F44336; }
.cell.revealed.num-6 { color: #00BCD4; }
.cell.revealed.num-7 { color: #795548; }
.cell.revealed.num-8 { color: #607D8B; }

/* Game status */
.game-status {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.status-message {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

.status-win {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: winPulse 1s ease-in-out infinite alternate;
}

.status-lose {
    background: linear-gradient(45deg, #F44336, #FF5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: losePulse 1s ease-in-out infinite alternate;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes losePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff, transparent);
    border-radius: 50%;
    animation: particleFloat 3s ease-out forwards;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .title-icon {
        font-size: 2.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .game-board {
        padding: 15px;
    }
} 