@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@400;500;700;800&family=Noto+Sans+TC:wght@400;500;700;800&display=swap');

:root {
    --ink-900: #1c1f26;
    --ink-700: #383f4a;
    --paper: #fffdf7;
    --paper-soft: #fff7ea;
    --momo-yellow: #f4b942;
    --momo-yellow-deep: #d98a1f;
    --momo-blue: #3f8fd1;
    --momo-blue-deep: #1c5d94;
    --momo-ink: #1c1f26;
    --momo-charcoal: #34383f;
    --line-soft: rgba(28, 31, 38, 0.14);
    --profile-panel-bg: rgba(255, 255, 255, 0.8);
    --profile-panel-shadow: 0 10px 24px rgba(57, 71, 88, 0.1);
    --profile-heading-bg: linear-gradient(110deg, #fffdf7, #eef7ff);
    --profile-row-bg: rgba(255, 255, 255, 0.58);
    --profile-row-hover-bg: #ffffff;
    --profile-preview-bg: #fffaf0;
    --profile-unavailable-bg: #f4f5f6;
}

html, body {
    font-family: 'M PLUS 1p', 'Noto Sans TC', sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 230, 196, 0.68) 0%, rgba(255, 230, 196, 0) 40%),
        radial-gradient(circle at 90% 10%, rgba(186, 225, 255, 0.58) 0%, rgba(186, 225, 255, 0) 38%),
        linear-gradient(180deg, #fffefb 0%, #fff9f0 65%, #fff4e8 100%);
    color: var(--ink-900);
    min-height: 100%;
}

h1:focus {
    outline: none;
}

/* ── Game Layout ── */
.home-container,
.quiz-card {
    max-width: 480px;
    margin: 1rem auto;
}

/* ── Player Card ── */
.player-card {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}

.player-card .text-muted { color: #aaa !important; }
.player-card .progress   { background-color: #333; }

.hp-full  { opacity: 1;   font-size: 1.1rem; }
.hp-empty { opacity: 0.2; font-size: 1.1rem; }

/* ── Mode Buttons ── */
.mode-btn {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    background: #fff;
}

.mode-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12) !important; }
.mode-btn:active { transform: translateY(0); }
.mode-locked     { background: #f0f0f0; cursor: not-allowed; }

.mode-icon {
    font-size: 2rem;
    min-width: 2.5rem;
    text-align: center;
}

/* ── HP Exhausted Dialog ── */
.hp-dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}

.hp-dialog {
    max-width: 320px;
    width: 90%;
    border-radius: 16px;
}

