/* 応援キャラクター（talktrainer_school/mascot.py の mascot_img）の見た目 */
.mascot {
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: bottom;
}

/* ふわふわ上下に動かす。「動きを減らす」設定の人には動かさない */
@media (prefers-reduced-motion: no-preference) {
    .mascot-float {
        animation: mascot-float 4s ease-in-out infinite;
    }
}

@keyframes mascot-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* キャラのひとこと（吹き出し）。キャラの横に置く */
.mascot-say {
    position: relative;
    display: inline-block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    text-align: left;
}

/* 画面によっては「.main-content * { padding: 0 }」のように全要素の余白を消す指定があり、
   吹き出しの余白まで消えると、左のしっぽ（::after のひし形）が 1 文字目に重なる（発音記号の一覧で起きていた）。
   そうした指定に負けないよう、詳細度を上げて余白をもう一度指定する */
.mascot-say.mascot-say {
    padding: 8px 14px;
}

.mascot-say::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: translateY(-50%) rotate(45deg);
}

/* ---- 反応（キャラ + 吹き出し）。_mascot_reaction.html ---- */
.mascot-reaction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 16px;
    text-align: left;
}

.mascot-pair {
    display: flex;
    align-items: center;
}

.mascot-pair .mascot + .mascot {
    margin-left: -12px;
}

/* ---- 解放のトースト「図鑑に『…』が入った！」。base.html ---- */
.emoji-toast {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 32px);
    transition: opacity .4s, transform .4s;
}

.emoji-toast.hide {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.emoji-toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .15);
    color: #111827;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
    animation: emoji-toast-in .35s ease-out;
}

.emoji-toast-item:hover {
    background: #f0f9ff;
    color: #111827;
}

.emoji-toast-item small {
    display: block;
    font-weight: 400;
    color: #6b7280;
    font-size: .75rem;
}

@keyframes emoji-toast-in {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to { opacity: 1; transform: none; }
}

/* ---- 表情図鑑（/dex, /characters） ---- */
.dex-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.dex-progress {
    font-weight: 800;
    font-size: 1.1rem;
}

