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

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 900px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #333;
    font-size: 2em;
    flex-grow: 1;
}

.controls {
    display: flex;
    gap: 10px;
}

.restart-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.restart-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.4);
}

.file-selector {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 30px;
}

.file-selector h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 30px;
}

.file-select {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 3px solid #3498db;
    border-radius: 10px;
    background: white;
    color: #333;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.file-select:hover {
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.file-select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.start-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 50px;
    border-radius: 12px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 10px;
}

.start-btn:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.start-btn:active {
    transform: translateY(-1px);
}

.stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #3498db;
}

.message {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    animation: shake 0.5s;
}

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

.game-board {
    display: flex;
    gap: 30px;
    justify-content: center;
    min-height: 400px;
}

.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
}

.word-btn {
    background: white;
    border: 3px solid #e0e0e0;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.word-btn:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.key-btn {
    background: #3498db;
    color: white;
    border: none;
}

.key-btn:hover {
    background: #2980b9;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.value-btn {
    background: #2c3e50;
    color: white;
    border: none;
}

.value-btn:hover {
    background: #34495e;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
}

.word-btn.selected {
    border: 4px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

.game-over {
    text-align: center;
    padding: 40px;
}

.game-over h2 {
    color: #3498db;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 30px;
}

.play-again-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.play-again-btn:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.hidden {
    display: none;
}

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

    h1 {
        font-size: 1.2em;
    }

    header {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .restart-btn {
        padding: 6px 14px;
        font-size: 0.85em;
    }

    .file-selector {
        padding: 15px 10px;
    }

    .file-selector h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .file-select {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .start-btn {
        font-size: 0.95em;
        padding: 10px 25px;
    }

    .stats {
        padding: 8px;
        gap: 8px;
        margin-bottom: 15px;
    }

    .stat-item {
        min-width: 65px;
    }

    .stat-label {
        font-size: 0.75em;
    }

    .stat-value {
        font-size: 1.2em;
    }

    .message {
        font-size: 1em;
        padding: 10px;
        margin-bottom: 12px;
    }

    .game-board {
        gap: 6px;
        min-height: auto;
    }

    .column {
        max-width: 50%;
        gap: 6px;
    }

    .word-btn-row {
        gap: 3px;
    }

    .speak-btn {
        font-size: 0.85em;
        padding: 0 5px;
        min-width: 30px;
    }

    .word-btn {
        font-size: 0.7em;
        padding: 10px 8px;
        height: auto;
        min-height: 55px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .game-over {
        padding: 25px 10px;
    }

    .game-over h2 {
        font-size: 1.8em;
    }

    .game-over p {
        font-size: 1em;
    }

    .play-again-btn {
        font-size: 0.95em;
        padding: 10px 25px;
    }
}
