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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #ffffff;
    min-height: 100vh;
    color: #333;
}

/* ハンバーガーメニュー */
.hamburger-menu {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.hamburger-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-content {
    position: absolute;
    top: 50px;
    left: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    display: none;
    overflow: hidden;
}

.menu-content.show {
    display: block;
}

.menu-content a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.menu-content a:hover {
    background-color: #f5f5f5;
}

.menu-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0;
}

/* メインコンテナ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* タイトル */
h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

/* 進捗表示 */
.progress {
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* カード */
.card-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.card {
    width: 100%;
    min-height: 250px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    min-height: 250px;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-front {
    background: #ffffff;
}

.card-back {
    background: #ffffff;
    transform: rotateY(180deg);
}

.card-label {
    position: absolute;
    top: 16px;
    left: 20px;
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
}

.question-text {
    font-size: 1.2rem;
    text-align: center;
    line-height: 1.6;
}

.answer-text {
    font-size: 1.2rem;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 10px;
}

.note-text {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    line-height: 1.5;
    margin-top: 15px;
    font-style: italic;
}

.tap-hint {
    position: absolute;
    bottom: 16px;
    font-size: 0.75rem;
    color: #bbb;
}

/* ナビゲーションボタン */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* コントロールボタン */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    color: #333;
}

.control-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ホーム画面 */
.home-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.home-card {
    display: block;
    padding: 25px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.home-card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.home-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.home-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.home-card-desc {
    font-size: 0.85rem;
    color: #666;
}

/* テストモード共通 */
.score-display {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.test-card {
    width: 100%;
    min-height: 150px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

/* 選択式テスト */
.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.choice-btn {
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    color: #333;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.choice-btn:disabled {
    cursor: default;
}

.choice-btn.correct {
    background: #d4edda;
    color: #155724;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
}

.choice-btn.incorrect {
    background: #f8d7da;
    color: #721c24;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
}

/* 入力式テスト */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.answer-input {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.answer-input:disabled {
    background: #f5f5f5;
}

.submit-btn {
    align-self: center;
    padding: 12px 30px;
}

/* 結果表示 */
.result {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
}

.correct-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
}

.incorrect-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #dc3545;
}

#correct-answer {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #666;
}

/* 最終結果 */
.final-result {
    text-align: center;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.final-result h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#final-score {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .container {
        padding: 70px 15px 30px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .card-face {
        min-height: 200px;
        padding: 25px 20px;
    }

    .question-text,
    .answer-text {
        font-size: 1.1rem;
    }

    .nav-btn {
        width: 45px;
        height: 45px;
    }

    .choices {
        grid-template-columns: 1fr;
    }

    .choice-btn {
        min-height: 50px;
    }

    .home-card {
        padding: 20px;
    }

    .home-card-icon {
        font-size: 1.8rem;
    }
}