.dex-card {
    border: 1px solid var(--dex-border, #e5e7eb);
    background: var(--dex-bg, #fff);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
}

.dex-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.dex-card-head .dex-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dex-color, #111827);
}

.dex-card-head .dex-verb {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid var(--dex-border, #e5e7eb);
    color: var(--dex-color, #111827);
    margin-left: 6px;
}

.dex-card-head .dex-got {
    margin-left: auto;
    font-size: .85rem;
    color: #6b7280;
    font-weight: 700;
}

.dex-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 480px) {
    .dex-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dex-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
    cursor: pointer;
    font: inherit;
    color: #374151;
    transition: background .15s, transform .1s;
}

.dex-cell:hover {
    background: #fff;
    transform: translateY(-1px);
}

.dex-cell .mascot {
    width: 56px !important;
    height: 56px !important;
}

.dex-cell-label {
    font-size: .7rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* まだ集めていない表情は黒いシルエット（同じ画像を黒塗りにする。talktrainer-speak と同じ見た目） */
.dex-cell.locked .mascot {
    filter: brightness(0);
    opacity: .28;
}

.dex-cell.locked .dex-cell-label {
    color: #9ca3af;
}

.dex-cell.is-new::after {
    content: "NEW";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: .6rem;
    font-weight: 800;
    color: #fff;
    background: #ef4444;
    border-radius: 9999px;
    padding: 1px 6px;
}

.dex-cell {
    position: relative;
}

/* 表情を押したときの大きい表示 */
.dex-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dex-overlay[hidden] {
    display: none;
}

.dex-modal {
    background: #fff;
    border-radius: 24px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
}

.dex-modal .mascot {
    width: 160px !important;
    height: 160px !important;
}

.dex-modal.locked .mascot {
    filter: brightness(0);
    opacity: .3;
}

.dex-modal-name {
    font-weight: 800;
    font-size: 1.15rem;
    margin-top: 8px;
}

.dex-modal-meta {
    color: #6b7280;
    font-size: .8rem;
}

.dex-modal-line {
    margin: 12px 0 0;
    font-size: .95rem;
    line-height: 1.6;
}

/* 紹介ページ（/characters） */
.chars-hero {
    text-align: center;
    padding: 24px 0 8px;
}

.chars-hero .mascot-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
}

.chars-relation {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    max-width: 560px;
    margin: 12px auto 20px;
    text-align: center;
}

.chars-relation .rel-name {
    font-size: .75rem;
    font-weight: 700;
}

.chars-relation .rel-verb {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dex-color, #111827);
}

.chars-relation .rel-arrow {
    color: #9ca3af;
    padding: 0 2px;
}

.chars-profile {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 640px) {
    .chars-profile {
        grid-template-columns: 1fr;
    }
}

.chars-profile dt {
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
}

.chars-profile dd {
    margin: 0 0 8px;
    font-size: .9rem;
    line-height: 1.6;
}

.chars-quote {
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.chars-tagline {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dex-color, #111827);
}

/* トースト（カード型。閉じるまで残る） */
.emoji-toast-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 12px 14px 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    min-width: 260px;
    max-width: 340px;
    animation: emoji-toast-in .35s ease-out;
}

.emoji-toast-title {
    font-weight: 800;
    font-size: .95rem;
    margin-bottom: 6px;
    padding-right: 24px;
}

.emoji-toast-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 700;
    color: #111827;
    padding: 2px 0;
}

.emoji-toast-link {
    display: block;
    margin-top: 8px;
    text-align: center;
    background: #2563eb;
    color: #fff !important;
    font-weight: 700;
    font-size: .9rem;
    border-radius: 10px;
    padding: 8px 12px;
    text-decoration: none;
}

.emoji-toast-link:hover {
    background: #1d4ed8;
}

.emoji-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

/* 問題ページの「正解！／不正解！」の横（macros.html の answer_mascot） */
.mascot-answer {
    margin-left: 12px;
}

@media (max-width: 640px) {
    .mascot-answer {
        margin-left: 0;
        margin-top: 10px;
        flex-basis: 100%;
    }
}

/* 各ページの見出し横の小さいキャラ */
.mascot-page-head {
    justify-content: flex-start;
    margin: 8px 0 12px;
}

/* 連続ログインの節目（student_main_home.html の #streak-overlay） */
.streak-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.streak-card {
    background: #fff;
    border-radius: 28px;
    padding: 28px 22px 22px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
    animation: emoji-toast-in .4s ease-out;
}

.streak-pair {
    justify-content: center;
}

.streak-pair .mascot + .mascot {
    margin-left: -18px;
}

.streak-eyebrow {
    margin-top: 10px;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .2em;
    color: #9ca3af;
}

.streak-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    margin-top: 4px;
}

.streak-line {
    margin: 10px 0 0;
    color: #374151;
    line-height: 1.6;
}

.streak-dex {
    display: inline-block;
    margin-top: 12px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.streak-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

/* エラーページのキャラ */
.mascot-error {
    justify-content: flex-start;
    margin-bottom: 8px;
}

/* ---- コーチマーク（static/js/coachmark.js） ---- */
.cm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1085;
}

.cm-hole {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .6), 0 0 0 3px #fbbf24;
    pointer-events: none;
    transition: top .25s, left .25s, width .25s, height .25s;
}

.cm-overlay .cm-card {
    position: fixed;
    background: #fff;
    border-radius: 18px;
    padding: 14px 16px 12px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .35);
    width: min(360px, calc(100vw - 24px));
    /* 画面より背が高くなったときは、カードの中をスクロールしてボタンまで届くようにする */
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    z-index: 1;
}

.cm-card.cm-center {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .6), 0 18px 50px rgba(15, 23, 42, .35);
}

