* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

/* Setup Section */
.setup {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.setup-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

label {
    font-weight: 600;
    color: #555;
    min-width: 180px;
}

input[type="file"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    flex: 1;
}

select, button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

select {
    background: #f0f0f0;
    border: 2px solid #ddd;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Timer */
.timer {
    text-align: center;
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

.timer.warning {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Game Area */
.game-area {
    display: none;
}

.columns {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-top: 30px;
}

.column {
    flex: 1;
    max-width: 400px;
}

.column h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Word Items */
.word-item {
    padding: 20px;
    background: #f8f9fa;
    border: 3px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    text-align: center;
    font-weight: 500;
}

.word-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.word-item.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.word-item.matched {
    background: #51cf66;
    border-color: #51cf66;
    color: white;
    animation: matchAnimation 0.5s;
}

.word-item.wrong {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
    animation: wrongAnimation 0.5s;
}

@keyframes matchAnimation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes wrongAnimation {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Stats */
.stats {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    color: #555;
}

.stats span {
    margin: 0 15px;
    font-weight: 600;
}

/* Result */
.result {
    display: none;
    text-align: center;
    padding: 30px;
    background: #51cf66;
    color: white;
    border-radius: 15px;
    margin-top: 20px;
}

.result h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.result button {
    margin-top: 20px;
}

/* Instructions */
.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.instructions ul {
    margin-left: 20px;
}

.instructions li {
    margin: 5px 0;
    color: #555;
}


/* ... código anterior ... */

/* Modal de Erro */
.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.error-modal.show {
    display: flex;
}

.error-modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.error-modal-content h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 28px;
}

.error-modal-content .correct-answer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #51cf66;
}

.error-modal-content .word-pair {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.error-modal-content .word-box {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 20px;
}

.error-modal-content .word-box.english {
    background: #e7f5ff;
    color: #1971c2;
}

.error-modal-content .word-box.portuguese {
    background: #d3f9d8;
    color: #2f9e44;
}

.error-modal-content .arrow {
    font-size: 30px;
    color: #51cf66;
}

.error-modal-content button {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 18px;
}

.error-modal-content .review-info {
    margin-top: 15px;
    color: #868e96;
    font-size: 14px;
}

/* Highlight da resposta correta */
.word-item.highlight-correct {
    background: #ffd43b !important;
    border-color: #ffd43b !important;
    color: #333 !important;
    animation: highlightPulse 1s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Notificação de revisão */
.review-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4c6ef5;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease-out;
    z-index: 999;
    transition: opacity 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Painel de Estatísticas */
.stats-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.stats-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.stats-toggle:hover {
    transform: translateY(-2px);
}

.stats-content {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    overflow-y: auto;
    padding: 30px;
    animation: slideInRight 0.3s ease-out;
}

.stats-content.show {
    display: block;
}

.stats-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.stats-close:hover {
    color: #333;
}

.stats-content h2 {
    margin-bottom: 25px;
    color: #333;
}

.stats-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.stats-section:last-child {
    border-bottom: none;
}

.stats-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Lista de palavras difíceis */
.difficult-words-list {
    max-height: 300px;
    overflow-y: auto;
}

.difficult-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.word-pair-text {
    flex: 1;
}

.word-pair-text .english {
    font-weight: 600;
    color: #1971c2;
}

.word-pair-text .portuguese {
    color: #2f9e44;
    font-size: 14px;
}

.error-badge {
    background: #ff6b6b;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Histórico de sessões */
.sessions-history {
    max-height: 300px;
    overflow-y: auto;
}

.session-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.session-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.session-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.session-stats span {
    margin-right: 10px;
}

.session-stats .correct {
    color: #51cf66;
}

.session-stats .wrong {
    color: #ff6b6b;
}

.session-stats .accuracy {
    color: #667eea;
    font-weight: 600;
}

/* Ações */
.stats-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #f0f0f0;
    color: #333;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e0e0e0;
}

.action-btn.danger {
    background: #ffe0e0;
    color: #c92a2a;
}

.action-btn.danger:hover {
    background: #ffc9c9;
}

/* Responsivo */
@media (max-width: 768px) {
    .stats-content {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}