/* Base Variables and Theme Setup */
:root {
    --primary-color: #0b47a6; /* Slovak Royal Blue */
    --secondary-color: #ff9800; /* Warm Amber */
    --accent-color: #10b981; /* Soft Emerald Green */
    --danger-color: #ef4444; /* Soft Red */
    --bg-dark: #0f172a; /* Slate Dark */
    --text-light: #f8fafc;
    --text-dark: #1e293b;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --shadow-main: 0 10px 30px -5px rgba(11, 71, 166, 0.1);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --font-heading: 'Outfit', 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

/* Reset and Globals */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #e0f2fe 0%, #fef3c7 50%, #dcfce7 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.month-week-selectors {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

/* Header Styles */
.app-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.05);
}

.header-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: var(--text-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px -3px rgba(11, 71, 166, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.brand-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
    margin-top: -3px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-tab-btn {
    border: none;
    background: transparent;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-header-btn {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

.auth-header-btn:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.nav-tab-btn i {
    font-size: 16px;
    color: var(--primary-color);
}

.nav-tab-btn:hover {
    background: rgba(11, 71, 166, 0.05);
}

.nav-tab-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 15px -3px rgba(11, 71, 166, 0.25);
}

.nav-tab-btn.active i {
    color: var(--text-light);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    background: rgba(11, 71, 166, 0.06);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(11, 71, 166, 0.1);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--text-light);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.15);
}

/* Main Container and Cards */
.main-container {
    width: 92%;
    max-width: 1200px;
    margin: 40px auto;
    flex-grow: 1;
}

.view-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* PLAYGROUND VIEW */
.playground-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
}

@media (max-width: 992px) {
    .playground-grid {
        grid-template-columns: 1fr;
    }
}

/* Character Selector */
.character-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.character-selector.compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-end;
    gap: 12px 15px;
    margin-bottom: 15px;
    background: rgba(11, 71, 166, 0.07);
    padding: 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(11, 71, 166, 0.15);
}

.selector-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.selector-item.flex-large {
    flex: 1.2;
}

.compact-select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--card-border);
    background-color: white;
    color: var(--text-dark);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.compact-select:focus {
    border-color: var(--primary-color);
}

.selector-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.character-options {
    display: flex;
    gap: 12px;
}

.char-option-btn {
    flex: 1;
    border: 2px solid var(--card-border);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-md);
    padding: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.char-option-btn:hover {
    border-color: rgba(11, 71, 166, 0.3);
    background: rgba(255, 255, 255, 0.8);
}

.char-option-btn.active {
    border-color: var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 4px 15px -3px rgba(11, 71, 166, 0.1);
}

.char-icon {
    font-size: 20px;
}

/* WebRTC Stream Video Screen */
.avatar-screen-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #1e293b;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    /* Тонкая выпуклая темная рамка */
    border: 3.5px solid #1e293b;
    box-shadow: 
        inset 0 4px 8px rgba(255, 255, 255, 0.15),
        inset 0 -4px 8px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(0, 0, 0, 0.85),
        0 10px 25px rgba(0, 0, 0, 0.3);
}

.ai-status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-status-badge i {
    color: var(--accent-color);
}

.avatar-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-mock-animation {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
    animation: pulse-ring 2s infinite ease-out;
    z-index: 1;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.subtitle-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 30px 20px 15px 20px;
    color: var(--text-light);
    text-align: center;
    z-index: 5;
}

.subtitle-overlay p {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

/* Chat bubble dialogue block */
.dialogue-chat {
    margin-top: 20px;
    min-height: 380px;
    max-height: 540px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bubble {
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    max-width: 90%;
    line-height: 1.4;
    font-size: 13.5px;
}

.tutor-bubble {
    background: #f1f5f9;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.bubble-meta {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.bubble-text {
    font-weight: 500;
}

/* Controls Panel - Right side */
.controls-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
}

.task-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.btn-read-task.convex-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    color: var(--primary-color);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    box-shadow: 
        0 4px 10px rgba(11, 71, 166, 0.15),
        inset 0 1px 2px #ffffff;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.btn-read-task.convex-audio-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(145deg, #ffffff 0%, #dbeafe 100%);
    box-shadow: 0 6px 14px rgba(11, 71, 166, 0.25);
}

.btn-read-task.convex-audio-btn:active, .btn-read-task.convex-audio-btn.playing {
    transform: translateY(1px) scale(0.98);
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-read-task.convex-audio-btn.playing i {
    animation: task-audio-pulse 0.8s infinite alternate ease-in-out;
}

@keyframes task-audio-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.25); }
}