.cm-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-face {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
}

.cm-step {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #9ca3af;
}

.cm-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
}

.cm-text {
    margin: 10px 0 0;
    font-size: .9rem;
    line-height: 1.65;
    color: #374151;
}

.cm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.cm-btn {
    border: 0;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
}

.cm-btn-primary {
    background: #2563eb;
    color: #fff;
}

.cm-btn-primary:hover {
    background: #1d4ed8;
}

.cm-btn-ghost {
    background: #f3f4f6;
    color: #374151;
}

.cm-hide {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: .75rem;
    color: #6b7280;
    cursor: pointer;
}

.cm-hide input {
    width: 16px;
    height: 16px;
}

/* 操作のデモ（ステップの demo。HTML は coachmark.js の DEMOS）。7 秒でくり返す。
   keys:  → キーが押されると次の単語に、← キーが押されると前の単語に切り替わる（PC）
   swipe: 指が左へ動くと次の単語に、右へ動くと前の単語に切り替わる（スマホ・タブレット）
   下の 2 つのラベルは、いま動いている向きのほうだけ色を付ける */
.cm-demo {
    margin: 10px 0 0;
}

.cm-demo-stage {
    position: relative;
    height: 92px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    overflow: hidden;
}

.cm-demo-track {
    display: flex;
    height: 100%;
    animation: cm-demo-slide 7s ease-in-out infinite;
}

.cm-demo-word {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
}

.cm-demo-word b {
    font-size: 1.2rem;
    line-height: 1.2;
    color: #111827;
}

.cm-demo-ja {
    font-size: .72rem;
    color: #6b7280;
}

.cm-demo-no {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: .68rem;
    font-weight: 800;
    color: #60a5fa;
}

.cm-demo-hand {
    position: absolute;
    left: 66%;
    bottom: 4px;
    margin-left: -11px;
    font-size: 1.4rem;
    line-height: 1;
    color: #1f2937;
    opacity: 0;
    animation: cm-swipe-hand 7s ease-in-out infinite;
}

/* 指先が画面にふれている位置の丸 */
.cm-demo-hand::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 22px;
    height: 22px;
    margin-left: -13px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .25);
}

.cm-demo-hand i {
    position: relative;
}

