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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

/* Home Page Styles */
.home-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.home-container h1 {
    font-size: 2.5rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.instructions {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.instructions h2 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
    color: #444;
}

.instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.difficulty-selection h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-beginner {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #2c5f2d;
}

.btn-intermediate {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
}

.btn-advanced {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #8b0000;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.level-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.level-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Game Page Styles */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.difficulty-badge {
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: capitalize;
}

.home-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.home-link:hover {
    text-decoration: underline;
}

.score-display {
    display: flex;
    justify-content: space-around;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 30px;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.game-area {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading {
    font-size: 1.2rem;
    color: #667eea;
}

.quiz-content {
    width: 100%;
    text-align: center;
}

.katakana-word {
    font-size: 4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.answer-input {
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

.answer-input:focus {
    border-color: #667eea;
}

.submit-btn {
    padding: 15px;
    font-size: 1.1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #5568d3;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.feedback {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 30px;
}

.feedback.correct {
    color: #22c55e;
    animation: fadeIn 0.3s;
}

.feedback.incorrect {
    color: #ef4444;
    animation: shake 0.5s;
}

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

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

.completion {
    text-align: center;
}

.completion h2 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 20px;
}

.completion-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.completion-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: #667eea;
    color: white;
    padding: 12px 30px;
    font-weight: bold;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 12px 30px;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Responsive Design */
@media (max-width: 600px) {
    .home-container {
        padding: 25px;
    }

    .home-container h1 {
        font-size: 2rem;
    }

    .katakana-word {
        font-size: 3rem;
    }

    .game-container {
        padding: 20px;
    }

    .score-display {
        flex-direction: column;
        gap: 10px;
    }
}