.exercise-task {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Scenario Buttons Styling */
.scenario-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.scenario-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 2px solid rgba(11, 71, 166, 0.15);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.scenario-btn:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.06);
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(11, 71, 166, 0.2);
}

.scenario-btn.active {
    border-color: #f97316;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25), 0 6px 16px rgba(249, 115, 22, 0.3);
    transform: scale(1.05);
}

.scenario-btn.disabled {
    opacity: 0.6;
    background: #f1f5f9;
    border-color: #cbd5e1;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.scenario-lock-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
    background: #ef4444;
    color: #ffffff;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pronunciation-widget {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(11, 71, 166, 0.08);
    border-radius: var(--border-radius-md);
    padding: 20px;
}

.phrase-target {
    margin-bottom: 15px;
}

.target-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.phoneme-word-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.phoneme-word {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.phoneme-word.correct {
    color: var(--accent-color);
    background: #d1fae5;
    border-color: #a7f3d0;
}

.phoneme-word.warning {
    color: #d97706;
    background: #fef3c7;
    border-color: #fde68a;
}

.phoneme-word.incorrect {
    color: var(--danger-color);
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Convex 3D Tactile Tip Button for Accessibility / Low Vision */
.tip-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(145deg, #ffffff 0%, #fff7ed 100%);
    border: 2.5px solid #f97316;
    border-radius: 16px;
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
    user-select: none;
    box-shadow: 
        0 6px 16px rgba(249, 115, 22, 0.2),
        inset 0 2px 4px #ffffff,
        inset 0 -3px 6px rgba(249, 115, 22, 0.12);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tip-box:hover {
    transform: translateY(-2px) scale(1.01);
    background: linear-gradient(145deg, #ffffff 0%, #ffedd5 100%);
    border-color: #ea580c;
    box-shadow: 
        0 8px 22px rgba(249, 115, 22, 0.3),
        inset 0 2px 4px #ffffff,
        inset 0 -3px 6px rgba(249, 115, 22, 0.18);
}

.tip-box:active, .tip-box.playing {
    transform: translateY(2px) scale(0.99);
    box-shadow: 
        0 2px 6px rgba(249, 115, 22, 0.2),
        inset 0 3px 6px rgba(0, 0, 0, 0.1);
    border-color: #c2410c;
}

.tip-icon {
    font-size: 20px;
    color: #ea580c;
    background: #ffedd5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #fdba74;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(234, 88, 12, 0.2);
    flex-shrink: 0;
}

.tip-box.playing .tip-icon {
    animation: tip-megaphone-pulse 0.8s infinite alternate ease-in-out;
}

@keyframes tip-megaphone-pulse {
    0% { transform: scale(1); color: #ea580c; background: #ffedd5; }
    100% { transform: scale(1.18); color: #ffffff; background: #ea580c; }
}

.tip-content {
    flex: 1;
}

.tip-content h4 {
    font-size: 12.5px;
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 3px;
}

.tip-content p {
    font-size: 12.5px;
    color: #9a3412;
    line-height: 1.4;
    font-weight: 600;
}

.tip-audio-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    background: #ea580c;
    color: #ffffff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.3);
    transition: background 0.2s ease;
}

.tip-box:hover .tip-audio-badge {
    background: #c2410c;
}

.tip-audio-badge i {
    font-size: 13px;
}

.tip-audio-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Microphone record states */
.record-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-record-speech {
    border: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: var(--text-light);
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 8px 25px -5px rgba(11, 71, 166, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.btn-record-speech:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -5px rgba(11, 71, 166, 0.6);
}

.btn-record-speech.recording {
    background: var(--danger-color);
    box-shadow: 0 0 25px var(--danger-color);
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.record-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    opacity: 0.7;
}

/* Audio Recording wave bars */
.recording-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
}

.wave-bar {
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
}

.btn-record-speech.recording + .record-status + .recording-wave,
.recording-wave:not(.hidden) .wave-bar {
    animation: wave-jump 0.8s infinite ease-in-out alternate;
}

.recording-wave .wave-bar:nth-child(2) { animation-delay: 0.15s; }
.recording-wave .wave-bar:nth-child(3) { animation-delay: 0.3s; }
.recording-wave .wave-bar:nth-child(4) { animation-delay: 0.45s; }
.recording-wave .wave-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes wave-jump {
    0% { height: 8px; }
    100% { height: 28px; }
}

/* Pronunciation feedback card */
.speech-feedback-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: var(--border-radius-md);
    padding: 15px 20px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.score-circle span:first-child {
    font-size: 16px;
    font-weight: 800;
}

.score-circle .score-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.feedback-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 2px;
}

.feedback-details p {
    font-size: 12px;
    color: #047857;
}

/* PARENT CABINET VIEW */
.cabinet-welcome {
    background: linear-gradient(135deg, rgba(11, 71, 166, 0.05), rgba(255, 152, 0, 0.05));
    border-color: rgba(11, 71, 166, 0.1);
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

@media (max-width: 576px) {
    .welcome-header {
        flex-direction: column;
        text-align: center;
    }
}

.parent-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    background: var(--primary-color);
    color: var(--text-light);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px -3px rgba(11, 71, 166, 0.2);
}

.welcome-text h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.welcome-text p {
    font-size: 13.5px;
    opacity: 0.8;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.time-icon { background: #dbeafe; color: var(--primary-color); }
.vocab-icon { background: #fef3c7; color: var(--secondary-color); }
.social-icon { background: #d1fae5; color: var(--accent-color); }

.stat-info .stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.stat-info h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Chart and Details grids */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

@media (max-width: 992px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container h3, .milestones-container h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
}

.milestone-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.milestone-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.milestone-checkbox {
    font-size: 20px;
}

.milestone-item.completed .milestone-checkbox {
    color: var(--accent-color);
}

.milestone-item.locked {
    opacity: 0.5;
}

.milestone-item.locked .milestone-checkbox {
    color: var(--text-dark);
}

.milestone-info h4 {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.milestone-info p {
    font-size: 11.5px;
    opacity: 0.7;
    line-height: 1.4;
}

/* GDPR Panel */
.gdpr-settings-card {
    border-left: 5px solid var(--primary-color);
}

.gdpr-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.gdpr-shield {
    font-size: 28px;
    color: var(--primary-color);
}

.gdpr-title h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.gdpr-title p {
    font-size: 12px;
    opacity: 0.8;
}

.gdpr-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-gdpr-secondary {
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-gdpr-secondary:hover {
    background: rgba(11, 71, 166, 0.05);
}

.btn-gdpr-danger {
    border: none;
    background: var(--danger-color);
    color: var(--text-light);
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.btn-gdpr-danger:hover {
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
}

/* Footer Area Styles */
.app-footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.6);
    padding: 30px 0;
    margin-top: 60px;
    font-size: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

.footer-affiliate-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0088cc;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    margin-left: 8px;
    transition: background 0.2s ease;
}

.footer-affiliate-link:hover {
    background: #0077b5;
}

.footer-legal-links {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.3);
}

.footer-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Character Selector Group Grid */
.character-group {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(11, 71, 166, 0.05);
}

.group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.char-locked-wrapper {
    position: relative;
    flex: 1;
}

.lock-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: var(--text-light);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.2);
    z-index: 5;
    pointer-events: none;
}

.char-option-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
}

.char-option-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: var(--card-border);
}

/* Modals / Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 35px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-dark);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.modal-close-btn:hover {
    opacity: 1;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 20px;
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: rgba(11, 71, 166, 0.08);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 5px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-header p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.modal-body {
    margin-bottom: 20px;
}

.math-question {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--secondary-color);
    text-align: center;
    margin: 10px 0;
    letter-spacing: 1px;
}

.modal-input {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.95);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 71, 166, 0.12);
}

.modal-error {
    color: var(--danger-color);
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
}

.btn-modal-primary {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: var(--text-light);
    padding: 13px;
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(11, 71, 166, 0.2);
    transition: all 0.2s ease;
}

.btn-modal-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(11, 71, 166, 0.3);
}

/* Pricing Section inside Cabinet */
.pricing-section {
    margin-top: 25px;
    padding: 30px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 25px;
}

.pricing-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.pricing-header p {
    font-size: 13px;
    color: #64748b;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.plan-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(11, 71, 166, 0.06);
    border-radius: var(--border-radius-md);
    padding: 25px 15px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(11, 71, 166, 0.04);
}

.plan-card.featured {
    background: #ffffff;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 25px rgba(11, 71, 166, 0.06);
    transform: scale(1.02);
}

.plan-card.featured:hover {
    transform: scale(1.02) translateY(-3px);
}

.plan-card.featured-premium {
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
    border: 2px solid #8b5cf6;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15);
    transform: scale(1.03);
}

.plan-card.featured-premium:hover {
    transform: scale(1.03) translateY(-3px);
}

.plan-card.featured-premium .plan-badge {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
}

.btn-plan-select.btn-premium {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #fff;
    border: none;
}

.btn-plan-select.btn-premium:hover {
    background: linear-gradient(135deg, #7c3aed, #c084fc);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: var(--text-light);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.plan-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.plan-price {
    margin-bottom: 3px;
}

.price-currency {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    vertical-align: super;
}

.price-value {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary-color);
}

.price-period {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.plan-total {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

.plan-features li {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-features li i {
    color: var(--accent-color);
}

.btn-plan-select {
    width: 100%;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    padding: 9px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-card.featured .btn-plan-select {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-plan-select:hover {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 3px 10px rgba(11, 71, 166, 0.12);
}

/* Active Subscription Banner */
.subscription-banner {
    margin-top: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    animation: fadeIn 0.4s ease;
}

.sub-banner-icon {
    font-size: 22px;
    color: #ffd700;
}

.sub-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.sub-title {
    font-weight: 700;
    font-size: 13.5px;
}

.sub-details {
    font-size: 11.5px;
    opacity: 0.8;
}

/* Stripe Simulator Modal */
.payment-card {
    max-width: 440px;
}

.payment-amount-display {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: 8px;
}

.stripe-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.form-group label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.card-number-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.card-number-wrapper input {
    padding-right: 45px;
}

.card-brand-icon {
    position: absolute;
    right: 15px;
    font-size: 18px;
    color: #94a3b8;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Success Checkmark Animation */
.payment-success-screen {
    text-align: center;
    padding: 15px 0;
}

.payment-success-screen h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin: 15px 0 6px 0;
}

.payment-success-screen p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
}

.success-checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 72px;
    height: 72px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--accent-color);
}

.success-checkmark .check-icon .icon-line {
    height: 4px;
    background-color: var(--accent-color);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 38px;
    left: 12px;
    width: 22px;
    transform: rotate(45deg);
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 34px;
    right: 8px;
    width: 42px;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon .icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, 0.15);
    box-sizing: content-box;
    position: absolute;
}

/* Scenario Selector, Scenario Badges, and Word-Level Highlighting Styles */
.scenario-selector-container {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.scenario-badge {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-badge:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.scenario-badge.active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.scenario-badge.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.05);
}

/* Word-Level Highlights for Speech Assessment */
#phrase-phoneme-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 12px 0;
    justify-content: center;
}

.phoneme-word {
    font-size: 24px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s ease;
    color: var(--text-dark);
}

.phoneme-word.correct {
    background-color: rgba(16, 185, 129, 0.2); /* Accent green */
    color: #047857;
    border-bottom: 3px solid #10b981;
}

.phoneme-word.warning {
    background-color: rgba(245, 158, 11, 0.2); /* Secondary amber */
    color: #b45309;
    border-bottom: 3px solid #f59e0b;
}

.phoneme-word.incorrect {
    background-color: rgba(239, 68, 68, 0.2); /* Danger red */
    color: #b91c1c;
    border-bottom: 3px solid #ef4444;
}

/* Chat Input Wrapper Styles */
.chat-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid var(--card-border);
}

#chat-input-field {
    flex: 1;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input-field:focus {
    border-color: var(--primary-color);
}

.chat-input-wrapper button {
    border-radius: 12px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s;
}

.chat-input-wrapper button:hover {
    transform: scale(1.05);
}

/* Typing Indicators */
.typing-indicator-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #64748b;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Video Frame adjustments */
.video-stream-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #1e293b;
}

#heygen-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden {
    display: none !important;
}

/* Registration and Verification Modal Styles */
.reg-success-details h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.expired-lock-card, .invite-card, .registration-card, .parent-expiry-card {
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-dark);
}

