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

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    padding-top: 95px; /* Augmenté de 80px à 95px pour plus d'espace */
}

/* Header fixe */
.header { 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

h1 { 
    color: #667eea; 
    font-size: 20px;
    flex: 1;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.search { 
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
}
.search:focus {
    border-color: #667eea;
}

/* Menu off-canvas */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
}
.overlay.show {
    display: block;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 300;
    transition: left 0.3s ease;
    overflow-y: auto;
}
.sidebar.show {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
}
.sidebar-header p {
    font-size: 14px;
    opacity: 0.9;
}

.menu-section {
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9ff;
}

.menu-item {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #333;
    transition: background 0.2s;
}
.menu-item:hover {
    background: #f8f9ff;
}
.menu-item.active {
    background: #f8f9ff;
    color: #667eea;
    font-weight: 600;
}
.menu-item-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
}

/* Vues */
.view {
    display: none;
}
.view.active {
    display: block;
}

/* Catégories */
.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}
.categories::-webkit-scrollbar {
    display: none;
}
.cat-btn {
    background: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.cat-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.cat-btn:active {
    transform: scale(0.95);
}

/* Mots */
.words {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.word {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}
.word:active { 
    transform: scale(0.95); 
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.freq-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.freq-high { background: #ff4444; }
.freq-medium { background: #ffa726; }
.freq-low { background: #66bb6a; }
.word-fr { 
    font-size: 16px; 
    font-weight: 500; 
    margin-bottom: 8px;
    color: #333;
}
.word-jp { 
    font-size: 20px; 
    color: #667eea; 
    font-weight: 600; 
    margin-bottom: 5px;
}
.word-rom { 
    font-size: 12px; 
    color: #999; 
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal.show { 
    display: flex;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.3s;
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-fr { 
    font-size: 18px; 
    color: #666; 
    margin-bottom: 20px;
}
.modal-jp { 
    font-size: 42px; 
    color: #667eea; 
    font-weight: 600; 
    margin-bottom: 10px;
}
.modal-rom { 
    font-size: 18px; 
    color: #999; 
    font-style: italic; 
    margin-bottom: 15px;
}
.modal-freq {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}
.modal-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-btn:active {
    background: #5568d3;
}

.count {
    color: white;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    opacity: 0.9;
}

/* Quiz styles */
.quiz-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.quiz-game {
    display: block;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}
.quiz-score {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}
.quiz-progress {
    font-size: 14px;
    color: #999;
}
.quiz-question {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}
.quiz-question-text {
    font-size: 32px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
}
.quiz-question-hint {
    font-size: 14px;
    color: #999;
}
.quiz-choices {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
.quiz-choice {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.quiz-choice:active {
    transform: scale(0.98);
}
.quiz-choice.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}
.quiz-choice.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}
.quiz-choice.disabled {
    pointer-events: none;
    opacity: 0.6;
}
.quiz-result {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.quiz-result.correct {
    background: #d4edda;
    color: #155724;
}
.quiz-result.incorrect {
    background: #f8d7da;
    color: #721c24;
}
.quiz-result-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}
.quiz-result-text {
    font-size: 16px;
}
.quiz-next-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}
.quiz-next-btn:active {
    background: #5568d3;
}
.quiz-final {
    text-align: center;
}
.quiz-final-score {
    font-size: 48px;
    color: #667eea;
    font-weight: 600;
    margin: 20px 0;
}
.quiz-final-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}
.quiz-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 5px;
}
