/* ========================================
   GAME STYLES (ANAGRAM, TETRIS, MINE SWEEPER)
   ======================================== */

/* ========================================
   ANAGRAM GAME STYLES
   ======================================== */

.scrabble-container {
    padding: 40px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    min-height: 100vh;
}

.scrabble-title {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.letter-count-selector {
    text-align: center;
    margin-bottom: 30px;
}

.letter-count-dropdown {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 10px;
    font-size: 1rem;
    color: #2F4F4F;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-count-dropdown:focus {
    outline: none;
    border-color: #20c997;
    box-shadow: 0 0 10px rgba(32, 201, 151, 0.3);
}

.letter-count-label {
    color: white;
    font-size: 1.2rem;
    margin-right: 10px;
}

.game-controls {
    text-align: center;
    margin-top: 40px;
}

.play-button {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.input-container {
    text-align: center;
}

.word-input {
    width: 50%;
    padding: 15px;
    font-size: 1.1rem;
    border: 3px solid #8B4513;
    border-radius: 10px;
    background: white;
    color: #2F4F4F;
    text-align: center;
}

.word-input:focus {
    outline: none;
    border-color: #20c997;
    box-shadow: 0 0 10px rgba(32, 201, 151, 0.3);
}

.word-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.score-section {
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
}

.score-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.total-score {
    font-size: 2rem;
    font-weight: bold;
    color: #2F4F4F;
    margin-bottom: 10px;
}

.round-score {
    font-size: 1.2rem;
    color: #20c997;
    font-weight: bold;
    margin-bottom: 10px;
}

.message {
    font-size: 1.1rem;
    color: #2F4F4F;
    margin-bottom: 10px;
}

.error-message {
    color: #dc3545;
}

.success-message {
    color: #28a745;
}

.scoring-section {
    margin: 30px auto;
    max-width: 800px;
}

.scoring-header {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.scoring-header:hover {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.scoring-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

.scoring-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.scoring-icon.expanded {
    transform: rotate(180deg);
}

.scoring-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.scoring-content.expanded {
    max-height: 500px;
    padding: 20px;
}

.scoring-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2F4F4F;
    text-align: left;
}

.dealt-tiles-section {
    text-align: center;
    margin: 30px auto;
    max-width: 1200px;
}

.dealt-tiles-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.dealt-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.dealt-tile {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    border: 3px solid #8B4513;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.dealt-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.dealt-tile-letter {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
}

.dealt-tile-points {
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    position: absolute;
    bottom: 5px;
    right: 5px;
}

/* ========================================
   TETRIS GAME STYLES
   ======================================== */

.game-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin: 20px auto;
    max-width: 1200px;
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 250px;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions ul {
    text-align: left;
    color: #2c3e50;
    line-height: 1.6;
}

.instructions li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}



.game-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 200px;
}

.info-section {
    margin-bottom: 20px;
}

.info-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

.control-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.control-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   MINE SWEEPER GAME STYLES
   ======================================== */

.game-container {
    max-width: 100%;
    margin: 50px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

.game-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mine-counter {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e74c3c;
}

.new-game-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    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 20px rgba(0,0,0,0.3);
}

.game-status {
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #27ae60;
    min-width: 120px;
    text-align: center;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
    background: #34495e;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    max-width: 600px;
    margin: 0 auto;
}

.game-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    margin: 20px 0;
}

.cell {
    width: 60px;
    height: 60px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.cell:hover {
    background: #d5dbdb;
    transform: scale(1.05);
}

.cell.covered {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: 2px solid #2c3e50;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.cell.uncovered {
    background: #fff;
    border: 1px solid #bdc3c7;
}

.cell.mine {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
}

.cell.exploded {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
    animation: explode 0.5s ease;
}

.cell.flagged {
    background: #f39c12;
    color: white;
    border: 2px solid #e67e22;
}

.cell.question {
    background: #9b59b6;
    color: white;
    border: 2px solid #8e44ad;
}

.cell.incorrect-flag {
    background: #e74c3c;
    color: white;
    border: 2px solid #c0392b;
}

.number-1 { color: #3498db; }
.number-2 { color: #27ae60; }
.number-3 { color: #e74c3c; }
.number-4 { color: #8e44ad; }
.number-5 { color: #e67e22; }
.number-6 { color: #1abc9c; }
.number-7 { color: #2c3e50; }
.number-8 { color: #95a5a6; }

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.game-over {
    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;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.game-over.win h2 {
    color: #27ae60;
}

.game-over.lose h2 {
    color: #e74c3c;
}

.game-over button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
}

.instructions {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 250px;
    flex-shrink: 0;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.instructions ul {
    text-align: left;
    color: #34495e;
}

.instructions li {
    margin-bottom: 8px;
}

/* ========================================
   RESPONSIVE DESIGN FOR GAMES
   ======================================== */

@media (max-width: 768px) {
    .game-board {
        max-width: 500px;
        gap: 2px;
        padding: 10px;
    }
    
    .cell {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .dealt-tiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }

    .dealt-tile {
        width: 60px;
        height: 60px;
    }

    .dealt-tile-letter {
        font-size: 1.5rem;
    }

    .dealt-tile-points {
        font-size: 0.7rem;
    }

    .scrabble-title, .dealt-tiles-title {
        font-size: 2rem;
    }

    .word-input {
        width: 250px;
    }

    .letter-count-selector {
        margin-bottom: 20px;
    }

    .letter-count-dropdown {
        padding: 8px;
        font-size: 0.9rem;
    }

    .total-score {
        font-size: 1.5rem;
    }

    .round-score {
        font-size: 1rem;
    }

    .message {
        font-size: 1rem;
    }

    .scoring-header {
        padding: 12px 15px;
    }

    .scoring-title {
        font-size: 1.1rem;
    }

    .scoring-icon {
        font-size: 1.3rem;
    }

    .scoring-text {
        font-size: 1rem;
    }


    .game-area {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-info {
        min-width: 150px;
    }

    .info-value {
        font-size: 1.2rem;
    }

    .control-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .instructions {
        max-width: 100%;
        margin: 10px 0;
    }


    .game-controls {
        flex-direction: column;
        gap: 15px;
    }

    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .cell {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .game-board {
        max-width: 350px;
    }

    .instructions {
        min-width: auto;
        width: 100%;
        max-width: 350px;
    }
}


