
/* カードのスタイル調整 */
.card {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(255, 153, 0, 0.1);
}

.card-header {
    padding: 0.5rem;
    background-color: #ff9900 !important;
}

#toggleFullscreen {
    transition: all 0.3s ease;
}

#toggleFullscreen:hover {
    transform: scale(1.1);
}

/* *********************** モバイル最適化 *********************** */
/* タッチターゲットの最小サイズ確保 */
.btn {
    min-height: 44px; /* iOS推奨のタッチターゲットサイズ */
    min-width: 44px;
}

/* モバイル用のナビゲーションバー */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #ff9900;
    padding: 10px 0;
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-nav .btn {
    flex: 1;
    margin: 0 5px;
    padding: 12px 8px;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* モバイル用のコンテンツエリア調整 */
@media (max-width: 768px) {
    .container.my-5 {
        margin-bottom: 80px !important; /* モバイルナビゲーションの高さ分 */
        padding-bottom: 20px;
    }

    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* デスクトップナビゲーションを非表示 */
    .user-info-container .btn {
        display: none;
    }

    /* ユーザー情報の簡略化 */
    .user-info-container {
        padding: 10px 15px;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin-bottom: 15px;
    }

    .container.my-5 {
        margin-top: 1rem !important;
    }

    /* ボタンサイズの拡大 */
    .grade-btn {
        padding: 1rem;
        min-height: 80px;
        font-size: 1rem;
    }

    .subject-btn {
        padding: 1.5rem 1rem;
        min-height: 100px;
        font-size: 1.1rem;
    }

    /* モーダルサイズの調整 */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    /* 数値入力パッドの調整 */
    .numpad-btn {
        min-height: 50px;
        font-size: 1.2rem;
        margin: 2px;
    }

    /* 問題表示エリアの調整 */
    .problem-container {
        padding: 15px;
        margin: 10px 0;
    }

    /* 単元選択の調整 */
    .unit-item {
        padding: 15px;
        margin: 5px 0;
        min-height: 60px;
    }
}

/* 超小型デバイス対応 */
@media (max-width: 480px) {
    .grade-btn {
        padding: 0.8rem;
        min-height: 70px;
        font-size: 0.9rem;
    }

    .grade-btn i {
        font-size: 1rem;
    }

    .grade-btn span {
        font-size: 0.9rem;
    }

    .subject-btn {
        padding: 1.2rem 0.8rem;
        min-height: 80px;
        font-size: 1rem;
    }

    .mobile-nav .btn {
        padding: 10px 5px;
        font-size: 0.8rem;
    }

    /* カードの余白調整 */
    .card-body {
        padding: 15px;
    }

    /* ボタングループの調整 */
    .btn-group .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* タッチ操作の最適化 */
@media (hover: none) and (pointer: coarse) {
    /* タッチデバイス専用のホバー効果無効化 */
    .grade-btn:hover,
    .subject-btn:hover,
    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    /* タッチフィードバック */
    .grade-btn:active,
    .subject-btn:active,
    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* フェードインアニメーション */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* スムーズなトランジション */
.step-section {
    transition: all 0.3s ease;
}

/* モバイル用のタッチフィードバック強化 */
@media (max-width: 768px) {
    .btn:active {
        transform: scale(0.9);
        transition: transform 0.05s ease;
    }

    /* モバイルでのスクロール最適化 */
    .grade-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* モバイルでのフォーカス表示 */
    .btn:focus {
        outline: 2px solid #ff9900;
        outline-offset: 2px;
    }
}

/* *********************** ユーザー作成 *********************** */
/* ユーザーログインモーダル専用のスタイル */
#userModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#userModal .modal-header {
    padding: 1.5rem;
}

#userModal .form-floating input.form-control {
    border-radius: 10px;
    padding: 1rem 0.75rem;
    height: calc(3.5rem + 2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

#userModal .form-floating input.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.15);
    background-color: #fff;
}

#userModal .btn-primary {
    border-radius: 10px;
    padding: 0.8rem;
    transition: all 0.3s ease;
}

#userModal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.15);
}

#userModal #toggleLoginMode:hover {
    background-color: rgba(13,110,253,0.04);
    border-radius: 10px;
}

/* ユーザーモーダルのアニメーション */
#userModal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

#userModal.show .modal-dialog {
    transform: scale(1);
}