.modal-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 71, 166, 0.15);
}

/* Character Button Selection overrides */
.char-option-btn {
    transition: all 0.2s ease;
}
.char-option-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.char-option-btn.active {
    background: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--primary-color) !important;
}

/* Locked modal headers layout */
.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 15px auto;
}

/* Pulse Play Button Overlay for Avatar Autoplay Fallback */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.play-btn-circle {
    width: 60px;
    height: 60px;
    background: var(--primary-color, #4f46e5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
    animation: pulsePlay 2s infinite;
    padding-left: 5px;
}

@keyframes pulsePlay {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(79, 70, 229, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* Scenario Button and Badge styling alignment */
.scenario-badge, .scenario-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-badge:hover, .scenario-btn:hover {
    background: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.scenario-badge.active, .scenario-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.scenario-badge.disabled, .scenario-btn.disabled, .scenario-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
    transform: none;
    box-shadow: none;
}

.scenario-lock-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

/* Constrain video to parent container to prevent mobile overflows */
.avatar-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Global Mobile Responsiveness Optimizations (Screens under 768px) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .nav-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-tab-btn {
        flex-direction: column;
        gap: 4px;
        padding: 8px 6px;
        font-size: 11px;
        flex: 1;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .nav-tab-btn i {
        font-size: 16px;
    }
    
    .main-container {
        margin: 15px auto;
        width: 95%;
    }
    
    .card {
        padding: 15px 10px;
        border-radius: var(--border-radius-md);
    }
    
    h1, .brand-name {
        font-size: 18px !important;
    }
    
    h2 {
        font-size: 16px !important;
    }
    
    h3 {
        font-size: 14px !important;
    }
    
    .avatar-screen-wrapper {
        aspect-ratio: 16 / 11; /* ratio for small screens */
    }

    .dialogue-chat {
        min-height: 220px;
        max-height: 340px;
    }

    /* Prevent mobile input zooming on focus */
    #chat-input-field {
        font-size: 16px !important;
    }

    /* Wrap scenario selector buttons properly on small screens */
    .scenario-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    /* Flex wrapping for character & track options to prevent horizontal cutoffs */
    .character-options {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .char-option-btn {
        flex: 1 1 calc(50% - 8px) !important;
        min-width: 110px !important;
        font-size: 12px !important;
        padding: 8px !important;
    }

    /* Compact Selectors Mobile layout */
    .character-selector.compact {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px !important;
        margin-bottom: 12px !important;
    }

    .selector-item {
        flex: none !important;
        width: 100% !important;
    }

    .compact-select {
        padding: 10px !important;
        font-size: 16px !important; /* prevents mobile Safari auto-zooming */
    }
}

/* --- Interactive Game Zone Enhancements --- */

/* Click Me Overlay Badge */
.click-me-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    padding: 10px 22px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pulseBounce 1.4s infinite ease-in-out;
    border: 2px solid #ffffff;
    letter-spacing: 0.5px;
    user-select: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.click-me-badge i {
    font-size: 18px;
}

@keyframes pulseBounce {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.08);
        box-shadow: 0 12px 30px rgba(255, 152, 0, 0.85), 0 0 20px rgba(255, 255, 255, 0.9);
    }
}

/* Blinking Dropdowns Sequence Animation */
@keyframes dropdownBlinkAnim {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.8);
        border-color: #ff9800;
        background-color: #fff9c4;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px 5px rgba(255, 152, 0, 0.95);
        border-color: #e65100;
        background-color: #ffe082;
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.8);
        border-color: #ff9800;
        background-color: #fff9c4;
        transform: scale(1);
    }
}