/* キーボードの ← → キー（keys） */
.cm-demo-keyrow {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 7px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.cm-demo-key {
    width: 38px;
    height: 26px;
    border: 1px solid #cbd5e1;
    border-bottom-width: 3px;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cm-demo-key-next {
    animation: cm-key-next 7s linear infinite;
}

.cm-demo-key-prev {
    animation: cm-key-prev 7s linear infinite;
}

.cm-demo-keys .cm-demo-word {
    padding-bottom: 30px;
}

.cm-demo-caption {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: .75rem;
    font-weight: 700;
    color: #4b5563;
}

.cm-demo-caption span {
    flex: 1 1 0;
    padding: 3px 6px;
    border-radius: 999px;
    background: #f3f4f6;
    text-align: center;
    white-space: nowrap;
}

.cm-demo-cap-next {
    animation: cm-demo-label-next 7s linear infinite;
}

.cm-demo-cap-prev {
    animation: cm-demo-label-prev 7s linear infinite;
}

@keyframes cm-demo-slide {
    0%, 12% { transform: translateX(0); }
    30%, 62% { transform: translateX(-100%); }
    80%, 100% { transform: translateX(0); }
}

@keyframes cm-swipe-hand {
    0% { left: 66%; opacity: 0; }
    8%, 12% { left: 66%; opacity: 1; }
    30% { left: 34%; opacity: 1; }
    38%, 50% { left: 34%; opacity: 0; }
    58%, 62% { left: 34%; opacity: 1; }
    80% { left: 66%; opacity: 1; }
    88%, 100% { left: 66%; opacity: 0; }
}

/* 押されているあいだは青くして、少し沈ませる */
@keyframes cm-key-next {
    0%, 8% { background: #fff; border-color: #cbd5e1; color: #1f2937; transform: translateY(0); }
    10%, 17% { background: #2563eb; border-color: #1d4ed8; color: #fff; transform: translateY(2px); }
    20%, 100% { background: #fff; border-color: #cbd5e1; color: #1f2937; transform: translateY(0); }
}

@keyframes cm-key-prev {
    0%, 58% { background: #fff; border-color: #cbd5e1; color: #1f2937; transform: translateY(0); }
    60%, 67% { background: #2563eb; border-color: #1d4ed8; color: #fff; transform: translateY(2px); }
    70%, 100% { background: #fff; border-color: #cbd5e1; color: #1f2937; transform: translateY(0); }
}

@keyframes cm-demo-label-next {
    0%, 7% { background: #f3f4f6; color: #4b5563; }
    9%, 38% { background: #2563eb; color: #fff; }
    41%, 100% { background: #f3f4f6; color: #4b5563; }
}

@keyframes cm-demo-label-prev {
    0%, 57% { background: #f3f4f6; color: #4b5563; }
    59%, 88% { background: #2563eb; color: #fff; }
    91%, 100% { background: #f3f4f6; color: #4b5563; }
}

/* 縦に短い画面（小さめのスマホ・横向き）では、カードが対象に重ならないよう全体を少し詰める */
@media (max-height: 700px) {
    .cm-overlay .cm-card {
        padding: 10px 14px;
    }

    .cm-face {
        width: 44px;
        height: 44px;
    }

    .cm-text,
    .cm-demo {
        margin-top: 6px;
    }

    .cm-text {
        line-height: 1.5;
    }

    .cm-demo-stage {
        height: 70px;
    }

    .cm-demo-word {
        padding-bottom: 16px;
    }

    .cm-demo-word b {
        font-size: 1.05rem;
    }

    .cm-demo-hand {
        bottom: 2px;
        font-size: 1.15rem;
    }

    .cm-demo-keyrow {
        bottom: 5px;
    }

    .cm-demo-key {
        height: 22px;
    }

    .cm-demo-keys .cm-demo-word {
        padding-bottom: 26px;
    }

    .cm-actions,
    .cm-hide {
        margin-top: 8px;
    }
}

/* 「動きを減らす」設定の人には動かさない（指を中央に置いた絵と、左右のラベルだけを見せる） */
@media (prefers-reduced-motion: reduce) {
    .cm-demo-track,
    .cm-demo-hand,
    .cm-demo-key,
    .cm-demo-cap-next,
    .cm-demo-cap-prev {
        animation: none;
    }

    .cm-demo-hand {
        left: 50%;
        opacity: 1;
    }
}

/* ============================================================
   マイアイコン: ヘッダー右上の自分のアイコンを、表情図鑑で集めた表情に変える
   （ボタンは base.html、選ぶ画面は static/js/my_icon.js が作る）
   ============================================================ */

/* ヘッダーのアイコン。鉛筆の印を右下に重ねるので、丸の外側に枠を持つ */
.my-icon-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.my-icon-avatar {
    display: block;
}

/* キャラの絵のときは背景の色を付けない（絵そのものを見せる）。丸く切り抜くと手や耳が欠けるので、切り抜きもしない */
.my-icon-avatar.is-mascot,
.my-icon-preview.is-mascot {
    background: transparent;
    border-radius: 0;
}

.my-icon-avatar.is-mascot img,
.my-icon-preview.is-mascot img {
    object-fit: contain;
}

.my-icon-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 9999px;
    background: #56a4fb;
    color: #fff;
    border: 2px solid #fff;
}

.my-icon-badge svg {
    width: 10px;
    height: 10px;
}

/* 選ぶ画面を開いている間は、後ろのページをスクロールさせない */
body.my-icon-open {
    overflow: hidden;
}

.my-icon-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(15, 23, 42, .5);
}

.my-icon-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 460px;
    max-height: min(92vh, 760px);
    max-height: min(92dvh, 760px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, .25);
    overflow: hidden;
    color: #1f2937;
    text-align: left;
}

.my-icon-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 6px 18px;
}

.my-icon-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.4;
}

.my-icon-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}

.my-icon-close:hover {
    background: #f3f4f6;
}

.my-icon-close svg {
    width: 18px;
    height: 18px;
}

.my-icon-me {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 18px 14px;
    border-bottom: 1px solid #eef0f4;
}

.my-icon-preview {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 9999px;
    overflow: hidden;
    background: #f3f4f6;
}

.my-icon-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-icon-me-text {
    min-width: 0;
}

.my-icon-user {
    font-weight: 700;
    font-size: .9375rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.my-icon-email {
    font-size: .75rem;
    color: #6b7280;
    overflow-wrap: anywhere;
}

.my-icon-preview-name {
    margin-top: 4px;
    font-size: .8125rem;
    font-weight: 700;
    color: #2563eb;
}

.my-icon-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 18px 16px;
    -webkit-overflow-scrolling: touch;
}

.my-icon-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.my-icon-count {
    font-size: .8125rem;
    font-weight: 700;
    color: #374151;
}

.my-icon-dex-link {
    font-size: .8125rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.my-icon-dex-link::after {
    content: " →";
}

.my-icon-dex-link:hover {
    text-decoration: underline;
}

.my-icon-hint,
.my-icon-status {
    margin: 6px 0 0;
    font-size: .75rem;
    line-height: 1.6;
    color: #6b7280;
}

.my-icon-status {
    padding: 24px 0;
    text-align: center;
    font-size: .8125rem;
}

.my-icon-group {
    margin-top: 14px;
}

.my-icon-group-name {
    margin: 0 0 6px;
    font-size: .8125rem;
    font-weight: 700;
    color: #374151;
}

.my-icon-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 480px) {
    .my-icon-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }
}

.my-icon-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 9999px;
    background: #f3f6fb;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.my-icon-cell img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9999px;
}

.my-icon-cell.is-default img {
    object-fit: cover;
}

.my-icon-cell:not(:disabled):hover {
    background: #e8f2ff;
    transform: translateY(-1px);
}

.my-icon-cell:focus-visible {
    outline: 2px solid #56a4fb;
    outline-offset: 2px;
}

.my-icon-cell.is-selected {
    border-color: #2563eb;
    background: #e8f2ff;
}

/* まだ集めていない表情: 表情図鑑と同じ黒い影（選べない） */
.my-icon-cell.is-locked {
    cursor: default;
    background: #f6f7f9;
}

.my-icon-cell.is-locked img {
    filter: brightness(0);
    opacity: .22;
}

.my-icon-check {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    display: none;
    place-items: center;
    border-radius: 9999px;
    background: #2563eb;
    color: #fff;
    border: 2px solid #fff;
}

.my-icon-check svg {
    width: 11px;
    height: 11px;
}

.my-icon-cell.is-selected .my-icon-check {
    display: grid;
}

.my-icon-foot {
    padding: 10px 18px 14px;
    border-top: 1px solid #eef0f4;
    background: #fff;
}

.my-icon-message {
    margin: 0 0 8px;
    font-size: .8125rem;
    color: #b91c1c;
}

.my-icon-actions {
    display: flex;
    gap: 10px;
}

.my-icon-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.my-icon-btn-ghost {
    background: #fff;
    border-color: #e5e7eb;
    color: #4b5563;
}

.my-icon-btn-ghost:hover {
    background: #f9fafb;
}

.my-icon-btn-primary {
    flex: 1;
    background: #56a4fb;
    color: #fff;
}

.my-icon-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.my-icon-btn-primary:disabled {
    opacity: .45;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .my-icon-cell {
        transition: none;
    }
}