/* Form Floating のラベル調整 */
#userModal .form-floating label {
    padding: 1rem 0.75rem;
}

#userModal .form-floating > .form-control:focus ~ label,
#userModal .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(.85) translateY(-0.75rem) translateX(0.15rem);
    background-color: transparent;
}

#userModal .form-floating > .form-control:focus,
#userModal .form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* 学年選択ボタンのサイズ調整とスタイル改善 */
.grade-btn {
    width: 100%;
    padding: 0.5rem;  /* パディングを小さく */
    margin-bottom: 0.5rem; /* マージンを小さく */
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid #ff9900;
    background-color: white;
    color: #ff9900;
    position: relative;
    overflow: hidden;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;  /* ギャップを小さく */
}

.grade-btn i {
    font-size: 1.2rem;  /* アイコンサイズを小さく */
    margin: 0.1rem;
}

.grade-btn span {
    font-size: 1.1rem;  /* テキストサイズを小さく */
    margin: 0.3rem 0;
}

.grade-btn small {
    font-size: 0.8rem;
    opacity: 0.8;
    color: #ff9900;
}

/* 教科選択ボタン（算数・数学、国語、理科）のスタイル設定 */
.subject-btn {
    padding: 1.2rem 1rem;
    border-color: #ff9900;
    color: #ff9900;
    width: 100%;  /* ボタンの幅を親要素に合わせる */
    min-height: 80px;  /* ボタンの高さを統一 */
    display: flex;  /* Flexboxレイアウトを使用 */
    align-items: center;  /* 垂直方向の中央揃え */
    justify-content: center;  /* 水平方向の中央揃え */
    margin-bottom: 1rem;  /* ボタン間の余白（特にモバイル表示時） */
}

.subject-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #ccc;
    color: #6c757d;
    pointer-events: none;
}

.subject-btn.disabled i {
    color: #6c757d;
}

.subject-btn.disabled small {
    color: #6c757d;
    margin-top: 5px;
}

/* 教科選択ボタン内のアイコン（算数の電卓アイコンなど）のスタイル */
.subject-btn i {
    margin-right: 0.5rem;  /* アイコンとテキストの間隔 */
    font-size: 1.2rem;  /* アイコンサイズ */
}

/* ユーザー情報コンテナの改善 */
.user-info-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(255, 153, 0, 0.1);
    border: 1px solid rgba(255, 153, 0, 0.1);
    position: fixed;  /* 追加：固定位置に */
    top: 0;          /* 追加：上端に配置 */
    left: 0;         /* 追加：左端から */
    right: 0;        /* 追加：右端まで */
    z-index: 1000;   /* 追加：他の要素より前面に */
}

.container.my-5 {
    margin-top: calc(80px) !important;  /* 追加：ユーザー情報の高さ + 余白 */
}

/* バッジのスタイル調整 */
.badge {
    background-color: #ff9900;
    color: white;
}

/* ボタンスタイルの統一 */
.btn-outline-primary {
    color: #ff9900;
    border-color: #ff9900;
}

.btn-outline-primary:hover {
    background-color: #ff9900;
    border-color: #ff9900;
    color: white;
}

.btn-primary {
    background-color: #ff9900;
    border-color: #ff9900;
}

.btn-primary:hover {
    background-color: #e68a00;
    border-color: #e68a00;
}

/* モーダルヘッダーの色調整 */
.modal-header.bg-primary {
    background-color: #ff9900 !important;
}

/* 説明セクションの色調整 */
.explanation {
    background-color: #fff9f0;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border-left: 5px solid #ff9900;
}

/* スクロールバーのカスタマイズ */
.grade-container {
    max-height: 550px;
    overflow-y: auto;
    padding: 15px;
}

.grade-container::-webkit-scrollbar {
    width: 6px;
}

.grade-container::-webkit-scrollbar-track {
    background: #fff9f0;
    border-radius: 3px;
}

.grade-container::-webkit-scrollbar-thumb {
    background: #ff9900;
    border-radius: 3px;
}

/* アニメーションの色調整 */
.points-earned {
    animation: pointsEarned 0.8s ease;
    color: #ff9900;
}

/* ホバーエフェクトの改善 */
.grade-btn:hover {
    transform: translateY(-3px);  /* 上下の動きを小さく */
    box-shadow: 0 8px 15px rgba(255, 153, 0, 0.2);
    background-color: #ff9900;
    color: white;
}

