:root {
    /* Palette */
    --bg-paper: #f9f9f7;
    --bg-card: #ffffff;

    --text-ink: #2b2b2b;
    --text-faded: #666666;
    --text-light: #999999;

    --accent-red: #a33e3e;
    --accent-red-dark: #803030;
    --accent-blue: #2c3e50;
    --accent-blue-light: #3498db;
    --accent-gold: #D4AF37;

    --line-color: #e0e0e0;

    /* Functional */
    --color-success: #27ae60;
    --color-success-bg: #e8f5e9;
    --color-error: #c0392b;
    --color-error-bg: #ffebee;
    --color-warning: #f39c12;
    --color-warning-bg: #fff3cd;

    /* Typography */
    --font-serif: "Georgia", "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

    /* Spacing */
    --space-xs: 8px;
    --space-s: 16px;
    --space-m: 24px;
    --space-l: 32px;
    --space-xl: 64px;

    --border-radius: 4px;
    --border-radius-lg: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-paper);
    color: var(--text-ink);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-m);
}

.content-block {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.content-main {
    grid-column: 1 / 2;
}

.content-note {
    grid-column: 2 / 3;
    padding-top: 60px;
    /* Visual alignment with headers */
}

@media (max-width: 900px) {
    .content-block {
        grid-template-columns: 1fr;
        gap: var(--space-m);
    }

    .content-note {
        grid-column: 1 / -1;
        padding-top: var(--space-s);
        border-left: none;
        border-top: 2px solid var(--accent-red);
        background: rgba(0, 0, 0, 0.02);
        padding: var(--space-s);
        margin-bottom: var(--space-l);
    }
}

/* --- Header --- */
header {
    padding: 40px 0;
    border-bottom: 1px solid var(--text-ink);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-ink);
    text-decoration: none;
}

nav a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-faded);
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--text-ink);
}

.lang-switch {
    font-size: 0.875rem;
    display: flex;
    gap: var(--space-s);
}

.lang-opt {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lang-opt.active {
    opacity: 1;
    font-weight: 600;
    border-bottom: 1px solid var(--accent-red);
}

/* --- Typography --- */
h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 var(--space-l) 0;
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin: var(--space-xl) 0 var(--space-m) 0;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: var(--space-s);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

h2:first-child {
    margin-top: 0;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    margin: var(--space-m) 0 var(--space-xs) 0;
    color: var(--text-ink);
}

p.lead {
    font-size: 1.25rem;
    color: var(--text-faded);
    margin-bottom: var(--space-l);
    font-family: var(--font-serif);
}

.chapter-num {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-faded);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Components: Modules --- */
.module-list {
    list-style: none;
    padding: 0;
}

.module-item {
    padding: var(--space-m) 0;
    border-bottom: 1px solid var(--line-color);
    transition: background-color 0.3s;
}

.module-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.module-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.module-meta {
    font-size: 0.875rem;
    color: var(--text-faded);
    margin-top: var(--space-xs);
    display: block;
}

.tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border: 1px solid var(--line-color);
    border-radius: 2px;
    margin-right: var(--space-xs);
    vertical-align: middle;
}

.tag.active {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* --- Components: Sidebar Notes --- */
.margin-note {
    font-size: 0.85rem;
    color: var(--text-faded);
    margin-bottom: var(--space-m);
    background: var(--bg-card);
    border: 1px solid var(--line-color);
    padding: var(--space-s);
    font-family: var(--font-serif);
    font-style: italic;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.margin-note strong {
    font-family: var(--font-sans);
    font-style: normal;
    display: block;
    margin-bottom: 4px;
    color: var(--text-ink);
    font-weight: 600;
}

/* --- Components: Images & Placeholders --- */
.visual-concept {
    margin: var(--space-l) 0;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.visual-concept img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.visual-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

.img-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    padding: 40px;
    text-align: center;
    color: var(--text-faded);
    font-family: monospace;
    margin: var(--space-l) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.img-placeholder-icon {
    font-size: 2rem;
    margin-bottom: var(--space-s);
    opacity: 0.5;
}

.img-placeholder-prompt {
    font-weight: bold;
    margin-bottom: var(--space-xs);
}

.img-placeholder-desc {
    font-size: 0.9rem;
    max-width: 80%;
}

/* --- Components: Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-red);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn:hover {
    background-color: var(--accent-red-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
}

.btn-outline:hover {
    background: var(--accent-red);
    color: white;
}

/* --- Footer --- */
footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--text-ink);
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-faded);
}

