/* Legacy small-screen overrides removed and replaced with clearer breakpoints below */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Controls Bar */
.game-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.control-group select {
    padding: 8px 15px;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.control-group select:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.3);
}

.start-game-btn {
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

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

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.stat-value {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    min-width: 60px;
    text-align: center;
}

/* Main Game Layout */
.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Left Panel */
.left-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.panel-card h2 {
    color: #667eea;
    font-size: 24px;
    margin: 0 0 10px 0;
    text-align: center;
}

.panel-card h3 {
    color: #667eea;
    font-size: 18px;
    margin: 0 0 15px 0;
}

.game-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid #667eea;
}

/* Middle Panel */
.middle-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-board {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-grid {
    display: grid;
    gap: 3px;
    background: #34495e;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    aspect-ratio: 1;
    max-width: 600px;
    width: 100%;
}

.letter-cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}

.letter-cell:hover {
    transform: scale(1.05);
}

.letter-cell.letter {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

.letter-cell.collected {
    background: linear-gradient(135deg, #56c596 0%, #2ecc71 100%);
    color: white;
}

.letter-cell.collected::after {
    content: '✓';
    position: absolute;
    font-size: 28px;
}

.letter-cell.wrong {
    background: linear-gradient(135deg, #ff7979 0%, #e74c3c 100%);
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Right Panel */
.right-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ad-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

/* Celebration Modal */
.celebration-modal {
    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: 10000;
    animation: fadeIn 0.3s;
}

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

.celebration-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.5s;
}

@keyframes scaleIn {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

.celebration-content h2 {
    color: #667eea;
    font-size: 48px;
    margin: 20px 0;
}

.celebration-content p {
    font-size: 20px;
    color: #666;
    margin: 15px 0;
}

.play-again-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.play-again-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        gap: 16px;
    }

    .left-panel, .right-panel {
        width: 100%;
    }

    .letter-grid {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .stats {
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 10px;
    }

    .control-group, .start-game-btn {
        width: 100%;
    }

    .letter-grid {
        max-width: 100%;
    }

    .letter-cell {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    .middle-panel {
        padding: 12px;
        width: 100%;
        max-width: 100%;
    }

    .letter-grid {
        max-width: 100%;
        width: 100%;
        gap: 2px;
    }

    .letter-cell {
        font-size: 16px;
    }
}