.grade-btn:hover small {
    color: white;
}

/* 教科選択ボタンの調整 */
.subject-btn {
    padding: 1.2rem 1rem;
    border-color: #ff9900;
    color: #ff9900;
}

.subject-btn:hover {
    background-color: #ff9900;
    border-color: #ff9900;
    color: white;
}

/************************ 単元一覧 ************************/
/* 単元リストのスタイル */
.text-bronze {
    color: #CD7F32;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(0,0,0,0.05);
    margin-left: auto;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap; /* 追加: スマホで折り返し */
    font-size: 1rem;
}

.unit-item {
    display: flex;
    justify-content: space-between;  /* 左右の要素を両端に配置 */
    align-items: center;
    padding: 0.75rem 1rem;          /* パディングを追加して余白を確保 */
    width: 100%;                    /* 幅を100%に設定 */
}

.unit-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;                        /* 左側の要素が利用可能なスペースを占有 */
}

/* 右矢印アイコンのスタイル */
.unit-item .fa-chevron-right {
    margin-left: auto;              /* 右端に強制的に配置 */
    color: #6c757d;                /* text-mutedの色を明示的に指定 */
}

/* 王冠アイコンのホバーエフェクト */
.fa-crown {
    transition: transform 0.2s ease;
}

.fa-crown:hover {
    transform: scale(1.2);
}

.achievement-badge {
    margin-left: auto;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unit-info {
    width: 100%;
}

/* 達成バッジのホバーエフェクト */
.achievement-badge:hover {
    background-color: rgba(0,0,0,0.08);
}

/* 手書き文字エリア */

canvas {
    border: 1px solid #ccc; /* キャンバスの境界を表示（デバッグ用） */
}

/* モーダル関連のスタイル */
.modal-header.bg-primary {
    background-color: #ff9900 !important;
}

.problem-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.numpad-container {
    max-width: 100%;
    margin-top: 1rem;
}

.numpad-btn {
    height: 45px;
}

/* 手書きキャンバスのサイズ調整 */
.modal .handwriting-canvas {
    height: 250px;
}

/* 問題コンテナのスタイル */
.problem-container {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125) !important;
    transition: all 0.3s ease;
}

.problem-container:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* モーダル内の問題表示スタイル */
#modal-problem-content {
    font-size: 2.4em;      /* 文字サイズを大きく */
    font-weight: 600;      /* 文字を太く */
    line-height: 1.6;      /* 行間を適度に */
    padding: 1rem;         /* 余白をつける */
    margin-bottom: 1.5rem; /* 下部との間隔 */
    background-color: #f8f9fa; /* 背景色で区別 */
    border-radius: 8px;    /* 角を丸く */
}

/* MathJax数式のスタイル調整 */
#modal-problem-content .MathJax {
    font-size: 120% !important; /* 数式も大きく */
}

