﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

body {
    background-color: #e6f7ff;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, #4a90e2, #63b3ed);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
}

.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.coins {
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-icon {
    color: gold;
}

nav {
    background-color: #3182ce;
    padding: 0.5rem;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

nav li {
    margin: 0 10px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.3s;
}

nav a:hover, nav a.active {
    background-color: #2c5aa0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    min-height: 70vh;
}

.section {
    display: none;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.section.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h2 {
    color: #2c5aa0;
    margin-bottom: 15px;
    border-bottom: 2px solid #e6f7ff;
    padding-bottom: 10px;
}

.video-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background-color: #f0f9ff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    height: 160px;
    background-color: #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    margin-bottom: 10px;
    color: #2c5aa0;
}

.btn {
    display: inline-block;
    background-color: #4a90e2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn:hover {
    background-color: #2c5aa0;
    transform: translateY(-2px);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #4a90e2;
    color: #4a90e2;
}

.btn-outline:hover {
    background-color: #4a90e2;
    color: white;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f9ff;
    border-radius: 10px;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

.option {
    padding: 10px;
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background-color: #ebf8ff;
    border-color: #4a90e2;
}

.option.selected {
    background-color: #bee3f8;
    border-color: #4a90e2;
}

.option.correct {
    background-color: #c6f6d5;
    border-color: #48bb78;
}

.option.incorrect {
    background-color: #fed7d7;
    border-color: #f56565;
}

.progress-container {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 10px;
    margin: 20px 0;
}

.progress-bar {
    height: 20px;
    background: linear-gradient(90deg, #4a90e2, #63b3ed);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s;
}

.achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.achievement {
    background-color: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.achievement:hover {
    transform: scale(1.05);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.achievement-reward {
    font-size: 0.8rem;
    color: #2d3748;
    margin-top: 5px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.shop-item {
    background-color: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shop-item-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.shop-item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
}

.purchased {
    background-color: #c6f6d5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background-color: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c5aa0;
}

/* РЎС‚РёР»Рё РґР»СЏ РјР°СЃРєРѕС‚Р° */
.mascot-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.mascot {
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, #4a90e2, #63b3ed);
    border-radius: 60px 60px 20px 20px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.mascot:hover {
    transform: scale(1.05);
}

.mascot-face {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mascot-eyes {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.mascot-eye {
    width: 15px;
    height: 15px;
    background: #2c5aa0;
    border-radius: 50%;
}

.mascot-mouth {
    width: 30px;
    height: 10px;
    background: #2c5aa0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.mascot-body {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 40px;
}

.mascot-hands {
    position: absolute;
    top: 80px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
}

.mascot-hand {
    width: 20px;
    height: 40px;
    background: white;
    border-radius: 10px;
}

.mascot-message {
    position: absolute;
    bottom: 200px;
    right: 0;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: min(300px, calc(100vw - 24px));
    max-height: 38vh;
    overflow: auto;
    min-height: auto;
    display: none;
}

.mascot-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.mascot-message.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mascot-tip {
    background: #4a90e2;
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-top: 10px;
    display: inline-block;
}

/* РЎС‚РёР»Рё РґР»СЏ С‡Р°С‚Р° СЃ РјР°СЃРєРѕС‚РѕРј */
.chat-container {
    max-width: 600px;
    margin: 0 auto;
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.message.mascot {
    background: #e6f7ff;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.message.user {
    background: #4a90e2;
    color: white;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}

.chat-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.chat-option {
    padding: 12px;
    background: white;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.chat-option:hover {
    background: #ebf8ff;
    border-color: #4a90e2;
}

/* РЎС‚РёР»Рё РґР»СЏ РґРёР°Р»РѕРіРѕРІС‹С… РѕРєРѕРЅ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.modal h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.modal-btn.primary {
    background: #4a90e2;
    color: white;
}

.modal-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

footer {
    background-color: #1f5fbf;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    border-radius: 28px 28px 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.developer-info {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.developer-info h3 {
    margin-bottom: 15px;
    color: #fff;
}

.developer-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    text-align: left;
}

.developer-contact {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

/* РќРѕРІС‹Рµ СЃС‚РёР»Рё РґР»СЏ РґРѕРїРѕР»РЅРёС‚РµР»СЊРЅС‹С… РёРіСЂ */
.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mini-game-card {
    background-color: #f0f9ff;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.mini-game-card:hover {
    transform: translateY(-5px);
}

.mini-game-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.violation-scene {
    width: 100%;
    height: 300px;
    background-color: #f7fafc;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    position: relative;
    margin: 20px 0;
}

.scene-character {
    width: 30px;
    height: 50px;
    position: absolute;
    transition: all 0.3s;
}

.violation-option {
    padding: 10px 15px;
    margin: 5px;
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.violation-option:hover {
    background-color: #ebf8ff;
    border-color: #4a90e2;
}

.violation-option.correct {
    background-color: #c6f6d5;
    border-color: #48bb78;
}

.violation-option.incorrect {
    background-color: #fed7d7;
    border-color: #f56565;
}

.bicycle-equipment {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.equipment-item {
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.equipment-item.selected {
    background-color: #bee3f8;
    border-color: #4a90e2;
}

.equipment-item.correct {
    background-color: #c6f6d5;
    border-color: #48bb78;
}

.equipment-item.incorrect {
    background-color: #fed7d7;
    border-color: #f56565;
}

.equipment-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.intersection-map {
    width: 100%;
    height: 400px;
    background-color: #f7fafc;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    position: relative;
    margin: 20px 0;
}

.road-horizontal {
    position: absolute;
    width: 100%;
    height: 60px;
    background-color: #4a5568;
    top: 50%;
    transform: translateY(-50%);
}

.road-vertical {
    position: absolute;
    width: 60px;
    height: 100%;
    background-color: #4a5568;
    left: 50%;
    transform: translateX(-50%);
}

.traffic-sign {
    width: 40px;
    height: 40px;
    background-color: white;
    border: 2px solid #2d3748;
    border-radius: 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

/* РЎС‚РёР»Рё РґР»СЏ РєРІРµСЃС‚РѕРІ */
.quests-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.quest-card {
    background-color: #f0f9ff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.quest-icon {
    font-size: 2rem;
}

.quest-progress {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.quest-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #63b3ed);
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s;
}

.quest-reward {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-weight: bold;
    color: #2d3748;
}

.quest-completed {
    background-color: #c6f6d5;
}

/* РЎС‚РёР»Рё РґР»СЏ СЂРµР№С‚РёРЅРіРѕРІ */
.leaderboard {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.leaderboard-header {
    background: linear-gradient(135deg, #4a90e2, #63b3ed);
    color: white;
    padding: 15px;
    text-align: center;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.leaderboard-item:nth-child(even) {
    background-color: #f7fafc;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    background-color: #4a90e2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.leaderboard-user {
    flex-grow: 1;
}

.leaderboard-score {
    font-weight: bold;
    color: #2c5aa0;
}

/* РЎС‚РёР»Рё РґР»СЏ РєРѕРјРёРєСЃРѕРІ */
.comic-container {
    max-width: 800px;
    margin: 0 auto;
}

.comic-panel {
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.comic-character {
    width: 80px;
    height: 120px;
    position: absolute;
    bottom: 20px;
}

.comic-text {
    background-color: #f0f9ff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
}

.comic-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #f0f9ff;
}

.comic-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
}

.comic-choice {
    padding: 12px 15px;
    background-color: white;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.comic-choice:hover {
    background-color: #ebf8ff;
    border-color: #4a90e2;
}

/* РЎС‚РёР»Рё РґР»СЏ СЂРѕРґРёС‚РµР»СЊСЃРєРѕРіРѕ СЂР°Р·РґРµР»Р° */
.parent-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.parent-card {
    background-color: #f0f9ff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.progress-chart {
    width: 100%;
    height: 200px;
    background-color: white;
    border-radius: 10px;
    margin: 15px 0;
    padding: 10px;
}

.checklist {
    list-style: none;
    margin-top: 15px;
}

.checklist-item {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
}

.checklist-checkbox.checked {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

/* РЎС‚РёР»Рё РґР»СЏ РєР°СЃС‚РѕРјРёР·Р°С†РёРё */
.customization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.customization-item {
    background-color: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.customization-item:hover {
    transform: scale(1.05);
}

.customization-item.selected {
    background-color: #bee3f8;
    border: 2px solid #4a90e2;
}

.customization-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .video-lessons, .achievements, .shop-items, .stats-grid,
    .mini-games-grid, .quests-container, .customization-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav li {
        margin: 5px 0;
    }

    .user-info {
        position: static;
        justify-content: center;
        margin-top: 10px;
    }

    .mascot-container {
        bottom: 80px;
        right: 10px;
    }

    .mascot {
        width: 80px;
        height: 120px;
    }

    .mascot-message {
        max-width: 250px;
        font-size: 0.9rem;
    }
}

/* === РќРѕРІС‹Р№ РІРёР·СѓР°Р»СЊРЅС‹Р№ СЃС‚РёР»СЊ === */
:root {
    --font-body: "M PLUS Rounded 1c", "Trebuchet MS", sans-serif;
    --font-display: "Rubik", "Trebuchet MS", sans-serif;
    --ink: #1f2937;
    --ink-soft: #334155;
    --primary: #2f80ed;
    --primary-dark: #1f5fbf;
    --accent: #ffb703;
    --accent-soft: #ffe2a8;
    --mint: #2ec4b6;
    --surface: #ffffff;
    --surface-alt: #f5f7ff;
    --border: rgba(31, 41, 55, 0.12);
    --shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    --radius-lg: 24px;
}

* {
    font-family: inherit;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: linear-gradient(135deg, #f8fbff 0%, #f2f7ff 45%, #fff6e8 100%);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 183, 3, 0.18), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(46, 196, 182, 0.16), transparent 40%),
        radial-gradient(circle at 10% 85%, rgba(47, 128, 237, 0.14), transparent 45%);
    z-index: -1;
}

h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: 0.2px;
}

header {
    background: linear-gradient(135deg, #2f80ed, #56ccf2);
    border-radius: 0 0 28px 28px;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -20px;
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    filter: blur(2px);
}

.logo-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 8px 12px;
}

.user-info {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

nav {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

nav ul {
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
}

nav ul::-webkit-scrollbar {
    height: 6px;
}

nav ul::-webkit-scrollbar-thumb {
    background: rgba(47, 128, 237, 0.4);
    border-radius: 999px;
}

nav a {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid transparent;
    padding: 6px 14px;
    white-space: nowrap;
}

nav a:hover,
nav a.active {
    background: linear-gradient(135deg, var(--primary), #56ccf2);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.container {
    padding: 32px 20px 40px;
}

.section {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
}

.section.active {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

h2 {
    color: var(--ink);
    border-bottom: 2px dashed rgba(47, 128, 237, 0.2);
}

.btn {
    background: linear-gradient(135deg, var(--primary), #56ccf2);
    box-shadow: 0 10px 20px rgba(47, 128, 237, 0.25);
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3bb5ea);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    color: white;
}

.video-card,
.mini-game-card,
.achievement,
.shop-item,
.stat-card,
.quest-card,
.parent-card,
.customization-item {
    background: var(--surface);
    border: 1px solid var(--border);
}

.video-thumbnail {
    background: linear-gradient(135deg, #2f80ed, #56ccf2);
}

.stats-grid .stat-card {
    position: relative;
    overflow: hidden;
}

.stats-grid .stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 183, 3, 0.16), transparent 45%);
    pointer-events: none;
}

/* Home hero */
.home-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed rgba(47, 128, 237, 0.3);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.hero-panel {
    display: grid;
    gap: 16px;
}

.hero-card {
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(47, 128, 237, 0.15);
}

.hero-card-accent {
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.2), rgba(47, 128, 237, 0.15));
}

.hero-progress {
    height: 10px;
    background: rgba(47, 128, 237, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0;
}

.hero-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ffd166);
    transition: width 0.3s ease;
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* Guide */
.guide-controls {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.guide-search {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.guide-search input {
    flex: 1;
    min-width: 220px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
}

.guide-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.guide-card {
    position: relative;
    min-height: 220px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.guide-card-front,
.guide-card-back {
    position: absolute;
    inset: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}

.guide-card-back {
    display: none;
}

.guide-card.is-flipped .guide-card-front {
    display: none;
}

.guide-card.is-flipped .guide-card-back {
    display: flex;
}

.guide-icon {
    font-size: 2.4rem;
}

.guide-category {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.guide-tip {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--primary-dark);
}

.guide-card.highlight {
    box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.35);
}

.guide-empty {
    padding: 20px;
    text-align: center;
    background: var(--surface-alt);
    border-radius: 16px;
}

@media (min-width: 769px) {
    .guide-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .guide-card {
        min-height: 300px;
    }

    .guide-card-front,
    .guide-card-back {
        justify-content: flex-start;
        overflow: auto;
        padding-right: 4px;
    }

    .guide-card-front h3 {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .guide-card-back p {
        font-size: 0.95rem;
        line-height: 1.45;
        margin: 0;
    }
}

/* Home dashboard */
.home-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.home-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-card.accent-card {
    background: linear-gradient(135deg, rgba(47, 128, 237, 0.1), rgba(255, 183, 3, 0.18));
}

.home-mini-list {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.home-progress-summary {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* Course */
.course-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.course-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

.course-roadmap {
    display: grid;
    gap: 12px;
}

.course-module {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface-alt);
}

.course-module h4 {
    margin-bottom: 8px;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(47, 128, 237, 0.1);
    font-size: 0.8rem;
}

.tag.muted {
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink-soft);
}

.course-block {
    margin-top: 24px;
}

.course-block-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.daily-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.daily-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.daily-card .options {
    display: grid;
    gap: 6px;
}

.route-container {
    background: var(--surface-alt);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    margin-top: 12px;
}

.route-step {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(47, 128, 237, 0.3);
    margin-bottom: 10px;
    background: white;
}

.print-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

/* Certificate */
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.certificate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.certificate-list {
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.certificate-progress {
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.certificate-note {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 6px;
}

/* Auth */
.auth-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.auth-tab {
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.auth-panel.hidden {
    display: none;
}

.auth-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    display: grid;
    gap: 10px;
}

.auth-card input {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.turnstile-box {
    display: grid;
    gap: 6px;
}

.turnstile-message {
    margin: 0;
    font-size: 0.82rem;
    color: #c53030;
}

.auth-warning {
    background: rgba(255, 183, 3, 0.2);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.auth-switch {
    display: flex;
    gap: 10px;
}

.child-auth-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.child-auth-switch .child-auth-mode {
    flex: 1;
}

.child-register-fields {
    display: grid;
    gap: 8px;
}

.child-register-fields.hidden {
    display: none;
}

.child-register-fields label {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.child-code-fields {
    display: grid;
    gap: 8px;
}

.child-code-fields.hidden {
    display: none;
}

.verification-fields {
    display: grid;
    gap: 8px;
}

.verification-fields.hidden {
    display: none;
}

.auth-message {
    margin: 0;
    font-size: 0.82rem;
    color: #2563eb;
}

.auth-mode {
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
}

.auth-mode.active {
    background: var(--primary);
    color: white;
}

.parent-reset-box {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fff;
}

.parent-reset-box.hidden {
    display: none;
}

.parent-reset-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.parent-reset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.parent-child-form {
    display: grid;
    gap: 8px;
    margin: 10px 0;
}

.parent-child-form input,
.parent-child-form select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.parent-children-list {
    display: grid;
    gap: 10px;
}

.parent-child-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.parent-child-item.active {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(47, 128, 237, 0.12);
}

.parent-child-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.parent-child-age {
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(47, 128, 237, 0.12);
    font-size: 0.8rem;
}

.parent-child-stats {
    display: grid;
    gap: 2px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    text-align: right;
}

.parent-child-meta {
    margin-top: 6px;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.parent-child-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.age-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.age-option {
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
}

.age-option.active {
    background: var(--primary);
    color: white;
}

.auth-session {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.auth-session.hidden {
    display: none;
}

.auth-session p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--ink-soft);
}

/* Teacher */
.teacher-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.teacher-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
}

.teacher-form input {
    width: 100%;
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.teacher-note {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.teacher-class-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--surface-alt);
}

.teacher-assignments {
    display: grid;
    gap: 10px;
}

/* Progress chart */
.progress-row {
    display: grid;
    grid-template-columns: 70px 1fr 60px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.progress-label,
.progress-value {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.progress-track {
    height: 10px;
    background: rgba(47, 128, 237, 0.15);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--mint));
}

/* Chat */
.chat-container {
    border: 1px solid var(--border);
    background: var(--surface);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-option {
    border-radius: 12px;
}

/* Customization */
.customization-item.selected {
    border: 2px solid var(--primary);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    nav ul {
        padding: 8px 10px;
        flex-direction: row;
        align-items: center;
    }

    .hero-meta {
        flex-direction: column;
        gap: 6px;
    }
}

/* Course lessons */
.lesson-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.lesson-steps {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.lesson-step {
    background: #ffffff;
    border: 1px dashed var(--border);
    padding: 14px;
    border-radius: 12px;
}

.lesson-success {
    margin-top: 10px;
    color: #16a34a;
    font-weight: 600;
}

.lesson-fail {
    margin-top: 10px;
    color: #dc2626;
    font-weight: 600;
}

.video-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.video-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--mint));
}

.video-sim {
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.video-control-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.video-control-btn {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

.video-control-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.video-hint {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.lesson-video-embed-wrap {
    margin-bottom: 10px;
}

.lesson-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #020617;
    border: 1px solid var(--border);
}

.lesson-video-embed iframe,
.lesson-video-embed video {
    width: 100%;
    height: 100%;
    border: 0;
}

.lesson-video-missing {
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--ink-soft);
    background: #f8fafc;
}

.lesson-mobile-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.practice-card, .mini-quiz {
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
    margin-top: 8px;
}

.practice-options, .mini-quiz-options, .daily-options, .route-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.practice-feedback, .mini-quiz-feedback, .daily-feedback, .route-feedback {
    margin-top: 8px;
    font-weight: 600;
}

.roadmap-module {
    margin-bottom: 16px;
}

.roadmap-lessons {
    display: grid;
    gap: 8px;
}

.roadmap-lesson {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
}

.roadmap-lesson.done {
    background: #ecfdf3;
    border-color: #86efac;
}

.roadmap-lesson.in-progress {
    background: #fef9c3;
    border-color: #fde68a;
}

.daily-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.daily-card.completed {
    border-color: #bbf7d0;
}

.route-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.route-step-header {
    font-weight: 700;
    margin-bottom: 6px;
}

.teacher-class {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    display: grid;
    gap: 6px;
}

.teacher-class.active {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(76, 124, 255, 0.18);
}

.teacher-assignment-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.teacher-students {
    margin-bottom: 12px;
}

.teacher-student-row {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.sign-question {
    font-weight: 600;
    margin-bottom: 8px;
}

.lesson-objectives ul,
.lesson-rules ul {
    padding-left: 18px;
}
.teacher-students-list {
    display: grid;
    gap: 6px;
}

/* РџСЂРѕС„РёР»СЊ */
.profile-hub {
    display: grid;
    gap: 20px;
    margin: 20px 0 30px;
}

.profile-hero-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    align-items: center;
    background: #f7fbff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile-avatar {
    position: relative;
    width: 96px;
    height: 96px;
}

.profile-avatar-stickers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.profile-avatar-frame {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    background: #fff;
    border: 2px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e3a8a;
    position: relative;
    overflow: hidden;
}

.profile-avatar-stickers .profile-sticker {
    position: absolute;
    font-size: 1rem;
}

.profile-sticker.s-1 { top: -6px; right: -6px; }
.profile-sticker.s-2 { bottom: -6px; right: -6px; }
.profile-sticker.s-3 { top: -6px; left: -6px; }
.profile-sticker.s-4 { bottom: -6px; left: -6px; }

.profile-hero-info .profile-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e3a8a;
}

.profile-subtitle {
    margin-top: 6px;
    color: #4a5568;
}

.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.profile-hero-stats {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    color: #2d3748;
    font-size: 0.95rem;
}

.profile-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.profile-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.profile-progress-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 12px;
    align-items: center;
    font-size: 0.9rem;
}

.profile-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
}

.profile-progress-value {
    font-weight: 600;
    color: #1e293b;
}

.profile-skill {
    display: grid;
    gap: 6px;
}

.profile-skill-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #1e293b;
}

.profile-skill-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.profile-skill-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #14b8a6);
}

.profile-goal-item {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.profile-goal-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.profile-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #facc15);
}

.profile-goal-form {
    display: grid;
    gap: 10px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
}

.profile-goal-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 10px;
    align-items: center;
}

.profile-goal-row input,
.profile-journal input,
.profile-journal select {
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.profile-journal {
    display: grid;
    gap: 8px;
}

.profile-collection {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.profile-collection-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* РњРѕР±РёР»СЊРЅС‹Рµ С‚РµРјС‹ */
@media (max-width: 768px) {
    body.is-mobile header {
        padding: 1rem 0.8rem;
    }

    body.is-mobile .container {
        padding: 16px;
    }

    body.is-mobile nav ul {
        gap: 6px;
    }

    .profile-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-hero-actions {
        align-items: center;
    }

    .profile-hero-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
}

body.phone-ios {
    background: linear-gradient(180deg, #f8fbff 0%, #e6f7ff 100%);
}

body.phone-ios header {
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    border-radius: 0 0 24px 24px;
}

body.phone-ios nav {
    position: sticky;
    bottom: 0;
    top: auto;
    margin: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

body.phone-ios .container {
    padding-bottom: 90px;
}

body.phone-ios nav a {
    color: #1e293b;
}

body.phone-ios nav a.active {
    background: #60a5fa;
    color: #fff;
}

body.phone-ios .section {
    border-radius: 20px;
}

body.phone-android {
    background: #f0fff4;
}

body.phone-android header {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

body.phone-android nav {
    background: #0f172a;
}

body.phone-android nav a {
    color: #e2e8f0;
}

body.phone-android nav a.active {
    background: #22c55e;
    color: #0f172a;
}

body.phone-android .btn {
    border-radius: 14px;
}

/* Session gate */
body.session-locked {
    overflow: hidden;
}

body.session-locked > :not(#session-gate) {
    pointer-events: none;
    user-select: none;
}

.session-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 183, 3, 0.25), transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(47, 128, 237, 0.25), transparent 40%),
        rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(4px);
}

.session-gate-card {
    width: min(100%, 460px);
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 22px;
    display: grid;
    gap: 12px;
}

.session-gate-card h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.session-gate-card p {
    margin: 0;
    color: var(--ink-soft);
}

.session-gate-message {
    min-height: 20px;
    color: #c53030 !important;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Mobile UX overhaul */
@media (max-width: 768px) {
    body.is-mobile {
        font-size: 15px;
        line-height: 1.45;
    }

    body.is-mobile header {
        position: sticky;
        top: 0;
        z-index: 40;
        margin: 0;
        padding: 12px 14px 10px;
        border-radius: 0 0 16px 16px;
    }

    body.is-mobile .logo {
        justify-content: flex-start;
    }

    body.is-mobile .logo h1 {
        font-size: 1.2rem;
    }

    body.is-mobile header > p {
        margin-top: 6px;
        text-align: left;
        font-size: 0.86rem;
    }

    body.is-mobile .user-info {
        position: static;
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
        padding: 8px 12px;
        border-radius: 14px;
    }

    body.is-mobile nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 45;
        margin: 0;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.2);
    }

    body.is-mobile nav ul {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        padding: 0;
        align-items: stretch;
    }

    body.is-mobile nav li {
        margin: 0;
    }

    body.is-mobile nav a {
        display: grid;
        place-items: center;
        text-align: center;
        font-size: 0.72rem;
        line-height: 1.15;
        min-height: 44px;
        padding: 6px 4px;
        border-radius: 10px;
    }

    body.is-mobile .container {
        padding: 12px 10px calc(100px + env(safe-area-inset-bottom));
        max-width: 100%;
    }

    body.is-mobile .section {
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 12px;
    }

    body.is-mobile .home-hero,
    body.is-mobile .home-dashboard,
    body.is-mobile .certificate-grid,
    body.is-mobile .teacher-layout,
    body.is-mobile .quiz-layout,
    body.is-mobile .profile-layout,
    body.is-mobile .stats-grid,
    body.is-mobile .video-lessons {
        grid-template-columns: 1fr !important;
    }

    body.is-mobile .btn {
        width: 100%;
        min-height: 46px;
        padding: 11px 14px;
        border-radius: 12px;
        margin-top: 8px;
    }

    body.is-mobile input,
    body.is-mobile select,
    body.is-mobile textarea,
    body.is-mobile button {
        font-size: 16px;
    }

    body.is-mobile .auth-card input,
    body.is-mobile .teacher-form input,
    body.is-mobile .profile-goal-row input,
    body.is-mobile .profile-journal input,
    body.is-mobile .profile-journal select {
        min-height: 46px;
    }

    body.is-mobile .auth-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.is-mobile .child-auth-switch {
        grid-template-columns: 1fr;
    }

    body.is-mobile .parent-reset-row {
        grid-template-columns: 1fr;
    }

    body.is-mobile .parent-child-head {
        flex-direction: column;
    }

    body.is-mobile .parent-child-stats {
        text-align: left;
    }

    body.is-mobile .video-control-btn {
        min-height: 48px;
        font-size: 0.95rem;
    }

    body.is-mobile .lesson-mobile-actions {
        grid-template-columns: 1fr;
    }

    body.is-mobile .mascot-container {
        bottom: calc(106px + env(safe-area-inset-bottom));
        right: 8px;
    }

    body.is-mobile .mascot {
        width: 78px;
        height: 120px;
        border-radius: 40px 40px 14px 14px;
    }

    body.is-mobile .mascot-face {
        width: 52px;
        height: 52px;
        top: 18px;
    }

    body.is-mobile .mascot-eye {
        width: 10px;
        height: 10px;
    }

    body.is-mobile .mascot-mouth {
        width: 24px;
    }

    body.is-mobile .mascot-body {
        width: 56px;
        height: 56px;
        bottom: 14px;
    }

    body.is-mobile .mascot-hand {
        width: 14px;
        height: 30px;
    }

    body.is-mobile .mascot-message {
        right: -2px;
        bottom: 130px;
        width: min(170px, 62vw);
        max-height: 30vh;
        padding: 10px;
        font-size: 0.74rem;
        line-height: 1.28;
    }

    body.is-mobile #mascot-text {
        max-height: 10.2em;
        overflow: auto;
        display: block;
        padding-right: 2px;
    }

    body.is-mobile .mascot-tip {
        font-size: 0.66rem;
        padding: 3px 7px;
        margin-top: 6px;
    }

    body.is-mobile .auth-session {
        flex-direction: column;
        align-items: stretch;
    }

    body.is-mobile .modal-content {
        width: min(94vw, 430px);
        margin: 0 auto;
        padding: 14px;
        border-radius: 14px;
    }

    body.is-mobile .profile-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    body.is-mobile .profile-hero-actions,
    body.is-mobile .profile-hero-stats {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    body.is-mobile nav a {
        font-size: 0.67rem;
    }

    body.is-mobile h2 {
        font-size: 1.2rem;
    }

    .session-gate {
        padding: 12px;
    }

    .session-gate-card {
        padding: 16px;
        border-radius: 16px;
    }
}

/* 2026 Mobile Redesign */
@keyframes mobileSectionReveal {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    body.is-mobile {
        --mobile-nav-height: 82px;
        --mobile-card-radius: 20px;
        --mobile-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
        background:
            radial-gradient(circle at 10% 8%, rgba(255, 183, 3, 0.22), transparent 35%),
            radial-gradient(circle at 92% 2%, rgba(47, 128, 237, 0.2), transparent 38%),
            linear-gradient(180deg, #f5f9ff 0%, #f8fbff 40%, #fdfaf2 100%);
        color: #162136;
    }

    body.is-mobile header {
        position: sticky;
        top: 0;
        z-index: 70;
        padding: 14px 14px 10px;
        border-radius: 0 0 22px 22px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
        backdrop-filter: blur(10px);
        background: linear-gradient(135deg, #0ea5e9, #2563eb 58%, #1d4ed8);
    }

    body.is-mobile .logo {
        justify-content: flex-start;
        gap: 8px;
    }

    body.is-mobile .logo-icon {
        min-width: 42px;
        text-align: center;
        padding: 8px;
        font-size: 1.35rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.18);
    }

    body.is-mobile .logo h1 {
        font-size: 1.08rem;
        line-height: 1.2;
        letter-spacing: 0.2px;
    }

    body.is-mobile header > p {
        margin-top: 8px;
        text-align: left;
        font-size: 0.78rem;
        line-height: 1.3;
        opacity: 0.92;
    }

    body.is-mobile .user-info {
        margin-top: 10px;
        width: 100%;
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 14px;
        padding: 9px 10px;
        font-size: 0.83rem;
    }

    body.is-mobile .user-info > div {
        background: rgba(15, 23, 42, 0.15);
        border-radius: 10px;
        padding: 6px 8px;
        text-align: center;
    }

    body.is-mobile nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        top: auto;
        margin: 0;
        padding: 8px;
        border-radius: 22px;
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 20px 36px rgba(2, 6, 23, 0.25);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(14px);
        z-index: 90;
    }

    body.is-mobile nav ul {
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
    }

    body.is-mobile nav li {
        margin: 0;
    }

    body.is-mobile nav a {
        position: relative;
        min-height: 58px;
        padding: 7px 4px 6px;
        border-radius: 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: 0.66rem;
        font-weight: 700;
        line-height: 1.05;
        color: #334155;
        background: transparent;
    }

    body.is-mobile nav a::before {
        font-size: 1.08rem;
        line-height: 1;
    }

    body.is-mobile nav a[data-section="home"]::before { content: "🏠"; }
    body.is-mobile nav a[data-section="course"]::before { content: "🎓"; }
    body.is-mobile nav a[data-section="practice"]::before { content: "🎮"; }
    body.is-mobile nav a[data-section="comics"]::before { content: "📖"; }
    body.is-mobile nav a[data-section="profile"]::before { content: "👤"; }

    body.is-mobile nav a.active {
        color: #ffffff;
        background: linear-gradient(145deg, #2563eb, #0ea5e9);
        box-shadow: 0 10px 18px rgba(37, 99, 235, 0.35);
    }

    body.is-mobile nav a.active::before {
        filter: saturate(1.1);
    }

    body.is-mobile .container {
        max-width: 100%;
        padding: 12px 10px calc(var(--mobile-nav-height) + 46px + env(safe-area-inset-bottom));
    }

    body.is-mobile .section {
        border-radius: var(--mobile-card-radius);
        border: 1px solid rgba(148, 163, 184, 0.24);
        box-shadow: var(--mobile-shadow);
        padding: 14px;
        margin-bottom: 14px;
        background:
            radial-gradient(circle at 92% -8%, rgba(14, 165, 233, 0.12), transparent 45%),
            #ffffff;
        animation: mobileSectionReveal 0.32s ease;
    }

    body.is-mobile h2 {
        font-size: 1.1rem;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom-width: 1px;
    }

    body.is-mobile .btn {
        min-height: 46px;
        border-radius: 14px;
        width: 100%;
        font-size: 0.9rem;
        font-weight: 700;
        margin-top: 8px;
        box-shadow: 0 8px 14px rgba(37, 99, 235, 0.18);
    }

    body.is-mobile .btn-outline {
        box-shadow: none;
    }

    body.is-mobile .hero-text {
        border-radius: 18px;
        padding: 14px;
        background: linear-gradient(155deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.06));
        border: 1px solid rgba(37, 99, 235, 0.2);
    }

    body.is-mobile .hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
    }

    body.is-mobile .hero-actions .btn {
        margin-top: 0;
        min-height: 42px;
        padding: 9px 8px;
        font-size: 0.78rem;
    }

    body.is-mobile .hero-actions .btn:last-child {
        grid-column: 1 / -1;
    }

    body.is-mobile .hero-chips {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-top: 10px;
        scrollbar-width: none;
    }

    body.is-mobile .hero-chips::-webkit-scrollbar {
        display: none;
    }

    body.is-mobile .chip {
        white-space: nowrap;
        border-radius: 999px;
        background: #eaf2ff;
        border: 1px solid #cfe2ff;
        font-size: 0.73rem;
        padding: 6px 10px;
    }

    body.is-mobile .home-dashboard,
    body.is-mobile .video-lessons {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(86%, 1fr);
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        padding: 4px 2px 8px;
        margin-left: -2px;
        margin-right: -2px;
        scrollbar-width: none;
    }

    body.is-mobile .home-dashboard::-webkit-scrollbar,
    body.is-mobile .video-lessons::-webkit-scrollbar {
        display: none;
    }

    body.is-mobile .home-card,
    body.is-mobile .video-card {
        scroll-snap-align: start;
    }

    body.is-mobile .home-card {
        border-radius: 16px;
        border: 1px solid rgba(148, 163, 184, 0.24);
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
        min-height: 165px;
    }

    body.is-mobile .video-card {
        border-radius: 18px;
        overflow: hidden;
    }

    body.is-mobile .video-thumbnail {
        height: 124px;
        font-size: 2.3rem;
    }

    body.is-mobile .video-info {
        padding: 12px;
    }

    body.is-mobile .video-info h3 {
        font-size: 0.98rem;
        margin-bottom: 6px;
    }

    body.is-mobile .video-info p {
        font-size: 0.82rem;
        line-height: 1.4;
        color: #475569;
    }

    body.is-mobile .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.is-mobile .stat-card {
        border-radius: 14px;
        padding: 12px;
        text-align: center;
    }

    body.is-mobile .course-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.is-mobile .course-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.is-mobile .course-actions .btn {
        margin-top: 0;
        min-height: 42px;
        font-size: 0.78rem;
        padding: 8px 6px;
    }

    body.is-mobile .course-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.is-mobile .course-card {
        border-radius: 16px;
        padding: 13px;
    }

    body.is-mobile .course-roadmap {
        gap: 8px;
    }

    body.is-mobile .roadmap-module {
        margin-bottom: 10px;
    }

    body.is-mobile .roadmap-module h4 {
        font-size: 0.92rem;
        margin-bottom: 6px;
    }

    body.is-mobile .roadmap-lesson {
        border-radius: 12px;
        padding: 12px 10px;
        gap: 10px;
        min-height: 52px;
        align-items: center;
    }

    body.is-mobile .roadmap-lesson .lesson-title {
        font-size: 0.84rem;
        line-height: 1.3;
    }

    body.is-mobile .lesson-card {
        border-radius: 16px;
        padding: 14px;
        background:
            radial-gradient(circle at 92% -16%, rgba(14, 165, 233, 0.12), transparent 45%),
            #ffffff;
    }

    body.is-mobile .lesson-card h4 {
        font-size: 1rem;
        line-height: 1.35;
    }

    body.is-mobile .lesson-card p,
    body.is-mobile .lesson-objectives li,
    body.is-mobile .lesson-rules li {
        font-size: 0.84rem;
        line-height: 1.42;
    }

    body.is-mobile .lesson-steps {
        gap: 10px;
        margin-top: 12px;
    }

    body.is-mobile .lesson-step {
        border-radius: 12px;
        border-style: solid;
        padding: 11px;
        background: #f8fbff;
    }

    body.is-mobile .video-sim {
        border-radius: 12px;
        padding: 10px;
        background: #ffffff;
    }

    body.is-mobile .video-control-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    body.is-mobile .video-control-btn {
        min-height: 44px;
        border-radius: 11px;
        font-size: 0.82rem;
        padding: 6px 4px;
    }

    body.is-mobile .lesson-mobile-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    body.is-mobile .print-cards {
        display: grid;
        gap: 8px;
    }

    body.is-mobile .daily-cards-grid,
    body.is-mobile .route-options,
    body.is-mobile .daily-options,
    body.is-mobile .mini-quiz-options,
    body.is-mobile .practice-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.is-mobile .option,
    body.is-mobile .mini-quiz-options button,
    body.is-mobile .practice-options button,
    body.is-mobile .daily-options button,
    body.is-mobile .route-options button {
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 0.86rem;
        text-align: left;
    }

    body.is-mobile .auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 14px 0;
    }

    body.is-mobile .auth-tab {
        min-height: 42px;
        border-radius: 12px;
        font-size: 0.8rem;
    }

    body.is-mobile .auth-card {
        border-radius: 16px;
        padding: 14px;
        gap: 9px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    }

    body.is-mobile .auth-card input,
    body.is-mobile .auth-card select {
        min-height: 44px;
        border-radius: 12px;
    }

    body.is-mobile .auth-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.is-mobile .child-auth-switch {
        grid-template-columns: 1fr;
    }

    body.is-mobile .parent-reset-row,
    body.is-mobile .parent-reset-actions,
    body.is-mobile .parent-child-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.is-mobile .parent-child-item {
        border-radius: 14px;
        padding: 10px;
    }

    body.is-mobile .quiz-container {
        max-width: 100%;
    }

    body.is-mobile .mascot-container {
        right: 8px;
        bottom: calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom));
        z-index: 85;
    }

    body.is-mobile .mascot {
        width: 74px;
        height: 114px;
    }

    body.is-mobile .mascot-message {
        right: -2px;
        bottom: 118px;
        width: min(46vw, 170px);
        max-width: 170px;
        max-height: 22vh;
        overflow: auto;
        padding: 8px 9px;
        font-size: 0.7rem;
        line-height: 1.3;
        border-radius: 12px;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
    }
}

@media (max-width: 420px) {
    body.is-mobile nav {
        left: 8px;
        right: 8px;
    }

    body.is-mobile nav a {
        font-size: 0.61rem;
        min-height: 56px;
    }

    body.is-mobile .hero-actions .btn {
        font-size: 0.74rem;
    }

    body.is-mobile .course-actions {
        grid-template-columns: 1fr;
    }

    body.is-mobile .mascot-message {
        width: min(50vw, 160px);
        max-width: 160px;
        font-size: 0.69rem;
    }
}

/* 2026 Tim mascot image override */
@keyframes timFramePulse {
    0%, 100% {
        box-shadow:
            0 0 0 3px #ffffff,
            0 12px 24px rgba(15, 23, 42, 0.25);
    }
    50% {
        box-shadow:
            0 0 0 3px #ffffff,
            0 16px 30px rgba(15, 23, 42, 0.32);
    }
}

.mascot {
    width: 168px;
    height: 168px;
    position: relative;
    background: linear-gradient(145deg, #f8fbff, #dbeafe) !important;
    border: 4px solid #ffffff;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: timFramePulse 3.2s ease-in-out infinite;
}

#mascot-image {
    width: 84%;
    height: 84%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.28));
    z-index: 1;
}

.mascot-face,
.mascot-eyes,
.mascot-eye,
.mascot-mouth,
.mascot-body,
.mascot-hands,
.mascot-hand {
    display: none !important;
}

.mascot-accessory-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.mascot-message {
    bottom: 186px;
}

@media (max-width: 768px) {
    body.is-mobile .mascot {
        width: 90px;
        height: 90px;
        border-width: 3px;
        border-radius: 16px;
    }

    body.is-mobile #mascot-image {
        width: 86%;
        height: 86%;
        filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.28));
    }

    body.is-mobile .mascot-message {
        bottom: 112px;
    }
}

.quiz-difficulty {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 700;
}

.video-admin-cta {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.video-admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    margin-bottom: 8px;
}

.video-admin-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-admin-main span {
    color: #64748b;
    font-size: 0.85rem;
}

.video-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#video-admin-embed {
    width: 100%;
    min-height: 108px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.video-card-status {
    margin: 6px 0 4px;
    font-size: 0.85rem;
    font-weight: 700;
}

.video-external-link {
    display: grid;
    place-items: center;
    gap: 10px;
    height: 100%;
    text-align: center;
    color: #cbd5e1;
    padding: 16px;
}

.video-player-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.video-player-modal.show {
    display: flex;
}

.video-player-shell {
    width: min(920px, 100%);
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 16px;
    padding: 12px;
}

.video-player-content {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    background: #020617;
}

.video-player-content iframe,
.video-player-content video {
    width: 100%;
    height: 100%;
    border: 0;
}

.text-success {
    color: #0f766e;
    font-weight: 600;
}

.text-danger {
    color: #dc2626;
    font-weight: 600;
}

@media (max-width: 768px) {
    .video-admin-cta {
        justify-content: stretch;
    }

    .video-admin-cta .btn {
        width: 100%;
    }

    .video-admin-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .video-admin-actions {
        width: 100%;
    }
}

/* Stability fixes: desktop guide readability + mobile/webview centering and overflow control */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.guide-card,
.guide-card-front,
.guide-card-back,
.guide-card-front h3,
.guide-card-back p,
.guide-tip {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 769px) {
    .guide-card {
        min-height: 340px;
    }

    .guide-card-front,
    .guide-card-back {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    body.is-mobile {
        overscroll-behavior-x: none;
    }

    body.is-mobile nav {
        width: min(calc(100vw - 16px), 560px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    body.is-mobile .container,
    body.is-mobile .section,
    body.is-mobile .course-card,
    body.is-mobile .home-card,
    body.is-mobile .profile-card,
    body.is-mobile .parent-card,
    body.is-mobile .video-card {
        min-width: 0;
        max-width: 100%;
    }

    body.is-mobile input,
    body.is-mobile select,
    body.is-mobile textarea,
    body.is-mobile button {
        max-width: 100%;
    }

    body.is-mobile .profile-hero-card,
    body.is-mobile .profile-journal,
    body.is-mobile .profile-goal-form,
    body.is-mobile .auth-card,
    body.is-mobile .parent-child-form,
    body.is-mobile .parent-child-item {
        overflow-wrap: anywhere;
    }

    body.is-mobile .home-dashboard,
    body.is-mobile .video-lessons,
    body.is-mobile .hero-chips,
    body.is-mobile .route-options-grid,
    body.is-mobile .available-signs {
        overscroll-behavior-x: contain;
    }
}

/* 2026-03 mobile/android hardening */
.lesson-video-embed-wrap,
.lesson-video-embed,
.video-player-content {
    max-width: 100%;
    overflow: hidden;
}

.lesson-video-embed iframe,
.lesson-video-embed video,
.video-player-content iframe,
.video-player-content video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    display: block;
}

.video-external-link {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.violation-scene {
    height: clamp(190px, 32vh, 260px) !important;
}

.intersection-map {
    height: clamp(210px, 34vh, 300px) !important;
}

.sign-question,
.violation-text {
    line-height: 1.35;
}

@media (max-width: 768px) {
    body.is-mobile nav {
        width: min(calc(100vw - 16px), 560px) !important;
        max-width: 560px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.is-mobile nav ul {
        width: 100%;
    }

    body.is-mobile nav a::before {
        display: block;
        line-height: 1;
    }

    body.is-mobile nav a[data-section="home"]::before { content: "🏠" !important; }
    body.is-mobile nav a[data-section="course"]::before { content: "🎓" !important; }
    body.is-mobile nav a[data-section="practice"]::before { content: "🎮" !important; }
    body.is-mobile nav a[data-section="comics"]::before { content: "📖" !important; }
    body.is-mobile nav a[data-section="profile"]::before { content: "👤" !important; }

    body.is-mobile .container,
    body.is-mobile .section,
    body.is-mobile .auth-form,
    body.is-mobile .auth-card,
    body.is-mobile .parent-child-form,
    body.is-mobile .parent-child-item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    body.is-mobile .auth-card *,
    body.is-mobile .auth-form *,
    body.is-mobile .parent-child-form * {
        max-width: 100%;
        min-width: 0;
    }

    body.is-mobile .home-dashboard,
    body.is-mobile .video-lessons {
        grid-auto-columns: 92% !important;
        gap: 10px;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        scroll-padding-left: 0;
    }

    body.is-mobile .home-dashboard > *,
    body.is-mobile .video-lessons > * {
        width: 100%;
        min-width: 0;
    }

    body.is-mobile .violation-scene {
        height: clamp(160px, 25vh, 220px) !important;
        margin: 12px 0 !important;
    }

    body.is-mobile .intersection-map {
        height: clamp(170px, 27vh, 235px) !important;
        margin: 12px 0 !important;
    }

    body.is-mobile .sign-question,
    body.is-mobile .violation-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    body.phone-android .home-dashboard,
    body.phone-android .video-lessons {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0 8px;
        align-items: stretch;
    }

    body.phone-android .home-dashboard > *,
    body.phone-android .video-lessons > * {
        flex: 0 0 calc(100vw - 30px);
        width: calc(100vw - 30px);
        min-width: calc(100vw - 30px);
        max-width: calc(100vw - 30px);
        scroll-snap-align: start;
        box-sizing: border-box;
    }

    body.phone-android .home-dashboard > :first-child,
    body.phone-android .video-lessons > :first-child {
        flex: 0 0 calc(100vw - 30px) !important;
        width: calc(100vw - 30px) !important;
        min-width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
    }

    body.phone-android .hero-chips,
    body.phone-android .available-signs,
    body.phone-android .route-options-grid {
        min-width: 0;
    }
}

