/* ============================================
   TOMUS - Style CSS
   Thème sombre pour le jeu de lettres
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    color: #4a9eff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

.subtitle {
    color: #aaa;
    font-size: 1.1em;
}

/* ===== GAME INFO ===== */
.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-item .label {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-item span:last-child {
    font-size: 1.3em;
    font-weight: bold;
    color: #4a9eff;
}

/* ===== STATUS MESSAGE ===== */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    animation: fadeIn 0.3s;
}

.status-message.success {
    background: #27ae60;
    color: #fff;
}

.status-message.error {
    background: #e74c3c;
    color: #fff;
}

.status-message.info {
    background: #3498db;
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== GAME GRID ===== */
.game-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.game-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.game-cell {
    width: 60px;
    height: 60px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.game-cell.filled {
    border-color: #666;
    animation: pop 0.2s;
}

.game-cell.correct {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.game-cell.present {
    background: #f39c12;
    border-color: #f39c12;
    color: #fff;
}

.game-cell.absent {
    background: #34495e;
    border-color: #34495e;
    color: #888;
}

.game-cell.current {
    border-color: #4a9eff;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

.game-cell.first-letter {
    background: #1a4a7a;
    border-color: #4a9eff;
    color: #fff;
    font-weight: bold;
    cursor: default;
    opacity: 0.9;
}

.current-word .letter.first-letter {
    background: #1a4a7a;
    border-color: #4a9eff;
    color: #fff;
    font-weight: bold;
    cursor: default;
    opacity: 0.9;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.game-cell.flip {
    animation: flip 0.5s;
}

/* ===== INPUT SECTION ===== */
.input-section {
    margin-bottom: 30px;
}

.current-word {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 60px;
    align-items: center;
}

.current-word .letter {
    width: 50px;
    height: 50px;
    background: #2a2a2a;
    border: 2px solid #4a9eff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.input-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: #4a9eff;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #3a8eef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 158, 255, 0.4);
}

.btn-primary:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #7f8c8d;
    color: #fff;
}

.btn-secondary:hover {
    background: #6c7a7b;
    transform: translateY(-2px);
}

/* ===== VIRTUAL KEYBOARD ===== */
.virtual-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.keyboard-key {
    padding: 12px 16px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    min-width: 40px;
}

.keyboard-key:hover {
    background: #3a3a3a;
    border-color: #666;
}

.keyboard-key.correct {
    background: #27ae60;
    border-color: #27ae60;
}

.keyboard-key.present {
    background: #f39c12;
    border-color: #f39c12;
}

.keyboard-key.absent {
    background: #34495e;
    border-color: #34495e;
    opacity: 0.5;
}

.keyboard-key.wide {
    padding: 12px 24px;
    font-size: 0.9em;
}

/* ===== MODAL ===== */
.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: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
}

.modal-content h2 {
    color: #4a9eff;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #ddd;
}

.result-solution {
    font-size: 2em;
    font-weight: bold;
    color: #27ae60;
    margin: 20px 0;
    padding: 15px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    
    .game-cell {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .current-word .letter {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    
    .keyboard-key {
        padding: 10px 12px;
        font-size: 0.9em;
        min-width: 35px;
    }
}

/* ===== ANIMATIONS ===== */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.win {
    animation: win 0.6s;
}

@keyframes win {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