/* 問題内容のスタイル */
.problem-content {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* 回答ボタンのスタイル */
.answer-btn {
    min-width: 120px;
    white-space: nowrap;
}

/* 結果エリアのスタイル */
.result-area {
    min-width: 200px;
}

.result-area .alert {
    margin-bottom: 0;
    padding: 0.5rem 1rem;
}

/******************** 数式キーパッド ********************/

/* モーダルのスタイル */
.modal-lg {
    max-width: 900px;
}

/* 数式入力エリアのスタイル調整 */
#math-field {
    min-height: 85px; /* ボタン2つ分の高さに合わせる */
    font-size: 4.5em;
    margin-bottom: 0;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* 入力エリアのボタングループのスタイル */
.input-area .btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* キーパッド全体のレイアウト */
/* 数式キーパッドのボタン基本スタイル */
.numpad-btn {
    min-width: 50px;
    width: 50px;
    height: 50px;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
    text-align: center;  /* テキストを中央揃えに */
}

/* 数字ボタン専用のスタイルも中央揃えを確実にする */
.number-pad .numpad-btn {
    min-width: 60px;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ボタングループ全体も中央揃えに */
.btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* キーパッドセクション内の要素も中央揃えに */
.keypad-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 演算記号・数学記号用スタイル */
.keypad-center .numpad-btn,
.keypad-right .numpad-btn {
    font-size: 1.1em;  /* その他の記号は通常サイズ */
}

/* 新しい4分割レイアウト用のCSSはこれだけで十分 */
.math-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.keypad-section {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.section-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.25rem;
    text-align: center;
}

/* 十字キーパッドのスタイル */
.arrow-pad {
    margin-top: 0.5rem;
}

.arrow-pad .btn-group {
    margin-bottom: 2px;
}

.arrow-pad .numpad-btn {
    margin: 2px;
}

.arrow-pad .d-flex {
    margin-bottom: 2px;
}

/* gap-0クラスの追加 */
.gap-0 {
    gap: 0 !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .math-keypad {
        grid-template-columns: repeat(2, 1fr);
    }

    /* モーダルの高さ制限とスクロール最適化 */
    .modal-dialog {
        max-height: 95vh;
        margin: 10px;
    }

    .modal-body {
        max-height: 75vh;
        overflow-y: auto;
        padding: 15px;
    }

    /* キーパッド全体の高さ制限 */
    .math-keypad {
        max-height: 65vh;
        overflow-y: auto;
        padding: 10px;
    }

        /* キーパッドセクションのナビゲーション改善 */
    .keypad-section {
        position: relative;
        scroll-margin-top: 10px;
    }

    /* セクションラベルの改善 */
    .section-label {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        padding: 8px 0;
        margin-bottom: 8px;
        border-bottom: 2px solid #dee2e6;
        font-weight: bold;
        color: #495057;
    }
}

@media (max-width: 480px) {
    .math-keypad {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* 超小型デバイスでの最適化 */
    .modal-dialog {
        max-height: 98vh;
        margin: 5px;
    }

    .modal-body {
        max-height: 80vh;
        padding: 10px;
    }

    .math-keypad {
        max-height: 70vh;
        padding: 8px;
    }

        /* 超小型デバイスでのナビゲーション改善 */
    .section-label {
        font-size: 0.9rem;
        padding: 6px 0;
    }

        /* スクロール時のスムーズな動作 */
    .math-keypad {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* 超小型デバイスでのキーパッドナビゲーション確保 */
    .keypad-navigation {
        display: block !important;
        visibility: visible !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1060 !important;
    }

    .keypad-navigation .btn {
        font-size: 0.7rem;
        padding: 6px 4px;
        margin: 0 1px;
        flex: 1;
    }

    .keypad-navigation .btn i {
        font-size: 0.8rem;
        margin-right: 2px;
    }
}

/* キーパッドナビゲーションのスタイル（全画面サイズ対応） */
.keypad-navigation {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1060;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 15px;
    display: block !important;
    visibility: visible !important;
}

.keypad-navigation .btn {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0 2px;
}

.keypad-navigation .btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* アイコンの表示を強制（全画面サイズ） */
.keypad-navigation .btn i {
    display: inline-block !important;
    visibility: visible !important;
    font-size: 0.9rem;
    margin-right: 4px;
}

/* レスポンシブ対応の調整 */
@media (max-width: 768px) {
    /* モバイル表示時のサイズ調整 */
    .numpad-btn {
        min-width: 45px;
        width: 45px;
        height: 45px;
    }

    /* モバイル表示時の数字ボタンサイズ */
    .number-pad .numpad-btn {
        min-width: 55px;
        width: 55px;
        height: 55px;
    }

    #math-field {
        min-height: 50px; /* モバイル表示時は高さを調整 */
        margin-bottom: 10px;
    }

    .input-area .btn {
        height: 40px;
        margin-bottom: 5px;
    }

    /* モバイル用キーパッドナビゲーション調整 */
    .keypad-navigation {
        position: sticky;
        top: 0;
        bottom: auto;
        left: auto;
        right: auto;
        background: #fff;
        border-top: none;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 15px;
        padding: 8px 0;
        z-index: 1060;
        box-shadow: none;
    }

    .keypad-navigation .btn {
        font-size: 0.8rem;
        padding: 8px 6px;
        margin: 0 1px;
        flex: 1;
    }

    /* アイコンの表示を強制 */
    .keypad-navigation .btn i {
        display: inline-block !important;
        visibility: visible !important;
        font-size: 0.9rem;
        margin-right: 4px;
    }


}

/******************** 結果画面 **********************/

/* 正解・不正解の背景色 */
.bg-success-light {
    background-color: rgba(25, 135, 84, 0.05) !important;
}

.bg-danger-light {
    background-color: rgba(220, 53, 69, 0.05) !important;
}

/* 問題レビューのスタイル強化 */
.problem-review {
    transition: all 0.3s ease;
}

.problem-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.problem-review .badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.problem-review .answer-content {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 解説エリアのスタイル改善 */
.explanation {
    position: relative;
    background-color: #fff9f0;
}

.explanation h6 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* ポイント獲得表示の強化 */
.points-earned {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fff9f0;
    border-radius: 20px;
    font-size: 1.1rem;
}

.points-earned .fa-trophy {
    font-size: 1.2rem;
}

@media (min-width: 768px) {
  .keypad-navigation {
    display: none !important;
  }
}
@media (max-width: 767.98px) {
  .keypad-navigation {
    display: block !important;
  }
}

@media (max-width: 767.98px) {
  .mobile-nav .mobile-nav-label {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .modal-body {
    overflow-x: hidden;
    max-width: 100vw;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }
  .modal-dialog {
    margin-left: 0;
    margin-right: 0;
    width: 100vw;
    max-width: 100vw;
  }
  .math-keypad, .keypad-section {
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    display: block;
  }
  .keypad-section .btn,
  .math-keypad .btn,
  .numpad-btn {
    font-size: 1.5rem !important;
    padding: 1rem 0 !important;
    min-width: 60px !important;
    min-height: 60px !important;
    width: 100%;
    margin-bottom: 8px;
  }
  .keypad-section .btn-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  /* 結果画面のボタンを縦並び・幅100%に */
  .result-section-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .result-section-buttons .btn {
    width: 100%;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 576px) {
  .achievement-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 0.95rem;
    padding: 0.3rem 0.5rem;
  }
  .achievement-badge .percentage,
  .achievement-badge small,
  .achievement-badge .ms-2 {
    font-size: 0.95rem;
    margin-left: 0;
    margin-right: 0;
  }
  .achievement-badge .ms-2 {
    margin-top: 2px;
  }
  .badge-crown {
    flex-direction: row;
    gap: 0.15rem;
    font-size: 0.98rem;
  }
}

/* タップ時の拡大を防止 */
.math-keypad, .numpad-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  user-select: none;
}

/* ストア関連のスタイル */
.store-item-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.store-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.store-item-card.owned {
    border: 2px solid #28a745;
}

.store-item-card.equipped {
    border: 2px solid #007bff;
    box-shadow: 0 0 15px rgba(0,123,255,0.3);
}

.avatar-icon {
    font-size: 3rem;
    transition: all 0.3s ease;
}

.avatar-icon:hover {
    transform: scale(1.1);
}

.theme-preview {
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
}

.theme-preview:hover {
    transform: scale(1.05);
}

.achievement-icon {
    font-size: 3rem;
    transition: all 0.3s ease;
}

.achievement-icon:hover {
    transform: scale(1.1);
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(400px);
    transition: transform 0.5s ease;
    max-width: 300px;
}

.achievement-notification.show {
    transform: translateX(0);
}

.achievement-notification .achievement-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.achievement-notification .achievement-content h6 {
    margin: 0;
    color: #333;
    font-weight: bold;
}

.achievement-notification .achievement-content p {
    margin: 5px 0;
    color: #666;
}

.achievement-notification .achievement-content small {
    color: #ffc107;
    font-weight: bold;
}

/* ストアタブのスタイル */
#storeTabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

#storeTabs .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

#storeTabs .nav-link.active {
    color: #007bff;
    background-color: #e3f2fd;
    border-bottom: 3px solid #007bff;
}

/* ストアアイテムの価格表示 */
.store-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffc107;
}

.store-price i {
    margin-right: 5px;
}

/* 所持済みバッジ */
.owned-badge {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 未所持バッジ */
.unowned-badge {
    background: #6c757d;
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 統計情報のスタイル */
.stats-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

.stat-item {
    padding: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 2px 0;
}

.stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
}

/* レアリティバッジのスタイル */
.badge.bg-purple {
    background-color: #6f42c1 !important;
    color: white;
}

/* モバイル用ストアボタン */
#mobile-store {
    display: none;
}

@media (max-width: 768px) {
    #mobile-store {
        display: block;
    }

    .achievement-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .achievement-notification.show {
        transform: translateY(0);
    }

    .store-item-card {
        margin-bottom: 15px;
    }

    .avatar-icon, .achievement-icon {
        font-size: 2.5rem;
    }

    .theme-preview {
        height: 50px;
    }
}
