/* ==== GLOBAL STYLES ==== */
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f8fafc; /* bg-slate-50 */
    color: #1e293b; /* Default text color: text-slate-800 */
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* ==== TYPOGRAPHY ==== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: #1e293b; /* Default heading color */
}

h1 {
    font-size: 2.25rem; /* text-4xl (example, adjust as needed) */
    font-weight: 700; /* font-bold */
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 600; /* font-semibold */
    margin-bottom: 1.25rem; /* mb-5 */
    color: #4f46e5; /* text-indigo-600 */
    border-bottom: 1px solid #e5e7eb; /* border-slate-200 */
    padding-bottom: 0.75rem; /* pb-3 */
}

h3 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    margin-top: 1.75rem; /* mt-7 */
    margin-bottom: 1rem; /* mb-4 */
    color: #334155; /* text-slate-700 */
}

p {
    margin-bottom: 1rem;
    color: #475569; /* text-slate-600 */
}

ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #475569;
}

li {
    margin-bottom: 0.5rem;
}

a {
    color: #4f46e5; /* text-indigo-600 */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #3730a3; /* darker indigo on hover */
    text-decoration: underline;
}

code.code-inline { /* Updated selector for clarity */
    background-color: #eef2ff; /* indigo-50 */
    color: #4338ca; /* indigo-700 */
    padding: 0.1em 0.4em;
    border-radius: 0.25rem;
    font-family: 'Menlo', 'Monaco', 'Consolas', "Liberation Mono", "Courier New", monospace;
    font-weight: 600;
    font-size: 0.95em;
}

/* Text Styling Utilities */
.japanese, .jp-text, .font-noto-sans-jp {
    font-family: 'Noto Sans JP', sans-serif;
}

.romaji {
    font-style: italic;
    color: #64748b; /* text-slate-500 */
    font-size: 0.9em;
    display: block; /* Often better for readability below Japanese text */
}

.english-translation {
    font-style: italic;
    color: #64748b; /* text-slate-500 */
    font-size: 0.9em;
    display: block;
}

