/* Games Page Specific Styles */

/* Section Lead Text */
.section-lead {
    text-align: center;
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* Logo Link */
.nav-logo a.logo-text {
    text-decoration: none;
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: var(--glow-primary);
    transition: all 0.3s ease;
}

.nav-logo a.logo-text:hover {
    color: var(--accent-color);
    text-shadow: var(--glow-accent);
}

/* Hero Section */
.games-hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 2rem 60px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    position: relative;
}

.games-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 0, 64, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.games-hero .hero-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: var(--glow-primary);
    margin-bottom: 1rem;
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

.games-hero .hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.game-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
}

.game-stats .stat {
    text-align: center;
}

.game-stats .stat-value {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: var(--glow-accent);
}

.game-stats .stat-label {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Game Card */
.game-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 64, 0.1), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-primary);
    border-color: var(--accent-color);
}

.game-card.wide-card {
    grid-column: span 2;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.game-header h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0;
}

.game-badge {
    background: rgba(255, 0, 64, 0.2);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    border: 1px solid var(--accent-color);
}

.game-preview {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 0, 64, 0.3);
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.game-preview canvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.game-score {
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-color);
    font-size: 0.95rem;
    margin: 0;
}

.game-instructions {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Grid Games (2048, Minesweeper, etc.) */
.grid-game {
    display: grid;
    gap: 4px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* 2048 Specific */
#game2048 {
    grid-template-columns: repeat(4, 60px);
    grid-template-rows: repeat(4, 60px);
}

#game2048 .tile {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

/* Minesweeper Specific */
#minesweeperGame {
    grid-template-columns: repeat(9, 28px);
    grid-template-rows: repeat(9, 28px);
}

#minesweeperGame .cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 0, 64, 0.2);
    border: 1px solid rgba(255, 0, 64, 0.4);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#minesweeperGame .cell:hover {
    background: rgba(255, 0, 64, 0.4);
}

#minesweeperGame .cell.revealed {
    background: rgba(0, 0, 0, 0.6);
    cursor: default;
}

#minesweeperGame .cell.mine {
    background: var(--primary-color);
    color: var(--bg-dark);
}

#minesweeperGame .cell.flagged::after {
    content: '🚩';
}

/* Simon Says */
.simon-grid {
    display: grid;
    grid-template-columns: repeat(2, 100px);
    grid-template-rows: repeat(2, 100px);
    gap: 10px;
    padding: 10px;
}

.simon-grid .simon-btn {
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.simon-grid .simon-btn:hover {
    transform: scale(1.05);
}

.simon-grid .simon-btn.active {
    transform: scale(0.95);
    filter: brightness(1.5);
    box-shadow: 0 0 30px currentColor;
}

.simon-grid .simon-btn.red { background: #ff0040; }
.simon-grid .simon-btn.blue { background: #0080ff; }
.simon-grid .simon-btn.green { background: #00ff80; }
.simon-grid .simon-btn.yellow { background: #ffff00; }

/* Wordle */
.wordle-grid {
    display: grid;
    grid-template-rows: repeat(6, 40px);
    gap: 6px;
    padding: 10px;
}

.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    gap: 6px;
}

.wordle-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(255, 0, 64, 0.1);
    border: 2px solid rgba(255, 0, 64, 0.4);
    border-radius: 6px;
    text-transform: uppercase;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.wordle-cell.correct {
    background: #00ff80;
    border-color: #00ff80;
    color: var(--bg-dark);
}

.wordle-cell.present {
    background: #ffff00;
    border-color: #ffff00;
    color: var(--bg-dark);
}

.wordle-cell.absent {
    background: rgba(100, 100, 100, 0.5);
    border-color: rgba(100, 100, 100, 0.5);
}

/* Sudoku */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 30px);
    grid-template-rows: repeat(9, 30px);
    gap: 2px;
    padding: 10px;
}

.sudoku-grid .sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    background: rgba(255, 0, 64, 0.1);
    border: 1px solid rgba(255, 0, 64, 0.3);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sudoku-grid .sudoku-cell:nth-child(3n) {
    border-right: 2px solid var(--primary-color);
}

.sudoku-grid .sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-grid .sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--primary-color);
}

.sudoku-grid .sudoku-cell.fixed {
    color: var(--primary-color);
    font-weight: 700;
}

.sudoku-grid .sudoku-cell.selected {
    background: rgba(255, 0, 64, 0.4);
    box-shadow: var(--glow-primary);
}

.sudoku-grid .sudoku-cell.error {
    background: rgba(255, 0, 0, 0.4);
}

/* Nonogram */
.nonogram-grid {
    display: grid;
    gap: 2px;
    padding: 10px;
}

.nonogram-cell {
    width: 25px;
    height: 25px;
    background: rgba(255, 0, 64, 0.1);
    border: 1px solid rgba(255, 0, 64, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
}

.nonogram-cell.filled {
    background: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

.nonogram-cell.marked {
    background: rgba(100, 100, 100, 0.3);
}

.nonogram-cell.marked::after {
    content: '×';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-size: 1rem;
}

/* Reaction Test */
.reaction-box {
    width: 300px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 64, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    color: var(--text-light);
}

.reaction-box.waiting {
    background: rgba(255, 0, 64, 0.3);
}

.reaction-box.ready {
    background: #00ff80;
    color: var(--bg-dark);
    box-shadow: 0 0 30px #00ff80;
}

.reaction-box.too-early {
    background: #ff0040;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Aim Trainer */
.aim-box {
    width: 350px;
    height: 250px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.aim-target {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, var(--primary-color) 30%, transparent 70%);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    cursor: crosshair;
    animation: pulse-target 0.5s ease infinite;
    box-shadow: 0 0 20px var(--primary-color);
}

@keyframes pulse-target {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Typing Test */
.typing-box {
    width: 100%;
    padding: 1.5rem;
}

.typing-prompt {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 1rem;
    min-height: 80px;
}

.typing-prompt .correct {
    color: #00ff80;
}

.typing-prompt .incorrect {
    color: #ff0040;
    text-decoration: underline;
}

.typing-prompt .current {
    background: rgba(255, 0, 64, 0.3);
    border-bottom: 2px solid var(--primary-color);
}

.typing-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.typing-input:focus {
    box-shadow: var(--glow-primary);
}

.typing-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Whack-a-Mole */
.whack-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 10px;
    padding: 10px;
}

.whack-hole {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 0, 64, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.whack-hole.active {
    background: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-color);
    animation: bug-appear 0.2s ease;
}

.whack-hole.active::after {
    content: '🐛';
}

.whack-hole.hit {
    background: #00ff80;
    box-shadow: 0 0 20px #00ff80;
}

.whack-hole.hit::after {
    content: '💥';
}

@keyframes bug-appear {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 900px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card.wide-card {
        grid-column: span 1;
    }
    
    .games-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-stats .stat-value {
        font-size: 2rem;
    }
    
    .reaction-box {
        width: 100%;
        max-width: 300px;
    }
    
    .aim-box {
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .games-hero {
        padding: 100px 1rem 40px;
        min-height: auto;
    }
    
    .games-hero .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .games-hero .hero-subtitle {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .game-card {
        padding: 1rem;
    }
    
    .game-header h3 {
        font-size: 1.1rem;
    }
    
    .game-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
    
    .game-preview {
        min-height: 150px;
    }
    
    .game-preview canvas {
        max-width: 280px;
        max-height: 200px;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .game-btn {
        width: 100%;
    }
    
    #game2048 {
        grid-template-columns: repeat(4, 50px);
        grid-template-rows: repeat(4, 50px);
    }
    
    #game2048 .tile {
        font-size: 1rem;
    }
    
    #minesweeperGame {
        grid-template-columns: repeat(9, 24px);
        grid-template-rows: repeat(9, 24px);
    }
    
    #minesweeperGame .cell {
        font-size: 0.75rem;
    }
    
    .simon-grid {
        grid-template-columns: repeat(2, 70px);
        grid-template-rows: repeat(2, 70px);
        gap: 8px;
    }
    
    .wordle-row {
        grid-template-columns: repeat(5, 35px);
    }
    
    .wordle-cell {
        font-size: 1rem;
        height: 35px;
    }
    
    .sudoku-grid {
        grid-template-columns: repeat(9, 26px);
        grid-template-rows: repeat(9, 26px);
    }
    
    .sudoku-grid .sudoku-cell {
        font-size: 0.85rem;
    }
    
    .whack-grid {
        grid-template-columns: repeat(3, 60px);
        grid-template-rows: repeat(3, 60px);
        gap: 8px;
    }
    
    .reaction-box {
        width: 100%;
        height: 150px;
        font-size: 1rem;
    }
    
    .aim-box {
        width: 100%;
        height: 200px;
    }
    
    .aim-target {
        width: 35px;
        height: 35px;
    }
    
    .typing-box {
        padding: 1rem;
    }
    
    .typing-prompt {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .typing-input {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        display: none;
    }
    
    header .nav-menu.active {
        display: flex;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(0, 0, 0, 0.95);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 1.5rem;
        z-index: 999;
        overflow-y: auto;
        gap: 0;
    }
    
    header .nav-menu.active li {
        width: 100%;
        text-align: center;
    }
    
    header .nav-menu.active .nav-link {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 0, 64, 0.2);
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .nav-logo a.logo-text {
        font-size: 1.2rem;
    }
}

/* Animations */
@keyframes glow-pulse {
    0% { text-shadow: 0 0 20px var(--primary-color); }
    100% { text-shadow: 0 0 40px var(--primary-color), 0 0 60px var(--accent-color); }
}