/* ── Quiz Card ── */
.quiz-card   { border-radius: 12px; border: none; }
.prompt-box  { padding: 1rem; background: #f0f4ff; border-radius: 8px; }

.grammar-prompt-box {
    border: 1px solid rgba(63, 143, 209, 0.22);
}

.grammar-prompt-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.grammar-prompt-box h5 {
    margin: 0;
    line-height: 1.45;
}

.grammar-pronunciation-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.grammar-pronunciation-btn {
    display: inline-flex;
    width: 30px;
    height: 30px;
    min-height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.grammar-pronunciation-btn > span {
    display: inline-flex;
    line-height: 1;
    transform: translateY(-1px);
}

.grammar-pronunciation-btn-slow > span {
    transform: translateY(-2px);
}

/* ── Dialogue Prompt Styles ── */
.grammar-dialogue-flow {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
}

.grammar-dialogue-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.grammar-speaker-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
}

.grammar-speaker-badge.is-partner {
    background: rgba(100, 116, 139, 0.15);
    color: var(--ink-700);
    border: 1px solid rgba(100, 116, 139, 0.25);
}

.grammar-speaker-badge.is-target {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.grammar-dialogue-text {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink-900);
}

.grammar-dialogue-row.is-target-speaker .grammar-dialogue-text {
    font-weight: 800;
    color: #1d4ed8;
}

.grammar-dialogue-btn {
    margin-left: 0.1rem;
}


.grammar-pronunciation-btn:hover {
    transform: translateY(-1px);
}

.grammar-pronunciation-btn:focus-visible {
    outline: 2px solid #258cfb;
    outline-offset: 2px;
}

.grammar-pronunciation-btn-normal {
    background: transparent;
    color: #24587f;
}

.grammar-pronunciation-btn-normal:hover {
    background: rgba(220, 238, 255, 0.72);
    box-shadow: none;
}

.grammar-pronunciation-btn-slow {
    background: transparent;
    color: #805a17;
}

.grammar-pronunciation-btn-slow:hover {
    background: rgba(255, 237, 185, 0.72);
    box-shadow: none;
}

.grammar-quiz-card {
    background:
        radial-gradient(circle at 85% 8%, rgba(255, 219, 166, 0.42) 0%, transparent 36%),
        radial-gradient(circle at 12% 0%, rgba(182, 223, 255, 0.35) 0%, transparent 34%),
        linear-gradient(170deg, #fffefb 0%, #fff8ee 100%);
    border: 1.5px solid rgba(222, 194, 147, 0.5);
    box-shadow: 0 12px 26px rgba(88, 65, 25, 0.12);
}

.grammar-quiz-header {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.grammar-topic-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem 1rem;
    border: 1px solid rgba(217, 138, 31, 0.28);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(238, 247, 255, 0.95));
    text-align: start;
}

.grammar-topic-heading .character-reaction {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
}

.grammar-topic-heading h1 {
    min-width: 0;
    margin: 0;
    color: var(--ink-900);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.grammar-quiz-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.grammar-quiz-stat {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(95, 111, 128, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.grammar-hp-stat {
    border-color: rgba(208, 91, 91, 0.28);
    background: rgba(255, 245, 245, 0.82);
}

.grammar-progress-stat {
    border-color: rgba(63, 143, 209, 0.28);
    background: rgba(240, 247, 255, 0.86);
}

.grammar-premium-stat {
    border-color: rgba(217, 138, 31, 0.3);
    background: rgba(255, 250, 231, 0.9);
}

.grammar-stat-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
}

.grammar-stat-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.08rem;
}

.grammar-stat-label {
    overflow: hidden;
    color: #6c7784;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grammar-stat-value {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grammar-stat-value small {
    color: #7c8792;
    font-size: 0.72rem;
    font-weight: 700;
}

.grammar-character-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(194, 167, 118, 0.35);
}


.grammar-answer-zone {
    min-height: 104px;
    align-content: flex-start;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(252,247,238,0.98));
    border-color: rgba(176, 147, 102, 0.4) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.grammar-answer-zone.is-dragging {
    touch-action: none;
    border-color: rgba(43, 111, 168, 0.78) !important;
    box-shadow: inset 0 0 0 2px rgba(43, 111, 168, 0.18);
}

.grammar-token-drop-slot {
    display: inline-flex;
    width: 0;
    min-width: 0;
    min-height: 48px;
    flex: 0 0 0;
    align-items: center;
    justify-content: center;
    margin: 0.2rem 0;
    border-radius: 8px;
    pointer-events: none;
    overflow: visible;
    transition: width 0.12s ease, flex-basis 0.12s ease;
}

.grammar-token-drop-marker {
    width: 4px;
    height: 48px;
    border: 2px dashed rgba(43, 111, 168, 0.78);
    border-radius: 5px;
    opacity: 0;
    transform: scaleY(0.82);
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.grammar-answer-zone.is-dragging .grammar-token-drop-slot {
    width: 52px;
    min-width: 52px;
    min-height: 56px;
    flex-basis: 52px;
    pointer-events: auto;
    cursor: copy;
}

.grammar-answer-zone.is-dragging .grammar-token-drop-marker {
    height: 56px;
    opacity: 0.8;
    transform: scaleY(1);
}

.grammar-answer-zone.is-dragging .grammar-token-drop-slot:hover .grammar-token-drop-marker {
    background: rgba(43, 111, 168, 0.18);
    opacity: 1;
    transform: scaleY(1.08);
}

.grammar-token-pool {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch !important;
}

.grammar-token-option,
.grammar-token-selected {
    min-height: 48px;
    border-radius: 11px;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

.grammar-token-option:not(:disabled),
.grammar-token-selected:not(:disabled) {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.grammar-token-option.is-drag-source,
.grammar-token-selected.is-drag-source {
    opacity: 0.58;
    cursor: grabbing;
}

.grammar-token-option {
    width: 100%;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.grammar-token-option {
    border: 2px solid #d3dce8;
    background: #ffffff;
    color: #2f3e50;
}

.grammar-token-option:hover:not(:disabled) {
    border-color: #5e8fbf;
    background: #f4f9ff;
    transform: translateY(-1px);
}

.grammar-token-option.is-selected,
.grammar-token-option:disabled {
    border-color: #c2c9d1;
    background: #e7eaee;
    color: #89929d;
    box-shadow: none;
    cursor: not-allowed;
}

.grammar-token-selected {
    margin: 0.2rem;
    border: 2px solid #2b6fa8;
    background: linear-gradient(135deg, #3d86c4, #2a6598);
    color: #fff;
}

.grammar-token-option:disabled,
.grammar-token-selected:disabled {
    opacity: 0.82;
}

.token-pool  { gap: 4px; }

.btn-tts {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 32px; height: 32px;
    padding: 0; line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

.btn-tts:hover { background: #e8f0fe; }

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.75rem 1.5rem 1.5rem;
    color: var(--ink-700);
    font-size: 0.78rem;
    text-align: center;
}

.site-footer-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    color: var(--momo-blue-deep);
    font-weight: 700;
}

.legal-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.legal-hero {
    padding: 1.5rem clamp(1rem, 4vw, 3rem) 2rem;
    border-bottom: 1px solid var(--line-soft);
    background:
        radial-gradient(circle at 92% 0%, rgba(186, 225, 255, 0.48) 0%, transparent 30%),
        linear-gradient(135deg, rgba(255, 253, 247, 0.9), rgba(255, 247, 234, 0.72));
}

.legal-kicker {
    color: var(--momo-blue-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-hero h1 {
    margin: 0.45rem 0 0.65rem;
    color: var(--ink-900);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
}

.legal-hero p {
    max-width: 42rem;
    margin: 0;
    color: var(--ink-700);
    line-height: 1.75;
}

.legal-meta {
    display: flex;
    gap: 0.45rem;
    margin-top: 1.15rem;
    color: var(--ink-700);
    font-size: 0.82rem;
}

.legal-sections {
    max-width: 780px;
    margin: 0 auto;
}

.legal-section {
    padding: 1.55rem 0.25rem;
    border-bottom: 1px solid var(--line-soft);
}

.legal-section-heading {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.65rem;
}

.legal-section-number {
    flex: 0 0 auto;
    color: var(--momo-yellow-deep);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.legal-section h2 {
    margin: 0;
    color: var(--ink-900);
    font-size: 1.12rem;
    font-weight: 800;
}

.legal-section p,
.legal-section li {
    color: var(--ink-700);
    font-size: 0.94rem;
    line-height: 1.85;
}

.legal-section p {
    margin: 0 0 0.7rem;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    margin: 0;
    padding-left: 1.3rem;
}

.legal-section li + li {
    margin-top: 0.55rem;
}

.legal-section strong {
    color: var(--ink-900);
}

.legal-back-button {
    display: block;
    width: fit-content;
    margin: 1.5rem auto 0;
    text-decoration: none;
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .legal-section li,
html[data-theme="dark"] .legal-meta,
html[data-theme="dark"] .legal-hero p {
    color: #b8c7d2;
}

html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .legal-kicker {
    color: #a9dcff;
}

html[data-theme="dark"] .legal-hero {
    background:
        radial-gradient(circle at 92% 0%, rgba(46, 94, 126, 0.48) 0%, transparent 30%),
        linear-gradient(135deg, rgba(24, 35, 46, 0.92), rgba(32, 45, 57, 0.82));
}

html[data-theme="dark"] .legal-hero h1,
html[data-theme="dark"] .legal-section h2,
html[data-theme="dark"] .legal-section strong {
    color: #f3f7fa;
}

@media (max-width: 520px) {
    .site-footer {
        flex-direction: column;
        gap: 0.55rem;
        padding: 0.75rem 1rem max(1rem, env(safe-area-inset-bottom));
    }

    .site-footer-links {
        flex-wrap: wrap;
        gap: 0.25rem 0.6rem;
    }

    .legal-page {
        padding: 0.9rem 0.8rem 2.5rem;
    }

    .legal-hero {
        padding: 1.25rem 1rem 1.5rem;
    }

    .legal-section {
        padding: 1.3rem 0.15rem;
    }
}

.settings-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem;
}

.adventure-back-button {
    border: 1px solid rgba(63, 143, 209, 0.3);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--momo-blue-deep);
    font-weight: 800;
}

.adventure-back-button:hover {
    border-color: var(--momo-blue);
    background: #eef8ff;
    color: var(--momo-blue-deep);
}

html[data-theme="dark"] .adventure-back-button {
    border-color: rgba(105, 177, 224, 0.34);
    background: #1c303f;
    color: #bfe7ff;
}

html[data-theme="dark"] .adventure-back-button:hover {
    background: #244356;
    color: #d7f1ff;
}

@media (max-width: 520px) {
    .settings-container {
        padding: 0.9rem 0.8rem 3rem;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.momo-loading {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1.75rem;
    padding: 2rem 1.5rem;
    overflow: hidden;
    background: #fdfefe;
    color: #365f7d;
}

.momo-loading-mark {
    width: min(76vw, 31rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    animation: momo-loading-breathe 2.8s ease-in-out infinite;
}

.momo-loading-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.momo-loading-brand {
    display: grid;
    gap: 0.45rem;
    text-align: center;
    animation: momo-loading-rise 0.7s ease-out both;
}

.momo-loading-english {
    display: flex;
    justify-content: center;
    gap: 0.45em;
    font-family: 'M PLUS 1p', 'Noto Sans TC', sans-serif;
    font-size: 2.7rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
}

.momo-loading-english span:first-child {
    color: #365f7d;
}

.momo-loading-english span:last-child {
    color: #d65355;
}

.momo-loading-brand strong {
    color: #7da18b;
    font-family: 'Noto Sans TC', 'M PLUS 1p', sans-serif;
    font-size: 2.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.1;
    padding-left: 0.18em;
}

@media (max-width: 480px) {
    .momo-loading {
        gap: 1.4rem;
    }

    .momo-loading-english {
        font-size: 1.65rem;
    }

    .momo-loading-brand strong {
        font-size: 1.85rem;
    }
}

@keyframes momo-loading-breathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.35rem); }
}

@keyframes momo-loading-rise {
    from { opacity: 0; transform: translateY(0.6rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .momo-loading-mark,
    .momo-loading-brand {
        animation: none;
    }
}

.momo-loading {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 2.75rem) clamp(1.25rem, 7vw, 6rem) max(1.25rem, env(safe-area-inset-bottom));
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(244, 185, 66, 0.16) 0 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(45deg, rgba(63, 143, 209, 0.08) 0 1px, transparent 1px) 14px 14px / 28px 28px,
        linear-gradient(180deg, #fffdf7 0%, #fff7ea 100%);
    color: var(--momo-ink);
}

.momo-loading::before {
    position: absolute;
    inset: 0;
    z-index: -2;
    content: "";
    background: linear-gradient(118deg, transparent 0 42%, rgba(63, 143, 209, 0.08) 42.2% 42.45%, transparent 42.7% 100%);
    pointer-events: none;
}

.momo-loading::after {
    position: absolute;
    right: -8rem;
    bottom: -10rem;
    z-index: -1;
    width: min(48vw, 26rem);
    height: min(48vw, 26rem);
    content: "";
    border: 1px solid rgba(28, 93, 148, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 0 1.5rem rgba(244, 185, 66, 0.08), 0 0 0 3rem rgba(63, 143, 209, 0.05);
    pointer-events: none;
}

.momo-loading-topline,
.momo-loading-footer {
    position: relative;
    z-index: 2;
    width: min(100%, 42rem);
    margin: 0 auto;
}

.momo-loading-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(28, 31, 38, 0.18);
    color: var(--momo-blue-deep);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1;
}

.momo-loading-route-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--momo-yellow-deep);
    white-space: nowrap;
}

.momo-loading-route-label::before {
    width: 0.45rem;
    height: 0.45rem;
    content: "";
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.momo-loading-route {
    position: absolute;
    inset: 18% 0 16%;
    z-index: 0;
    width: min(100%, 54rem);
    margin: auto;
    pointer-events: none;
}

.momo-loading-route::before {
    position: absolute;
    inset: 7% 4% 11%;
    content: "";
    border: 2px dashed rgba(63, 143, 209, 0.29);
    border-color: rgba(63, 143, 209, 0.29) transparent rgba(217, 138, 31, 0.3) transparent;
    border-radius: 48% 52% 53% 47%;
    transform: rotate(-13deg);
    animation: momo-loading-route-drift 5s ease-in-out infinite;
}

.momo-loading-route::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4.5rem;
    height: 4.5rem;
    content: "✦";
    color: rgba(217, 138, 31, 0.35);
    font-size: 2rem;
    line-height: 4.5rem;
    text-align: center;
    transform: translate(-50%, -50%) rotate(12deg);
}

.momo-loading-route-pin {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--momo-ink);
    border-radius: 50%;
    background: var(--momo-yellow);
    box-shadow: 0 0 0 0.28rem rgba(244, 185, 66, 0.18);
}

.momo-loading-route-pin-start {
    top: 20%;
    left: 13%;
}

.momo-loading-route-pin-middle {
    top: 42%;
    right: 16%;
    background: var(--momo-blue);
    box-shadow: 0 0 0 0.28rem rgba(63, 143, 209, 0.16);
}

.momo-loading-route-pin-end {
    bottom: 11%;
    left: 30%;
    background: var(--momo-ink);
    box-shadow: 0 0 0 0.28rem rgba(28, 31, 38, 0.12);
}

.momo-loading-content {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 1;
    align-content: center;
    justify-items: center;
    gap: clamp(1rem, 3vh, 1.75rem);
    width: 100%;
    text-align: center;
    animation: momo-loading-enter 0.75s ease-out both;
}

.momo-loading-character-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(12.5rem, 45vw, 18rem);
    aspect-ratio: 1;
}

.momo-loading-character-wrap::before,
.momo-loading-character-wrap::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.momo-loading-character-wrap::before {
    inset: 7%;
    border: 1px dashed rgba(28, 93, 148, 0.44);
    transform: rotate(18deg);
    animation: momo-loading-ring 7s linear infinite;
}

.momo-loading-character-wrap::after {
    inset: 15%;
    border: 2px solid rgba(244, 185, 66, 0.74);
    border-left-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(-24deg);
}

.momo-loading-character {
    position: relative;
    z-index: 1;
    width: 91%;
    height: 91%;
    object-fit: contain;
    filter: drop-shadow(0 0.65rem 0 rgba(28, 31, 38, 0.12));
    animation: momo-loading-float 2.8s ease-in-out infinite;
}

.momo-loading-stamp {
    position: absolute;
    top: 8%;
    right: 1%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 3.9rem;
    aspect-ratio: 1;
    border: 2px solid var(--momo-ink);
    border-radius: 50%;
    background: var(--momo-yellow);
    box-shadow: 0.2rem 0.2rem 0 var(--momo-ink);
    color: var(--momo-ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    transform: rotate(11deg);
}

.momo-loading-brand {
    display: grid;
    justify-items: center;
    gap: 0.48rem;
    animation: none;
}

.momo-loading-english {
    display: flex;
    justify-content: center;
    gap: 0.4em;
    color: var(--momo-ink);
    font-size: clamp(1.5rem, 5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.momo-loading-english span:first-child {
    color: var(--momo-blue-deep);
}

.momo-loading-english span:last-child {
    color: var(--momo-ink);
}

.momo-loading-brand strong {
    display: inline-block;
    color: var(--momo-ink);
    font-size: clamp(1.75rem, 6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1.1;
    padding-left: 0.2em;
}

.momo-loading-brand strong::after {
    display: block;
    width: 3.4rem;
    height: 0.25rem;
    margin: 0.65rem auto 0;
    content: "";
    border-radius: 999px;
    background: var(--momo-yellow);
}

.momo-loading-status {
    color: var(--momo-blue-deep);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.momo-loading-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(28, 31, 38, 0.18);
    color: var(--momo-blue-deep);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
}

.momo-loading-footer-level {
    color: var(--momo-yellow-deep);
    text-align: right;
}

.momo-loading-progress {
    display: inline-flex;
    gap: 0.35rem;
}

.momo-loading-progress span {
    width: 0.48rem;
    height: 0.48rem;
    border: 1.5px solid var(--momo-blue);
    border-radius: 50%;
    background: transparent;
    animation: momo-loading-progress 1.4s ease-in-out infinite;
}

.momo-loading-progress span:nth-child(2) { animation-delay: 0.15s; }
.momo-loading-progress span:nth-child(3) { animation-delay: 0.3s; }
.momo-loading-progress span:nth-child(4) { animation-delay: 0.45s; }

@media (max-width: 480px) {
    .momo-loading {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .momo-loading-topline {
        font-size: 0.56rem;
    }

    .momo-loading-route {
        inset: 21% -18% 18%;
    }

    .momo-loading-route-pin-start { left: 19%; }
    .momo-loading-route-pin-middle { right: 21%; }
    .momo-loading-route-pin-end { left: 35%; }

    .momo-loading-character-wrap {
        width: min(67vw, 16rem);
    }

    .momo-loading-stamp {
        width: 3.25rem;
        font-size: 0.66rem;
    }

    .momo-loading-footer {
        grid-template-columns: 1fr auto;
    }

    .momo-loading-footer-label {
        display: none;
    }

    .momo-loading-footer-level {
        grid-column: 2;
    }
}

@keyframes momo-loading-enter {
    from { opacity: 0; transform: translateY(0.65rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes momo-loading-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-0.45rem) rotate(1deg); }
}

@keyframes momo-loading-ring {
    to { transform: rotate(378deg); }
}

@keyframes momo-loading-route-drift {
    0%, 100% { transform: rotate(-13deg) translateY(0); }
    50% { transform: rotate(-10deg) translateY(0.35rem); }
}

@keyframes momo-loading-progress {
    0%, 100% { background: transparent; transform: scale(0.82); }
    50% { background: var(--momo-yellow); transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
    .momo-loading-content,
    .momo-loading-character,
    .momo-loading-character-wrap::before,
    .momo-loading-route::before,
    .momo-loading-progress span {
        animation: none;
    }
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ════════════════════════════════════════
   Food Hunt Mode (WordQuiz /quiz/word/… route)
   ════════════════════════════════════════ */

.dungeon-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 0.5rem 1rem 3rem;
}

/* ── Entry / Start Screen ── */
.dungeon-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    text-align: center;
}

.dungeon-banner {
    background: linear-gradient(160deg, #1b4332 0%, #2d6a4f 100%);
    border-radius: 20px;
    padding: 1.5rem 2rem 1.25rem;
    width: 100%;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.dungeon-gate-emoji {
    font-size: 3.2rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: gate-float 2.4s ease-in-out infinite;
}
@keyframes gate-float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%       { transform: translateY(-8px) rotate(3deg); }
}
.dungeon-title-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #a8e6cf;
    letter-spacing: .04em;
    margin-bottom: 0.4rem;
}
.dungeon-level-badge {
    display: inline-block;
    border: 1.5px solid #a8e6cf;
    color: #a8e6cf;
    border-radius: 8px;
    padding: 1px 12px;
    font-size: 0.78rem;
    font-weight: bold;
    opacity: .85;
}

.dungeon-stats-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}
.dungeon-stat {
    background: #f8f4ee;
    border-radius: 12px;
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #5d4037;
    flex: 1;
    text-align: center;
}

.dungeon-enter-btn {
    width: 100%;
    background: linear-gradient(135deg, #e8b86d, #c8922e);
    border: none;
    border-radius: 14px;
    padding: 0.9rem;
    font-size: 1.05rem;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232,184,109,.4);
    transition: transform .15s, box-shadow .15s;
}
.dungeon-enter-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,184,109,.55); }
.dungeon-enter-btn:active { transform: translateY(0); }

.dungeon-back-link {
    background: none; border: none;
    color: #9e9e9e; font-size: 0.85rem; cursor: pointer; padding: 0;
}
.dungeon-back-link:hover { color: #616161; }

.dungeon-return-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    background: #ffffff;
    color: #2d3436;
    border: 2px solid #2d3436;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dungeon-return-btn:hover {
    background: #f5f7fa;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.dungeon-return-btn:active {
    transform: translateY(0);
}

/* ── Quiz Session ── */
.dungeon-session {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.dungeon-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0.3rem 0;
}
.dungeon-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: bold;
    transition: background .25s;
}
.dot-todo    { background: #ecf0f1; color: #b2bec3; }
.dot-current { background: #fdcb6e; color: #2d3436; animation: dot-pulse 1.2s ease-in-out infinite; }
@keyframes dot-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(253,203,110,.5); } 50% { box-shadow: 0 0 0 5px rgba(253,203,110,0); } }
.dot-ok { background: #00b894; color: white; }
.dot-x  { background: #e17055; color: white; }

.dungeon-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dungeon-hp { font-size: 0.8rem; font-weight: bold; color: #e17055; white-space: nowrap; }
.dungeon-combo {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: bold;
}
.combo-normal { background: #ecf0f1; color: #7f8c8d; }
.combo-hot    { background: #fdcb6e; color: #2d3436; }
.combo-fever  { background: #e17055; color: white; animation: fever-pulse .6s infinite alternate; }
@keyframes fever-pulse { to { opacity: .65; } }
.dungeon-exp    { font-weight: bold; color: #00b894; font-size: 0.88rem; }
.dungeon-timer  { font-size: 0.9rem; font-weight: bold; min-width: 34px; text-align: right; }
.timer-urgent   { color: #e17055; animation: timer-blink .5s infinite alternate; }
@keyframes timer-blink { to { opacity: .35; } }

.dungeon-timer-track {
    height: 5px; background: #ecf0f1; border-radius: 3px; overflow: hidden;
}
.dungeon-timer-fill {
    height: 100%; border-radius: 3px; transition: width 1s linear, background .4s;
}
.timer-fill-expired { transition: none; }
.timer-fill-ok  { background: #00b894; }
.timer-fill-hot { background: #fdcb6e; }
.timer-fill-low { background: #e17055; }

.dungeon-word-card {
    background: linear-gradient(160deg, #1b4332, #2d6a4f);
    border-radius: 18px;
    padding: 1.4rem 1rem;
    text-align: center;
    color: white;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.dungeon-word-kanji   { font-size: 2.6rem; font-weight: bold; line-height: 1; display: flex; align-items: flex-end; gap: 0.45rem; }
.dungeon-word-reading { color: #a8e6cf; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.dungeon-speak-btn {
    background: rgba(255,255,255,.15); border: none; border-radius: 50%;
    width: 26px; height: 26px; cursor: pointer; color: white; font-size: 0.75rem;
    transition: background .15s;
}
.dungeon-speak-btn:hover { background: rgba(255,255,255,.3); }
.dungeon-word-category {
    font-size: 0.68rem; color: #95a5a6;
    background: rgba(255,255,255,.08); border-radius: 6px; padding: 1px 8px;
}

.dungeon-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.dungeon-choice {
    background: white;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    padding: 0.9rem 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    transition: border-color .12s, background .12s, transform .1s;
    line-height: 1.35;
    min-height: 66px;
}
.dungeon-choice:hover:not(:disabled) { border-color: #e8b86d; background: #fffbf2; transform: translateY(-1px); }
.dungeon-choice:disabled { cursor: default; }
.dc-correct { background: #d1fae5 !important; border-color: #00b894 !important; color: #065f46 !important; }
.dc-wrong   { background: #fee2e2 !important; border-color: #e17055 !important; color: #991b1b !important; }
.dc-neutral { opacity: .4; }

.dungeon-feedback {
    text-align: center; font-size: 0.95rem; font-weight: bold;
    padding: 0.5rem; border-radius: 10px;
    animation: fb-pop .2s ease-out;
}
@keyframes fb-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fb-ok { background: #d1fae5; color: #065f46; }
.fb-x  { background: #fee2e2; color: #991b1b; }

/* ── Result Screen ── */
.dungeon-result {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 1rem 0 2rem; text-align: center;
}
.result-stars {
    display: flex; justify-content: center;
    align-items: flex-end; gap: 6px;
    font-size: 2.4rem; line-height: 1;
}
.result-star { color: #dfe6e9; transition: all .3s; }
.result-star.star-on {
    color: #f39c12;
    filter: drop-shadow(0 0 8px rgba(243,156,18,.55));
    animation: star-in .4s cubic-bezier(.36,1.6,.5,1) both;
}
.result-stars .result-star:nth-child(2) { font-size: 3rem; }
.result-star.star-on:nth-child(1) { animation-delay: .1s; }
.result-star.star-on:nth-child(2) { animation-delay: .3s; }
.result-star.star-on:nth-child(3) { animation-delay: .5s; }
@keyframes star-in { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }

.result-title    { font-size: 1.4rem; font-weight: bold; color: #2d3436; }
.result-subtitle { font-size: 0.82rem; color: #95a5a6; }

.dungeon-score-card {
    background: #f8f9fa; border-radius: 16px;
    padding: 1.1rem 1.4rem; width: 100%;
    display: flex; flex-direction: column; gap: 0.55rem;
}
.score-row { display: flex; justify-content: space-between; font-size: 0.88rem; color: #636e72; }
.score-val { font-weight: bold; color: #2d3436; }
.score-exp { font-weight: bold; color: #00b894; }

.result-dots {
    display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 0.2rem;
}
.rd {
    width: 25px; height: 25px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: bold;
}
.rd-ok { background: #00b894; color: white; }
.rd-x  { background: #e17055; color: white; }

.dungeon-retry-btn {
    width: 100%; background: linear-gradient(135deg, #e8b86d, #c8922e);
    border: none; border-radius: 14px; padding: 0.8rem;
    font-size: 1rem; font-weight: bold; color: #1a1a2e; cursor: pointer;
    transition: transform .15s;
}
.dungeon-retry-btn:hover { transform: translateY(-2px); }
.dungeon-exit-btn {
    background: none; border: 1.5px solid #dfe6e9; border-radius: 12px;
    padding: 0.65rem; width: 100%; font-size: 0.88rem; color: #636e72; cursor: pointer;
    transition: background .15s;
}
.dungeon-exit-btn:hover { background: #f8f9fa; }

.world-map {
    max-width: 480px;
    margin: 0 auto;
    padding: 0.75rem 1rem 3rem;
}

/* Player header row */
.wm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 0.5rem;
}
.wm-lv-info { font-size: 0.95rem; }

.premium-member-badge {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 8.8rem;
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    overflow: hidden;
    border: 1px solid rgba(218, 170, 63, 0.78);
    border-radius: 999px;
    background: linear-gradient(135deg, #34383f 0%, #181b20 56%, #4a3b1f 100%);
    color: #ffe9a6;
    box-shadow: 0 5px 14px rgba(57, 43, 18, 0.2), inset 0 1px 0 rgba(255, 244, 193, 0.22);
}

.premium-member-badge::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.18) 48%, transparent 70%);
    pointer-events: none;
    transform: translateX(-125%);
    animation: premium-sheen 6s ease-in-out infinite;
}

.premium-member-mark {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff2ac, #d49a32);
    color: #25282d;
    font-size: 0.95rem;
    box-shadow: 0 0 0 2px rgba(255, 222, 131, 0.14), 0 2px 7px rgba(0, 0, 0, 0.25);
}

.premium-member-copy {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.05;
}

.premium-member-copy strong {
    color: #fff4c7;
    font-size: 0.68rem;
    font-weight: 800;
}

.premium-member-copy small {
    margin-top: 0.16rem;
    overflow: hidden;
    color: #d9bb75;
    font-size: 0.6rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes premium-sheen {
    0%, 55% { transform: translateX(-125%); }
    75%, 100% { transform: translateX(125%); }
}

/* Streak badge */
.wm-streak {
    font-size: 0.85rem;
    font-weight: 600;
    color: #b2bec3;
    white-space: nowrap;
}
.streak-active { color: #e17055; }

/* Daily missions bar */
.wm-daily-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.daily-item {
    font-size: 0.72rem;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px 10px;
    color: #636e72;
    font-weight: 600;
}
.daily-done { background: #d1fae5; color: #065f46; }
.daily-hint { margin-left: auto; color: #b2bec3; background: none; font-weight: 400; }

/* HP exhausted banner */
.hp-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff5f5;
    border: 1.5px solid #feb2b2;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c53030;
    flex-wrap: wrap;
}
.hp-banner-btn {
    background: #fff;
    border: 1.5px solid #feb2b2;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    color: #c53030;
    transition: background .15s;
}
.hp-banner-btn:hover { background: #fed7d7; }
.hp-banner-premium { border-color: #f6e05e; color: #744210; }
.hp-banner-premium:hover { background: #fefcbf; }

/* EXP bar */
.wm-exp-section { margin-bottom: 0.75rem; }
.exp-track {
    height: 8px;
    background: #dfe6e9;
    border-radius: 4px;
    overflow: hidden;
}
.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--momo-yellow), var(--momo-blue));
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Level cards */
.wm-path { display: flex; flex-direction: column; gap: 0; }

.wm-level-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    color: white;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.wm-level-card:hover:not(.wm-locked) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2) !important;
}
.wm-level-card:active:not(.wm-locked) { transform: translateY(0); }

.wm-locked  { filter: grayscale(70%); opacity: 0.55; cursor: not-allowed; }

/* Season colour themes — each start/end stop keeps white card text at WCAG AA (>= 4.5:1). */
.wm-course { background: linear-gradient(135deg, #2a72b5 0%, var(--momo-blue-deep) 100%); }
.wm-n5 { background: linear-gradient(135deg, #a8620c 0%, #7a4507 100%); }
.wm-n4 { background: linear-gradient(135deg, #2a72b5 0%, var(--momo-blue-deep) 100%); }
.wm-n3 { background: linear-gradient(135deg, #4a4f58 0%, #22252b 100%); }
.wm-n2 { background: linear-gradient(135deg, #2f5f95 0%, #16324f 100%); }
.wm-n1 { background: linear-gradient(135deg, #111318 0%, #2c2f36 100%); }
.wm-kana { background: linear-gradient(135deg, #a8620c 0%, var(--momo-blue-deep) 100%); }

.wm-level-card:focus-visible {
    outline: 3px solid var(--momo-blue);
    outline-offset: 3px;
}

.wm-coming-soon {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1.5px dashed rgba(28, 93, 148, 0.32);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--momo-blue-deep);
    font-size: 0.92rem;
    font-weight: 700;
}

.wm-coming-soon-icon { font-size: 1.3rem; }

html[data-theme="dark"] .wm-coming-soon {
    border-color: rgba(169, 220, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
    color: #a9dcff;
}

/* Active (current level) glow */
.wm-active {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(255,200,0,.65),
                0 8px 24px rgba(0,0,0,.18) !important;
}

.wm-card-emoji { font-size: 2.4rem; flex-shrink: 0; }

.wm-card-body { flex: 1; min-width: 0; }

.wm-level-badge {
    background: rgba(255,255,255,.28);
    border-radius: 6px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: bold;
    flex-shrink: 0;
}
.wm-season    { font-size: 0.75rem; opacity: .9; }
.wm-card-desc { opacity: .94; }
.wm-card-body .text-muted { color: rgba(255,255,255,.85) !important; }

.wm-progress-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wm-mini-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,.3);
    border-radius: 3px;
    overflow: hidden;
}
.wm-mini-fill {
    height: 100%;
    background: rgba(255,255,255,.9);
    border-radius: 3px;
    transition: width .4s ease;
}
.wm-prog-label {
    font-size: 0.75rem;
    white-space: nowrap;
}

/* CTA button inside card */
.wm-card-cta {
    background: rgba(255,255,255,.22);
    border-radius: 10px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.cta-pulse {
    background: white;
    color: #2d3436;
    animation: cta-bounce 1.8s ease-in-out infinite;
}
@keyframes cta-bounce {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.07); }
}
.cta-done { background: rgba(0,220,100,.25); }
.cta-lock { background: rgba(0,0,0,.18); }

/* ── Word Dungeon List page (/quiz/word) ── */
.wdl-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 0.9rem;
    text-align: center;
    letter-spacing: .02em;
}
.wdl-level-section {
    margin-bottom: 0.75rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.wdl-level-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: white;
}
.wdl-level-emoji  { font-size: 1.5rem; }
.wdl-level-name   { font-size: 1rem; font-weight: bold; }
.wdl-level-region { font-size: 0.75rem; opacity: .85; margin-left: auto; }
.wdl-chips {
    background: #fffbf0;
    padding: 0.55rem 0.75rem 0.65rem;
    flex-wrap: wrap;
    overflow-x: unset;
}
.wdl-loading {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    color: #b2bec3;
}

/* Vocabulary dungeon grid (used in Map page) */
.vocab-section {
    margin: 1rem 1rem 1.5rem;
    background: rgba(255, 248, 230, 0.85);
    border: 1.5px solid #fdcb6e;
    border-radius: 16px;
    padding: 0.85rem 0.9rem 1rem;
}
.vocab-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #7c5a00;
    margin-bottom: 0.65rem;
}
.vocab-section-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: #b08030;
    background: rgba(253, 203, 110, 0.35);
    border-radius: 10px;
    padding: 1px 8px;
}
.vocab-theme-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.vocab-theme-card {
    border: 1px solid rgba(253, 203, 110, 0.75);
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(255, 252, 240, 0.96), rgba(255, 243, 214, 0.86));
    overflow: hidden;
}

.vocab-theme-header {
    width: 100%;
    border: none;
    background: transparent;
    color: #5e4208;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title toggle"
        "meta toggle";
    column-gap: 10px;
    row-gap: 3px;
    text-align: left;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
}

.vocab-theme-header:hover {
    background: rgba(255, 237, 180, 0.22);
}

.vocab-theme-title {
    grid-area: title;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.vocab-theme-meta {
    grid-area: meta;
    font-size: 0.74rem;
    font-weight: 600;
    color: #9a6a14;
}

.vocab-theme-toggle {
    grid-area: toggle;
    align-self: center;
    justify-self: end;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(188, 138, 45, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    color: #7c5208;
    background: rgba(255, 238, 194, 0.7);
}

.vocab-theme-preview,
.vocab-dungeon-grid {
    padding: 0 0.75rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.vocab-preview-more {
    align-self: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #9f6c14;
    background: rgba(255, 231, 173, 0.8);
    border-radius: 999px;
    padding: 4px 9px;
}

.dungeon-chip {
    background: linear-gradient(135deg, #ffedd1, #ffe2af);
    border: 1.5px solid #f2c14e;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2f2e2b;
    cursor: pointer;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    transition: transform .12s, box-shadow .12s;
}

.dungeon-chip .chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dungeon-chip .chip-count {
    font-size: 0.66rem;
    font-weight: 700;
    color: #8b5a13;
    background: rgba(255, 247, 224, 0.88);
    border-radius: 999px;
    padding: 2px 6px;
}

.dungeon-chip.is-preview {
    white-space: nowrap;
}

.dungeon-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 193, 78, 0.42);
}

.dungeon-chip:active {
    transform: translateY(0);
}

.dungeon-chip.chip-locked {
    opacity: 0.72;
    filter: grayscale(0.18);
}

@media (min-width: 560px) {
    .vocab-theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vocab-theme-card.is-expanded {
        grid-column: span 2;
    }
}

/* Connector between level cards */
.wm-connector {
    display: flex;
    justify-content: center;
    padding: 4px 0;
}
.conn-unlocked {
    width: 3px; height: 22px;
    background: #b2bec3;
    border-radius: 2px;
}
.conn-locked {
    width: 3px; height: 22px;
    border-radius: 2px;
    background: repeating-linear-gradient(
        to bottom,
        #b2bec3 0, #b2bec3 4px,
        transparent 4px, transparent 8px
    );
}

/* Hero banner on MapHome */
.wm-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1.1rem 1.2rem 1.2rem;
    margin-bottom: 0.6rem;
    border-radius: 16px;
    background: linear-gradient(130deg, #fdf7f0 0%, #edf2fc 100%);
    border-left: 4px solid var(--momo-yellow-deep);
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
    overflow: hidden;
}
.wm-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.wm-hero-title {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--ink-900);
}
.wm-hero-subtitle {
    margin: 0.3rem 0 0;
    color: var(--ink-700);
    font-size: 0.88rem;
}
.wm-hero-logo {
    flex: 0 0 clamp(80px, 18vw, 130px);
    width: clamp(80px, 18vw, 130px);
    height: clamp(58px, 11vw, 84px);
    align-self: stretch;
    display: block;
    object-fit: contain;
    opacity: 0.92;
    transform-origin: center bottom;
    animation: wm-hero-character-float 3.2s ease-in-out infinite;
}

@media (max-width: 576px) {
    .wm-hero {
        gap: 0.5rem;
    }

    .wm-hero-logo {
        flex-basis: 72px;
        width: 72px;
        height: 52px;
    }
}

@media (max-width: 420px) {
    .wm-header {
        flex-wrap: wrap;
    }

    .premium-member-badge {
        flex: 1 0 100%;
        justify-content: center;
        order: 3;
    }
}

/* Hint banner shared by MapHome and Map */
.wm-hint-banner,
.map-hint-banner {
    margin: 0.45rem 0 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: 11px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #7a3417;
    background: #fff2e1;
    border: 1px solid #ffddb9;
    width: 100%;
    box-sizing: border-box;
}

/* Grammar quiz completion screen */
.completion-star {
    font-size: 4rem;
    animation: star-pop .5s cubic-bezier(.36,1.6,.5,1) both;
}
@keyframes star-pop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.completion-exp-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--momo-blue) 0%, var(--momo-blue-deep) 100%);
    color: white;
    border-radius: 20px;
    padding: 0.3rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

/* ════════════════════════════════════════
   Map Page — MoMo Trail (Unified)
   ════════════════════════════════════════ */

/* Level-specific header gradients */
.map-course { background: linear-gradient(135deg, #2a72b5 0%, var(--momo-blue-deep) 100%); }
.map-n5 { background: linear-gradient(135deg, #a8620c 0%, #7a4507 100%); }
.map-n4 { background: linear-gradient(135deg, #2a72b5 0%, var(--momo-blue-deep) 100%); }
.map-n3 { background: linear-gradient(135deg, #4a4f58 0%, #22252b 100%); }
.map-n2 { background: linear-gradient(135deg, #2f5f95 0%, #16324f 100%); }
.map-n1 { background: linear-gradient(135deg, #111318 0%, #2c2f36 100%); border-bottom: 1px solid rgba(244, 185, 66, 0.4); }

/* Page wrapper */
.map-page {
    max-width: 640px;
    margin: 0 auto 2rem;
    min-height: calc(100vh - 1rem);
    border-radius: 28px;
    border: 1px solid var(--line-soft);
    background:
        radial-gradient(circle at 15% 8%, rgba(254, 222, 176, 0.45) 0%, transparent 36%),
        radial-gradient(circle at 85% 12%, rgba(170, 214, 248, 0.40) 0%, transparent 34%),
        linear-gradient(180deg, #fffcf7 0%, #fff4e6 100%);
    box-shadow: 0 24px 48px rgba(43, 48, 61, 0.15);
    overflow: visible;
}

/* Sticky header */
.map-header {
    padding: 1rem 1rem 1.25rem;
    color: white;
    border-radius: 28px 28px 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 6px 20px rgba(35, 38, 48, 0.18);
}

.map-back-btn {
    background: rgba(255,255,255,.22);
    border: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
    transition: background .2s;
}
.map-back-btn:hover { background: rgba(255,255,255,.38); }

.map-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.map-hp-row { margin-top: 0.4rem; }
.hp-full  { opacity: 1;   font-size: 1.1rem; }
.hp-empty { opacity: 0.2; font-size: 1.1rem; }

/* ── Chapter Trail ── */
.chapter-trail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem 0.75rem 3rem;
}

/* ── Chapter Card (replaces icon-only circle nodes) ── */
.chapter-card {
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.10);
    border: 1.5px solid transparent;
    transition: box-shadow .15s;
}
.chapter-card-cleared {
    background: linear-gradient(160deg, #f0f7ff, #e2effd);
    border-color: rgba(63, 143, 209, 0.35);
}
.chapter-card-current {
    background: linear-gradient(160deg, #fffbe8, #fff3c4);
    border-color: rgba(244, 185, 66, 0.55);
    box-shadow: 0 8px 22px rgba(217, 138, 31, .18), 0 0 0 3px rgba(244,185,66,.18);
    animation: card-pulse 2.4s ease-in-out infinite;
}
@keyframes card-pulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(217,138,31,.18), 0 0 0 3px rgba(244,185,66,.18); }
    50%       { box-shadow: 0 8px 22px rgba(217,138,31,.10), 0 0 0 8px rgba(244,185,66,.08); }
}

/* ── Per-character card themes (current state) ── */

/* MOMO: 白黑 — crisp white, soft black rim */
.chapter-card-current.card-char-momo {
    background: linear-gradient(160deg, #fafafa, #eeeeee);
    border-color: rgba(30, 30, 30, 0.28);
    box-shadow: 0 8px 22px rgba(0,0,0,.13), 0 0 0 3px rgba(0,0,0,.08);
    animation: card-pulse-momo 2.4s ease-in-out infinite;
}
@keyframes card-pulse-momo {
    0%, 100% { box-shadow: 0 8px 22px rgba(0,0,0,.13), 0 0 0 3px rgba(0,0,0,.08); }
    50%       { box-shadow: 0 8px 22px rgba(0,0,0,.05), 0 0 0 9px rgba(0,0,0,.04); }
}
.chapter-card-current.card-char-momo .chapter-num-badge { background: #1c1c1c; color: #fff; }

/* ICHI: 白粉 — soft pink white, hot-pink accent */
.chapter-card-current.card-char-ichi {
    background: linear-gradient(160deg, #fff0f8, #fce7f3);
    border-color: rgba(236, 72, 153, 0.48);
    box-shadow: 0 8px 22px rgba(219,39,119,.18), 0 0 0 3px rgba(236,72,153,.22);
    animation: card-pulse-ichi 2.4s ease-in-out infinite;
}
@keyframes card-pulse-ichi {
    0%, 100% { box-shadow: 0 8px 22px rgba(219,39,119,.18), 0 0 0 3px rgba(236,72,153,.22); }
    50%       { box-shadow: 0 8px 22px rgba(219,39,119,.08), 0 0 0 9px rgba(236,72,153,.09); }
}
.chapter-card-current.card-char-ichi .chapter-num-badge  { background: #ec4899; color: #fff; }
.chapter-card-current.card-char-ichi .chapter-card-title  { color: #831843; }
.chapter-card-current.card-char-ichi .chapter-card-focus  { color: #be185d; }
.chapter-card-current.card-char-ichi .inline-grammar-btn  { background: rgba(255,255,255,.70); border-color: rgba(244,114,182,.35); color: #831843; }
.chapter-card-current.card-char-ichi .igb-current         { border-color: rgba(244,114,182,.60); background: rgba(255,240,249,.98); }

/* KEN: 白紅 — pure white, vivid red accent */
.chapter-card-current.card-char-ken {
    background: linear-gradient(160deg, #fff8f8, #ffe8e8);
    border-color: rgba(153, 27, 27, 0.38);
    box-shadow: 0 8px 22px rgba(140,20,20,.18), 0 0 0 3px rgba(153,27,27,.18);
    animation: card-pulse-ken 2.4s ease-in-out infinite;
}
@keyframes card-pulse-ken {
    0%, 100% { box-shadow: 0 8px 22px rgba(140,20,20,.18), 0 0 0 3px rgba(153,27,27,.18); }
    50%       { box-shadow: 0 8px 22px rgba(140,20,20,.07), 0 0 0 9px rgba(153,27,27,.07); }
}
.chapter-card-current.card-char-ken .chapter-num-badge { background: #b91c1c; color: #fff; }

/* LION: 黃白 — warm golden cream */
.chapter-card-current.card-char-lion {
    background: linear-gradient(160deg, #fffde7, #fff8b0);
    border-color: rgba(234, 179, 8, 0.58);
    box-shadow: 0 8px 22px rgba(180, 130, 0, .20), 0 0 0 3px rgba(234,179,8,.22);
    animation: card-pulse-lion 2.4s ease-in-out infinite;
}
@keyframes card-pulse-lion {
    0%, 100% { box-shadow: 0 8px 22px rgba(180,130,0,.20), 0 0 0 3px rgba(234,179,8,.22); }
    50%       { box-shadow: 0 8px 22px rgba(180,130,0,.08), 0 0 0 9px rgba(234,179,8,.08); }
}
.chapter-card-current.card-char-lion .chapter-num-badge { background: #ca8a04; color: #fff; }

/* TEACHER: 藍白 — soft sky blue, clean white */
.chapter-card-current.card-char-teacher {
    background: linear-gradient(160deg, #eff6ff, #dbeafe);
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .16), 0 0 0 3px rgba(59,130,246,.18);
    animation: card-pulse-teacher 2.4s ease-in-out infinite;
}
@keyframes card-pulse-teacher {
    0%, 100% { box-shadow: 0 8px 22px rgba(37,99,235,.16), 0 0 0 3px rgba(59,130,246,.18); }
    50%       { box-shadow: 0 8px 22px rgba(37,99,235,.07), 0 0 0 9px rgba(59,130,246,.08); }
}
.chapter-card-current.card-char-teacher .chapter-num-badge { background: #1d4ed8; color: #fff; }

/* ── Per-character CLEARED card themes ── */
.chapter-card-cleared.card-char-momo {
    background: linear-gradient(160deg, #f9f9f9, #efefef);
    border-color: rgba(50, 50, 50, 0.22);
}
.chapter-card-cleared.card-char-ichi {
    background: linear-gradient(160deg, #fff0f8, #fce4f1);
    border-color: rgba(219, 39, 119, 0.28);
}
.chapter-card-cleared.card-char-ken {
    background: linear-gradient(160deg, #fff6f6, #fde8e8);
    border-color: rgba(153, 27, 27, 0.26);
}
.chapter-card-cleared.card-char-lion {
    background: linear-gradient(160deg, #fffde8, #fef6bf);
    border-color: rgba(202, 138, 4, 0.32);
}
.chapter-card-cleared.card-char-teacher {
    background: linear-gradient(160deg, #eff6ff, #dbeafe);
    border-color: rgba(59, 130, 246, 0.30);
}

.chapter-card-locked {
    background: linear-gradient(160deg, #f6f8fa, #edf0f3);
    border-color: rgba(160, 172, 184, 0.38);
    opacity: 0.72;
}

.chapter-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem 0.7rem;
}
.chapter-num-badge {
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--momo-blue-deep);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(28,93,148,.25);
}
.chapter-card-cleared .chapter-num-badge { background: var(--momo-blue); }
.chapter-card-current .chapter-num-badge { background: var(--momo-yellow-deep); color: #1a1a2e; }
.chapter-card-locked  .chapter-num-badge { background: #9aa5b1; }
/* per-character cleared badge overrides */
.chapter-card-cleared.card-char-momo    .chapter-num-badge { background: #555;    color: #fff; }
.chapter-card-cleared.card-char-ichi    .chapter-num-badge { background: #db2777; color: #fff; }
.chapter-card-cleared.card-char-ken     .chapter-num-badge { background: #b91c1c; color: #fff; }
.chapter-card-cleared.card-char-lion    .chapter-num-badge { background: #ca8a04; color: #fff; }
.chapter-card-cleared.card-char-teacher .chapter-num-badge { background: #2563eb; color: #fff; }

.chapter-card-info { flex: 1; min-width: 0; }
.chapter-card-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-card-focus {
    font-size: 0.72rem;
    color: #5a6778;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-mascot-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
    padding: 3px;
}

/* Per-character colour rings on chapter mascots */
.mascot-momo    { background: linear-gradient(135deg, #f5f5f5, #1c1c1c); }
.mascot-ichi    { background: linear-gradient(135deg, #12121e, #ec4899); }
.mascot-ken     { background: linear-gradient(135deg, #fecaca, #991b1b); }
.mascot-lion    { background: linear-gradient(135deg, #fbbf24, #fffde7); }
.mascot-teacher { background: linear-gradient(135deg, #1d4ed8, #bfdbfe); }

/* ── Inline Grammar List ── */
.chapter-grammar-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 0.75rem 0.75rem;
}
.inline-grammar-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,0.82);
    border: 1.5px solid #dde3e9;
    border-radius: 11px;
    padding: 8px 10px;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    color: var(--ink-900);
    transition: background .12s, border-color .12s, transform .12s;
    width: 100%;
}
.inline-grammar-btn:not(:disabled):hover {
    background: #eef4ff;
    border-color: var(--momo-blue);
    transform: translateX(2px);
}
.inline-grammar-btn:disabled { cursor: not-allowed; opacity: .52; }

.igb-cleared { border-color: rgba(34,197,94,.40);  background: rgba(240,253,244,.92); border-left: 4px solid #22c55e; }
.igb-current { border-color: rgba(244,185,66,.55);  background: rgba(255,251,235,.97); border-left: 4px solid #f59e0b; }
.igb-locked  { border-color: rgba(180,188,198,.4);  background: rgba(246,248,250,.85); }

/* Per-character grammar button colors — cleared state (green left border = "done") */
.card-char-momo    .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.28);   background: rgba(240,253,244,.96); }
.card-char-ichi    .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.28);   background: rgba(255,240,249,.94); }
.card-char-ken     .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.28);   background: rgba(240,253,244,.96); }
.card-char-lion    .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.35);   background: rgba(240,253,244,.96); }
.card-char-teacher .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.32);   background: rgba(240,253,244,.96); }
/* Per-character grammar button colors — current (unlocked) state */
.card-char-momo    .igb-current { border-left: 4px solid #1c1c1c; border-color: rgba(30,30,30,.35);    background: rgba(255,255,255,.99); }
.card-char-ichi    .igb-current { border-left: 4px solid #db2777; border-color: rgba(219,39,119,.40);  background: rgba(255,240,249,.98); }
.card-char-ken     .igb-current { border-left: 4px solid #b91c1c; border-color: rgba(185,28,28,.45);   background: rgba(255,248,248,.99); }
.card-char-lion    .igb-current { border-left: 4px solid #ca8a04; border-color: rgba(202,138,4,.55);   background: rgba(255,253,215,.99); }
.card-char-teacher .igb-current { border-left: 4px solid #2563eb; border-color: rgba(37,99,235,.45);   background: rgba(239,246,255,.99); }
/* Ichi active-card (dark bg) overrides the light rule above */
.chapter-card-current.card-char-ichi .igb-current { border-left: 4px solid #ec4899; border-color: rgba(244,114,182,.60); background: rgba(255,240,249,.98); color: #831843; }
.chapter-card-current.card-char-ichi .igb-cleared { border-left: 4px solid #22c55e; border-color: rgba(34,197,94,.35);   background: rgba(236,253,245,.95); color: #166534; }





.igb-mascot {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 2px;
}

/* Mascot bg also on grammar button icons */
.igb-char-momo    .igb-mascot { background: linear-gradient(135deg, #f5f5f5, #1c1c1c); }
.igb-char-ichi    .igb-mascot { background: linear-gradient(135deg, #12121e, #ec4899); }
.igb-char-ken     .igb-mascot { background: linear-gradient(135deg, #fecaca, #991b1b); }
.igb-char-lion    .igb-mascot { background: linear-gradient(135deg, #fbbf24, #fffde7); }
.igb-char-teacher .igb-mascot { background: linear-gradient(135deg, #1d4ed8, #bfdbfe); }
.igb-label { flex: 1; }
.igb-badge {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.igb-badge-done  { background: var(--momo-blue); color: #fff; }
.igb-badge-go    { background: var(--momo-yellow); color: #1a1a2e; }
.igb-badge-lock  { background: #e2e6eb; font-size: 0.8rem; }
.igb-badge-stars { background: transparent; color: #f59e0b; font-size: 0.75rem; letter-spacing: -1px; min-width: 36px; }

/* ── Per-chapter Dungeon Chips ── */
.chapter-dungeon-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0.75rem 0.85rem;
    border-top: 1px solid rgba(0,0,0,.06);
    padding-top: 0.6rem;
}
.dungeon-inline-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fff6de, #ffe9a8);
    border: 1.5px solid rgba(165,110,24,.28);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    color: #3a2800;
    cursor: pointer;
    transition: transform .12s;
    box-shadow: 0 2px 6px rgba(140,103,31,.12);
}
.dungeon-inline-chip:not(.dic-locked):hover { transform: translateY(-1px); }
.dic-locked {
    background: linear-gradient(135deg, #f0f3f6, #dde3e9);
    border-color: rgba(160,172,184,.3);
    color: #7a8694;
    cursor: not-allowed;
}
.dic-cleared {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: rgba(22,163,74,.30);
    color: #14532d;
    box-shadow: 0 2px 6px rgba(22,163,74,.14);
}
.dic-cleared .dic-stars { color: #16a34a; }
.dic-icon { font-size: 0.95rem; }
.dic-label { font-weight: 700; }
.dic-stars { font-size: 0.7rem; color: #7d6030; margin-left: 2px; }
.dic-locked .dic-stars { color: #9aa5b1; }

/* Per-character dungeon chip themes */
.card-char-momo .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #f7f7f7, #d8d8d8);
    border-color: rgba(58,58,58,.28);
    color: #1c1c1c;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.card-char-momo .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) .dic-stars { color: #444; }
.card-char-ichi .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #fff8e6, #fdecc8);
    border-color: rgba(180, 138, 62, .34);
    color: #7c5322;
    box-shadow: 0 2px 6px rgba(180,138,62,.12);
}
.card-char-ichi .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) .dic-stars { color: #a16207; }
.card-char-lion .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #fff3c2, #ffd978);
    border-color: rgba(202,138,4,.34);
    color: #8a4b00;
    box-shadow: 0 2px 6px rgba(180,130,0,.14);
}
.card-char-lion .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) .dic-stars { color: #b45309; }
.card-char-ken .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: rgba(153,27,27,.28);
    color: #7f1d1d;
    box-shadow: 0 2px 6px rgba(153,27,27,.12);
}
.card-char-ken .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) .dic-stars { color: #b91c1c; }
.card-char-teacher .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #fffaf2, #ffe6d5);
    border-color: rgba(240, 124, 82, .30);
    color: #7c2d12;
    box-shadow: 0 2px 6px rgba(240,124,82,.12);
}
.card-char-teacher .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) .dic-stars { color: #ea580c; }

/* ── Locked chapter hint ── */
.chapter-locked-hint {
    font-size: 0.8rem;
    color: #8a94a3;
    padding: 0.5rem 0.9rem 0.75rem;
    font-style: italic;
}

/* Faint left spine */
.chapter-trail::before {
    content: "";
    position: absolute;
    top: 1rem;
    bottom: 2.5rem;
    left: 1.7rem;
    width: 4px;
    border-radius: 999px;
    transform: none;
    background: linear-gradient(180deg, rgba(169, 180, 196, 0.35) 0%, rgba(137, 150, 166, 0.10) 100%);
    z-index: 0;
}

/* Vertical connector between chapter cards */
.trail-connector {
    position: relative;
    z-index: 1;
    width: 4px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #c8d3dc, #b8c6d0);
    flex-shrink: 0;
    align-self: flex-start;
    margin-left: 1.45rem;
}
.trail-connector.cleared-conn {
    background: linear-gradient(180deg, var(--momo-blue), var(--momo-blue-deep));
    box-shadow: 0 0 8px rgba(63, 143, 209, 0.3);
}

/* Node row with zigzag */
.trail-node-row {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
}
.offset-left  { justify-content: flex-start; padding-left: 6%; }
.offset-right { justify-content: flex-end;   padding-right: 6%; }

/* Chapter node button — icon-only circle (Duolingo style) */
.chapter-node-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}
.chapter-node-btn:disabled { cursor: not-allowed; }

/* Node circle wrapper with badge */
.node-circle-wrap {
    position: relative;
}

.node-circle {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 5px solid transparent;
    transition: transform .15s;
}
.chapter-node-btn:not(:disabled):hover .node-circle { transform: scale(1.08); }

/* Cleared: deep blue + checkmark */
.node-cleared {
    background: linear-gradient(145deg, var(--momo-blue) 0%, var(--momo-blue-deep) 100%);
    border-color: #7bbde5;
    color: white;
    box-shadow:
        0 0 0 4px rgba(63, 143, 209, 0.18),
        0 8px 22px rgba(28, 93, 148, 0.35);
}

/* Current: warm yellow + pulsing glow ring */
.node-current {
    background: linear-gradient(145deg, #fffbe8 0%, #ffd966 100%);
    border-color: var(--momo-yellow);
    color: #7a3c00;
    animation: node-pulse 2s ease-in-out infinite;
    box-shadow:
        0 0 0 6px rgba(244, 185, 66, 0.28),
        0 8px 22px rgba(217, 138, 31, 0.30);
}
@keyframes node-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(244,185,66,.28), 0 8px 22px rgba(217,138,31,.30); }
    50%       { box-shadow: 0 0 0 15px rgba(244,185,66,.10), 0 8px 22px rgba(217,138,31,.22); }
}

/* Locked: muted gray */
.node-locked {
    background: linear-gradient(145deg, #f0f3f6, #dde3e9);
    border-color: #c2ccd7;
    color: #a0acb8;
    box-shadow: 0 4px 10px rgba(74, 83, 94, 0.12);
}

/* Chapter index number badge */
.node-index-badge {
    position: absolute;
    bottom: -6px;
    right: -8px;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--momo-blue-deep);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.22);
}

/* ── Dungeon Branch Nodes (side branches off chapter nodes) ── */
.dungeon-branch {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.1rem 0;
}
.branch-left  { justify-content: flex-start; padding-left: 8%; }
.branch-right { justify-content: flex-end;   padding-right: 8%; }

.dungeon-line {
    width: 32px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f2c14e, #ee9f42);
    flex-shrink: 0;
}

.dungeon-node {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s;
}
.dungeon-node:not(.dungeon-btn-locked):hover { transform: translateY(-2px) scale(1.06); }

.dungeon-node-star {
    position: absolute;
    bottom: -5px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--momo-yellow-deep);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.18);
}

.dungeon-node.dungeon-btn-unpassed {
    background: linear-gradient(145deg, #ffe9b8, #f7ca60);
    border-color: rgba(165, 110, 24, 0.3);
    box-shadow: 0 6px 14px rgba(120, 80, 10, 0.18);
}
.dungeon-node.dungeon-btn-tried {
    background: linear-gradient(145deg, #ffe5cc, #ffb87a);
    border-color: rgba(175, 98, 38, 0.35);
    box-shadow: 0 6px 14px rgba(140, 70, 20, 0.18);
}
.dungeon-node.dungeon-btn-passed {
    background: linear-gradient(145deg, var(--momo-blue), var(--momo-blue-deep));
    border-color: rgba(31, 95, 149, 0.4);
    box-shadow: 0 6px 14px rgba(28, 93, 148, 0.28);
}
/* Per-character dungeon node — passed/cleared state */
.card-char-momo    .dungeon-btn-passed { background: linear-gradient(145deg, #555, #222);     border-color: rgba(0,0,0,.35);       box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.card-char-ichi    .dungeon-btn-passed { background: linear-gradient(145deg, #ec4899, #9d174d); border-color: rgba(157,23,77,.42);   box-shadow: 0 6px 14px rgba(157,23,77,.28); }
.card-char-ken     .dungeon-btn-passed { background: linear-gradient(145deg, #ef4444, #991b1b); border-color: rgba(153,27,27,.42);   box-shadow: 0 6px 14px rgba(153,27,27,.28); }
.card-char-lion    .dungeon-btn-passed { background: linear-gradient(145deg, #f59e0b, #b45309); border-color: rgba(180,83,9,.40);    box-shadow: 0 6px 14px rgba(180,83,9,.24); }
.card-char-teacher .dungeon-btn-passed { background: linear-gradient(145deg, #3b82f6, #1d4ed8); border-color: rgba(29,78,216,.42);   box-shadow: 0 6px 14px rgba(29,78,216,.26); }
.dungeon-node.dungeon-btn-locked {
    background: linear-gradient(145deg, #f0f3f6, #dde3e9);
    border-color: rgba(97, 107, 118, 0.28);
    color: #a0acb8;
    cursor: not-allowed;
    box-shadow: 0 3px 8px rgba(74, 83, 94, 0.1);
}

.dungeon-branch + .dungeon-branch { margin-top: 0.3rem; }

/* Boss/completion node at end of trail */
.boss-complete {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 0.5rem;
}
.boss-star {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffd700, #ff8c00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto;
    box-shadow:
        0 0 0 8px rgba(255, 200, 0, 0.18),
        0 0 28px rgba(255, 200, 0, 0.5);
    animation: cta-bounce 2s ease-in-out infinite;
}

/* ── Vocabulary Dungeon Grid Section ── */
.vocab-section {
    margin: 1rem 1rem 1.5rem;
    padding: 1rem;
    background: linear-gradient(165deg, rgba(255, 251, 241, 0.95), rgba(255, 240, 206, 0.88));
    border: 1px solid rgba(227, 169, 67, 0.44);
    border-radius: 18px;
    box-shadow: 0 12px 22px rgba(78, 64, 31, 0.10);
}

.vocab-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #7d500e;
    margin-bottom: 0.8rem;
}
.vocab-section-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #9b6720;
}

.vocab-theme-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.vocab-theme-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(196, 137, 35, 0.32);
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 0 5px 12px rgba(88, 64, 24, 0.08);
}

.vocab-theme-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.72rem 0.88rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.vocab-theme-header:hover { background: rgba(255, 248, 230, 0.7); }

.vocab-theme-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a3210;
    flex: 1;
}
.vocab-theme-meta {
    font-size: 0.72rem;
    color: #9b6720;
}
.vocab-theme-toggle {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--momo-blue-deep);
    margin-left: 0.4rem;
    white-space: nowrap;
}

.vocab-theme-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0.88rem 0.75rem;
}
.vocab-preview-more {
    font-size: 0.72rem;
    color: #9b6720;
    display: flex;
    align-items: center;
}

.vocab-dungeon-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0.88rem 0.75rem;
}

.dungeon-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fff6de, #ffe9a8);
    border: 1px solid rgba(165, 110, 24, 0.28);
    border-radius: 10px;
    padding: 0.52rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3a2800;
    cursor: pointer;
    transition: transform .12s;
    box-shadow: 0 3px 8px rgba(140, 103, 31, 0.12);
    font-family: inherit;
}
.dungeon-chip:not(.chip-locked):hover { transform: translateY(-1px); }

.chip-locked {
    background: linear-gradient(135deg, #f0f3f6, #dde3e9);
    border-color: rgba(97, 107, 118, 0.22);
    color: #6a7585;
    cursor: not-allowed;
}

.dungeon-chip.is-preview { font-size: 0.78rem; padding: 0.35rem 0.72rem; }
.chip-name { font-weight: 700; }
.chip-count { font-size: 0.72rem; color: #7d6030; }

/* ── Tap-to-reveal Popup (bottom sheet / modal) ── */
.map-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 28, .52);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: popup-fade .15s ease-out;
}
@keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }

.map-popup-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    padding: 1.8rem 1.3rem 2.2rem;
    box-shadow: 0 -14px 36px rgba(0,0,0,.26);
    animation: popup-rise .22s cubic-bezier(.32,1.1,.4,1) both;
}
@media (min-width: 560px) {
    .map-popup-overlay { align-items: center; }
    .map-popup-card { border-radius: 24px; }
}
@keyframes popup-rise {
    from { transform: translateY(28px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Drag handle */
.map-popup-card::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #dde3e9;
    transform: translateX(-50%);
}

.map-popup-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f2f5;
    color: #52606c;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.map-popup-close:hover { background: #e2e6eb; }

.map-popup-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--momo-blue-deep);
    text-transform: uppercase;
    margin-top: 0.2rem;
}
.map-popup-title {
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--ink-900);
    margin: 0.2rem 0 0.28rem;
    line-height: 1.3;
}
.map-popup-subtext {
    font-size: 0.86rem;
    color: #667288;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.map-popup-lessons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.1rem;
}

.grammar-lesson-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid #dde3e9;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    color: var(--ink-900);
    transition: background .12s, border-color .12s, transform .12s;
    width: 100%;
}
.grammar-lesson-btn:not(:disabled):hover {
    background: #f0f5ff;
    border-color: var(--momo-blue);
    transform: translateY(-1px);
}
.grammar-lesson-btn:disabled { cursor: not-allowed; opacity: .5; }

.map-popup-cta {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    color: #1a1a2e;
    background: linear-gradient(135deg, var(--momo-yellow) 0%, var(--momo-yellow-deep) 100%);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(217, 138, 31, .35);
    transition: transform .15s, box-shadow .15s;
}
.map-popup-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(217, 138, 31, .45);
}
.map-popup-cta:disabled {
    background: #dfe4ea;
    color: #8a94a3;
    box-shadow: none;
    cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .world-map,
    .map-page {
        border-radius: 0;
        margin-bottom: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .map-header { border-radius: 0; }

    .chapter-trail::before { display: none; }

    .offset-left,
    .offset-right {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .branch-left {
        justify-content: flex-start;
        padding-left: 6%;
        padding-right: 0;
    }

    .branch-right {
        justify-content: flex-end;
        padding-left: 0;
        padding-right: 6%;
    }
}

@media (max-width: 520px) {
    .grammar-topic-heading {
        padding: 0.75rem 0.65rem 0.8rem;
    }

    .grammar-topic-heading h1 {
        font-size: 1.05rem;
    }

    .grammar-quiz-stats {
        gap: 0.45rem;
    }

    .grammar-quiz-stat {
        gap: 0.45rem;
        padding: 0.55rem 0.6rem;
    }

    .grammar-stat-icon {
        width: 1.8rem;
        height: 1.8rem;
        flex-basis: 1.8rem;
    }

    .grammar-stat-label {
        font-size: 0.6rem;
    }

    .grammar-stat-value {
        font-size: 0.9rem;
    }

    .grammar-token-option,
    .grammar-token-selected {
        min-height: 44px;
        font-size: 0.76rem;
        padding: 0.25rem 0.3rem;
        line-height: 1.1;
    }

    .grammar-token-drop-slot {
        min-height: 44px;
        flex-basis: 0;
        width: 0;
        min-width: 0;
    }

    .grammar-answer-zone.is-dragging .grammar-token-drop-slot {
        min-height: 52px;
        flex-basis: 48px;
        width: 48px;
        min-width: 48px;
    }

    .grammar-token-drop-marker {
        height: 44px;
    }

    .grammar-answer-zone.is-dragging .grammar-token-drop-marker {
        height: 52px;
    }

    .grammar-token-selected {
        margin: 0.15rem;
    }

    .grammar-token-pool {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

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

    .dungeon-choice {
        min-height: 72px;
        font-size: 1.03rem;
    }
}


/* ════════════════════════════════════════
   Character Reactions (喜怒哀樂)
   ════════════════════════════════════════ */

.character-reaction {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: reaction-pop .3s cubic-bezier(.36,1.6,.5,1) both;
}

.character-reaction-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.18));
    transform-origin: center bottom;
    animation: character-reaction-float 2.6s ease-in-out infinite;
}

.character-reaction-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    animation: character-reaction-float 2.6s ease-in-out infinite;
}

@keyframes reaction-pop {
    0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
    70%  { transform: scale(1.12) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes wm-hero-character-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes character-reaction-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-4px) rotate(1deg); }
}

.completion-character .character-reaction-joy .character-reaction-img,
.completion-character .character-reaction-joy .character-reaction-fallback {
    animation: character-reaction-celebrate 1.9s ease-in-out infinite;
}

@keyframes character-reaction-celebrate {
    0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); }
    50% { transform: translateY(-7px) rotate(2deg) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .wm-hero-logo,
    .podcast-hero-character-motion,
    .podcast-subscription-badge::after,
    .character-reaction,
    .character-reaction-img,
    .character-reaction-fallback {
        animation: none;
    }
}

.feedback-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.feedback-row .dungeon-feedback,
.feedback-row .alert {
    flex: 1;
    margin-bottom: 0;
}

.japanese-ruby {
    ruby-position: over;
    ruby-align: center;
    white-space: nowrap;
}
.japanese-ruby rt {
    color: inherit;
    font-size: 0.42em;
    font-weight: 500;
    line-height: 1;
}
.grammar-correct-answer,
.dungeon-correct-answer {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18em;
    margin-inline-start: 0.25rem;
}
.dungeon-word-kanji .japanese-ruby rt { color: #a8e6cf; }
.dungeon-answer-meaning { font-size: 0.9em; }

.completion-character {
    display: flex;
    justify-content: center;
    margin-bottom: 0.4rem;
}
.completion-character .character-reaction {
    width: 96px;
    height: 96px;
}

.completion-saving {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    margin: 0.8rem auto 0;
    color: var(--momo-ink);
    font-weight: 700;
}
.completion-saving-spinner {
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(28, 93, 148, 0.2);
    border-top-color: var(--momo-blue-deep);
    border-radius: 50%;
    animation: completion-saving-spin 0.8s linear infinite;
}
.completion-saving-dots {
    width: 1.25rem;
    overflow: hidden;
    text-align: left;
    animation: completion-saving-dots 1.2s steps(4, end) infinite;
}
@keyframes completion-saving-spin {
    to { transform: rotate(360deg); }
}
@keyframes completion-saving-dots {
    0%, 20% { width: 0; }
    60%, 100% { width: 1.25rem; }
}

.completion-video-shell {
    width: min(100%, 360px);
    margin: 0.75rem auto 0;
}
.completion-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.completion-actions {
    display: flex;
    justify-content: center;
}
.completion-continue-btn {
    display: inline-flex;
    width: min(100%, 320px);
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.35rem;
    border: 1px solid rgba(28, 93, 148, 0.35);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--momo-blue) 0%, var(--momo-blue-deep) 100%);
    box-shadow: 0 8px 18px rgba(28, 93, 148, 0.2);
    color: #fff;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.completion-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(28, 93, 148, 0.28);
    filter: brightness(1.05);
}
.completion-continue-btn:active {
    transform: translateY(0);
}
.completion-continue-btn:focus-visible {
    outline: 3px solid rgba(244, 185, 66, 0.72);
    outline-offset: 3px;
}
.completion-continue-btn:disabled {
    cursor: wait;
    filter: saturate(0.6);
    opacity: 0.65;
    transform: none;
}
.completion-continue-icon {
    font-size: 1.35em;
    line-height: 0.8;
}

/* Theme settings */
.theme-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.theme-mode-option {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink-900);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.theme-mode-option:hover {
    border-color: var(--momo-blue);
    transform: translateY(-1px);
}

.theme-mode-option.is-selected {
    border-color: var(--momo-yellow-deep);
    background: linear-gradient(135deg, rgba(244, 185, 66, 0.16), rgba(63, 143, 209, 0.11));
    box-shadow: 0 0 0 2px rgba(244, 185, 66, 0.12);
}

.theme-mode-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff2c7;
    color: #9b6400;
    font-size: 1.15rem;
}

.theme-mode-icon-dark {
    background: #26384c;
    color: #f7c85c;
}

.theme-mode-copy {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
}

.theme-mode-copy strong,
.theme-mode-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-mode-copy strong {
    font-size: 0.84rem;
}

.theme-mode-copy small {
    color: var(--text-soft);
    font-size: 0.7rem;
    line-height: 1.35;
}

.theme-mode-check {
    width: 1.25rem;
    flex: 0 0 1.25rem;
    color: var(--momo-yellow-deep);
    font-weight: 800;
    text-align: center;
}

@media (max-width: 420px) {
    .theme-mode-grid {
        grid-template-columns: 1fr;
    }
}

/* Night Trail: preserve level and character accents on a quieter canvas. */
html[data-theme="dark"] {
    --ink-900: #f2f5f8;
    --ink-700: #c0ccd8;
    --paper: #18232e;
    --paper-soft: #202d39;
    --line-soft: rgba(194, 214, 232, 0.18);
    --surface-1: #1c2935;
    --surface-2: #233341;
    --surface-3: #2d3e4d;
    --text-soft: #aab9c8;
    --border-strong: rgba(182, 207, 229, 0.3);
    --profile-panel-bg: #182633;
    --profile-panel-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    --profile-heading-bg: linear-gradient(110deg, #24394a, #2c4050);
    --profile-row-bg: #1b2a37;
    --profile-row-hover-bg: #263b4b;
    --profile-preview-bg: #253543;
    --profile-unavailable-bg: #29343d;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% 0%, rgba(244, 185, 66, 0.09) 0%, transparent 32%),
        radial-gradient(circle at 92% 8%, rgba(63, 143, 209, 0.15) 0%, transparent 34%),
        linear-gradient(180deg, #101922 0%, #15212c 55%, #101820 100%);
    color: var(--ink-900);
}

html[data-theme="dark"] body {
    color-scheme: dark;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu {
    border-color: var(--border-strong);
    background-color: var(--surface-1);
    color: var(--ink-900);
}

html[data-theme="dark"] .mistake-book-kicker {
    color: #f2c75c;
}

html[data-theme="dark"] .mistake-book-heading h6 {
    color: var(--ink-900);
}

html[data-theme="dark"] .mistake-book-total {
    color: #b8c7d5;
}

html[data-theme="dark"] .mistake-book-total strong {
    color: #7fc1f0;
}

html[data-theme="dark"] .source-grammar {
    color: #9bd9f5;
    background: #20475e;
}

html[data-theme="dark"] .source-word {
    color: #f4d48a;
    background: #4a3b20;
}

html[data-theme="dark"] .mistake-answer,
html[data-theme="dark"] .mistake-word-line span {
    color: #8ecaff;
}

html[data-theme="dark"] .mistake-stat-wrong strong,
html[data-theme="dark"] .mistake-stat-rate strong {
    color: #ff8b92;
}

html[data-theme="dark"] .mistake-stat-correct strong {
    color: #6ed6a1;
}

html[data-theme="dark"] .mistake-practice-btn {
    background: #2e7fbb;
}

html[data-theme="dark"] .mistake-practice-btn:hover:not(:disabled) {
    background: #4b9ed4;
}

html[data-theme="dark"] .text-muted {
    color: var(--text-soft) !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
    background-color: var(--surface-2) !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--ink-900) !important;
}

html[data-theme="dark"] a,
html[data-theme="dark"] .btn-link {
    color: #83c5f6;
}

html[data-theme="dark"] .btn-primary {
    background-color: #2e7fbb;
    border-color: #55a5dd;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    border-color: var(--border-strong);
    background-color: #17232e;
    color: var(--ink-900);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #8293a5;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    border-color: #68b5ee;
    background-color: #1b2935;
    color: var(--ink-900);
}

html[data-theme="dark"] .form-select option {
    background-color: #17232e;
    color: var(--ink-900);
}

html[data-theme="dark"] .alert-light {
    border-color: var(--border-strong);
    background-color: var(--surface-2);
    color: var(--ink-900);
}

html[data-theme="dark"] .table {
    --bs-table-color: var(--ink-900);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-strong);
}

html[data-theme="dark"] .mode-btn,
html[data-theme="dark"] .answer-zone {
    border-color: var(--border-strong);
    background: var(--surface-1);
    color: var(--ink-900);
}

html[data-theme="dark"] .mode-locked {
    background: #27333e;
}

html[data-theme="dark"] .prompt-box {
    background: #203346;
    color: var(--ink-900);
}

html[data-theme="dark"] .grammar-quiz-card {
    background:
        radial-gradient(circle at 85% 8%, rgba(244, 185, 66, 0.14) 0%, transparent 36%),
        radial-gradient(circle at 12% 0%, rgba(63, 143, 209, 0.16) 0%, transparent 34%),
        linear-gradient(170deg, #1d2a36 0%, #1a2631 100%);
    border-color: rgba(213, 171, 97, 0.42);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .grammar-topic-heading {
    border-color: rgba(213, 171, 97, 0.42);
    background: linear-gradient(135deg, rgba(62, 52, 35, 0.94), rgba(31, 57, 78, 0.96));
}

html[data-theme="dark"] .grammar-topic-eyebrow {
    color: #e9c978;
}

html[data-theme="dark"] .grammar-topic-heading h1 {
    color: #f3f6f8;
}

html[data-theme="dark"] .grammar-quiz-stat {
    border-color: rgba(187, 206, 222, 0.25);
    background: rgba(36, 52, 66, 0.86);
}

html[data-theme="dark"] .grammar-hp-stat {
    border-color: rgba(255, 139, 146, 0.34);
    background: rgba(78, 42, 48, 0.72);
}

html[data-theme="dark"] .grammar-progress-stat {
    border-color: rgba(112, 184, 233, 0.38);
    background: rgba(31, 57, 78, 0.86);
}

html[data-theme="dark"] .grammar-premium-stat {
    border-color: rgba(233, 201, 120, 0.38);
    background: rgba(73, 59, 32, 0.72);
}

html[data-theme="dark"] .grammar-stat-icon {
    background: rgba(12, 24, 35, 0.42);
}

html[data-theme="dark"] .grammar-stat-label,
html[data-theme="dark"] .grammar-stat-value small {
    color: #b8c7d5;
}

html[data-theme="dark"] .grammar-stat-value {
    color: #f3f6f8;
}

html[data-theme="dark"] .grammar-character-strip {
    background: rgba(26, 38, 49, 0.86);
    border-color: rgba(187, 206, 222, 0.25);
}

html[data-theme="dark"] .grammar-character-label {
    color: #e9c978;
}

html[data-theme="dark"] .grammar-prompt-box {
    border-color: rgba(107, 170, 218, 0.42);
    background: linear-gradient(180deg, rgba(31, 57, 78, 0.96), rgba(27, 48, 67, 0.9));
}

html[data-theme="dark"] .grammar-pronunciation-btn-normal {
    background: transparent;
    color: #e9f5ff;
}

html[data-theme="dark"] .grammar-pronunciation-btn-normal:hover {
    background: rgba(49, 111, 157, 0.42);
}

html[data-theme="dark"] .grammar-pronunciation-btn-slow {
    background: transparent;
    color: #fff0bd;
}

html[data-theme="dark"] .grammar-pronunciation-btn-slow:hover {
    background: rgba(132, 96, 31, 0.48);
}

html[data-theme="dark"] .grammar-speaker-badge.is-partner {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .grammar-speaker-badge.is-target {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"] .grammar-dialogue-text {
    color: #f1f5f9;
}

html[data-theme="dark"] .grammar-dialogue-row.is-target-speaker .grammar-dialogue-text {
    color: #7dd3fc;
}


html[data-theme="dark"] .grammar-answer-zone {
    border-color: rgba(191, 159, 105, 0.4) !important;
    background: linear-gradient(180deg, rgba(33, 45, 55, 0.98), rgba(28, 39, 48, 0.98));
}

html[data-theme="dark"] .grammar-token-option {
    border-color: #526577;
    background: #243442;
    color: #eef4fa;
}

html[data-theme="dark"] .grammar-token-option:hover:not(:disabled) {
    border-color: #70b8e9;
    background: #2d465b;
}

html[data-theme="dark"] .grammar-token-option.is-selected,
html[data-theme="dark"] .grammar-token-option:disabled {
    border-color: #66717b;
    background: #4a545c;
    color: #b7c0c8;
}

html[data-theme="dark"] .grammar-token-selected {
    border-color: #69b5e9;
    background: linear-gradient(135deg, #347eaf, #24587f);
}

html[data-theme="dark"] .grammar-token-drop-marker {
    border-color: rgba(105, 181, 233, 0.9);
}

html[data-theme="dark"] .btn-tts {
    border-color: #6b7e8f;
    color: #dce9f5;
}

html[data-theme="dark"] .btn-tts:hover {
    background: #29435a;
}

html[data-theme="dark"] .dungeon-stat,
html[data-theme="dark"] .dungeon-choice,
html[data-theme="dark"] .dungeon-score-card,
html[data-theme="dark"] .dungeon-exit-btn,
html[data-theme="dark"] .dungeon-return-btn {
    border-color: var(--border-strong);
    background: var(--surface-1);
    color: var(--ink-900);
}

html[data-theme="dark"] .dungeon-stat,
html[data-theme="dark"] .score-row,
html[data-theme="dark"] .dungeon-exit-btn {
    color: var(--text-soft);
}

html[data-theme="dark"] .dungeon-return-btn:hover,
html[data-theme="dark"] .dungeon-exit-btn:hover {
    background: var(--surface-3);
}

html[data-theme="dark"] .dungeon-back-link {
    color: #9fb0bf;
}

html[data-theme="dark"] .dungeon-back-link:hover {
    color: #f0c65b;
}

html[data-theme="dark"] .dungeon-dots .dot-todo,
html[data-theme="dark"] .dungeon-combo.combo-normal,
html[data-theme="dark"] .dungeon-timer-track {
    background: #334453;
}

html[data-theme="dark"] .dungeon-choice:hover:not(:disabled) {
    border-color: #e3b653;
    background: #3b3528;
}

html[data-theme="dark"] .dc-correct,
html[data-theme="dark"] .fb-ok {
    border-color: #38c996 !important;
    background: #163f35 !important;
    color: #baf2db !important;
}

html[data-theme="dark"] .dc-wrong,
html[data-theme="dark"] .fb-x {
    border-color: #eb777e !important;
    background: #48262e !important;
    color: #ffc4c7 !important;
}

html[data-theme="dark"] .result-title,
html[data-theme="dark"] .score-val {
    color: var(--ink-900);
}

html[data-theme="dark"] .result-subtitle {
    color: var(--text-soft);
}

html[data-theme="dark"] .daily-item {
    background: #2d3b48;
    color: #c4d0dc;
}

html[data-theme="dark"] .daily-done {
    background: #194538;
    color: #a9e8ca;
}

html[data-theme="dark"] .wm-hero {
    background: linear-gradient(130deg, #1d2b37 0%, #213c50 100%);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .wm-hero-subtitle,
html[data-theme="dark"] .wm-hero-title {
    color: var(--ink-900);
}

html[data-theme="dark"] .wm-login-reminder {
    border-color: rgba(240, 195, 109, 0.5);
    background: #3b321f;
    color: #f5d98c;
}

html[data-theme="dark"] .hp-banner {
    border-color: #9f555d;
    background: #40272d;
    color: #ffbec2;
}

html[data-theme="dark"] .hp-banner-btn {
    border-color: #9f555d;
    background: #512e34;
    color: #ffc6ca;
}

html[data-theme="dark"] .hp-banner-btn:hover {
    background: #63383e;
}

html[data-theme="dark"] .hp-banner-premium {
    border-color: #b18b39;
    color: #ffe6a1;
}

html[data-theme="dark"] .hp-banner-premium:hover {
    background: #55451f;
}

html[data-theme="dark"] .exp-track,
html[data-theme="dark"] .conn-unlocked {
    background: #354554;
}

html[data-theme="dark"] .wm-active {
    box-shadow: 0 0 0 3px var(--surface-1), 0 0 0 6px rgba(255, 200, 0, 0.65),
        0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .cta-pulse {
    background: #f0c35b;
    color: #1d2730;
}

html[data-theme="dark"] .wdl-title,
html[data-theme="dark"] .map-popup-title {
    color: var(--ink-900);
}

html[data-theme="dark"] .wdl-chips,
html[data-theme="dark"] .wdl-loading {
    background: #1b2935;
}

html[data-theme="dark"] .vocab-section {
    background: linear-gradient(165deg, rgba(55, 46, 28, 0.95), rgba(45, 40, 27, 0.9));
    border-color: rgba(227, 169, 67, 0.52);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .vocab-section-header,
html[data-theme="dark"] .vocab-theme-title,
html[data-theme="dark"] .vocab-theme-header {
    color: #f3d486;
}

html[data-theme="dark"] .vocab-theme-card {
    background: rgba(34, 39, 40, 0.82);
    border-color: rgba(210, 159, 60, 0.4);
}

html[data-theme="dark"] .vocab-theme-header:hover {
    background: rgba(255, 220, 125, 0.1);
}

html[data-theme="dark"] .vocab-theme-meta,
html[data-theme="dark"] .vocab-preview-more,
html[data-theme="dark"] .vocab-section-count {
    color: #d5aa58;
}

html[data-theme="dark"] .dungeon-chip,
html[data-theme="dark"] .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    background: linear-gradient(135deg, #554321, #725c28);
    border-color: rgba(244, 193, 78, 0.55);
    color: #fff0bd;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .dungeon-chip .chip-count,
html[data-theme="dark"] .chip-count,
html[data-theme="dark"] .dic-stars {
    color: #f3d789;
}

html[data-theme="dark"] .chip-locked,
html[data-theme="dark"] .dic-locked,
html[data-theme="dark"] .node-locked,
html[data-theme="dark"] .dungeon-node.dungeon-btn-locked,
html[data-theme="dark"] .chapter-card-locked {
    background: linear-gradient(145deg, #2b3640, #202b34);
    border-color: rgba(154, 174, 191, 0.35);
    color: #9eafbd;
}

html[data-theme="dark"] .dic-cleared {
    background: linear-gradient(135deg, #1d503e, #27694d);
    border-color: rgba(78, 206, 142, 0.45);
    color: #c0f1d5;
}

html[data-theme="dark"] .map-page {
    background:
        radial-gradient(circle at 15% 8%, rgba(244, 185, 66, 0.11) 0%, transparent 36%),
        radial-gradient(circle at 85% 12%, rgba(63, 143, 209, 0.14) 0%, transparent 34%),
        linear-gradient(180deg, #1a2732 0%, #17232d 100%);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .chapter-card-cleared {
    background: linear-gradient(160deg, #1c3546, #1b2d3c);
    border-color: rgba(94, 174, 226, 0.38);
}

html[data-theme="dark"] .chapter-card-current {
    background: linear-gradient(160deg, #44391f, #332d1d);
    border-color: rgba(244, 185, 66, 0.58);
}

html[data-theme="dark"] .chapter-card-current.card-char-momo {
    background: linear-gradient(160deg, #34404a, #26313a);
    border-color: rgba(200, 215, 227, 0.46);
}

html[data-theme="dark"] .chapter-card-current.card-char-ichi {
    background: linear-gradient(160deg, #4a2e43, #352333);
    border-color: rgba(236, 111, 170, 0.62);
}

html[data-theme="dark"] .chapter-card-current.card-char-ken {
    background: linear-gradient(160deg, #4a2d32, #342328);
    border-color: rgba(233, 108, 108, 0.58);
}

html[data-theme="dark"] .chapter-card-current.card-char-lion {
    background: linear-gradient(160deg, #51431d, #392f1a);
    border-color: rgba(241, 193, 62, 0.62);
}

html[data-theme="dark"] .chapter-card-current.card-char-teacher {
    background: linear-gradient(160deg, #294361, #203349);
    border-color: rgba(111, 174, 247, 0.58);
}

html[data-theme="dark"] .chapter-card-cleared.card-char-momo {
    background: linear-gradient(160deg, #2c3740, #242e36);
}

html[data-theme="dark"] .chapter-card-cleared.card-char-ichi {
    background: linear-gradient(160deg, #3b2938, #2d222d);
}

html[data-theme="dark"] .chapter-card-cleared.card-char-ken {
    background: linear-gradient(160deg, #3c292d, #2d2226);
}

html[data-theme="dark"] .chapter-card-cleared.card-char-lion {
    background: linear-gradient(160deg, #44391d, #332d1b);
}

html[data-theme="dark"] .chapter-card-cleared.card-char-teacher {
    background: linear-gradient(160deg, #273c55, #203247);
}

html[data-theme="dark"] .chapter-card-title,
html[data-theme="dark"] .chapter-card-focus {
    color: var(--ink-900);
}

html[data-theme="dark"] .chapter-card-focus {
    color: #b6c3d0;
}

html[data-theme="dark"] .inline-grammar-btn {
    border-color: rgba(174, 198, 218, 0.28);
    background: rgba(27, 40, 51, 0.9);
    color: #edf3f8;
}

html[data-theme="dark"] .inline-grammar-btn:not(:disabled):hover,
html[data-theme="dark"] .grammar-lesson-btn:not(:disabled):hover {
    background: #29445b;
    border-color: #66abe0;
}

html[data-theme="dark"] .igb-cleared,
html[data-theme="dark"] .card-char-momo .igb-cleared,
html[data-theme="dark"] .card-char-ichi .igb-cleared,
html[data-theme="dark"] .card-char-ken .igb-cleared,
html[data-theme="dark"] .card-char-lion .igb-cleared,
html[data-theme="dark"] .card-char-teacher .igb-cleared {
    border-color: rgba(57, 197, 137, 0.42);
    border-left-color: #37c98d;
    background: rgba(24, 70, 55, 0.9);
    color: #b9efd3;
}

html[data-theme="dark"] .igb-current,
html[data-theme="dark"] .card-char-momo .igb-current,
html[data-theme="dark"] .card-char-ichi .igb-current,
html[data-theme="dark"] .card-char-ken .igb-current,
html[data-theme="dark"] .card-char-lion .igb-current,
html[data-theme="dark"] .card-char-teacher .igb-current {
    border-color: rgba(242, 190, 80, 0.52);
    border-left-color: #e4b33f;
    background: rgba(65, 53, 27, 0.92);
    color: #ffe6a2;
}

html[data-theme="dark"] .chapter-card-current.card-char-ichi .igb-current {
    border-color: rgba(244, 114, 182, 0.62);
    border-left-color: #ec6fae;
    background: rgba(71, 38, 61, 0.96);
    color: #ffd1e8;
}

html[data-theme="dark"] .chapter-card-current.card-char-ichi .igb-cleared {
    background: rgba(24, 70, 55, 0.94);
    color: #b9efd3;
}

html[data-theme="dark"] .chapter-dungeon-row {
    border-top-color: rgba(187, 204, 219, 0.14);
}

html[data-theme="dark"] .chapter-locked-hint,
html[data-theme="dark"] .map-popup-subtext {
    color: #aab9c8;
}

html[data-theme="dark"] .trail-connector,
html[data-theme="dark"] .chapter-trail::before {
    background: linear-gradient(180deg, #516577, #344553);
}

html[data-theme="dark"] .node-index-badge,
html[data-theme="dark"] .dungeon-node-star {
    border-color: #1b2834;
}

html[data-theme="dark"] .map-hint-banner {
    border-color: rgba(226, 169, 91, 0.52);
    background: #3e3020;
    color: #f1ce91;
}

html[data-theme="dark"] .map-popup-card {
    background: var(--paper);
    color: var(--ink-900);
}

html[data-theme="dark"] .map-popup-card::before {
    background: #617486;
}

html[data-theme="dark"] .map-popup-close {
    background: #2b3b4a;
    color: #d3e0eb;
}

html[data-theme="dark"] .map-popup-close:hover {
    background: #3a5062;
}

html[data-theme="dark"] .grammar-lesson-btn {
    border-color: var(--border-strong);
    background: #223341;
    color: var(--ink-900);
}

html[data-theme="dark"] .completion-video {
    border-color: var(--border-strong);
    background: #17232e;
}

html[data-theme="dark"] .momo-loading {
    background:
        linear-gradient(135deg, rgba(244, 185, 66, 0.08) 0 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(45deg, rgba(63, 143, 209, 0.08) 0 1px, transparent 1px) 14px 14px / 28px 28px,
        linear-gradient(180deg, #1e2a31 0%, #18232b 100%);
    color: #fff7ea;
}

html[data-theme="dark"] .momo-loading::before {
    background: linear-gradient(118deg, transparent 0 42%, rgba(104, 182, 232, 0.1) 42.2% 42.45%, transparent 42.7% 100%);
}

html[data-theme="dark"] .momo-loading::after {
    border-color: rgba(104, 182, 232, 0.24);
    box-shadow: 0 0 0 1.5rem rgba(244, 185, 66, 0.06), 0 0 0 3rem rgba(104, 182, 232, 0.04);
}

html[data-theme="dark"] .momo-loading-topline,
html[data-theme="dark"] .momo-loading-footer {
    border-color: rgba(255, 247, 234, 0.22);
    color: #9ed5f5;
}

html[data-theme="dark"] .momo-loading-english span:first-child,
html[data-theme="dark"] .momo-loading-status {
    color: #9ed5f5;
}

html[data-theme="dark"] .momo-loading-english span:last-child,
html[data-theme="dark"] .momo-loading-brand strong {
    color: #fff7ea;
}

html[data-theme="dark"] .momo-loading-character-wrap::before {
    border-color: rgba(158, 213, 245, 0.48);
}

html[data-theme="dark"] .momo-loading-character-wrap::after {
    border-color: rgba(244, 185, 66, 0.82);
    border-left-color: transparent;
    border-bottom-color: transparent;
}

html[data-theme="dark"] .momo-loading-route-pin {
    border-color: #fff7ea;
}

html[data-theme="dark"] .momo-loading-stamp {
    border-color: #fff7ea;
    box-shadow: 0.2rem 0.2rem 0 #fff7ea;
}

html[data-theme="dark"] .momo-loading-footer-level,
html[data-theme="dark"] .momo-loading-route-label {
    color: #f4b942;
}

html[data-theme="dark"] .momo-loading-progress span {
    border-color: #68b6e8;
}

html[data-theme="dark"] code {
    color: #f08ab5;
}

.world-map {
    max-width: 760px;
    padding: 1.25rem 1rem 4rem;
}

.wm-hero {
    min-height: 168px;
    margin-bottom: 1rem;
    padding: 1.45rem 1.5rem;
    border: 1px solid rgba(28, 93, 148, 0.2);
    border-left: 5px solid var(--momo-yellow-deep);
    border-radius: 22px;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0.92), rgba(237, 247, 255, 0.78)),
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(63, 143, 209, 0.06) 18px 20px);
    box-shadow: 0 14px 30px rgba(55, 83, 109, 0.12);
}

.wm-hero-premium {
    border-color: rgba(217, 138, 31, 0.52);
    background:
        linear-gradient(118deg, rgba(255, 252, 238, 0.96), rgba(237, 247, 255, 0.78)),
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(217, 138, 31, 0.05) 18px 20px);
    box-shadow: 0 14px 30px rgba(55, 83, 109, 0.12), inset 0 0 0 1px rgba(255, 222, 131, 0.22);
}

.wm-hero-premium::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    background: radial-gradient(circle at 88% 18%, rgba(217, 138, 31, 0.14), transparent 38%);
    pointer-events: none;
}

.wm-hero-copy {
    flex: 1 1 auto;
    max-width: 68%;
}

.wm-hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
}

.wm-hero-side .wm-hero-logo {
    align-self: flex-end;
}

.wm-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    margin-top: 0.9rem;
}

.wm-hero-premium-badge {
    position: relative;
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 0.38rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.3rem 0.62rem 0.3rem 0.35rem;
    border: 1px solid rgba(255, 221, 131, 0.78);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffeaa1, #d9952b);
    color: #27313a;
    box-shadow: 0 5px 14px rgba(57, 43, 18, 0.28), inset 0 1px 0 rgba(255, 255, 232, 0.7);
    pointer-events: none;
    user-select: none;
}

.wm-hero-premium-badge-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    flex: 0 0 1.3rem;
    border-radius: 50%;
    background: #fff4bd;
    color: #765018;
    font-size: 0.78rem;
    box-shadow: 0 0 0 2px rgba(255, 248, 200, 0.32);
}

.wm-hero-premium-badge-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1;
}

.wm-hero-premium-badge-copy strong {
    color: #2d3032;
    font-size: 0.68rem;
    font-weight: 900;
}

.wm-hero-premium-badge-copy small {
    margin-top: 0.14rem;
    overflow: hidden;
    color: #6b4b17;
    font-size: 0.5rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-hero-title {
    font-size: 2.1rem;
    letter-spacing: 0;
    line-height: 1.15;
}

.wm-hero-subtitle {
    max-width: 25rem;
    margin-top: 0.55rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.wm-hero-logo {
    flex-basis: 142px;
    width: 142px;
    height: 112px;
    opacity: 1;
    filter: drop-shadow(0 8px 8px rgba(28, 31, 38, 0.12));
}

.wm-login-reminder,
.wm-premium-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(99, 78, 28, 0.08);
}

.wm-login-reminder {
    border: 1px solid rgba(63, 143, 209, 0.28);
    background: linear-gradient(110deg, #eef8ff, #ffffff);
    color: #194c76;
}

.wm-premium-reminder {
    border: 1px solid rgba(217, 138, 31, 0.48);
    background: linear-gradient(110deg, #fff8dc, #fffdf4);
    color: #5e470f;
}

.wm-login-reminder-copy,
.wm-premium-reminder-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.wm-login-reminder-copy > div,
.wm-premium-reminder-copy > div {
    min-width: 0;
}

.wm-login-reminder-copy strong,
.wm-login-reminder-copy span:last-child,
.wm-premium-reminder-copy strong,
.wm-premium-reminder-copy > div > span {
    display: block;
}

.wm-login-reminder-copy span:last-child,
.wm-premium-reminder-copy > div > span {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.wm-login-reminder-icon,
.wm-premium-reminder-icon {
    flex: 0 0 auto;
    font-size: 1.45rem;
    line-height: 1.15;
}

.wm-premium-reminder-icon {
    color: var(--momo-yellow-deep);
}

.wm-premium-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    margin-top: 0.5rem;
    color: #795f16;
    font-size: 0.76rem;
    font-weight: 800;
}

.wm-login-reminder-btn,
.wm-premium-reminder-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.wm-login-reminder-btn {
    background: var(--momo-blue-deep);
}

.wm-premium-reminder-btn {
    background: var(--momo-yellow-deep);
}

.wm-login-reminder-btn:hover,
.wm-premium-reminder-btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

.wm-status-panel {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem 1.05rem;
    border: 1px solid rgba(28, 93, 148, 0.16);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 253, 0.9));
    box-shadow: 0 14px 30px rgba(57, 71, 88, 0.1);
}

.wm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.05rem 0.05rem 0.9rem;
    border-bottom: 1px solid rgba(28, 31, 38, 0.1);
}

.wm-header-left,
.wm-header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.wm-header-right {
    justify-content: flex-end;
    margin-left: auto;
}

.wm-japanese-level {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 2.3rem;
    padding: 0.28rem 0.62rem;
    border: 1px solid rgba(201, 151, 45, 0.32);
    border-radius: 13px;
    background: #fff7d9;
    color: #805712;
    box-shadow: 0 4px 10px rgba(187, 143, 38, 0.1);
}

.wm-japanese-flag {
    display: block;
    flex: 0 0 auto;
    width: 1.4rem;
    height: 0.94rem;
    border: 1px solid rgba(188, 0, 45, 0.18);
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(57, 71, 88, 0.12);
}

.wm-japanese-level strong {
    display: inline-block;
    min-width: 1.15rem;
    text-align: center;
    font-size: 1.08rem;
    line-height: 1;
}

.wm-streak {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.3rem;
    padding: 0.28rem 0.62rem;
    border: 1px solid rgba(200, 91, 55, 0.16);
    border-radius: 13px;
    background: #fff1ed;
    color: #a6533b;
    font-size: 0.86rem;
    font-weight: 800;
}

.wm-streak-icon {
    font-size: 1rem;
}

.streak-active {
    color: #c75b37;
}

.wm-character-glance {
    min-width: 5.8rem;
    text-align: right;
}

.wm-character-level {
    display: block;
    color: var(--momo-blue-deep);
    font-size: 1.2rem;
    line-height: 1.05;
}

.wm-character-title {
    display: block;
    margin-top: 0.2rem;
    color: #687789;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
}

.wm-resource-grid {
    display: grid;
    gap: 1rem;
    margin-top: 0.05rem;
}

.wm-resource-grid-with-hp {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.wm-resource-grid-only-exp {
    grid-template-columns: minmax(0, 1fr);
}

.wm-hp-block {
    min-width: 0;
    padding: 0.78rem 0.9rem;
    border-radius: 16px;
    background: rgba(239, 248, 255, 0.78);
}

.wm-hp-block-empty {
    background: #fff2ef;
}

.wm-resource-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.wm-resource-heading h2 {
    margin: 0;
    color: var(--ink-900);
    font-size: 0.98rem;
    font-weight: 900;
}

.wm-hp-meta,
.wm-exp-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.wm-hp-heading h2 {
    margin: 0;
    color: var(--ink-900);
    font-size: 1rem;
    font-weight: 800;
}

.wm-hp {
    display: flex;
    gap: 0.15rem;
    white-space: nowrap;
}

.wm-hp .hp-full,
.wm-hp .hp-empty {
    font-size: 1.15rem;
}

.wm-hp .hp-full {
    color: #e84c68;
}

.wm-hp-meta {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 0.45rem;
    color: #687789;
    font-size: 0.78rem;
}

.wm-hp-ad-status {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    max-width: 100%;
    padding: 0.22rem 0.48rem;
    border: 1px solid rgba(46, 125, 80, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: #4c7561;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.wm-hp-ad-icon {
    flex: 0 0 auto;
    color: #d6922d;
    font-size: 0.72rem;
    line-height: 1;
}

.hp-ad-used {
    border-color: rgba(141, 154, 170, 0.2);
    background: rgba(255, 255, 255, 0.42);
    color: #687789;
}

.hp-reset-hint {
    border-color: rgba(28, 93, 148, 0.2);
    color: var(--momo-blue-deep);
}

.hp-reset-hint .wm-hp-ad-icon {
    color: var(--momo-blue);
}

.wm-hp-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.wm-exp-section {
    min-width: 0;
    align-self: center;
    padding: 0.78rem 0.9rem;
}

.wm-resource-grid-with-hp .wm-exp-section {
    border-left: 1px solid rgba(28, 93, 148, 0.12);
}

.wm-exp-labels {
    color: #687789;
    font-size: 0.75rem;
    font-weight: 800;
}

.exp-track {
    height: 10px;
    margin-top: 0.4rem !important;
    background: #dfe9f0;
    border-radius: 999px;
}

.exp-fill {
    background: linear-gradient(90deg, var(--momo-yellow-deep), var(--momo-blue));
}

.wm-daily-bar {
    gap: 0.45rem;
    margin: 0 0 0.9rem;
    padding: 0 0.1rem;
}

.daily-item {
    border: 1px solid rgba(28, 31, 38, 0.1);
    background: rgba(255, 255, 255, 0.62);
    color: #687789;
    font-size: 0.74rem;
}

.daily-done {
    border-color: rgba(46, 125, 80, 0.22);
    background: #e5f6ec;
    color: #2e7d50;
}

.daily-hint {
    border: 0;
    background: transparent;
    color: #8d9aaa;
}

.wm-hint-banner {
    margin: 0 0 0.9rem;
    border: 1px solid #f1c68b;
    border-radius: 12px;
    background: #fff3e1;
    color: #7a3417;
}

.wm-path {
    gap: 0.7rem;
}

.wm-level-card {
    min-height: 122px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(55, 71, 88, 0.14);
}

.wm-level-card:hover:not(.wm-locked) {
    box-shadow: 0 13px 26px rgba(55, 71, 88, 0.2) !important;
}

.wm-card-emoji {
    width: 3.1rem;
    font-size: 2.55rem;
    text-align: center;
}

.wm-card-desc {
    margin-top: 0.2rem;
    line-height: 1.45;
}

.wm-progress-row {
    margin-top: 0.7rem !important;
}

.wm-mini-bar {
    height: 7px;
}

.wm-card-cta {
    padding: 0.45rem 0.8rem;
    border-radius: 11px;
}

.wm-active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.96), 0 0 0 6px rgba(217, 138, 31, 0.68), 0 12px 26px rgba(55, 71, 88, 0.18) !important;
}

.wm-connector {
    padding: 0.1rem 0;
}

.conn-unlocked,
.conn-locked {
    height: 18px;
}

@media (max-width: 576px) {
    .world-map {
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }

    .wm-hero {
        min-height: 142px;
        padding: 1.1rem 1rem;
        border-radius: 18px;
    }

    .wm-hero-copy {
        max-width: none;
    }

    .wm-hero-title {
        font-size: 1.7rem;
    }

    .wm-hero-subtitle {
        font-size: 0.82rem;
    }

    .wm-hero-logo {
        flex-basis: 88px;
        width: 88px;
        height: 76px;
    }

    .wm-login-reminder,
    .wm-premium-reminder {
        align-items: flex-start;
        flex-direction: column;
    }

    .wm-login-reminder-btn,
    .wm-premium-reminder-btn {
        align-self: flex-end;
    }

    .wm-status-panel {
        padding: 0.85rem;
        border-radius: 17px;
    }

    .wm-header {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .wm-header-left {
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .wm-header-right {
        flex-shrink: 0;
        justify-content: flex-end;
        margin-left: auto;
    }

    .wm-character-glance {
        min-width: 5.8rem;
        flex: 0 1 auto;
    }

    .wm-character-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .premium-member-badge {
        flex: 0 1 auto;
        min-width: 8.8rem;
        order: initial;
    }

    .wm-resource-grid-with-hp {
        grid-template-columns: minmax(0, 1fr);
    }

    .wm-resource-grid-with-hp .wm-exp-section {
        padding: 0.9rem 0.9rem 0.2rem;
        border-top: 1px solid rgba(28, 93, 148, 0.12);
        border-left: 0;
    }

    .wm-level-card {
        min-height: 116px;
        padding: 0.85rem;
    }

    .wm-card-emoji {
        width: 2.6rem;
        font-size: 2.1rem;
    }

    .wm-card-cta {
        padding-right: 0.6rem;
        padding-left: 0.6rem;
        font-size: 0.75rem;
    }
}

html[data-theme="dark"] .wm-hero {
    border-color: rgba(164, 199, 226, 0.22);
    border-left-color: #e2aa3d;
    background:
        linear-gradient(118deg, rgba(29, 48, 63, 0.98), rgba(32, 60, 80, 0.96)),
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(164, 199, 226, 0.06) 18px 20px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .wm-hero-premium {
    border-color: rgba(226, 170, 61, 0.62);
    background:
        linear-gradient(118deg, rgba(29, 44, 54, 0.98), rgba(32, 60, 80, 0.96) 64%, rgba(71, 55, 28, 0.9)),
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(226, 170, 61, 0.07) 18px 20px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 222, 131, 0.16);
}

html[data-theme="dark"] .wm-hero-premium::after {
    background: radial-gradient(circle at 88% 18%, rgba(226, 170, 61, 0.16), transparent 38%);
}


html[data-theme="dark"] .wm-login-reminder {
    border-color: rgba(105, 177, 224, 0.38);
    background: linear-gradient(110deg, #1e3a4d, #223341);
    color: #c8eaff;
}

html[data-theme="dark"] .wm-premium-reminder {
    border-color: rgba(226, 170, 61, 0.52);
    background: linear-gradient(110deg, #3e351f, #302d26);
    color: #ffe6a1;
}

html[data-theme="dark"] .wm-premium-benefits {
    color: #f2c96e;
}

html[data-theme="dark"] .wm-status-panel {
    border-color: rgba(182, 207, 229, 0.22);
    background: linear-gradient(145deg, rgba(28, 41, 53, 0.96), rgba(24, 36, 47, 0.94));
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .wm-header {
    border-bottom-color: rgba(194, 214, 232, 0.16);
}

html[data-theme="dark"] .wm-japanese-level {
    border-color: rgba(226, 170, 61, 0.38);
    background: #3b3322;
    color: #ffe8a4;
    box-shadow: none;
}

html[data-theme="dark"] .wm-japanese-flag {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

html[data-theme="dark"] .wm-streak {
    border-color: rgba(235, 119, 126, 0.24);
    background: #3b2c31;
    color: #ffc2b3;
}

html[data-theme="dark"] .wm-character-level {
    color: #a9ddff;
}

html[data-theme="dark"] .wm-character-title,
html[data-theme="dark"] .wm-hp-meta,
html[data-theme="dark"] .wm-exp-labels {
    color: var(--text-soft);
}

html[data-theme="dark"] .wm-hp-block {
    background: #203746;
}

html[data-theme="dark"] .wm-hp-block-empty {
    background: #40272d;
}

html[data-theme="dark"] .wm-hp-ad-status {
    border-color: rgba(91, 201, 150, 0.28);
    background: rgba(25, 69, 56, 0.72);
    color: #a9e8ca;
}

html[data-theme="dark"] .wm-hp-ad-status.hp-ad-used {
    border-color: rgba(194, 214, 232, 0.18);
    background: rgba(45, 59, 72, 0.72);
    color: #aab9c8;
}

html[data-theme="dark"] .wm-hp-ad-status.hp-reset-hint {
    border-color: rgba(169, 220, 255, 0.26);
    background: rgba(28, 57, 82, 0.72);
    color: #a9dcff;
}

html[data-theme="dark"] .hp-reset-hint .wm-hp-ad-icon {
    color: #a9dcff;
}

html[data-theme="dark"] .wm-resource-grid-with-hp .wm-exp-section {
    border-left-color: rgba(194, 214, 232, 0.16);
}

@media (max-width: 576px) {
    html[data-theme="dark"] .wm-resource-grid-with-hp .wm-exp-section {
        border-top-color: rgba(194, 214, 232, 0.16);
        border-left-color: transparent;
    }
}

html[data-theme="dark"] .exp-track {
    background: #354554;
}

html[data-theme="dark"] .daily-item {
    border-color: rgba(194, 214, 232, 0.18);
    background: #2d3b48;
    color: #c4d0dc;
}

html[data-theme="dark"] .daily-done {
    border-color: rgba(91, 201, 150, 0.28);
    background: #194538;
    color: #a9e8ca;
}

html[data-theme="dark"] .daily-hint {
    border-color: transparent;
    background: transparent;
    color: #8fa1b2;
}

html[data-theme="dark"] .wm-hint-banner {
    border-color: rgba(241, 198, 139, 0.35);
    background: #3a3024;
    color: #f2cd9b;
}

html[data-theme="dark"] .wm-level-card {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .wm-active {
    box-shadow: 0 0 0 3px var(--surface-1), 0 0 0 6px rgba(255, 200, 0, 0.68), 0 12px 26px rgba(0, 0, 0, 0.36) !important;
}

html[data-theme="dark"] .cta-pulse {
    background: #f0c35b;
    color: #25282d;
}

html[data-theme="dark"] .wm-n5,
html[data-theme="dark"] .map-n5 {
    background: linear-gradient(135deg, #5b4325 0%, #7b5424 100%);
}

html[data-theme="dark"] .wm-kana {
    background: linear-gradient(135deg, #8a6a21 0%, #245d8d 100%);
}

/* ── Food Dungeon Menu ── */
.word-menu-page {
    max-width: 640px;
}

.word-menu-header-subtitle {
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 600;
}

.word-menu-content {
    padding: 1.25rem 0.75rem 3rem;
}

.word-menu-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.8rem;
    padding: 0 0.25rem;
}

.word-menu-section-heading h2 {
    margin: 0;
    color: var(--ink-900);
    font-size: 1.05rem;
    font-weight: 800;
}

.word-menu-section-heading p {
    margin: 0.2rem 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.word-menu-course-list {
    gap: 0.7rem;
}

.word-menu-clickable {
    cursor: pointer;
}

.word-menu-clickable:focus-visible,
.word-dungeon-chip:focus-visible {
    outline: 3px solid rgba(63, 143, 209, 0.55);
    outline-offset: 3px;
}

.word-dungeon-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.word-dungeon-chip {
    width: 100%;
    min-height: 4.4rem;
    padding: 0.72rem 0.85rem;
    text-align: start;
}

.word-dungeon-chip .dic-label {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
}

.word-dungeon-name {
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-dungeon-meta {
    color: rgba(58, 40, 0, 0.68);
    font-size: 0.72rem;
    font-weight: 600;
}

.word-dungeon-chip.dic-cleared .word-dungeon-meta {
    color: rgba(20, 83, 45, 0.72);
}

.word-dungeon-chip.dic-locked .word-dungeon-meta {
    color: #7a8694;
}

.word-dungeon-action {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

html[data-theme="dark"] .word-menu-section-heading h2 {
    color: var(--text-strong);
}

html[data-theme="dark"] .word-menu-section-heading p {
    color: var(--text-soft);
}

html[data-theme="dark"] .word-dungeon-meta {
    color: rgba(255, 234, 180, 0.72);
}

html[data-theme="dark"] .word-dungeon-chip.dic-cleared .word-dungeon-meta {
    color: rgba(194, 245, 211, 0.78);
}

@media (max-width: 576px) {
    .word-menu-content {
        padding-right: 0.55rem;
        padding-left: 0.55rem;
    }

    .word-dungeon-chip {
        min-height: 4.1rem;
        padding-right: 0.7rem;
        padding-left: 0.7rem;
    }

    .word-dungeon-action {
        font-size: 0.65rem;
    }
}

html[data-theme="dark"] .wm-n5 {
    border-color: rgba(244, 185, 66, 0.4);
}

/* ── Kana Adventure ── */
.kana-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

.kana-back-btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(28, 93, 148, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--momo-blue-deep);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.kana-back-btn:hover {
    transform: translateY(-1px);
    border-color: var(--momo-blue);
    background: rgba(63, 143, 209, 0.08);
}

html[data-theme="dark"] .kana-back-btn {
    border-color: rgba(194, 214, 232, 0.35);
    background: rgba(194, 214, 232, 0.12);
    color: var(--text-strong);
}

html[data-theme="dark"] .kana-back-btn:hover {
    border-color: var(--momo-blue);
    background: rgba(63, 143, 209, 0.28);
}

.kana-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(28, 93, 148, 0.2);
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(255, 253, 247, 0.96), rgba(232, 245, 255, 0.92));
    box-shadow: 0 12px 28px rgba(28, 93, 148, 0.09);
}

.kana-eyebrow,
.kana-section-label {
    display: block;
    color: var(--momo-blue-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kana-hero h1 {
    margin: 0.2rem 0 0.25rem;
    color: var(--momo-ink);
    font-size: clamp(1.7rem, 4vw, 2.55rem);
    font-weight: 800;
}

.kana-hero p {
    max-width: 42rem;
    margin: 0;
    color: var(--ink-700);
    font-size: 0.92rem;
}

.kana-progress-summary {
    padding-left: 1rem;
    border-left: 3px solid var(--momo-yellow);
}

.kana-progress-summary span,
.kana-progress-summary strong {
    display: block;
}

.kana-progress-summary span {
    color: var(--ink-700);
    font-size: 0.76rem;
    font-weight: 700;
}

.kana-progress-summary strong {
    margin-top: 0.15rem;
    color: var(--momo-ink);
    font-size: 1.45rem;
}

.kana-progress-bar {
    height: 0.45rem;
    margin-top: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(28, 93, 148, 0.14);
}

.kana-progress-bar span {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--momo-yellow), var(--momo-blue));
    transition: width 0.35s ease;
}

.kana-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.kana-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(28, 93, 148, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-700);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.kana-tab:hover {
    transform: translateY(-1px);
    border-color: var(--momo-blue);
}

.kana-tab.is-active {
    border-color: var(--momo-blue-deep);
    background: var(--momo-blue-deep);
    color: #fff;
}

.kana-tab-character {
    font-family: 'Noto Sans JP', 'M PLUS 1p', sans-serif;
    font-size: 1.25rem;
    line-height: 1;
}

.kana-workbench {
    display: grid;
    grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.45fr);
    gap: 1rem;
    align-items: start;
}

.kana-index-panel,
.kana-study-panel {
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(57, 71, 88, 0.08);
}

.kana-index-panel {
    padding: 1rem;
}

.kana-index-heading,
.kana-study-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
}

.kana-index-heading {
    margin-bottom: 0.85rem;
}

.kana-study-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.kana-index-panel.is-collapsed .kana-index-heading {
    margin-bottom: 0;
}

.kana-index-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kana-index-heading strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--momo-ink);
    font-size: 1.05rem;
}

.kana-index-count,
.kana-stroke-count {
    color: var(--momo-blue-deep);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.kana-index-toggle,
.kana-study-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(28, 93, 148, 0.24);
    border-radius: 8px;
    background: transparent;
    color: var(--momo-blue-deep);
    cursor: pointer;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
}

.kana-index-toggle {
    width: 2rem;
    padding: 0.2rem;
    font-size: 1.05rem;
    line-height: 1;
}

.kana-index-toggle:hover,
.kana-study-tool:hover {
    border-color: var(--momo-blue);
    background: rgba(63, 143, 209, 0.08);
}

.kana-character-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
}

.kana-character-tile {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 4.15rem;
    place-items: center;
    padding: 0.35rem 0.2rem 0.25rem;
    border: 1px solid rgba(28, 93, 148, 0.14);
    border-radius: 10px;
    background: rgba(255, 253, 247, 0.84);
    color: var(--ink-900);
    cursor: pointer;
    font: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.kana-character-tile:hover,
.kana-character-tile.is-current {
    transform: translateY(-1px);
    border-color: var(--momo-blue);
    box-shadow: 0 4px 10px rgba(28, 93, 148, 0.14);
}

.kana-character-tile.is-current {
    outline: 2px solid rgba(244, 185, 66, 0.75);
    outline-offset: 1px;
}

.kana-character-tile.is-completed {
    background: #eef9f2;
}

.kana-character-tile.is-locked {
    cursor: not-allowed;
    opacity: 0.52;
}

.kana-character-tile.is-locked:hover {
    transform: none;
    border-color: rgba(28, 93, 148, 0.14);
    box-shadow: none;
}

.kana-tile-glyph {
    font-family: 'Noto Sans JP', 'M PLUS 1p', sans-serif;
    font-size: 1.55rem;
    line-height: 1;
}

.kana-character-tile small {
    color: var(--ink-700);
    font-size: 0.66rem;
    font-weight: 700;
}

.kana-tile-check {
    position: absolute;
    top: 0.2rem;
    right: 0.28rem;
    color: #2e7d50;
    font-size: 0.65rem;
    font-weight: 800;
}

.kana-study-panel {
    min-width: 0;
    padding: 1.2rem;
}

.kana-stroke-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(63, 143, 209, 0.1);
}

.kana-reading-line .kana-stroke-count {
    margin-right: 0.05rem;
    font-size: 0.72rem;
}

.kana-study-tools {
    display: flex;
    align-self: end;
    gap: 0.45rem;
    margin-bottom: 0.05rem;
}

.kana-study-tool {
    width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1;
}

.kana-reading-line {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-top: 0.15rem;
}

.kana-reading-line h2 {
    margin: 0;
    color: var(--momo-ink);
    font-family: 'Noto Sans JP', 'M PLUS 1p', sans-serif;
    font-size: 2rem;
    line-height: 1;
}

.kana-reading-line span {
    color: var(--momo-blue-deep);
    font-size: 0.95rem;
    font-weight: 800;
}

.kana-canvas-frame {
    position: relative;
    width: min(100%, 340px);
    aspect-ratio: 1;
    margin: 1.15rem auto 1rem;
    overflow: hidden;
    border: 2px solid rgba(28, 93, 148, 0.28);
    border-radius: 14px;
    background-color: #fffdf7;
    background-image: linear-gradient(rgba(63, 143, 209, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 143, 209, 0.1) 1px, transparent 1px);
    background-size: 25% 25%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 8px 18px rgba(28, 93, 148, 0.08);
}

.kana-canvas-frame::before,
.kana-canvas-frame::after {
    position: absolute;
    z-index: 0;
    display: block;
    content: '';
    pointer-events: none;
}

.kana-canvas-frame::before {
    inset: 0 50%;
    border-right: 1px dashed rgba(28, 93, 148, 0.2);
}

.kana-canvas-frame::after {
    inset: 50% 0;
    border-top: 1px dashed rgba(28, 93, 148, 0.2);
}

.kana-writing-canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.kana-guide-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.kana-guide-path {
    fill: none;
    stroke: var(--momo-yellow-deep);
    stroke-width: 28;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    opacity: 0.92;
}

.kana-guide-path-active {
    filter: drop-shadow(0 2px 2px rgba(217, 138, 31, 0.22));
}

.kana-guide-path-complete {
    stroke-dashoffset: 0;
}

.kana-canvas-badge {
    position: absolute;
    z-index: 3;
    top: 0.7rem;
    left: 0.7rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(28, 93, 148, 0.9);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.kana-phase-panel {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 520px;
    margin: 0 auto;
    padding: 0.7rem 0.8rem;
    border-left: 3px solid var(--momo-yellow);
    background: rgba(244, 185, 66, 0.1);
}

.kana-phase-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--momo-blue-deep);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
}

.kana-phase-panel strong,
.kana-phase-panel p {
    display: block;
    margin: 0;
}

.kana-phase-panel strong {
    color: var(--momo-ink);
    font-size: 0.9rem;
}

.kana-phase-panel p {
    margin-top: 0.15rem;
    color: var(--ink-700);
    font-size: 0.78rem;
}

.kana-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

.kana-action-primary,
.kana-action-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
}

.kana-action-primary {
    border: 2px solid var(--momo-ink);
    background: var(--momo-yellow);
    color: var(--momo-ink);
    box-shadow: 0.16rem 0.16rem 0 var(--momo-ink);
}

.kana-action-primary.is-loading,
.kana-action-primary.is-loading:hover {
    transform: none;
    border-color: var(--momo-blue-deep);
    background: var(--momo-blue-deep);
    color: #fff;
    cursor: wait;
}

.kana-action-primary:disabled {
    opacity: 1;
}

.kana-action-secondary {
    border: 1px solid rgba(28, 93, 148, 0.24);
    background: transparent;
    color: var(--momo-blue-deep);
}

.kana-action-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--momo-blue-deep);
    border-radius: 9px;
    background: var(--momo-blue-deep);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
}

.kana-loading-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(28, 93, 148, 0.22);
    border-top-color: var(--momo-blue-deep);
    border-radius: 50%;
    animation: kana-spin 0.7s linear infinite;
}

.kana-action-primary .kana-loading-spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

@keyframes kana-spin {
    to { transform: rotate(360deg); }
}

.kana-action-primary:hover,
.kana-action-secondary:hover {
    transform: translateY(-1px);
}

.kana-feedback,
.kana-save-note {
    max-width: 520px;
    margin: 0.75rem auto 0;
    color: var(--ink-700);
    font-size: 0.75rem;
    text-align: center;
}

.kana-feedback {
    color: #9a4d18;
    font-weight: 800;
}

.kana-save-note {
    color: #687789;
}

.kana-completion {
    max-width: 520px;
    margin: 1rem auto 0;
    padding: 0.9rem;
    border: 1px solid rgba(46, 125, 80, 0.25);
    border-radius: 10px;
    background: #eef9f2;
    text-align: center;
}

.kana-completion-symbol {
    display: block;
    color: var(--momo-yellow-deep);
    font-size: 1.4rem;
}

.kana-completion strong,
.kana-completion p {
    display: block;
    margin: 0;
}

.kana-completion strong {
    margin-top: 0.2rem;
    color: #2e7d50;
}

.kana-completion p {
    margin-top: 0.2rem;
    color: #4e6b58;
    font-size: 0.78rem;
}

.kana-empty-state {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
}

.kana-empty-state h1 {
    margin-bottom: 0.4rem;
}

html[data-theme="dark"] .kana-hero,
html[data-theme="dark"] .kana-index-panel,
html[data-theme="dark"] .kana-study-panel {
    border-color: rgba(194, 214, 232, 0.18);
    background: rgba(35, 48, 60, 0.88);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .kana-hero {
    background: linear-gradient(120deg, rgba(35, 48, 60, 0.94), rgba(34, 65, 88, 0.9));
}

html[data-theme="dark"] .kana-hero h1,
html[data-theme="dark"] .kana-index-heading strong,
html[data-theme="dark"] .kana-reading-line h2,
html[data-theme="dark"] .kana-reading-line .kana-stroke-count,
html[data-theme="dark"] .kana-reading-line > span,
html[data-theme="dark"] .kana-phase-panel strong {
    color: var(--text-strong);
}

html[data-theme="dark"] .kana-hero p,
html[data-theme="dark"] .kana-phase-panel p,
html[data-theme="dark"] .kana-index-count,
html[data-theme="dark"] .kana-progress-summary > span {
    color: var(--text-soft);
}

html[data-theme="dark"] .kana-progress-summary strong {
    color: var(--text-strong);
}

html[data-theme="dark"] .kana-tab,
html[data-theme="dark"] .kana-character-tile {
    border-color: rgba(194, 214, 232, 0.2);
    background: #2d3b48;
    color: var(--text-strong);
}

html[data-theme="dark"] .kana-character-tile.is-completed {
    background: #244437;
}

html[data-theme="dark"] .kana-character-tile small,
html[data-theme="dark"] .kana-save-note {
    color: var(--text-soft);
}

html[data-theme="dark"] .kana-canvas-frame {
    border-color: rgba(194, 214, 232, 0.28);
    background-color: #f7f3e8;
}

html[data-theme="dark"] .kana-completion {
    background: #244437;
}

@media (max-width: 820px) {
    .kana-workbench {
        grid-template-columns: 1fr;
    }

    .kana-index-panel {
        padding: 0.75rem;
    }

    .kana-index-heading {
        margin-bottom: 0.6rem;
    }

    .kana-character-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .kana-character-tile {
        min-height: 3.1rem;
        padding: 0.2rem 0.1rem;
        border-radius: 8px;
    }

    .kana-tile-glyph {
        font-size: 1.25rem;
    }

    .kana-character-tile small {
        font-size: 0.6rem;
    }
}

@media (max-width: 576px) {
    .kana-page {
        padding: 0.65rem 0.55rem 2rem;
    }

    .kana-hero {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .kana-progress-summary {
        padding-top: 0.7rem;
        padding-left: 0;
        border-top: 2px solid var(--momo-yellow);
        border-left: 0;
    }

    .kana-tabs {
        gap: 0.45rem;
    }

    .kana-tab {
        flex: 1;
        padding-right: 0.55rem;
        padding-left: 0.55rem;
    }

    .kana-index-panel,
    .kana-study-panel {
        padding: 0.8rem;
    }

    .kana-character-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .kana-character-tile {
        min-height: 2.7rem;
        padding: 0.15rem 0.05rem;
        border-radius: 7px;
    }

    .kana-tile-glyph {
        font-size: 1.05rem;
    }

    .kana-character-tile small {
        font-size: 0.54rem;
    }

    .kana-actions {
        flex-wrap: wrap;
    }

    .kana-action-primary,
    .kana-action-secondary {
        flex: 1 1 9rem;
    }
}

/* ── Map lesson flow ── */
.lesson-flow {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 0;
}

.lesson-flow-node {
    min-width: 0;
}

.lesson-flow-learning {
    display: flex;
    flex: 0.9 1 0;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.6rem;
    border: 1.5px solid rgba(28, 93, 148, 0.28);
    border-radius: 11px;
    background: linear-gradient(145deg, #eaf6ff, #d9ecfb);
    color: var(--ink-900);
    cursor: pointer;
    font: inherit;
    text-align: start;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.lesson-flow-learning:not(:disabled):hover {
    border-color: var(--momo-blue);
    box-shadow: 0 4px 12px rgba(28, 93, 148, 0.15);
    transform: translateY(-1px);
}

.lesson-flow-learning:disabled,
.lesson-flow-node:disabled {
    cursor: not-allowed;
}

.lesson-flow-locked {
    opacity: 0.52;
}

.lesson-flow-arrow {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--momo-blue-deep);
    font-size: 1rem;
    font-weight: 900;
}

.lesson-flow-step {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: var(--momo-blue-deep);
    font-size: 0.62rem;
    font-weight: 900;
}

.lesson-flow-copy,
.lesson-flow-word-content {
    min-width: 0;
}

.lesson-flow-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.lesson-flow-label {
    display: block;
    color: var(--text-soft);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.lesson-flow-title {
    display: block;
    overflow: hidden;
    color: var(--ink-900);
    font-size: 0.78rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-flow-icon {
    flex: 0 0 auto;
    font-size: 1.1rem;
}

.lesson-flow .inline-grammar-btn {
    flex: 1.35 1 0;
    width: auto;
}

.lesson-flow .inline-grammar-btn .lesson-flow-step {
    background: rgba(255, 255, 255, 0.62);
}

.lesson-flow-word-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.lesson-flow-word-row > .lesson-flow-arrow {
    min-height: 2.2rem;
}

.lesson-flow-word-content {
    flex: 1 1 auto;
}

.lesson-flow-word-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.2rem;
}

.lesson-flow-word-heading .lesson-flow-step {
    width: 1.35rem;
    height: 1.35rem;
    background: var(--momo-yellow);
    color: #302611;
}

.lesson-flow-word-heading .lesson-flow-label {
    color: var(--ink-900);
    font-size: 0.72rem;
}

.lesson-flow-word-content .chapter-dungeon-row {
    padding: 0;
    border-top: 0;
}

/* ── Map course promotion ── */
.map-course-promotion {
    display: grid;
    grid-template-columns: minmax(92px, 132px) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    margin: 1.25rem 0 0;
    padding: 0.9rem;
    border: 1px solid rgba(244, 185, 66, 0.5);
    border-radius: 16px;
    background: linear-gradient(135deg, #fff8d9, #fff0c2);
    box-shadow: 0 6px 16px rgba(140, 103, 31, 0.1);
}

.map-course-promotion:has(.map-course-promotion-image:only-child) {
    display: block;
}

.map-course-promotion-image {
    width: 100%;
    max-height: 110px;
    border-radius: 11px;
    object-fit: cover;
}

.map-course-promotion-label {
    display: block;
    margin-bottom: 0.15rem;
    color: #89641b;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-course-promotion h2 {
    margin: 0;
    color: #3a2b0c;
    font-size: 0.98rem;
    font-weight: 900;
}

.map-course-promotion p {
    margin: 0.25rem 0 0.55rem;
    color: #68532d;
    font-size: 0.78rem;
    line-height: 1.5;
}

.map-course-promotion-link {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: var(--momo-blue-deep);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}

.map-course-promotion-link:hover {
    background: var(--momo-blue);
    color: #fff;
}

/* ── Learning page ── */
.learning-page {
    max-width: 720px;
    min-height: calc(100vh - 2rem);
    margin: 0 auto 2rem;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf8 0%, #f4f8fb 100%);
    box-shadow: 0 20px 42px rgba(28, 93, 148, 0.12);
}

.learning-header {
    padding: 1rem 1.25rem 1.2rem;
    background: linear-gradient(135deg, #1c5d94, #3f8fd1);
    color: #fff;
}

.learning-back-btn {
    min-height: 2rem;
    margin-bottom: 1rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

.learning-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.learning-eyebrow {
    display: block;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.learning-header h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 900;
}

.learning-header p {
    max-width: 58ch;
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.86rem;
    line-height: 1.55;
    white-space: pre-line;
}

.learning-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
}

.learning-content section {
    padding: 0.95rem;
    border: 1px solid rgba(28, 93, 148, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.learning-content h2 {
    margin: 0 0 0.55rem;
    color: var(--momo-blue-deep);
    font-size: 0.86rem;
    font-weight: 900;
}

.learning-text {
    margin: 0;
    color: var(--ink-900);
    font-size: 0.94rem;
    line-height: 2.15;
    white-space: pre-line;
}

.learning-text .japanese-ruby rt,
.podcast-material-content pre .japanese-ruby rt {
    font-size: 0.55em;
    opacity: 0.85;
}

.learning-audio {
    width: 100%;
    min-height: 2.6rem;
}

.learning-video-frame {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #111820;
}

.learning-video-landscape {
    aspect-ratio: 16 / 9;
}

.learning-video-portrait {
    width: min(100%, 360px);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
}

.learning-video-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.learning-footer {
    padding: 0 1.25rem 1.25rem;
}

.learning-quiz-btn {
    width: 100%;
    min-height: 2.8rem;
    border: 0;
    border-radius: 10px;
    background: var(--momo-yellow-deep);
    color: #1f2430;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 900;
}

.learning-quiz-btn:hover {
    background: var(--momo-yellow);
}

html[data-theme="dark"] .lesson-flow-learning {
    border-color: rgba(145, 200, 241, 0.38);
    background: linear-gradient(145deg, #1d425f, #1c3549);
    color: var(--text-strong);
}

html[data-theme="dark"] .lesson-flow-title,
html[data-theme="dark"] .lesson-flow-word-heading .lesson-flow-label {
    color: var(--text-strong);
}

html[data-theme="dark"] .lesson-flow-step {
    background: rgba(255, 255, 255, 0.14);
    color: #b9def6;
}

html[data-theme="dark"] .map-course-promotion {
    border-color: rgba(244, 185, 66, 0.42);
    background: linear-gradient(135deg, #493d24, #3e3321);
}

html[data-theme="dark"] .map-course-promotion-label {
    color: #f1ce83;
}

html[data-theme="dark"] .map-course-promotion h2 {
    color: #fff1c7;
}

html[data-theme="dark"] .map-course-promotion p {
    color: #ddc99e;
}

html[data-theme="dark"] .learning-page {
    border-color: rgba(194, 214, 232, 0.2);
    background: linear-gradient(180deg, #202b35 0%, #18232c 100%);
}

html[data-theme="dark"] .learning-content section {
    border-color: rgba(194, 214, 232, 0.18);
    background: rgba(33, 48, 60, 0.88);
}

html[data-theme="dark"] .learning-content h2 {
    color: #a9d6f6;
}

html[data-theme="dark"] .learning-text {
    color: var(--text-strong);
}

@media (max-width: 576px) {
    .lesson-flow {
        flex-direction: column;
        gap: 0.2rem;
    }

    .lesson-flow-arrow {
        min-height: 1.25rem;
        transform: rotate(90deg);
    }

    .lesson-flow-word-row {
        flex-direction: column;
        gap: 0.2rem;
    }

    .lesson-flow-word-row > .lesson-flow-arrow {
        align-self: center;
    }

    .map-course-promotion {
        grid-template-columns: 1fr;
    }

    .map-course-promotion-image {
        max-height: 150px;
    }

    .learning-page {
        margin-right: 0.5rem;
        margin-left: 0.5rem;
        border-radius: 18px;
    }

    .learning-header,
    .learning-content,
    .learning-footer {
        padding-right: 0.9rem;
        padding-left: 0.9rem;
    }
}

.map-page {
    --map-card-bg: #ffffff;
    --map-card-border: #d9e1e8;
    --map-step-bg: #f7f9fa;
    --map-step-border: #d9e2e8;
    --map-text: #24313d;
    --map-muted: #6d7a86;
    --map-accent: #3d6d82;
    --map-accent-soft: #eaf1f4;
    --map-current: #b27a2a;
    --map-current-soft: #fbf5e9;
    --map-cleared: #5d876f;
    --map-cleared-soft: #eff6f1;
    --map-promo-bg: #f6f2e9;
    --map-promo-border: #ded1b4;
    --map-promo-text: #3d3426;
    --map-promo-muted: #756b5c;
}

.map-page .chapter-trail {
    gap: 0.85rem;
    padding: 1.25rem clamp(0.75rem, 2vw, 1.25rem) 3rem;
}

.map-page .chapter-trail::before {
    display: none;
}

.map-page .chapter-card,
.map-page .chapter-card-current.card-char-momo,
.map-page .chapter-card-current.card-char-ichi,
.map-page .chapter-card-current.card-char-lion,
.map-page .chapter-card-current.card-char-ken,
.map-page .chapter-card-current.card-char-teacher,
.map-page .chapter-card-cleared.card-char-momo,
.map-page .chapter-card-cleared.card-char-ichi,
.map-page .chapter-card-cleared.card-char-lion,
.map-page .chapter-card-cleared.card-char-ken,
.map-page .chapter-card-cleared.card-char-teacher {
    border: 1px solid var(--map-card-border) !important;
    border-radius: 18px;
    background: var(--map-card-bg) !important;
    box-shadow: 0 8px 22px rgba(31, 48, 61, 0.08) !important;
    animation: none !important;
    opacity: 1;
}

.map-page .chapter-card-current {
    border-left: 3px solid var(--map-current) !important;
    box-shadow: 0 8px 22px rgba(31, 48, 61, 0.1), 0 0 0 2px rgba(178, 122, 42, 0.1) !important;
}

.map-page .chapter-card-locked {
    opacity: 0.66;
}

.map-page .chapter-card-header {
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
}

.map-page .chapter-num-badge {
    width: 2.15rem;
    min-width: 2.15rem;
    height: 2.15rem;
    background: var(--map-accent) !important;
    color: #fff !important;
    box-shadow: none;
}

.map-page .chapter-card-current .chapter-num-badge {
    background: var(--map-current) !important;
    color: #fff !important;
}

.map-page .chapter-card-cleared .chapter-num-badge {
    background: var(--map-cleared) !important;
}

.map-page .chapter-card-locked .chapter-num-badge {
    background: #8d99a4 !important;
}

.map-page .chapter-card-title,
.map-page .chapter-card-current.card-char-ichi .chapter-card-title,
.map-page .chapter-card-current.card-char-ichi .chapter-card-focus {
    color: var(--map-text) !important;
}

.map-page .chapter-card-title {
    overflow: visible;
    font-size: 0.98rem;
    line-height: 1.35;
    white-space: normal;
}

.map-page .chapter-card-focus {
    margin-top: 0.2rem;
    color: var(--map-muted) !important;
    line-height: 1.45;
    white-space: normal;
}

.map-page .chapter-mascot-img,
.map-page .mascot-momo,
.map-page .mascot-ichi,
.map-page .mascot-lion,
.map-page .mascot-ken,
.map-page .mascot-teacher {
    width: 2.9rem;
    height: 2.9rem;
    padding: 0.2rem;
    border: 1px solid var(--map-card-border);
    background: var(--map-step-bg) !important;
}

.map-page .chapter-grammar-list {
    gap: 0.3rem;
    padding: 0.25rem 1rem 1.1rem;
}

.map-page .lesson-flow-lesson-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.35rem;
    color: var(--map-muted);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.map-page .lesson-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.1fr);
    align-items: stretch;
    gap: 0.55rem;
    min-width: 0;
    padding-top: 0.2rem;
}

.map-page .lesson-flow.has-learning:not(.has-word),
.map-page .lesson-flow:not(.has-learning).has-word {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.map-page .lesson-flow:not(.has-learning):not(.has-word) {
    grid-template-columns: minmax(0, 1fr);
}

.map-page .lesson-flow-node,
.map-page .lesson-flow-word-content {
    min-width: 0;
    min-height: 4rem;
}

.map-page .lesson-flow-learning,
.map-page .lesson-flow .inline-grammar-btn {
    width: 100%;
    border: 1px solid var(--map-step-border) !important;
    border-left: 3px solid var(--map-accent) !important;
    border-radius: 13px;
    background: var(--map-step-bg) !important;
    color: var(--map-text) !important;
    box-shadow: none;
    transform: none;
}

.map-page .lesson-flow-learning {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem;
    font: inherit;
    text-align: start;
}

.map-page .lesson-flow-learning:not(:disabled):hover,
.map-page .lesson-flow .inline-grammar-btn:not(:disabled):hover {
    border-color: var(--map-accent) !important;
    background: var(--map-accent-soft) !important;
    box-shadow: 0 4px 12px rgba(61, 109, 130, 0.12);
    transform: translateY(-1px);
}

.map-page .lesson-flow .inline-grammar-btn.igb-current {
    border-left-color: var(--map-current) !important;
    background: var(--map-current-soft) !important;
}

.map-page .lesson-flow .inline-grammar-btn.igb-cleared {
    border-left-color: var(--map-cleared) !important;
    background: var(--map-cleared-soft) !important;
}

.map-page .lesson-flow .inline-grammar-btn.igb-locked {
    border-left-color: #9aa5b1 !important;
    background: #f1f3f5 !important;
}

.map-page .lesson-flow .inline-grammar-btn .lesson-flow-step,
.map-page .lesson-flow-learning .lesson-flow-step {
    width: 1.8rem;
    min-width: 1.8rem;
    height: 1.8rem;
    border: 1px solid var(--map-step-border);
    background: var(--map-card-bg) !important;
    color: var(--map-accent) !important;
}

.map-page .lesson-flow .igb-current .lesson-flow-step {
    color: var(--map-current) !important;
}

.map-page .lesson-flow .igb-cleared .lesson-flow-step {
    color: var(--map-cleared) !important;
}

.map-page .lesson-flow .igb-locked .lesson-flow-step {
    color: #8d99a4 !important;
}

.map-page .lesson-flow-arrow {
    align-self: center;
    color: var(--map-muted) !important;
    font-size: 1rem;
    font-weight: 700;
    pointer-events: none;
}

.map-page .lesson-flow-copy,
.map-page .lesson-flow-word-content {
    min-width: 0;
}

.map-page .lesson-flow-label {
    color: var(--map-muted) !important;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.map-page .lesson-flow-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--map-text) !important;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.map-page .lesson-flow-icon {
    font-size: 1rem;
}

.map-page .lesson-flow .igb-mascot,
.map-page .igb-char-momo .igb-mascot,
.map-page .igb-char-ichi .igb-mascot,
.map-page .igb-char-lion .igb-mascot,
.map-page .igb-char-ken .igb-mascot,
.map-page .igb-char-teacher .igb-mascot {
    width: 2rem;
    height: 2rem;
    padding: 0.1rem;
    border: 1px solid var(--map-step-border);
    background: var(--map-card-bg) !important;
}

.map-page .lesson-flow .igb-badge {
    min-width: 1.8rem;
    height: 1.8rem;
}

.map-page .lesson-flow .igb-badge-go {
    background: var(--map-current) !important;
    color: #fff !important;
}

.map-page .lesson-flow .igb-badge-stars {
    color: var(--map-current) !important;
}

.map-page .lesson-flow .igb-label {
    min-width: 0;
}

.map-page .lesson-flow-word-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--map-step-border);
    border-left: 3px solid var(--map-accent);
    border-radius: 13px;
    background: var(--map-step-bg);
}

.map-page .lesson-flow-word-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.5rem;
}

.map-page .lesson-flow-word-heading .lesson-flow-step {
    width: 1.8rem;
    min-width: 1.8rem;
    height: 1.8rem;
    border: 1px solid var(--map-step-border);
    background: var(--map-card-bg) !important;
    color: var(--map-accent) !important;
}

.map-page .lesson-flow-word-heading .lesson-flow-label {
    color: var(--map-text) !important;
    font-size: 0.72rem;
}

.map-page .lesson-flow-word-content .chapter-dungeon-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.45rem;
    padding: 0;
    border: 0;
}

.map-page .dungeon-inline-chip,
.map-page .card-char-momo .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared),
.map-page .card-char-ichi .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared),
.map-page .card-char-lion .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared),
.map-page .card-char-ken .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared),
.map-page .card-char-teacher .dungeon-inline-chip:not(.dic-locked):not(.dic-cleared) {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    border: 1px solid var(--map-step-border) !important;
    border-radius: 9px;
    padding: 0.5rem 0.55rem;
    background: var(--map-card-bg) !important;
    color: var(--map-text) !important;
    box-shadow: none !important;
}

.map-page .dungeon-inline-chip:not(.dic-locked):hover {
    border-color: var(--map-accent) !important;
    background: var(--map-accent-soft) !important;
    transform: none;
}

.map-page .dungeon-inline-chip.dic-cleared {
    border-color: rgba(93, 135, 111, 0.45) !important;
    background: var(--map-cleared-soft) !important;
}

.map-page .dungeon-inline-chip.dic-locked {
    border-color: var(--map-step-border) !important;
    background: #f1f3f5 !important;
    color: #8d99a4 !important;
}

.map-page .dic-label {
    overflow: hidden;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-page .dic-stars {
    flex: 0 0 auto;
    color: var(--map-current) !important;
}

.map-page .trail-connector {
    align-self: center;
    width: 2px;
    height: 1.25rem;
    margin: 0;
    background: var(--map-card-border) !important;
    box-shadow: none !important;
}

.map-page .trail-connector.cleared-conn {
    background: var(--map-cleared) !important;
}

.map-page .map-course-promotion {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    margin: 0 0 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--map-promo-border);
    border-radius: 16px;
    background: var(--map-promo-bg);
    box-shadow: none;
}

.map-page .map-course-promotion-image {
    width: 4.5rem;
    height: 4.5rem;
    max-height: none;
    border: 1px solid var(--map-promo-border);
    border-radius: 50%;
    background: var(--map-card-bg);
    object-fit: contain;
}

.map-page .map-course-promotion-label {
    margin-bottom: 0.2rem;
    color: var(--map-current);
    font-size: 0.64rem;
}

.map-page .map-course-promotion h2 {
    color: var(--map-promo-text);
    font-size: 1rem;
    line-height: 1.35;
}

.map-page .map-course-promotion p {
    margin: 0.3rem 0 0.65rem;
    color: var(--map-promo-muted);
    font-size: 0.78rem;
}

.map-page .map-course-promotion-link {
    min-height: 2.1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: var(--map-accent);
    font-size: 0.76rem;
}

html[data-theme="dark"] .map-page {
    --map-card-bg: #202b35;
    --map-card-border: rgba(194, 214, 232, 0.2);
    --map-step-bg: #263641;
    --map-step-border: rgba(194, 214, 232, 0.2);
    --map-text: #f2f5f8;
    --map-muted: #aab8c4;
    --map-accent: #8dbbd4;
    --map-accent-soft: #2d4655;
    --map-current: #d4aa57;
    --map-current-soft: #403823;
    --map-cleared: #8fb99d;
    --map-cleared-soft: #293b32;
    --map-promo-bg: #302d26;
    --map-promo-border: rgba(212, 170, 87, 0.38);
    --map-promo-text: #fff1c7;
    --map-promo-muted: #ddc99e;
}

html[data-theme="dark"] .map-page .map-course-promotion-link {
    background: var(--momo-blue-deep);
    color: #fff;
}

html[data-theme="dark"] .map-page .map-course-promotion-link:hover {
    background: var(--momo-blue);
    color: #fff;
}

html[data-theme="dark"] .map-page .lesson-flow .igb-locked,
html[data-theme="dark"] .map-page .dungeon-inline-chip.dic-locked {
    background: #29343d !important;
    color: #9baab6 !important;
}

@media (max-width: 700px) {
    .map-page .chapter-trail {
        padding-right: 0.65rem;
        padding-left: 0.65rem;
    }

    .map-page .lesson-flow,
    .map-page .lesson-flow.has-learning:not(.has-word),
    .map-page .lesson-flow:not(.has-learning).has-word,
    .map-page .lesson-flow:not(.has-learning):not(.has-word) {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
    }

    .map-page .lesson-flow-arrow {
        min-height: 1rem;
        transform: rotate(90deg);
    }

    .map-page .lesson-flow-node,
    .map-page .lesson-flow-word-content {
        min-height: 4rem;
    }

    .map-page .lesson-flow-lesson-arrow {
        min-height: 1.25rem;
    }

    .map-page .lesson-flow-word-content .chapter-dungeon-row {
        grid-template-columns: 1fr;
    }

    .map-page .map-course-promotion {
        grid-template-columns: 3.8rem minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.8rem;
    }

    .map-page .map-course-promotion-image {
        width: 3.8rem;
        height: 3.8rem;
    }
}

/* Podcast Page */
.podcast-page {
    width: 100%;
    max-width: 1180px;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 1rem 0 2.5rem;
}

.podcast-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
    gap: clamp(1rem, 4vw, 3.5rem);
    align-items: center;
    min-width: 0;
    min-height: 15rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.6rem, 4vw, 2.8rem) clamp(1.25rem, 5vw, 3rem);
    overflow: hidden;
    border: 1px solid rgba(28, 93, 148, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(232, 245, 255, 0.92)),
        repeating-linear-gradient(90deg, transparent 0 22px, rgba(63, 143, 209, 0.06) 22px 23px);
    box-shadow: 0 14px 32px rgba(57, 71, 88, 0.1);
}

.podcast-hero-copy {
    position: relative;
    min-width: 0;
    z-index: 1;
    max-width: 42rem;
}

.podcast-kicker {
    display: block;
    color: var(--momo-blue-deep);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.podcast-hero h1,
.podcast-current-episode h2,
.podcast-section-heading h2,
.podcast-access-panel h2,
.podcast-manage-panel h2,
.podcast-player-placeholder h2 {
    margin: 0.3rem 0 0;
    color: var(--momo-ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.podcast-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.08;
}

.podcast-hero p,
.podcast-access-panel p,
.podcast-manage-panel p,
.podcast-player-placeholder p {
    margin: 0.7rem 0 0;
    color: var(--ink-700);
    line-height: 1.7;
}

.podcast-description {
    min-width: 0;
    margin-top: 0.7rem;
    color: var(--ink-700);
    line-height: 2.1;
    overflow-wrap: anywhere;
}

.podcast-description .japanese-ruby rt {
    font-size: 0.55em;
    opacity: 0.85;
}

.podcast-description a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.podcast-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    margin-top: 1.2rem;
    color: var(--ink-700);
    font-size: 0.82rem;
}

.podcast-episode-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    white-space: nowrap;
}

.podcast-episode-count strong {
    color: var(--momo-blue-deep);
    font-size: 1.05rem;
}

.podcast-subscription-badge {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    min-width: 11.4rem;
    max-width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 0.48rem;
    overflow: hidden;
    border: 1px solid rgba(218, 170, 63, 0.82);
    border-radius: 999px;
    background: linear-gradient(135deg, #353a40 0%, #171a1f 52%, #60491f 100%);
    color: #ffe9a6;
    box-shadow: 0 7px 18px rgba(57, 43, 18, 0.28), inset 0 1px 0 rgba(255, 244, 193, 0.24);
}

.podcast-subscription-badge::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.2) 48%, transparent 72%);
    pointer-events: none;
    transform: translateX(-125%);
    animation: podcast-subscription-sheen 6s ease-in-out infinite;
}

.podcast-subscription-badge-mark {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex: 0 0 1.85rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff3ad, #d49a32);
    color: #272b30;
    font-size: 1.05rem;
    box-shadow: 0 0 0 2px rgba(255, 222, 131, 0.16), 0 3px 8px rgba(0, 0, 0, 0.3);
}

.podcast-subscription-badge-copy {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.05;
}

.podcast-subscription-badge-copy strong {
    overflow-wrap: anywhere;
    color: #fff4c7;
    font-size: 0.84rem;
    font-weight: 900;
}

.podcast-subscription-badge-copy small {
    margin-top: 0.2rem;
    overflow: hidden;
    color: #d9bb75;
    font-size: 0.62rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes podcast-subscription-sheen {
    0%, 55% { transform: translateX(-125%); }
    75%, 100% { transform: translateX(125%); }
}

.podcast-hero-mark {
    position: relative;
    display: grid;
    width: min(100%, 16rem);
    height: 13rem;
    place-items: center;
    justify-self: end;
}

.podcast-hero-character-motion {
    width: 100%;
    height: 100%;
    animation: wm-hero-character-float 3.2s ease-in-out infinite;
}

.podcast-hero-character {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0;
    object-fit: contain;
    filter: drop-shadow(0 0.8rem 0.8rem rgba(28, 31, 38, 0.16));
}

.podcast-layout {
    display: grid;
    grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
}

.podcast-library,
.podcast-player-panel,
.podcast-material-panel,
.podcast-access-panel,
.podcast-manage-panel {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(57, 71, 88, 0.07);
    min-width: 0;
}

.podcast-library {
    position: sticky;
    top: 1rem;
    padding: 1rem;
}

.podcast-section-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.podcast-section-heading > div {
    min-width: 0;
}

.podcast-section-heading h2 {
    font-size: 1.25rem;
}

.podcast-loading-label,
.podcast-episode-card-copy > span,
.podcast-material-meta {
    color: var(--ink-700);
    font-size: 0.78rem;
}

.podcast-episode-list {
    display: grid;
    gap: 0.55rem;
    max-height: min(56vh, 38rem);
    margin-top: 1rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.podcast-episode-card {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 1.4rem;
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    min-height: 4.35rem;
    padding: 0.7rem;
    border: 1px solid rgba(28, 31, 38, 0.1);
    border-radius: 9px;
    background: rgba(255, 253, 247, 0.86);
    color: var(--momo-ink);
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.podcast-episode-card:hover,
.podcast-episode-card:focus-visible {
    border-color: var(--momo-blue);
    background: #fff;
    transform: translateY(-1px);
}

.podcast-episode-card.is-selected {
    border-color: var(--momo-blue-deep);
    background: #edf7ff;
    box-shadow: inset 3px 0 0 var(--momo-yellow-deep);
}

.podcast-episode-index {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--momo-yellow);
    color: var(--momo-ink);
    font-size: 0.76rem;
    font-weight: 800;
}

.podcast-episode-card-copy {
    display: grid;
    min-width: 0;
    gap: 0.25rem;
}

.podcast-episode-card-copy strong {
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podcast-episode-play {
    color: var(--momo-blue-deep);
    font-size: 0.75rem;
}

.podcast-player-column {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.podcast-player-panel,
.podcast-material-panel,
.podcast-access-panel,
.podcast-manage-panel {
    padding: 1.25rem;
}

.podcast-current-episode h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.25;
}

.podcast-current-episode {
    min-width: 0;
}

.podcast-audio {
    display: block;
    max-width: 100%;
    width: 100%;
    margin-top: 1.2rem;
}

.podcast-audio-caption {
    display: block;
    margin-top: 0.5rem;
}

.podcast-material-panel > .podcast-section-heading {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line-soft);
}

.podcast-access-badge {
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(28, 93, 148, 0.2);
    border-radius: 999px;
    background: #edf7ff;
    color: var(--momo-blue-deep);
    font-size: 0.72rem;
    font-weight: 700;
}

.podcast-locked-material,
.podcast-empty-state,
.podcast-player-placeholder {
    text-align: center;
}

.podcast-locked-material {
    max-width: 34rem;
    margin: 0 auto;
    padding: 2.2rem 1rem 1.2rem;
}

.podcast-lock-mark,
.podcast-placeholder-icon {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--momo-yellow-deep);
    font-size: 2rem;
}

.podcast-locked-material strong {
    display: block;
    font-size: 1.08rem;
}

.podcast-locked-material p {
    margin: 0.55rem auto 1rem;
    max-width: 28rem;
    color: var(--ink-700);
    line-height: 1.65;
}

.podcast-material-content {
    padding-top: 1.2rem;
}

.podcast-material-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.podcast-material-meta > span {
    color: var(--momo-blue-deep);
    font-size: 0.86rem;
    font-weight: 800;
}

.podcast-material-content pre {
    max-width: 100%;
    margin: 0;
    padding: 1.1rem 1.15rem;
    overflow-x: hidden;
    border: 1px solid rgba(28, 93, 148, 0.12);
    border-left: 3px solid var(--momo-yellow);
    border-radius: 8px;
    background: #fffaf0;
    color: var(--momo-ink);
    font: inherit;
    line-height: 2.2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Podcast Structured Lecture Notes (RWD Card Layout)
   ========================================================================== */

.podcast-lecture-container {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

/* Quick Nav Tabs */
.podcast-lecture-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 9999px;
    background: rgba(28, 93, 148, 0.06);
    border: 1px solid rgba(28, 93, 148, 0.12);
    margin-bottom: 0.5rem;
}

.podcast-lecture-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--momo-ink);
    cursor: pointer;
    transition: all 0.18s ease;
}

.podcast-lecture-nav-btn:hover {
    background: rgba(28, 93, 148, 0.1);
    color: var(--momo-blue-deep);
}

.podcast-lecture-nav-btn.is-active {
    background: #ffffff;
    border-color: rgba(28, 93, 148, 0.2);
    color: var(--momo-blue-deep);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.podcast-nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--momo-blue);
    color: #ffffff;
}

/* Section Banner */
.podcast-lecture-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-margin-top: 1rem;
}

.podcast-section-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(63, 143, 209, 0.08) 0%, rgba(244, 185, 66, 0.1) 100%);
    border-left: 4px solid var(--momo-blue-deep);
}

.podcast-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.podcast-banner-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--momo-blue-deep);
}

.podcast-section-banner h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--momo-ink);
}

.podcast-banner-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--momo-charcoal);
    background: #ffffff;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* 1. Vocabulary Grid & Cards */
.podcast-vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.podcast-vocab-card {
    background: #ffffff;
    border: 1px solid rgba(28, 93, 148, 0.14);
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.podcast-vocab-card:hover {
    box-shadow: 0 6px 16px rgba(28, 93, 148, 0.08);
    transform: translateY(-2px);
}

.podcast-vocab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.podcast-vocab-headword {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.podcast-vocab-ruby {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--momo-ink);
    line-height: 1.5;
}

.podcast-vocab-ruby ruby rt {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--momo-blue-deep);
}

.podcast-pos-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    line-height: 1.3;
}

.pos-verb { background: #e6f2ff; color: #0c63c7; border: 1px solid #b8daff; }
.pos-idiom { background: #f4ecfb; color: #7928ca; border: 1px solid #d9b8ff; }
.pos-collocation { background: #fff6e5; color: #b7791f; border: 1px solid #fed7aa; }
.pos-adverb { background: #e6fffa; color: #0d9488; border: 1px solid #99f6e4; }
.pos-noun { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pos-adj { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.pos-default { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.podcast-vocab-tools {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.podcast-mini-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--momo-ink);
    transition: background 0.15s ease;
}

.podcast-mini-btn:hover {
    background: #e2e8f0;
}

.podcast-vocab-meaning {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--momo-charcoal);
    line-height: 1.5;
}

.podcast-vocab-example-box {
    background: #f8fafc;
    border-left: 3px solid var(--momo-yellow);
    border-radius: 0 8px 8px 0;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.podcast-example-ja {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--momo-ink);
    line-height: 1.6;
    display: block;
}

.podcast-vocab-example-box .podcast-example-ja {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.podcast-example-text {
    flex: 1;
    min-width: 0;
    display: inline;
}

.podcast-example-icon {
    font-size: 0.68rem;
    font-weight: 800;
    background: var(--momo-yellow);
    color: #201a09;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.podcast-example-zh {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}

.podcast-vocab-example-box .podcast-example-zh {
    padding-left: 1.45rem;
}

.podcast-grammar-example-box .podcast-example-ja {
    display: block;
}

.podcast-grammar-example-box .podcast-example-zh {
    padding-left: 0;
}

/* 2. Grammar Cards */
.podcast-grammar-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.podcast-grammar-card {
    background: #ffffff;
    border: 1px solid rgba(28, 93, 148, 0.16);
    border-left: 4px solid var(--momo-blue-deep);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.podcast-grammar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.75rem;
}

.podcast-grammar-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--momo-blue) 0%, var(--momo-blue-deep) 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.podcast-grammar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--momo-ink);
    flex: 1;
    min-width: 180px;
}

.podcast-grammar-speak-btn {
    width: auto;
    padding: 0.32rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 9999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--momo-blue-deep);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.podcast-grammar-speak-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.podcast-grammar-speak-btn:active {
    transform: translateY(0);
}

.podcast-grammar-speak-btn.is-speaking {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0284c7;
    animation: podcast-speak-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes podcast-speak-pulse {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.35); }
    100% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
}

.podcast-grammar-field {
    display: grid;
    grid-template-columns: minmax(56px, auto) 1fr;
    gap: 0.75rem;
    align-items: baseline;
}

.podcast-field-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--momo-blue-deep);
    background: rgba(28, 93, 148, 0.08);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
}

.podcast-field-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.podcast-grammar-desc {
    font-size: 0.94rem;
    color: var(--momo-ink);
    line-height: 1.7;
}

.podcast-formula-chip {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: #fff8eb;
    border: 1px solid #fde68a;
    color: #92400e;
    line-height: 1.5;
}

.podcast-grammar-example-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.podcast-grammar-example-box p {
    margin: 0;
}

/* 3. Quiz Cards & Options */
.podcast-quiz-banner-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.podcast-quiz-score-badge {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--momo-ink);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.podcast-score-star {
    color: #d97706;
    font-weight: 800;
}

.podcast-quiz-toggle-btn {
    background: #ffffff;
    border: 1px solid var(--momo-blue);
    color: var(--momo-blue-deep);
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.podcast-quiz-toggle-btn:hover {
    background: rgba(63, 143, 209, 0.08);
}

.podcast-quiz-toggle-btn.is-active {
    background: var(--momo-blue-deep);
    color: #ffffff;
}

.podcast-quiz-reset-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.podcast-quiz-reset-btn:hover {
    background: #e2e8f0;
}

.podcast-quiz-category-block {
    margin-bottom: 1.5rem;
}

.podcast-quiz-category-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.podcast-quiz-category-title h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--momo-ink);
}

.podcast-category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--momo-yellow);
    color: #1a1a2e;
    font-size: 0.85rem;
    font-weight: 800;
}

.podcast-quiz-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.podcast-quiz-card {
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    border-radius: 12px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.podcast-quiz-card.card-correct {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e;
}

.podcast-quiz-card.card-incorrect {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

.podcast-quiz-question-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.podcast-question-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--momo-blue-deep);
    background: rgba(28, 93, 148, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.podcast-question-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--momo-ink);
    line-height: 1.6;
    flex: 1;
}

.podcast-quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.65rem;
}

.podcast-quiz-option-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: var(--momo-ink);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    min-height: 46px;
}

.podcast-quiz-option-btn:hover:not(:disabled) {
    border-color: var(--momo-blue);
    background: #f0f7fc;
}

.podcast-opt-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 800;
    color: #475569;
    flex-shrink: 0;
}

.podcast-opt-text {
    flex: 1;
}

.podcast-opt-mark {
    font-weight: 800;
    font-size: 0.95rem;
}

.podcast-quiz-option-btn.is-correct-pick {
    border-color: #16a34a !important;
    background: #f0fdf4 !important;
    color: #15803d !important;
}

.podcast-quiz-option-btn.is-correct-pick .podcast-opt-key {
    background: #16a34a;
    color: #ffffff;
}

.is-mark-correct {
    color: #16a34a;
}

.podcast-quiz-option-btn.is-wrong-pick {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.podcast-quiz-option-btn.is-wrong-pick .podcast-opt-key {
    background: #dc2626;
    color: #ffffff;
}

.is-mark-wrong {
    color: #dc2626;
}

.podcast-quiz-option-btn.is-revealed-correct {
    border-color: #16a34a !important;
    background: #f0fdf4 !important;
    color: #15803d !important;
    border-style: dashed !important;
}

.podcast-quiz-option-btn.is-revealed-correct .podcast-opt-key {
    background: #16a34a;
    color: #ffffff;
}

.is-mark-target {
    color: #16a34a;
}

.podcast-quiz-feedback {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
}

.feedback-correct {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.feedback-review {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

.podcast-feedback-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.podcast-feedback-badge {
    font-weight: 800;
}

.podcast-feedback-exp {
    font-weight: 500;
}

/* RWD Mobile Adjustments */
@media (max-width: 767px) {
    .podcast-vocab-grid {
        grid-template-columns: 1fr;
    }

    .podcast-grammar-field {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .podcast-field-label {
        width: fit-content;
    }

    .podcast-quiz-options {
        grid-template-columns: 1fr;
    }
}

.podcast-transcript-block {
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line-soft);
}

.podcast-transcript-heading h3 {
    margin: 0 0 0.75rem;
    color: var(--momo-ink);
    font-size: 1.12rem;
}

.podcast-transcript {
    display: grid;
    gap: 0.35rem;
    max-height: 25rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(28, 93, 148, 0.12);
    border-radius: 8px;
    background: rgba(232, 245, 255, 0.28);
    scroll-behavior: smooth;
}

.podcast-transcript-cue {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-900);
    cursor: pointer;
    text-align: left;
    line-height: 1.55;
    transition: background 160ms ease, border-color 160ms ease;
}

.podcast-transcript-cue > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.podcast-transcript-cue:hover,
.podcast-transcript-cue:focus-visible {
    border-color: rgba(63, 143, 209, 0.3);
    background: #f2f9ff;
}

.podcast-transcript-cue.is-active {
    border-color: rgba(217, 138, 31, 0.38);
    background: #fff5d9;
}

.podcast-cue-time {
    color: var(--momo-blue-deep);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    font-weight: 700;
}

.podcast-access-panel,
.podcast-manage-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-color: rgba(217, 138, 31, 0.28);
    background: linear-gradient(115deg, rgba(255, 250, 234, 0.92), rgba(255, 255, 255, 0.86));
}

.podcast-access-panel > div:first-child,
.podcast-manage-panel > div:first-child {
    min-width: 0;
    flex: 1 1 16rem;
}

.podcast-access-panel h2,
.podcast-manage-panel h2 {
    font-size: 1.25rem;
}

.podcast-plan-list {
    display: grid;
    flex: 1 1 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: 0;
}

.podcast-promotion-entry {
    flex: 1 1 100%;
    max-width: 620px;
    margin-top: 0.9rem;
}

.podcast-promotion-entry label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    font-weight: 800;
}

.podcast-promotion-controls {
    display: flex;
    gap: 0.55rem;
}

.podcast-promotion-controls .form-control { min-width: 0; }

.podcast-promotion-validate {
    flex: 0 0 auto;
    white-space: nowrap;
}

.podcast-promotion-entry small {
    display: block;
    margin-top: 0.35rem;
    color: var(--ink-700);
    font-size: 0.73rem;
    line-height: 1.45;
}

.podcast-promotion-feedback {
    margin-top: 0.55rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.podcast-promotion-feedback.is-valid { color: #23734c; }
.podcast-promotion-feedback.is-invalid { color: #a02b25; }

.podcast-plan-option {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.9rem;
    border: 1px solid rgba(28, 31, 38, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.74);
}

.podcast-plan-option-addon {
    border-color: rgba(217, 138, 31, 0.48);
    background: rgba(255, 250, 234, 0.82);
}

.podcast-plan-copy {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
    color: var(--ink-700);
    font-size: 0.78rem;
}

.podcast-plan-copy strong {
    color: var(--momo-blue-deep);
    font-size: 1.45rem;
    line-height: 1.2;
}

.podcast-plan-price-promotion {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.podcast-plan-original-price {
    color: var(--ink-700);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration-thickness: 2px;
}

.podcast-plan-discounted { color: var(--momo-blue-deep); }

.podcast-plan-label {
    color: var(--momo-ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.podcast-plan-period {
    color: var(--ink-700);
}

.podcast-plan-discount {
    color: #9a5b00;
    font-size: 0.72rem;
    font-weight: 800;
}

.podcast-plan-requirement {
    color: var(--momo-blue-deep);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

.podcast-plan-option .podcast-access-action {
    width: 100%;
}

.podcast-price-block {
    display: grid;
    flex: 0 0 auto;
    gap: 0.15rem;
    text-align: right;
}

.podcast-price-block strong {
    color: var(--momo-blue-deep);
    font-size: 1.45rem;
}

.podcast-price-block span {
    color: var(--ink-700);
    font-size: 0.76rem;
}

.podcast-access-action {
    flex: 0 0 auto;
}

.podcast-notice {
    margin: 1rem 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(28, 93, 148, 0.18);
    border-radius: 8px;
    background: #edf7ff;
    color: var(--momo-blue-deep);
}

.podcast-notice-error {
    border-color: rgba(170, 64, 51, 0.22);
    background: #fff0ed;
    color: #8c3328;
}

html[data-theme="dark"] .podcast-hero {
    border-color: rgba(141, 187, 212, 0.28);
    background: linear-gradient(135deg, #1e2b33, #263c47);
}

html[data-theme="dark"] .podcast-hero h1,
html[data-theme="dark"] .podcast-current-episode h2,
html[data-theme="dark"] .podcast-section-heading h2,
html[data-theme="dark"] .podcast-access-panel h2,
html[data-theme="dark"] .podcast-manage-panel h2,
html[data-theme="dark"] .podcast-player-placeholder h2,
html[data-theme="dark"] .podcast-transcript-heading h3,
html[data-theme="dark"] .podcast-material-content pre,
html[data-theme="dark"] .podcast-transcript-cue {
    color: #f3f6f8;
}

html[data-theme="dark"] .podcast-kicker,
html[data-theme="dark"] .podcast-episode-count strong,
html[data-theme="dark"] .podcast-cue-time,
html[data-theme="dark"] .podcast-material-meta > span {
    color: #a9d1e4;
}

html[data-theme="dark"] .podcast-hero p,
html[data-theme="dark"] .podcast-description,
html[data-theme="dark"] .podcast-access-panel p,
html[data-theme="dark"] .podcast-manage-panel p,
html[data-theme="dark"] .podcast-player-placeholder p,
html[data-theme="dark"] .podcast-hero-meta,
html[data-theme="dark"] .podcast-locked-material p,
html[data-theme="dark"] .podcast-loading-label,
html[data-theme="dark"] .podcast-episode-card-copy > span,
html[data-theme="dark"] .podcast-material-meta,
html[data-theme="dark"] .podcast-price-block span {
    color: #b5c2ca;
}

html[data-theme="dark"] .podcast-plan-option {
    border-color: rgba(194, 214, 232, 0.16);
    background: #26343d;
}

html[data-theme="dark"] .podcast-plan-option-addon {
    border-color: rgba(212, 170, 87, 0.48);
    background: #403823;
}

html[data-theme="dark"] .podcast-plan-label,
html[data-theme="dark"] .podcast-plan-copy strong {
    color: #f3f6f8;
}

html[data-theme="dark"] .podcast-plan-copy,
html[data-theme="dark"] .podcast-plan-period {
    color: #b5c2ca;
}

html[data-theme="dark"] .podcast-plan-requirement {
    color: #a9d1e4;
}

html[data-theme="dark"] .podcast-library,
html[data-theme="dark"] .podcast-player-panel,
html[data-theme="dark"] .podcast-material-panel,
html[data-theme="dark"] .podcast-access-panel,
html[data-theme="dark"] .podcast-manage-panel {
    background: rgba(31, 42, 50, 0.92);
}

html[data-theme="dark"] .podcast-episode-card {
    border-color: rgba(194, 214, 232, 0.16);
    background: #26343d;
    color: #f3f6f8;
}

html[data-theme="dark"] .podcast-episode-card:hover,
html[data-theme="dark"] .podcast-episode-card:focus-visible,
html[data-theme="dark"] .podcast-transcript-cue:hover,
html[data-theme="dark"] .podcast-transcript-cue:focus-visible {
    background: #304650;
}

html[data-theme="dark"] .podcast-episode-card.is-selected {
    border-color: #8dbbd4;
    background: #2d4655;
}

html[data-theme="dark"] .podcast-access-badge {
    border-color: rgba(141, 187, 212, 0.36);
    background: #2d4655;
    color: #cce8f5;
}

html[data-theme="dark"] .podcast-subscription-badge {
    border-color: rgba(255, 218, 121, 0.78);
    background: linear-gradient(135deg, #3b4046 0%, #171a1f 52%, #6a5021 100%);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 244, 193, 0.2);
}

html[data-theme="dark"] .podcast-subscription-badge-copy strong {
    color: #fff7d4;
}

html[data-theme="dark"] .podcast-subscription-badge-copy small {
    color: #e5c77d;
}

html[data-theme="dark"] .podcast-material-content pre {
    background: #2b332f;
}

html[data-theme="dark"] .podcast-material-content pre,
html[data-theme="dark"] .podcast-transcript {
    border-color: rgba(141, 187, 212, 0.2);
}

html[data-theme="dark"] .podcast-transcript {
    background: rgba(32, 44, 51, 0.72);
}

html[data-theme="dark"] .podcast-transcript-cue.is-active {
    border-color: rgba(212, 170, 87, 0.48);
    background: #403823;
}

html[data-theme="dark"] .podcast-access-panel,
html[data-theme="dark"] .podcast-manage-panel {
    border-color: rgba(212, 170, 87, 0.38);
    background: linear-gradient(115deg, #302d26, #26343d);
}

html[data-theme="dark"] .podcast-promotion-entry small,
html[data-theme="dark"] .podcast-plan-original-price {
    color: #c0ccd8;
}

html[data-theme="dark"] .podcast-promotion-feedback.is-valid { color: #8fdbb0; }
html[data-theme="dark"] .podcast-promotion-feedback.is-invalid { color: #ffaaa5; }

html[data-theme="dark"] .podcast-notice {
    border-color: rgba(141, 187, 212, 0.3);
    background: #263c47;
    color: #cce8f5;
}

html[data-theme="dark"] .podcast-notice-error {
    border-color: rgba(229, 137, 122, 0.32);
    background: #452d2c;
    color: #ffc9bd;
}

html[data-theme="dark"] .podcast-lecture-nav {
    background: rgba(141, 187, 212, 0.08);
    border-color: rgba(141, 187, 212, 0.16);
}

html[data-theme="dark"] .podcast-lecture-nav-btn {
    color: #e2e8f0;
}

html[data-theme="dark"] .podcast-lecture-nav-btn:hover {
    background: rgba(141, 187, 212, 0.15);
    color: #93c5fd;
}

html[data-theme="dark"] .podcast-lecture-nav-btn.is-active {
    background: #1e293b;
    border-color: rgba(141, 187, 212, 0.3);
    color: #93c5fd;
}

html[data-theme="dark"] .podcast-section-banner {
    background: linear-gradient(135deg, rgba(63, 143, 209, 0.15) 0%, rgba(244, 185, 66, 0.12) 100%);
    border-left-color: var(--momo-blue);
}

html[data-theme="dark"] .podcast-banner-kicker {
    color: #60a5fa;
}

html[data-theme="dark"] .podcast-section-banner h3 {
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-banner-badge {
    background: #1e293b;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .podcast-vocab-card,
html[data-theme="dark"] .podcast-grammar-card,
html[data-theme="dark"] .podcast-quiz-card {
    background: #1e293b;
    border-color: rgba(141, 187, 212, 0.18);
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-grammar-card {
    border-left-color: #38bdf8;
}

html[data-theme="dark"] .podcast-vocab-ruby {
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-vocab-ruby ruby rt {
    color: #93c5fd;
}

html[data-theme="dark"] .podcast-vocab-meaning {
    color: #cbd5e1;
}

html[data-theme="dark"] .podcast-vocab-example-box,
html[data-theme="dark"] .podcast-grammar-example-box {
    background: #0f172a;
}

html[data-theme="dark"] .podcast-example-ja {
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-example-zh {
    color: #94a3b8;
}

html[data-theme="dark"] .podcast-mini-btn {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-mini-btn:hover {
    background: #334155;
}

html[data-theme="dark"] .podcast-grammar-speak-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .podcast-grammar-speak-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #93c5fd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .podcast-grammar-speak-btn.is-speaking {
    background: rgba(14, 165, 233, 0.2);
    border-color: #0284c7;
    color: #7dd3fc;
    animation: podcast-speak-pulse-dark 1.4s ease-in-out infinite alternate;
}

@keyframes podcast-speak-pulse-dark {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    100% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
}

html[data-theme="dark"] .podcast-grammar-title,
html[data-theme="dark"] .podcast-question-text {
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-grammar-desc {
    color: #cbd5e1;
}

html[data-theme="dark"] .podcast-formula-chip {
    background: #3b2a1a;
    border-color: #78350f;
    color: #fde68a;
}

html[data-theme="dark"] .podcast-field-label,
html[data-theme="dark"] .podcast-question-num {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .podcast-quiz-category-title h4 {
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-category-pill {
    background: #f59e0b;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .podcast-quiz-score-badge {
    background: #1e293b;
    border-color: rgba(141, 187, 212, 0.25);
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-quiz-toggle-btn {
    background: #1e293b;
    border-color: #38bdf8;
    color: #7dd3fc;
}

html[data-theme="dark"] .podcast-quiz-toggle-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #7dd3fc;
}

html[data-theme="dark"] .podcast-quiz-toggle-btn.is-active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

html[data-theme="dark"] .podcast-quiz-reset-btn {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

html[data-theme="dark"] .podcast-quiz-reset-btn:hover {
    background: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-quiz-option-btn {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .podcast-quiz-option-btn:hover:not(:disabled) {
    background: #1e293b;
    border-color: var(--momo-blue);
}

html[data-theme="dark"] .podcast-opt-key {
    background: #1e293b;
    color: #94a3b8;
}

html[data-theme="dark"] .podcast-quiz-option-btn.is-correct-pick {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #a7f3d0 !important;
}

html[data-theme="dark"] .podcast-quiz-option-btn.is-wrong-pick {
    background: #7f1d1d !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .podcast-quiz-option-btn.is-revealed-correct {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #a7f3d0 !important;
}

html[data-theme="dark"] .feedback-correct {
    background: #064e3b;
    border-color: #047857;
    color: #a7f3d0;
}

html[data-theme="dark"] .feedback-review {
    background: #451a03;
    border-color: #78350f;
    color: #fde68a;
}

/* Dark mode POS badges */
html[data-theme="dark"] .pos-verb { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }
html[data-theme="dark"] .pos-idiom { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.35); }
html[data-theme="dark"] .pos-collocation { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
html[data-theme="dark"] .pos-adverb { background: rgba(20, 184, 166, 0.18); color: #5eead4; border-color: rgba(20, 184, 166, 0.35); }
html[data-theme="dark"] .pos-noun { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
html[data-theme="dark"] .pos-adj { background: rgba(236, 72, 153, 0.18); color: #f472b6; border-color: rgba(236, 72, 153, 0.35); }
html[data-theme="dark"] .pos-default { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.35); }

@media (max-width: 820px) {
    .podcast-page { padding-top: 0.5rem; }

    .podcast-hero {
        grid-template-columns: minmax(0, 1fr) 11rem;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .podcast-hero-mark {
        width: 10rem;
        height: 9rem;
    }

    .podcast-layout { grid-template-columns: minmax(0, 1fr); }
    .podcast-library { position: static; }
    .podcast-episode-list { max-height: 20rem; }
}

@media (max-width: 560px) {
    .podcast-hero {
        grid-template-columns: minmax(0, 1fr) 6.5rem;
        gap: 0.35rem;
        min-height: 0;
        padding: 1.1rem 1rem 1.3rem;
    }

    .podcast-hero-mark {
        width: 6.5rem;
        height: 7rem;
        align-self: end;
    }

    .podcast-hero h1 { font-size: clamp(1.8rem, 9vw, 2.45rem); }
    .podcast-hero p { margin-top: 0.55rem; line-height: 1.55; }
    .podcast-hero-meta { margin-top: 0.9rem; }

    .podcast-player-panel,
    .podcast-material-panel,
    .podcast-access-panel,
    .podcast-manage-panel {
        padding: 1rem;
    }

    .podcast-section-heading,
    .podcast-access-panel,
    .podcast-manage-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .podcast-transcript-cue {
        grid-template-columns: 3rem minmax(0, 1fr);
        gap: 0.55rem;
    }

    .podcast-price-block {
        text-align: left;
    }

    .podcast-plan-list {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .podcast-promotion-controls {
        flex-direction: column;
    }

    .podcast-promotion-validate {
        width: 100%;
    }

    .podcast-access-action,
    .podcast-manage-panel .btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .podcast-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.35rem;
    }

    .podcast-hero-copy { max-width: none; }

    .podcast-hero-mark {
        width: 6.5rem;
        height: 6.5rem;
        justify-self: end;
    }
}

/* Text-fit safety net: long English labels wrap to two lines instead of being clipped */
.chapter-card-title,
.lesson-flow-title,
.word-dungeon-name,
.dungeon-chip .chip-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: normal;
}

.grammar-stat-label,
.grammar-stat-value {
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.wm-card-cta,
.word-dungeon-action {
    max-width: 9rem;
    text-align: center;
    white-space: normal;
}
.word-dungeon-name {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Column + wrap made the podcast plan panel spill sideways on phones. */
@media (max-width: 560px) {
    .podcast-access-panel,
    .podcast-manage-panel {
        flex-wrap: nowrap;
    }

    .podcast-access-panel > div:first-child,
    .podcast-manage-panel > div:first-child {
        flex: 0 0 auto;
        width: 100%;
    }

    .podcast-promotion-entry,
    .podcast-plan-list {
        width: 100%;
    }
}