.blinking-dropdown {
    animation: dropdownBlinkAnim 1.1s infinite ease-in-out !important;
    font-weight: 700 !important;
    border-width: 2px !important;
    border-style: solid !important;
    position: relative;
    z-index: 5;
}

/* Transparent Green State for Selected Dropdowns */
.selected-dropdown-green {
    background-color: rgba(16, 185, 129, 0.22) !important;
    border-color: #10b981 !important;
    color: #064e3b !important;
    font-weight: 700 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35) !important;
    transition: all 0.3s ease;
}

/* Confirm Lesson Button */
.btn-confirm-lesson {
    width: 100%;
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid var(--accent-color, #10b981);
    background: var(--accent-color, #10b981);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-confirm-lesson:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* Blinking Animation for Confirm Button */
@keyframes confirmBtnBlinkAnim {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
        background: #10b981;
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 22px 7px rgba(16, 185, 129, 0.95);
        background: #059669;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
        background: #10b981;
    }
}

.blinking-btn {
    animation: confirmBtnBlinkAnim 1.0s infinite ease-in-out !important;
}

/* Locked / Disabled state for unpaid selectors */
/* Locked / Disabled state for Phase B selectors */
select:disabled,
button:disabled,
.disabled-dropdown,
.disabled-btn {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: none !important;
    animation: none !important;
}

.disabled-btn {
    background-color: #94a3b8 !important;
    color: #ffffff !important;
}

.subtitle-overlay {
    display: none !important;
}