/* --- Lesson Specific Utilities --- */
.analogy-box {
    background: #f8f9fa;
    border: 1px solid var(--line-color);
    padding: 20px;
    margin: 20px 0;
    color: #555;
    font-style: italic;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* Helper classes */
.text-center {
    text-align: center;
}

.mt-s {
    margin-top: var(--space-s);
}

.mt-m {
    margin-top: var(--space-m);
}

.mt-l {
    margin-top: var(--space-l);
}

.mb-s {
    margin-bottom: var(--space-s);
}

.mb-m {
    margin-bottom: var(--space-m);
}

/* --- Intonation Game --- */
#intonation-game {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--bg-paper);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--line-color);
}

.intonation-string {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.intonation-letters {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 2px;
    z-index: 2;
    pointer-events: none;
    /* Let events pass to container for cleaner physics */
}

.intonation-char {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-ink);
    position: relative;
    transform-origin: center center;
    will-change: transform;
    cursor: default;
}

.intonation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.intonation-overlay span {
    background: var(--accent-red);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    #intonation-game {
        height: 200px;
    }

    .intonation-char {
        font-size: 2rem;
    }
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    :root {
        --space-xl: 32px;
        --space-l: 24px;
        --space-m: 16px;
    }

    .container {
        padding: 0 var(--space-s);
    }

    /* Header */
    header {
        flex-direction: column;
        gap: var(--space-m);
        text-align: center;
        padding: var(--space-m) 0;
    }

    .logo {
        font-size: 1.25rem;
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    p.lead {
        font-size: 1.1rem;
    }

    /* Footer */
    footer {
        flex-direction: column;
        gap: var(--space-m);
        text-align: center;
    }

    footer div:last-child {
        display: flex;
        flex-direction: column;
        gap: var(--space-s);
    }

    footer a {
        margin-left: 0 !important;
    }

    /* Mobile image fixes */
    .visual-concept {
        margin: var(--space-m) 0;
    }

    .visual-concept img {
        border-radius: 4px;
    }

    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .metaphor-card img,
    .practice-card img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

/* --- Articles Section --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-l);
    margin-top: var(--space-l);
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--line-color);
    padding: var(--space-m);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.article-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--accent-blue);
}

.article-card p {
    color: var(--text-faded);
    font-size: 0.9rem;
    flex-grow: 1;
}

.article-meta {
    margin-top: var(--space-s);
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Quiz Component --- */
.quiz-container {
    background: #fff;
    border: 1px solid var(--line-color);
    padding: var(--space-l);
    margin: var(--space-l) 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.quiz-start,
.quiz-result {
    text-align: center;
}

.quiz-question-card {
    animation: fadeIn 0.3s ease;
}

.quiz-progress {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: var(--space-s);
    text-transform: uppercase;
}

.quiz-question-text {
    font-size: 1.2rem;
    margin-bottom: var(--space-m);
    font-family: var(--font-serif);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.quiz-option {
    padding: 12px 16px;
    border: 2px solid var(--line-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.quiz-option:hover:not(.selected) {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.quiz-option.selected {
    cursor: default;
}

.quiz-option.correct {
    background-color: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
}

.quiz-option.wrong {
    background-color: var(--color-error-bg);
    border-color: var(--color-error);
    color: var(--color-error);
}

.quiz-feedback {
    margin-top: var(--space-m);
    padding: var(--space-s);
    font-size: 0.95rem;
}

.quiz-feedback.success {
    background-color: var(--color-success-bg);
    color: #1e8449;
}

.quiz-feedback.error {
    background-color: var(--color-error-bg);
    color: #c0392b;
}

.quiz-next-btn {
    margin-top: var(--space-m);
}

.quiz-score {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin: var(--space-m) 0;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Topographic Layer Style --- */
.style-topographic {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%23ffffff'/%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23e0e0e0' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    /* overflow: hidden; Removed to allow tooltips to show */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.style-topographic:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

/* Optional: Add a subtle "layer" effect on top */
.style-topographic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    opacity: 0.5;
    border-radius: 12px 12px 0 0;
}

.style-topographic h3,
.style-topographic .soul-word {
    margin-top: 0;
    color: var(--text-ink);
    font-family: var(--font-serif);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* --- Inline Quiz Component --- */
.inline-quiz {
    background: #f8f9fa;
    border: 1px solid var(--line-color);
    padding: var(--space-m);
    margin: var(--space-l) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.inline-question {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-s);
    color: var(--text-ink);
    font-family: var(--font-serif);
}

.inline-options {
    display: flex;
    gap: var(--space-s);
    flex-wrap: wrap;
    margin-bottom: var(--space-s);
}

.inline-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--line-color);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-ink);
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.inline-btn:hover {
    border-color: var(--accent-blue);
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inline-feedback {
    margin-top: var(--space-s);
    padding: var(--space-s);
    font-size: 0.9rem;
    display: none;
}

.inline-feedback.correct {
    display: block;
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.inline-feedback.incorrect {
    display: block;
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* --- Visual Image Link Enhancement --- */
.visual-concept a {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.visual-concept a:hover {
    transform: translateY(-2px);
}

.visual-concept a:hover .visual-image {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Fix for intonation game inside visual-concept */
.visual-concept #intonation-game {
    margin: 0;
}

/* ===================================
   ENHANCED GAME COMPONENTS & MOBILE
   =================================== */

/* --- Game Container Base --- */
.game-container {
    background: var(--bg-card);
    border: 1px solid var(--line-color);
    padding: var(--space-l);
    margin: var(--space-l) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.game-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* --- Enhanced Drag and Drop --- */
.word-card,
.option-chip,
.place-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.word-card:hover,
.option-chip:hover,
.place-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.word-card:active,
.option-chip:active,
.place-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Drop zone enhancements */
.drop-slot,
.drop-column,
.container-box,
.container-surface {
    transition: all 0.3s ease;
}

.drop-slot.hovered,
.drop-column.drag-over {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Success animations */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.word-card.correct,
.option-chip.correct,
.place-card.correct {
    animation: successPulse 0.5s ease;
}

/* --- Enhanced Buttons --- */
.btn-nav,
.case-btn,
.check-btn,
.word-option {
    min-height: 44px;
    min-width: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav:hover:not(:disabled),
.case-btn:hover,
.check-btn:hover,
.word-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-nav:active:not(:disabled),
.case-btn:active,
.check-btn:active,
.word-option:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- Feedback Enhancements --- */
.feedback,
.feedback-box {
    border-radius: var(--border-radius);
    padding: var(--space-m);
    margin-top: var(--space-m);
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct,
.feedback-box.correct {
    background: var(--color-success-bg);
    border: 2px solid var(--color-success);
    color: var(--color-success);
}

.feedback.incorrect,
.feedback-box.incorrect {
    background: var(--color-error-bg);
    border: 2px solid var(--color-error);
    color: var(--color-error);
}

/* --- Responsive Tables --- */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .comparison-table,
    .table-forms {
        font-size: 0.9rem;
    }

    .comparison-table th,
    .comparison-table td,
    .table-forms th,
    .table-forms td {
        padding: 8px;
    }
}

/* --- Mobile Game Optimizations --- */
@media (max-width: 768px) {
    .game-container {
        padding: var(--space-m);
    }

    /* Stack grids vertically */
    .comparison-grid,
    .rule-grid,
    .v-na-game {
        grid-template-columns: 1fr !important;
        gap: var(--space-m);
    }

    /* Better mobile buttons */
    .word-option,
    .case-btn,
    .inline-btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 48px;
    }

    /* Mobile-friendly input fields */
    .input-field {
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 14px;
    }

    /* Better spacing for options */
    .quiz-options,
    .inline-options {
        gap: var(--space-m);
    }

    /* Presentation slides mobile */
    .presentation-container {
        padding: var(--space-m);
        min-height: 400px;
    }

    .slide-title {
        font-size: 1.75rem;
    }

    .slide-content {
        font-size: 1rem;
    }

    /* Detective game mobile */
    .dk-sentence {
        font-size: 1.25rem;
    }

    .case-options {
        grid-template-columns: 1fr;
        gap: var(--space-s);
    }

    /* Drag-and-drop mobile improvements */
    .options-pool {
        padding: var(--space-s);
        gap: var(--space-s);
    }

    .sentence-strip {
        padding: var(--space-s);
        font-size: 1rem;
    }

    .drop-slot {
        width: 120px;
        height: 44px;
        line-height: 40px;
    }

    /* Gender game mobile */
    .drop-column {
        min-height: 150px;
    }

    .word-bank {
        min-height: auto !important;
        padding: var(--space-s) !important;
    }

    /* Practice exercises mobile */
    .practice-container {
        padding: var(--space-m);
    }

    .transformation-exercise {
        padding: var(--space-m);
    }

    /* Better mobile margins */
    .theory-block,
    .detective-box {
        padding: var(--space-m);
        margin-bottom: var(--space-m);
    }
}

/* --- Touch-friendly enhancements --- */
@media (hover: none) and (pointer: coarse) {

    /* Touch devices */
    .word-card,
    .option-chip,
    .place-card {
        cursor: default;
    }

    /* Larger tap targets */
    button,
    .btn,
    .word-option,
    .case-btn {
        min-height: 48px;
        padding: 14px 24px;
    }

    /* Remove hover effects on touch */
    .word-card:hover,
    .option-chip:hover,
    .place-card:hover {
        transform: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
}

/* --- Smooth scrolling --- */
html {
    scroll-behavior: smooth;
}

/* --- Loading states --- */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}