/* ==== LAYOUT ==== */
header {
    position: sticky;
    top: 0;
    z-index: 50; /* Ensure header is above normal content but below overlays like modals */
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Body padding for pages with the fixed difficulty slider */
body.small-talk-page,
body.grammar-page-with-slider {
    padding-left: 100px; /* Default padding for desktop */
}

main.container {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.intro-banner-section {
    text-align: center;
    background-image: linear-gradient(to right, #f0f9ff, #e0e7ff);
    padding: 2.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.06);
}
.intro-banner-section h1 {
    font-size: 1.875rem;
    line-height: 2.25rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
}
@media (min-width: 768px) {
    .intro-banner-section h1 {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}
.intro-banner-section p {
    font-size: 1.125rem;
    color: #475569;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 2rem 1rem;
    text-align: center;
}
footer a { color: #94a3b8; }
footer a:hover { color: #818cf8; }
footer p { margin-bottom: 0.5rem; color: #94a3b8; }
footer .footer-links span { margin-left: 0.5rem; margin-right: 0.5rem; }

/* ==== COMPONENTS ==== */

/* --- Buttons --- */
.button-base {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.button-base:hover { transform: translateY(-1px); }
.button-base:active { transform: translateY(0); }

.button-indigo {
    background-color: #4f46e5; color: white; border-color: #4f46e5;
}
.button-indigo:hover { background-color: #4338ca; border-color: #4338ca; }
.button-indigo:focus { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5); }

.button-slate {
    background-color: #e2e8f0; color: #334155; border-color: #cbd5e1;
}
.button-slate:hover { background-color: #cbd5e1; }

.reroll-button {
    background: none; border: none; color: #4f46e5; cursor: pointer;
    font-size: 1.25rem; padding: 0.25rem 0.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.reroll-button:hover { color: #3730a3; transform: rotate(45deg); }

.toggle-section-button {
    background-color: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
    padding: 0.5rem 1rem; border-radius: 0.375rem; font-weight: 500;
    cursor: pointer; transition: background-color 0.2s, color 0.2s;
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; text-align: left; margin-top: 1rem; margin-bottom: 1rem;
}
.toggle-section-button:hover { background-color: #c7d2fe; }
.toggle-section-button .arrow-icon { margin-left: 0.5rem; transition: transform 0.3s ease; }
.toggle-section-button .arrow-icon.up { transform: rotate(180deg); }

/* --- Tables --- */
.table-container {
    overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.5rem;
    border-radius: 0.5rem; border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}
table { width: 100%; border-collapse: collapse; background-color: white; }
th, td {
    border: 1px solid #e2e8f0; padding: 0.75rem 1rem;
    text-align: left; vertical-align: top; font-size: 0.875rem;
}
@media (min-width: 768px) { th, td { font-size: 1rem; } }
th { background-color: #f1f5f9; font-weight: 600; color: #334155; font-family: 'Inter', sans-serif; }
td { color: #475569; }

td.japanese, .table-japanese-text { font-family: 'Noto Sans JP', sans-serif; font-size: 1.1em; font-weight: 500; }
td.romaji-cell, .table-romaji-text { font-family: 'Inter', sans-serif; font-style: italic; color: #64748b; font-size: 0.9em; }
td.notes-cell, .table-notes-text { font-size: 0.85em; color: #64748b; line-height: 1.3; } /* Updated for notes cell */
td.center-align, th.center-align { text-align: center; vertical-align: middle; }
td.number-cell, th.number-header { text-align: center; font-weight: 500; width: 10%; vertical-align: middle; }

/* Kana Table (index.html) */
#hiragana-table td, #katakana-table td, #hiragana-table th, #katakana-table th { text-align: center; vertical-align: middle; }
#hiragana-table td, #katakana-table td { height: 60px; position: relative; }
.kana-cell-content { display: inline-block; padding-left: 20px; position: relative; width: 100%; text-align: center; font-family: 'Noto Sans JP', 'Inter', sans-serif; }
.kana-checkbox { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; cursor: pointer; accent-color: #4f46e5; display: none; }
.selecting-mode .kana-checkbox { display: block; }
td.empty-cell { background-color: #f8fafc; }
td.empty-cell .kana-checkbox { display: none !important; }
.kana-table-master-checkbox { margin-right: 5px; accent-color: #4f46e5; display: none; }
.selecting-mode .kana-table-master-checkbox { display: inline-block; }
.select-all-script-checkbox { margin-right: 8px; accent-color: #34d399; transform: scale(1.1); }
#hiragana-table th .table-header-content, #katakana-table th .table-header-content { display: inline-flex; align-items: center; justify-content: center; width: 100%; }

/* Kanji Table (Kanji.html) */
.kanji-table .kanji-char { font-size: 2.5rem; font-family: 'Noto Sans JP', sans-serif; text-align: center; vertical-align: middle; width: 80px; background-color: #f8fafc; }
.kanji-table .readings span.reading-item { display: inline-block; background-color: #eef2ff; color: #4338ca; padding: 2px 8px; border-radius: 999px; margin-right: 5px; margin-bottom: 5px; font-size: 0.85em; font-family: 'Inter', 'Noto Sans JP', sans-serif; line-height: 1.3; }
.kanji-table .readings span.reading-item .romaji { font-style: italic; color: #6366f1; font-size: 0.9em; margin-left: 3px; }
.kanji-table .readings strong { font-weight: 600; color: #475569; margin-right: 5px; font-size: 0.8em; display: block; margin-bottom: 3px; }
.kanji-table .meaning { font-weight: 500; }
.kanji-table .mnemonic { font-style: italic; color: #64748b; font-size: 0.9em; line-height: 1.4; }

/* Particle & Verb Table (Grammar.html) */
td.particle-col { font-family: 'Noto Sans JP', sans-serif; font-size: 1.5em; font-weight: 600; text-align: center; vertical-align: middle; color: #4f46e5; }
td.kana-col { font-family: 'Noto Sans JP', sans-serif; font-size: 1em; }
#verb-list-table th, #verb-list-table td,
#verb-conjugation-table th, #verb-conjugation-table td { font-size: 0.85rem; padding: 0.5rem 0.75rem; } /* Smaller text for verb tables */
@media (min-width: 768px) { #verb-list-table th, #verb-list-table td, #verb-conjugation-table th, #verb-conjugation-table td { font-size: 0.95rem; } }


/* Table "Show More" Toggle */
.table-wrapper .toggle-button { background-color: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.table-wrapper .toggle-button:hover { background-color: #c7d2fe; }
.extra-row { display: none; transition: opacity 0.3s ease-in-out; opacity: 0; }
.extra-row.show { display: table-row; opacity: 1; }


/* --- Flashcards --- */
.card-grid {
    display: grid;
    gap: 1.5rem;
    justify-items: center;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.flip-card {
    background-color: transparent; perspective: 1000px; border-radius: 0.5rem; cursor: pointer;
}
.flip-card-inner {
    position: relative; width: 100%; height: 100%; text-align: center;
    transition: transform 0.6s; transform-style: preserve-3d;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute; width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-radius: 0.5rem; border: 1px solid #e2e8f0; padding: 1rem;
    overflow-wrap: break-word; word-break: break-word; line-height: 1.4;
    text-align: center; overflow-y: auto;
}
.flip-card-front { background-color: white; color: #1e293b; font-weight: 600; font-family: 'Noto Sans JP', 'Inter', sans-serif; }
.flip-card-back { background-color: #334155; color: white; transform: rotateY(180deg); font-family: 'Inter', 'Noto Sans JP', sans-serif; }

.flashcard-toggle-label .jp-first-text, .flashcard-toggle-label .en-first-text { transition: color 0.3s ease, font-weight 0.3s ease; }
.flashcard-toggle-label .jp-first-active, .flashcard-toggle-label .en-first-active { font-weight: 600; color: #4f46e5; }
.flashcard-toggle-label .jp-first-inactive, .flashcard-toggle-label .en-first-inactive { font-weight: 500; color: #6b7280; }
.flashcard-toggle-label > div.peer { margin-left: 1rem; }

.section-title-container {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #e5e7eb; padding-bottom: 0.75rem; margin-bottom: 1.25rem;
}
.section-title-container h2 { margin-bottom: 0 !important; padding-bottom: 0 !important; border-bottom: none !important; }

/* Flashcard Types */
.flashcard-type-kana { width: 140px; height: 180px; }
.flashcard-type-kana .flip-card-front { font-size: 3rem; }
.flashcard-type-kana .flip-card-back { font-size: 1.25rem; }

.flashcard-type-vocab { width: 180px; height: 220px; }
.flashcard-type-vocab .flip-card-front { font-size: 1.75rem; padding: 0.5rem; }
.flashcard-type-vocab .flip-card-back .reading { font-size: 1rem; font-style: italic; margin-bottom: 0.5rem; color: #cbd5e1; }
.flashcard-type-vocab .flip-card-back .meaning { font-size: 0.9rem; color: #e2e8f0; }
.flashcard-type-vocab .flip-card-back .separator,
.flashcard-type-kanji .flip-card-back .separator, /* For Kanji cards */
.flashcard-type-verb .flip-card-back .separator /* For Verb cards */
 { border-top: 1px solid #64748b; margin: 0.5rem auto; width: 80%; }

#phrase-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.flashcard-type-phrase { width: 100%; max-width: 300px; height: 180px; }
.flashcard-type-phrase .flip-card-front { font-family: 'Inter', sans-serif; font-size: 1rem; padding: 0.75rem; }
.flashcard-type-phrase .flip-card-back .japanese { font-family: 'Noto Sans JP', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.3; }
.flashcard-type-phrase .flip-card-back .reading { font-family: 'Inter', sans-serif; font-size: 0.85rem; font-style: italic; color: #cbd5e1; }

#sentence-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.flashcard-type-sentence { width: 100%; max-width: 320px; height: 200px; }
.flashcard-type-sentence .flip-card-front { font-family: 'Inter', sans-serif; font-size: 0.9rem; line-height: 1.4; padding: 0.75rem; }
.flashcard-type-sentence .flip-card-back .japanese { font-size: 0.95rem; line-height: 1.4; }
.flashcard-type-sentence .flip-card-back .reading { font-size: 0.8rem; }

#question-word-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flashcard-type-question-word { width: 100%; max-width: 280px; height: 200px; }
.flashcard-type-question-word .flip-card-front { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 700; }
.flashcard-type-question-word .flip-card-back { padding: 0.75rem; justify-content: space-around; }
.flashcard-type-question-word .flip-card-back .question-word-jp { font-family: 'Noto Sans JP', sans-serif; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; color: #f1f5f9; line-height: 1.2; }
.flashcard-type-question-word .flip-card-back .question-word-romaji-back { font-family: 'Inter', sans-serif; font-size: 0.9rem; font-style: italic; color: #94a3b8; margin-bottom: 0.5rem; }
.flashcard-type-question-word .flip-card-back .example-sentence { font-family: 'Noto Sans JP', sans-serif; font-size: 0.8rem; color: #cbd5e1; line-height: 1.25; }
.flashcard-type-question-word .flip-card-back .example-sentence .romaji { font-size: 0.7rem; color: #94a3b8; font-style: italic; display: block; margin-top: 0.1rem; }

.flashcard-type-kanji { width: 100%; max-width: 260px; height: 200px; }
.flashcard-type-kanji .flip-card-front { font-size: 3.5rem; }
.flashcard-type-kanji .flip-card-back .reading-label { font-weight: 600; color: #94a3b8; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 0.1rem; }
.flashcard-type-kanji .flip-card-back .reading { font-size: 0.85rem; margin-bottom: 0.4rem; color: #cbd5e1; }
.flashcard-type-kanji .flip-card-back .reading .romaji { font-style: italic; color: #94a3b8; font-size: 0.9em; }
.flashcard-type-kanji .flip-card-back .meaning { font-size: 0.95rem; font-weight: 500; color: #f1f5f9; }

/* Grammar Page Flashcards */
#particle-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flashcard-type-particle { width: 100%; max-width: 280px; height: 200px; }
.flashcard-type-particle .flip-card-front .text-lg { font-size: 1.125rem; } /* Tailwind's text-lg */
.flashcard-type-particle .flip-card-front .font-semibold { font-weight: 600; }
.flashcard-type-particle .flip-card-back .particle-jp { font-size: 2rem; }
.flashcard-type-particle .flip-card-back .particle-romaji-back { font-size: 1rem; }
.flashcard-type-particle .flip-card-back .example-sentence { font-size: 0.85rem; }
.flashcard-type-particle .flip-card-back .example-sentence .romaji { font-size: 0.75rem; }

#verb-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } /* Grid for verb flashcards */
.flashcard-type-verb { width: 100%; max-width: 240px; height: 200px; }
.flashcard-type-verb .flip-card-front .japanese { font-size: 2rem; } /* For dictionary form */
.flashcard-type-verb .flip-card-back .japanese { font-size: 1.25rem; } /* For masu form */
.flashcard-type-verb .flip-card-back .romaji { font-size: 0.9rem; font-style: italic; color: #cbd5e1; margin-bottom: 0.25rem; }
.flashcard-type-verb .flip-card-back .meaning { font-size: 0.9rem; color: #e2e8f0; }


#grammar-card-container.card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } /* Adjusted for better fit */
.flashcard-type-grammar, .flashcard-type-verb-pattern { width: 100%; max-width: 320px; height: 200px; } /* Wider for sentences */
.flashcard-type-grammar .flip-card-front .text-lg,
.flashcard-type-verb-pattern .flip-card-front .text-lg { font-size: 1.125rem; }
.flashcard-type-grammar .flip-card-front .font-semibold,
.flashcard-type-verb-pattern .flip-card-front .font-semibold { font-weight: 600; }
.flashcard-type-grammar .flip-card-back .japanese,
.flashcard-type-verb-pattern .flip-card-back .japanese { font-size: 1rem; }
.flashcard-type-grammar .flip-card-back .reading.romaji,
.flashcard-type-verb-pattern .flip-card-back .reading.romaji { font-size: 0.85rem; }
.flashcard-type-grammar .flip-card-back .answer-pattern { font-size: 0.75rem; }


.flashcard-type-number-time { width: 160px; height: 200px; }
.flashcard-type-number-time .flip-card-front { font-size: 1.75rem; }
.flashcard-type-number-time .flip-card-back { font-size: 0.9rem; padding: 0.75rem; }


/* --- Quizzes --- */
.quiz-container { text-align: center; max-width: 32rem; margin: 1.5rem auto 0 auto; }
.quiz-stats { display: flex; justify-content: space-around; align-items: center; margin-bottom: 1.5rem; font-size: 0.875rem; color: #475569; }
@media (min-width: 768px) { .quiz-stats { font-size: 1rem; } }
.quiz-stats .stat-item { font-weight: 500; }

.quiz-prompt-display {
    font-weight: 600; margin-bottom: 1.5rem; color: #1e293b; background-color: #f0f9ff;
    border-radius: 0.5rem; padding: 1rem 1.25rem; box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.05);
    min-height: 100px; display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.quiz-prompt-display.kana-quiz-character { font-size: 3.75rem; line-height: 1; }
@media (min-width: 768px) { .quiz-prompt-display.kana-quiz-character { font-size: 4.5rem; } }
.quiz-prompt-display.number-quiz-question { font-size: 2.25rem; line-height: 2.5rem; }
@media (min-width: 768px) { .quiz-prompt-display.number-quiz-question { font-size: 3rem; line-height: 1; } }
.quiz-prompt-display.kanji-quiz-character { font-size: 3.75rem; line-height: 1; font-family: 'Noto Sans JP', sans-serif; }
@media (min-width: 768px) { .quiz-prompt-display.kanji-quiz-character { font-size: 4.5rem; } }

.quiz-prompt-display.grammar-quiz-prompt,
.quiz-prompt-display.smalltalk-quiz-prompt { font-size: 1.125rem; line-height: 1.6; padding: 1rem; }
@media (min-width: 768px) { .quiz-prompt-display.grammar-quiz-prompt, .quiz-prompt-display.smalltalk-quiz-prompt { font-size: 1.25rem; } }

.quiz-prompt-display .quiz-blank { color: #9ca3af; font-weight: normal; border-bottom: 2px dashed #9ca3af; padding: 0 0.5em; margin: 0 0.25em; }
.quiz-prompt-display .text-sm { font-size: 0.875rem; }
.quiz-prompt-display .text-slate-500 { color: #64748b; }
.quiz-prompt-display .mb-1 { margin-bottom: 0.25rem; }
.quiz-prompt-display .mt-1 { margin-top: 0.25rem; }
.quiz-prompt-display .kana-example { font-family: 'Noto Sans JP', sans-serif; } /* Ensure Noto Sans for kana examples in prompt */
.quiz-prompt-display p.japanese span.japanese { /* Specific for quiz prompt sentence parts */
    display: inline; /* Helps keep sentence parts together */
}


.quiz-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.quiz-option {
    transition: background-color 0.2s ease-in-out, transform 0.1s ease, border-color 0.2s ease-in-out;
    border: 1px solid #cbd5e1; font-family: 'Inter', 'Noto Sans JP', sans-serif; font-weight: 500;
    padding: 0.75rem 1rem; border-radius: 0.5rem; background-color: white; color: #374151;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); cursor: pointer; min-height: 55px;
    display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.4;
}
.quiz-option:hover:not(:disabled) { background-color: #e2e8f0; transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.quiz-option:active:not(:disabled) { transform: translateY(0px); }
.quiz-option.correct { background-color: #10b981 !important; color: white !important; border-color: #059669 !important; font-weight: 600; }
.quiz-option.incorrect { background-color: #ef4444 !important; color: white !important; border-color: #dc2626 !important; font-weight: 600; }
.quiz-option:disabled { opacity: 0.7; cursor: not-allowed; }
.quiz-option-sm-text { font-size: 0.9rem; line-height: 1.3; }
.quiz-option-lg-text { font-size: 1.2rem; font-weight: 600; }


.quiz-feedback-display { min-height: 2rem; margin-bottom: 1.5rem; font-weight: 600; font-size: 1.125rem; }
.quiz-feedback-display.correct-feedback, .quiz-feedback-display .text-emerald-600 { color: #059669; }
.quiz-feedback-display.incorrect-feedback, .quiz-feedback-display .text-red-600 { color: #dc2626; }

.quiz-next-button {
    width: 100%; background-color: #4f46e5; color: white; font-weight: 700;
    padding: 0.75rem 1.5rem; border-radius: 0.5rem;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.06);
    border: none; cursor: pointer;
}
.quiz-next-button:hover:not(:disabled) { background-color: #4338ca; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.quiz-next-button:focus { outline: none; box-shadow: 0 0 0 2px white, 0 0 0 4px #6366f1; }
.quiz-next-button:disabled, .quiz-next-button.opacity-50 { opacity: 0.5; cursor: not-allowed; }

/* Kana Drawing Quiz (index.html) */
#kana-drawing-canvas { cursor: crosshair; touch-action: none; background-color: #fff; border: 1px solid #cbd5e1; border-radius: 0.375rem; }
#drawing-answer-display { font-family: 'Noto Sans JP', sans-serif; }
#drawing-prompt-container { background-color: #f0f9ff; padding: 0.75rem; border-radius: 0.5rem; border: 1px solid #e0f2fe; margin-bottom: 1.5rem; }


/* --- Difficulty Slider --- */
#difficulty-slider-container {
    position: fixed; left: 10px; top: 50%; transform: translateY(-50%); z-index: 100;
    display: flex; align-items: center; background-color: rgba(255,255,255,0.95);
    padding: 10px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); border: 1px solid #e2e8f0;
}
#difficulty-slider { display: flex; flex-direction: column; gap: 8px; background-color: transparent; padding: 0; border-radius: 0; box-shadow: none; border: none; }
#difficulty-slider-label {
    writing-mode: vertical-rl; transform: rotate(180deg); margin-right: 10px;
    color: #475569; font-weight: 600; font-size: 0.875rem; white-space: nowrap; padding: 5px 2px;
}
.difficulty-level-btn {
    width: 40px; height: 40px; border-radius: 50%; background-color: #eef2ff; color: #4338ca;
    font-weight: 600; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease-in-out; border: 2px solid transparent;
}
.difficulty-level-btn:hover { background-color: #c7d2fe; transform: scale(1.05); }
.difficulty-level-btn.active { background-color: #4f46e5; color: white; border-color: #3730a3; box-shadow: 0 0 0 3px rgba(79,70,229,0.4); }
@media (max-width: 768px) {
    #difficulty-slider-container { position: static; transform: none; flex-direction: column; width: auto; margin: 20px auto; align-items: center; padding: 10px; }
    #difficulty-slider-label { writing-mode: horizontal-tb; transform: none; margin-right: 0; margin-bottom: 10px; }
    #difficulty-slider { flex-direction: row; gap: 10px; }
    body.small-talk-page, body.grammar-page-with-slider { padding-left: 0; }
}

/* --- Matching Game (Small-talk.html) --- */
#matching-game { display: flex; justify-content: space-around; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; padding: 1rem; background-color: #f1f5f9; border-radius: 0.5rem; }
.matching-column { display: flex; flex-direction: column; gap: 0.75rem; width: 45%; }
.matching-item {
    padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 0.375rem; background-color: white;
    cursor: pointer; transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
    text-align: center; min-height: 50px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.matching-item:hover:not(.selected):not(.matched) { background-color: #f0f9ff; border-color: #7dd3fc; transform: translateY(-1px); }
.matching-item.selected { background-color: #cffafe; border-color: #22d3ee; font-weight: 600; box-shadow: 0 0 0 2px #a5f3fc; }
.matching-item.matched { background-color: #dcfce7; border-color: #86efac; color: #166534; cursor: default; opacity: 0.8; text-decoration: line-through; }
.matching-item.incorrect-match { background-color: #fee2e2; border-color: #fca5a5; animation: shake 0.5s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
#matching-feedback { text-align: center; margin-top: 1rem; font-weight: 600; min-height: 1.5rem; }
#new-match-game-btn.button-base { margin: 1.5rem auto 0 auto; } /* Uses button-base now */
.matching-item.japanese { font-family: 'Noto Sans JP', sans-serif; font-size: 1rem; }


/* --- Example Styles (Pronunciation, Particles) --- */
.example-word { font-weight: 500; color: #4f46e5; }
.particle-example { margin-top: 0.5rem; margin-bottom: 0.75rem; padding-left: 1rem; border-left: 3px solid #a5b4fc; color: #475569; }
.particle-example .japanese, .particle-example .kana-example { font-family: 'Noto Sans JP', sans-serif; font-weight: 500; font-size: 1em; display: block; margin-bottom: 0.25rem; }
.question-word-example { margin-top: 0.5rem; margin-bottom: 0.75rem; padding-left: 1rem; border-left: 3px solid #e2e8f0; color: #475569; }
.question-word-example .japanese { font-family: 'Noto Sans JP', sans-serif; font-weight: 500; }
.question-word-example .english-translation { font-size: 0.85em; }


/* ==== UTILITIES ==== */
.text-red-600 { color: #dc2626; }
.uppercase-emphasis { text-transform: uppercase; font-weight: bold; }

/* Imprint/Privacy Page Specifics */
.imprint-content h2, .privacy-content h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; color: #4f46e5; border-bottom: none; padding-bottom: 0; }
.imprint-content h3, .privacy-content h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; color: #1e293b; }
.imprint-content p, .privacy-content p { margin-bottom: 1rem; color: #475569; }
.imprint-content a, .privacy-content a { text-decoration: underline; }
.privacy-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.privacy-content ul li { margin-bottom: 0.5rem; }


/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }
