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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #fafafa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 300;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.word-pair {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.word-pair::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.word-pair:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.word-pair:hover::before {
    transform: scaleX(1);
}

.word-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.word-item:last-child {
    margin-bottom: 0;
}

.word-item:hover {
    background: #e9ecef;
}

.word {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.reading {
    font-style: italic;
    color: #666 !important;
}

.meaning {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.shuffle-btn, .add-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.shuffle-btn {
    background: #3498db;
    color: white;
}

.shuffle-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.add-btn {
    background: #2ecc71;
    color: white;
}

.add-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.word-pair {
    animation: fadeInUp 0.6s ease forwards;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.quiz-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: fadeInUp 0.6s ease forwards;
}

.quiz-question h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.sentence {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-left: 4px solid #3498db;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-btn {
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'Noto Sans JP', sans-serif;
}

.option-btn:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.option-btn.incorrect {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

.quiz-result {
    background: #e8f5e8;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #27ae60;
    margin-bottom: 1rem;
}

.correct-answer strong {
    font-size: 1.2rem;
    color: #155724;
}

.correct-answer p {
    margin: 0.5rem 0;
    color: #155724;
}

.quiz-hint {
    text-align: center;
}

.hint-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #6c757d;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.hint-btn:hover {
    background: #6c757d;
    color: white;
}

.hint-text {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.word-reference {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.word-reference h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.next-btn, .show-words-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.next-btn {
    background: #3498db;
    color: white;
}

.next-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.show-words-btn {
    background: #95a5a6;
    color: white;
}

.show-words-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .word-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .shuffle-btn, .add-btn {
        width: 100%;
    }
    
    .quiz-card {
        padding: 1.5rem;
    }
    
    .sentence {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .option-btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}