/* ===================================
   GER-VIN - Minigames Styling
   =================================== */

/* Game Hub */
.games-hub {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.games-header {
    text-align: center;
    margin-bottom: 3rem;
}

.games-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.games-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Game Cards Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.game-card:hover::before {
    opacity: 0.1;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.game-card-content {
    position: relative;
    z-index: 1;
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.game-difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.game-difficulty.easy {
    background: #66bb6a;
    color: white;
}

.game-difficulty.medium {
    background: #ffa726;
    color: white;
}

.game-difficulty.hard {
    background: #ef5350;
    color: white;
}

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.game-title {
    font-size: 2rem;
    color: var(--text-color);
}

.game-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mode-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 12px;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

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

.mode-btn:hover:not(.active) {
    background: var(--border-color);
}

.mode-btn:active {
    transform: scale(0.95);
}

/* Game Board */
.game-board {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-status {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.info-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Connect Four Board */
.connect4-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
}

.connect4-cell {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 50%;
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.connect4-cell:hover:not(.filled) {
    background: var(--border-color);
    transform: scale(1.05);
}

.connect4-cell.filled {
    cursor: default;
}

.connect4-cell.player1 {
    background: #ef5350;
    border-color: #c62828;
}

.connect4-cell.player2 {
    background: #ffd700;
    border-color: #ffa000;
}

/* TicTacToe Board */
.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.tictactoe-cell {
    aspect-ratio: 1;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.tictactoe-cell:hover:not(.filled) {
    background: var(--bg-secondary);
    transform: scale(1.05);
}

.tictactoe-cell.filled {
    cursor: default;
}

/* Memory Board */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: all 0.3s ease;
    position: relative;
}

.memory-card:hover:not(.flipped):not(.matched) {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.memory-card.flipped,
.memory-card.matched {
    background: var(--bg-secondary);
    cursor: default;
}

.memory-card.matched {
    opacity: 0.6;
    border-color: #66bb6a;
}

.memory-card:not(.flipped):not(.matched)::before {
    content: '🍽️';
    font-size: 3rem;
}

/* Hangman */
.hangman-container {
    max-width: 600px;
    margin: 0 auto;
}

.hangman-word {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.hangman-letter {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.hangman-keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
    max-width: 600px;
    margin: 2rem auto;
}

.hangman-key {
    padding: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.hangman-key:hover:not(.used) {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.hangman-key.used {
    opacity: 0.3;
    cursor: default;
}

.hangman-key.correct {
    background: #66bb6a;
    color: white;
    border-color: #43a047;
}

.hangman-key.wrong {
    background: #ef5350;
    color: white;
    border-color: #c62828;
}

.hangman-drawing {
    text-align: center;
    font-size: 6rem;
    margin: 2rem 0;
    min-height: 150px;
}

/* Quiz */
.quiz-question {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.quiz-question h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quiz-option {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-weight: 500;
}

.quiz-option:hover:not(.selected):not(.correct):not(.wrong) {
    background: var(--border-color);
    transform: scale(1.02);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.1);
}

.quiz-option.correct {
    background: #66bb6a;
    color: white;
    border-color: #43a047;
}

.quiz-option.wrong {
    background: #ef5350;
    color: white;
    border-color: #c62828;
}

/* Snake Game */
.snake-canvas {
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    display: block;
    margin: 0 auto;
}

.snake-controls {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 8px;
    justify-content: center;
    margin-top: 2rem;
}

.snake-btn {
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.snake-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.snake-btn:active {
    transform: scale(0.95);
}

/* 2048 Board */
.food2048-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 16px;
}

.food2048-tile {
    aspect-ratio: 1;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color);
}

.food2048-tile.empty {
    opacity: 0.3;
}

.food2048-tile.tile-2 { background: #eee4da; color: #776e65; }
.food2048-tile.tile-4 { background: #ede0c8; color: #776e65; }
.food2048-tile.tile-8 { background: #f2b179; color: white; }
.food2048-tile.tile-16 { background: #f59563; color: white; }
.food2048-tile.tile-32 { background: #f67c5f; color: white; }
.food2048-tile.tile-64 { background: #f65e3b; color: white; }
.food2048-tile.tile-128 { background: #edcf72; color: white; font-size: 2.5rem; }
.food2048-tile.tile-256 { background: #edcc61; color: white; font-size: 2.5rem; }
.food2048-tile.tile-512 { background: #edc850; color: white; font-size: 2.5rem; }
.food2048-tile.tile-1024 { background: #edc53f; color: white; font-size: 2rem; }
.food2048-tile.tile-2048 { background: #edc22e; color: white; font-size: 2rem; }

/* Game Actions */
.game-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.game-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.game-btn-primary {
    background: var(--primary-color);
    color: white;
}

.game-btn-primary:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

.game-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.game-btn-secondary:hover {
    background: var(--border-color);
}

/* Game Over Modal */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.game-over-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease;
}

.game-over-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.game-over-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.game-over-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 1rem 0;
}

/* Leaderboard */
.leaderboard {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.leaderboard h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
}

.leaderboard-item.rank-1 {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-item.rank-2 {
    border-left-color: #c0c0c0;
}

.leaderboard-item.rank-3 {
    border-left-color: #cd7f32;
}

.leaderboard-rank {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    min-width: 40px;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.leaderboard-score {
    font-weight: 700;
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
    .games-header h1 {
        font-size: 2rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .game-controls {
        width: 100%;
        flex-direction: column;
    }

    .mode-selector {
        width: 100%;
    }

    .connect4-board {
        gap: 4px;
    }

    .connect4-cell {
        font-size: 1.5rem;
    }

    .tictactoe-board {
        gap: 4px;
    }

    .tictactoe-cell {
        font-size: 1.5rem;
    }

    .memory-board {
        gap: 8px;
    }

    .memory-card {
        font-size: 2rem;
    }

    .food2048-board {
        gap: 8px;
    }

    .food2048-tile {
        font-size: 2rem;
    }

    .game-over-content {
        padding: 2rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 1rem;
    }

    .game-board {
        padding: 1rem;
    }

    .hangman-keyboard {
        grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
        gap: 4px;
    }

    .hangman-key {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}
