/* Minesweeper Game - Orange/Yellow Theme */

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

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
    --cell-covered: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    --cell-revealed: #FFFFFF;
    --cell-mine: #EF4444;
    --shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 25px rgba(245, 158, 11, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 728px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

header {
    margin-bottom: 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.new-game-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.new-game-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-box {
    background: var(--surface);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    text-align: center;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-left: 5px;
}

.instructions {
    background: var(--surface);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.game-board {
    display: inline-grid;
    gap: 2px;
    background: var(--border-color);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.game-board.easy {
    grid-template-columns: repeat(8, 35px);
}

.game-board.medium {
    grid-template-columns: repeat(12, 35px);
}

.game-board.hard {
    grid-template-columns: repeat(16, 30px);
}

.cell {
    width: 35px;
    height: 35px;
    background: var(--cell-covered);
    border: 2px solid var(--primary-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.game-board.hard .cell {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

.cell:hover:not(.revealed):not(.flagged) {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.cell.revealed {
    background: var(--cell-revealed);
    border-color: var(--border-color);
    cursor: default;
}

.cell.mine {
    background: var(--cell-mine);
    border-color: #DC2626;
}

.cell.mine::after {
    content: "💣";
    font-size: 1.2rem;
}

.cell.flagged {
    background: linear-gradient(135deg, #FED7AA 0%, #FB923C 100%);
}

.cell.flagged::after {
    content: "🚩";
    font-size: 1.2rem;
}

.cell.number-1 { color: #3B82F6; }
.cell.number-2 { color: #10B981; }
.cell.number-3 { color: #EF4444; }
.cell.number-4 { color: #8B5CF6; }
.cell.number-5 { color: #F59E0B; }
.cell.number-6 { color: #06B6D4; }
.cell.number-7 { color: #111827; }
.cell.number-8 { color: #6B7280; }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    border: 3px solid var(--primary-color);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.time-info {
    background: #FEF3C7;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.overlay-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.tips {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.tips h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
}

.tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .difficulty-selector {
        width: 100%;
    }
    
    .difficulty-btn {
        flex: 1;
    }
    
    .new-game-btn {
        width: 100%;
    }
    
    .cell {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .game-board.easy {
        grid-template-columns: repeat(8, 30px);
    }
    
    .game-board.medium {
        grid-template-columns: repeat(12, 30px);
    }
    
    .game-board.hard {
        grid-template-columns: repeat(16, 25px);
    }
    
    .game-board.hard .cell {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
}
