/* Подключение шрифта Unbounded */
@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-VariableFont_wght.ttf') format('truetype');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unbounded';
    src: url('fonts/Unbounded-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
}

/* Фиксация позиции кнопки "Назад" с учётом safe area (вырез, индикатор) */
.back-arrow-btn {
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    z-index: 1000 !important;
}

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    
    /* Стильная тёмная палитра */
    --chalkboard-green: #1a1f26;
    --chalkboard-green-light: #252c36;
    --chalk-white: #f4f6f8;
    --chalk-yellow: #ebe9e6;
    --accent-green: #14b8a6;
    --accent-green-light: #2dd4bf;
    --accent-emerald: #0d9488;
    --accent-primary: #5a8fb5;
    --accent-primary-light: #6fa3c9;
    --accent-primary-dark: rgba(45, 70, 95, 0.9);
    --accent-blue: #6ba3c4;
    --accent-orange: #d4a574;
    
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-dark: rgba(26, 32, 42, 0.94);
    --bg-surface: rgba(30, 38, 50, 0.88);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #f8fafc;
    --text-soft: #64748b;
    --border-light: rgba(255, 255, 255, 0.12);
    --border-medium: rgba(255, 255, 255, 0.2);
    --border-accent: rgba(45, 212, 191, 0.4);
    
    /* Тени — глубина и лёгкое свечение */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 48px rgba(45, 212, 191, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 64px rgba(45, 212, 191, 0.06);
    --glow-accent: 0 0 20px rgba(20, 184, 166, 0.18);
    
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    --radius-pill: 9999px;
}

html {
    min-height: 100%;
    min-height: 100dvh;
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: #000000;
    color: var(--chalk-white);
    line-height: 1.5;
    min-height: 100%;
    min-height: 100dvh;
    min-height: 100vh;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    margin: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
    touch-action: pan-y;
}

/* Фон — паттерн со стрелками и ОГЭ/ЕГЭ */
.page-bg {
    position: fixed;
    z-index: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: #000000;
    background-image: url('images/bg-oge-ege.png');
    background-repeat: repeat;
    background-position: 0 0;
    background-size: auto;
    pointer-events: none;
}
.page-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(15, 23, 42, 0.5) 0%, rgba(0, 0, 0, 0.82) 70%);
    pointer-events: none;
}

/* Декоративные котики на ракете на фоне */
.container::before {
    content: '';
    position: fixed;
    width: 120px;
    height: 120px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    top: 10%;
    right: 5%;
    animation: floatRocket 8s ease-in-out infinite;
}

.container::after {
    content: '';
    position: fixed;
    width: 100px;
    height: 100px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    bottom: 15%;
    left: 3%;
    animation: floatRocket 10s ease-in-out infinite reverse;
    transform: scaleX(-1);
}

@keyframes floatRocket {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) translateX(20px) rotate(-3deg);
    }
    75% {
        transform: translateY(-25px) translateX(5px) rotate(3deg);
    }
}

.screen::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    top: 20%;
    left: 2%;
    animation: floatRocket 12s ease-in-out infinite;
}

.screen::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    bottom: 25%;
    right: 4%;
    animation: floatRocket 15s ease-in-out infinite reverse;
    transform: scaleX(-1);
}

.chalkboard-formulas-bg {
    display: none;
}

body > * {
    position: relative;
    z-index: 1;
}

body.dark {
    background: #0a0a0a;
}

body.dark .test-card {
    background: rgba(45, 58, 72, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark .question {
    background: rgba(35, 45, 58, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark .answer-option {
    background: rgba(45, 58, 72, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark .results-details {
    background: rgba(45, 58, 72, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark .progress-bar {
    background: rgba(40, 52, 65, 0.9);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    min-height: 100%;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.header {
    text-align: center;
    margin-bottom: 4px;
    padding: 36px 20px 20px;
    position: relative;
}
.cat-mascot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    height: 200px;
}

.cat-mascot {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    position: relative;
}


.cat-icon {
    width: 260px;
    height: auto;
    max-height: 320px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
    mix-blend-mode: normal;
    image-rendering: -webkit-optimize-contrast;
}

.cat-icon:hover {
    transform: translateY(-5px);
}

.header-photo {
    width: 250px;
    height: 250px;
    object-fit: contain;
    display: block;
    margin: 16px auto;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 48px rgba(45, 212, 191, 0.12));
    transition: filter 0.3s ease;
}
.header-photo:hover {
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 56px rgba(45, 212, 191, 0.18));
}


@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Кот на экране теста */
.cat-test-side {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

.cat-test-image {
    width: 180px;
    height: auto;
    max-height: 220px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    mix-blend-mode: multiply;
    image-rendering: -webkit-optimize-contrast;
}

.cat-test-image:hover {
    transform: translateY(-3px);
}

/* Кот с дипломом на экране результатов */
.cat-results-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: bounce 0.8s ease;
}

.cat-results-image {
    width: 460px;
    height: auto;
    max-height: 540px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
    mix-blend-mode: multiply;
    image-rendering: -webkit-optimize-contrast;
}

/* Кот с часами в таймере */
.timer-cat-icon {
    width: 60px;
    height: 60px;
    margin-right: 8px;
    opacity: 0.8;
    animation: wiggle 2s ease-in-out infinite;
    mix-blend-mode: multiply;
    image-rendering: -webkit-optimize-contrast;
}

/* Кот думающий для пустого состояния */
.empty-state-cat {
    width: 360px;
    height: auto;
    max-height: 440px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    opacity: 0.7;
    animation: float 4s ease-in-out infinite;
    mix-blend-mode: multiply;
    image-rendering: -webkit-optimize-contrast;
}


@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}



.title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    margin-top: 0;
    color: var(--text-light);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 48px rgba(45, 212, 191, 0.08);
    letter-spacing: -0.04em;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.2;
    text-align: center;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.95;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    text-align: center;
}

.main-content {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 24px);
}

.main-content::before {
    content: '';
    position: fixed;
    width: 110px;
    height: 110px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    top: 50%;
    left: 1%;
    animation: floatRocket 9s ease-in-out infinite;
    transform: rotate(-15deg);
}

.main-content::after {
    content: '';
    position: fixed;
    width: 95px;
    height: 95px;
    background-image: 
        url('design-assets/cat-rocket.png'),
        url('images/cat-rocket.png'),
        url('cat-rocket.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    top: 70%;
    right: 2%;
    animation: floatRocket 11s ease-in-out infinite reverse;
    transform: scaleX(-1) rotate(10deg);
}

.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: calc(100vh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* При открытии в режиме админки сразу показываем панель */
html.admin-initial #admin-screen {
    display: block !important;
}
html.admin-initial #admin-panel-main {
    display: block !important;
}

.screen.active {
    display: block;
    position: relative;
    width: 100%;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Кнопки действий */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    margin-bottom: 16px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}
.action-buttons .btn-large {
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.action-buttons .btn-large:nth-child(1) { animation-delay: 0.05s; }
.action-buttons .btn-large:nth-child(2) { animation-delay: 0.1s; }
.action-buttons .btn-large:nth-child(3) { animation-delay: 0.15s; }
.action-buttons .btn-large:nth-child(4) { animation-delay: 0.2s; }
.action-buttons .btn-large:nth-child(5) { animation-delay: 0.25s; }
.action-buttons .btn-large:nth-child(6) { animation-delay: 0.3s; }

.btn-large {
    padding: 18px 28px;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    letter-spacing: -0.01em;
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.2s ease;
    border-radius: var(--border-radius-lg);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    backdrop-filter: blur(12px);
    line-height: 1.4;
}

.btn-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.btn-large:hover .btn-icon {
    transform: rotate(5deg);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

/* Главное меню: контент и нижний блок (фото + кнопки при прокрутке) */
#test-selection {
    position: relative;
    min-height: 50vh;
    padding-bottom: 0;
}

/* На главном экране разрешаем фото в футере выступать справа */
.container:has(#test-selection.active),
.main-content:has(#test-selection.active),
#test-selection.active {
    overflow-x: visible;
}

/* Спейсер — нижняя часть намного ближе к верхней */
.main-menu-spacer {
    min-height: 12vh;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
}

/* Приглашение пролистать: только стрелочка, без контура */
.main-menu-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 24px 10px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.main-menu-scroll-hint-arrow {
    font-size: 32px;
    font-weight: 300;
    color: var(--chalk-white);
    opacity: 0.85;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: scroll-hint-bounce 2.2s ease-in-out infinite;
}

@keyframes scroll-hint-bounce {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.75; }
    50% { transform: translateY(6px) scale(1.05); opacity: 1; }
}

/* Нижний блок — дизайн в стиле верхней части */
.main-menu-footer {
    position: relative;
    padding: 24px 16px 32px;
    margin-top: 0;
    overflow: visible;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: var(--chalk-white);
}

/* Мягкое свечение сверху, как у карточек */
.main-menu-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    pointer-events: none;
}

.main-menu-footer-inner {
    position: relative;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
}

.main-menu-footer-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 8px 0;
}

.main-menu-footer-title-line {
    flex: 1;
    max-width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    border-radius: 1px;
}

.main-menu-footer-title-wrap .main-menu-footer-title-line:last-child {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent);
}

.main-menu-footer-title {
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.main-menu-footer-title-main {
    color: var(--chalk-white);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.main-menu-footer-title-sub {
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.75));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@supports not (background-clip: text) {
    .main-menu-footer-title-sub {
        -webkit-text-fill-color: rgba(255, 255, 255, 0.9);
        background: none;
    }
}

/* Подпись над кнопками в футере */
.main-menu-footer-buttons::before {
    content: 'Связь и отзывы';
    display: block;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    text-align: center;
}

/* Фото: выровнено внутри прямоугольника футера */
.main-menu-photo {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 2;
}

.main-menu-photo .main-menu-photo-img {
    display: block;
    width: auto;
    max-width: 85%;
    max-height: 340px;
    height: auto;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 -6px 28px rgba(0, 0, 0, 0.35)) drop-shadow(4px 4px 24px rgba(0, 0, 0, 0.25));
}

.main-menu-footer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
}

.main-menu-footer-buttons .btn-footer {
    flex: 1 1 auto;
    min-width: 140px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Список тестов */
.test-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.test-card {
    background: var(--bg-card-dark);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    color: var(--chalk-white);
}

.test-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(35, 35, 35, 0.95);
    transform: translateY(-2px);
}

.test-card:active {
    box-shadow: var(--shadow);
}

.test-card-title {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 8px;
    color: #f0f0f0;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.test-card-description {
    font-size: 15px;
    color: #e0e0e0;
    margin-bottom: 12px;
    line-height: 1.5;
}

.test-card-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #d0d0d0;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-soft);
}

.empty-state p {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-hint {
    font-size: 16px;
    opacity: 0.7;
    color: var(--text-soft);
}

/* Кнопка "Назад" в виде стрелки — удобный тап на телефоне */
.back-arrow-btn {
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    user-select: none;
    -webkit-user-select: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
}

.back-arrow-btn:hover {
    background: rgba(45, 55, 72, 0.95);
    border-color: var(--border-accent);
    box-shadow: var(--shadow);
}

.back-arrow-btn:active {
    box-shadow: var(--shadow-sm);
}

.back-arrow-icon {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.back-arrow-btn[style*="display: none"] {
    display: none !important;
}

/* Экран теста */
.test-header {
    margin-bottom: 28px;
    margin-top: 0;
    padding-top: 0;
}

.timer-container {
    margin-bottom: 20px;
}

.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius);
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.5s ease;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    width: fit-content;
    min-width: 200px;
}

.timer::after {
    content: '🕐';
    position: absolute;
    right: 16px;
    font-size: 20px;
    opacity: 0.2;
}


.timer.warning {
    background: rgba(255, 219, 168, 0.8);
    border-color: var(--warning-color);
    color: var(--text-dark);
}

.timer.danger {
    background: rgba(255, 179, 186, 0.8);
    border-color: var(--danger-color);
    color: var(--text-dark);
    animation: pulse 1s infinite, slideUp 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-md);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
}

.timer-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.timer-text {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.test-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(30, 30, 30, 0.9);
    border: 2px solid var(--chalk-white);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--chalk-white) 0%, var(--chalk-yellow) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(240, 240, 240, 0.5);
}


.progress-text {
    font-size: 15px;
    color: var(--chalk-yellow);
    display: block;
    text-align: center;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.test-title {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.question-container {
    margin-bottom: 28px;
}

/* Окно с текстом задания */
.question {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
    padding: 22px;
    background: rgba(22, 30, 38, 0.9) !important;
    backdrop-filter: blur(14px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95) !important;
    animation: slideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Стили для MathJax формул в блоке задания (как в теории) */
.question .MathJax {
    font-size: 1.1em !important;
    color: rgba(255, 255, 255, 0.92) !important;
}

.question mjx-container {
    display: inline-block;
    margin: 0 3px;
    vertical-align: middle;
}

.question mjx-container[display="true"] {
    display: block;
    margin: 16px 0;
    text-align: center;
}

.question mjx-container[display="true"] mjx-math {
    text-align: center;
}

/* Улучшение отображения формул */
.MathJax {
    outline: none !important;
}

.MathJax_Display {
    margin: 1em 0 !important;
}

.question-image-container {
    margin-bottom: 24px;
    text-align: center;
    animation: slideUp 0.4s ease;
    display: none;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    margin: 0 auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.question-image:hover {
    box-shadow: var(--shadow-lg);
}

.image-error {
    padding: 16px;
    background: rgba(255, 179, 186, 0.3);
    border: 2px dashed var(--danger-color);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-size: 14px;
    text-align: center;
}

.question-task-name {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 10px;
    font-weight: 500;
}

/* ОГЭ: блок из нескольких заданий в одном экране (1–5) */
.question.step-block {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.step-plan-top {
    margin-bottom: 16px;
    text-align: center;
}
.step-plan-top .step-plan-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
    margin: 0 auto;
}
.step-plan-intro {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    padding: 12px 0;
    white-space: pre-line;
}
.step-question-block {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.step-question-block:last-child {
    border-bottom: none;
}
.step-q-num {
    font-weight: 700;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}
.step-q-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--chalk-white);
    margin-bottom: 12px;
}
.step-q-img {
    margin-bottom: 12px;
    text-align: center;
}
.step-q-img img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}
.step-answer-input.answer-input {
    min-height: 60px;
    margin-top: 4px;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.answer-input {
    width: 100%;
    padding: 20px;
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--border-radius);
    font-size: 17px;
    font-weight: 500;
    color: #ffffff;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
}


.answer-input::placeholder {
    color: #888888;
    opacity: 0.8;
}

.answer-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

/* Ответ — фото: плашка «Развернуть ответ» и кнопки Верно/Неверно */
.answer-as-photo-wrap {
    width: 100%;
    margin-top: 8px;
}
.answer-expand-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}
.answer-expand-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}
.answer-as-photo-expanded {
    margin-top: 16px;
    padding: 16px;
    background: rgba(25, 25, 25, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--border-radius);
}
.answer-as-photo-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}
.answer-as-photo-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Решение задачи (аналогично ответу-фото, но без кнопок Верно/Неверно) */
.solution-wrap {
    width: 100%;
    margin-top: 12px;
}
.solution-expand-btn {
    width: 100%;
    padding: 12px 18px;
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: var(--border-radius);
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.solution-expand-btn:hover {
    background: rgba(148, 163, 184, 0.26);
    border-color: rgba(226, 232, 240, 0.9);
}
.solution-expanded {
    margin-top: 10px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: var(--border-radius);
    border: 1px solid rgba(148, 163, 184, 0.7);
}
.solution-text {
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-bottom: 10px;
}
.solution-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}
.answer-as-photo-buttons .btn-verno,
.answer-as-photo-buttons .btn-neverno {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-verno {
    background: rgba(34, 197, 94, 0.25);
    border: 2px solid rgba(34, 197, 94, 0.6);
    color: #86efac;
}
.btn-verno:hover {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.8);
}
.btn-verno.selected {
    background: rgba(34, 197, 94, 0.5);
    border-color: #22c55e;
    color: #fff;
}
.btn-neverno {
    background: rgba(239, 68, 68, 0.25);
    border: 2px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}
.btn-neverno:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.8);
}
.btn-neverno.selected {
    background: rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
    color: #fff;
}
.step-answer-as-photo .answer-expand-btn {
    padding: 12px 16px;
    font-size: 15px;
}
.step-answer-as-photo .answer-as-photo-buttons .btn-verno,
.step-answer-as-photo .answer-as-photo-buttons .btn-neverno {
    min-width: 100px;
    padding: 10px 16px;
}

.answer-option {
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 17px;
    text-align: left;
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.answer-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--chalk-yellow);
    transition: width 0.3s ease;
    z-index: 0;
    opacity: 0.3;
}

.answer-option span {
    position: relative;
    z-index: 1;
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.answer-option.selected {
    background: linear-gradient(135deg, rgba(212, 244, 221, 0.6), rgba(184, 230, 200, 0.6));
    box-shadow: var(--shadow-md);
    color: var(--text-dark);
}

.answer-option.selected::before {
    width: 6px;
}

.answer-option.correct {
    border-color: var(--success-color);
    background: rgba(168, 230, 207, 0.5);
    color: var(--text-dark);
}

.answer-option.incorrect {
    border-color: var(--danger-color);
    background: rgba(255, 179, 186, 0.5);
    color: var(--text-dark);
}

.answer-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Кнопки */
.test-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    padding: 16px 28px;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    letter-spacing: -0.01em;
    z-index: 1;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(165deg, var(--accent-green-light) 0%, var(--accent-green) 40%, var(--accent-emerald) 100%);
    color: #fff;
    box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
    font-weight: 700;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(165deg, var(--accent-green-light) 0%, var(--accent-green) 50%, var(--accent-emerald) 100%);
    box-shadow: var(--shadow-md), var(--glow-accent);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    box-shadow: var(--shadow-sm);
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.btn-secondary {
    background: linear-gradient(165deg, #3d4d5c 0%, #334151 50%, #293544 100%);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(165deg, #475563 0%, #3d4d5c 50%, #334151 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary:active {
    box-shadow: var(--shadow-sm);
}

.btn-skip {
    background: rgba(255, 255, 255, 0.12);
    color: var(--chalk-white);
    box-shadow: var(--shadow);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-skip:hover {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-skip:active {
    box-shadow: var(--shadow-sm);
}

.btn-back {
    background: rgba(255, 255, 255, 0.15);
    color: var(--chalk-white);
    box-shadow: var(--shadow);
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-back:active {
    box-shadow: var(--shadow-sm);
}

/* Экран результатов */
/* Админ-панель */
body.admin-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0a0a;
}
body.admin-mode .header {
    display: none;
}
#admin-screen.admin-screen-black.active {
    background: #0a0a0a;
    min-height: 100vh;
    min-height: 100dvh;
    display: block !important;
    position: relative;
    z-index: 100;
    overflow: hidden;
}
/* Каждая панель — отдельное полноэкранное окно поверх предыдущего */
.admin-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    padding: 40px 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    background: #0a0a0a;
    -webkit-overflow-scrolling: touch;
}
.admin-panel[style*="display: none"] {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}
.admin-panel {
    transition: opacity 0.2s ease-out;
}
#admin-panel-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
}
#admin-panel-main .admin-panel-actions {
    width: 100%;
    max-width: 480px;
}
.admin-panel-title {
    color: #f1f5f9;
    font-size: 24px;
    font-weight: 700;
}
.admin-panel-subtitle-main {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin: 4px 0 20px 0;
    max-width: 360px;
    line-height: 1.4;
}
.admin-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-panel-actions .admin-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
}

.admin-panel-choice {
    position: relative;
}
.admin-panel-choice .admin-back-btn {
    position: absolute;
    top: -8px;
    left: 0;
    color: #f1f5f9;
}
.admin-panel-choice .admin-back-btn:hover {
    color: #fff;
}
.admin-panel-choice .admin-panel-title {
    margin-top: 32px;
}

.admin-panel-variants .admin-back-btn {
    position: absolute;
    top: -8px;
    left: 0;
    color: #f1f5f9;
}
.admin-panel-variants .admin-panel-title {
    margin-top: 32px;
}
.admin-panel-variants #admin-variants-add-btn {
    margin-top: 16px;
}
.admin-variants-list,
#admin-tasks-list {
    margin-top: 20px;
}

.admin-tasks-config-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.admin-tasks-config-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    min-width: 90px;
}
.admin-variants-section {
    margin-bottom: 20px;
}
.admin-variants-section-title {
    color: #f1f5f9;
    font-size: 16px;
    margin: 0 0 8px 0;
}
.admin-variants-ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-variants-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
}
.admin-variants-name {
    flex: 1;
    color: #e2e8f0;
    font-size: 14px;
}
.admin-variants-edit-btn {
    padding: 6px 12px;
    font-size: 13px;
}
.admin-variants-delete-btn {
    padding: 6px 12px;
    font-size: 13px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.admin-variants-delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Ученики в админке */
.admin-students-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.admin-students-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
}
.admin-students-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-students-name {
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 500;
}
.admin-students-meta {
    color: #94a3b8;
    font-size: 13px;
}
.admin-students-view-btn {
    padding: 8px 14px;
    font-size: 13px;
}
.admin-students-delete-btn {
    padding: 8px 14px;
    font-size: 13px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.admin-students-delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}
.admin-student-detail-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.admin-student-delete-btn {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.admin-student-delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}
.admin-student-stats-block {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 20px;
}
.admin-student-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
}
.admin-student-stat-label {
    color: #94a3b8;
    font-size: 12px;
}
.admin-student-stat-value {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
}
.admin-student-detail-variants {
    margin-top: 20px;
    margin-bottom: 16px;
}
.admin-student-variants-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.admin-student-variant-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 13px;
}
.admin-student-variant-name {
    color: #e2e8f0;
    font-weight: 600;
    min-width: 120px;
}
.admin-student-variant-meta {
    color: #94a3b8;
}
.admin-student-variant-value {
    font-weight: 600;
    margin-left: auto;
}

.admin-student-detail-tasks {
    margin-top: 20px;
    margin-bottom: 16px;
}
.admin-student-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.admin-student-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 13px;
}
.admin-student-task-num {
    color: #cbd5e1;
    font-weight: 500;
}
.admin-student-task-value {
    font-weight: 600;
}

.admin-student-results-heading {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
}
.admin-student-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-student-result-item {
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    font-size: 13px;
    color: #cbd5e1;
}
.admin-student-result-date { color: #94a3b8; margin-right: 6px; }
.admin-student-result-title { font-weight: 500; }
.admin-student-result-exam { color: #67c6c0; margin-left: 4px; }
.admin-student-result-score { margin-left: 8px; color: #a5f3fc; }
.admin-student-results-empty { color: #94a3b8; margin-top: 12px; font-size: 14px; }

.admin-panel-variant-list .admin-back-btn,
.admin-panel-editor .admin-back-btn {
    position: absolute;
    top: -8px;
    left: 0;
    color: #f1f5f9;
}
.admin-panel-variant-list .admin-panel-title,
.admin-panel-editor .admin-panel-title {
    margin-top: 32px;
}
.admin-variant-list-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.admin-variant-list-buttons .btn {
    width: 100%;
}

.admin-panel-variant-number .admin-variant-number-subtitle,
.admin-panel-task-number .admin-variant-number-subtitle,
.admin-panel-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin: -8px 0 20px 0;
}
.admin-input-label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 6px;
    margin-top: 12px;
}
.admin-input-label:first-of-type {
    margin-top: 0;
}
.admin-variant-number-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 320px;
}
.admin-variant-number-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.admin-variant-number-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}
.admin-variant-number-input:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
}
.admin-variant-number-input:focus {
    border-color: rgba(123, 196, 176, 0.8);
    background: rgba(255, 255, 255, 0.1);
}
.admin-variant-number-create-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
}

.admin-panel-editor {
    max-width: 640px;
    padding-bottom: 40px;
}
.admin-editor-loading {
    color: rgba(255, 255, 255, 0.8);
    padding: 24px 0;
    text-align: center;
}
.admin-editor-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}
.admin-editor-top-bar {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.admin-editor-add-task-btn {
    padding: 10px 18px;
    font-size: 14px;
}
.admin-editor-add-many-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-editor-add-many-label {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    white-space: nowrap;
}
.admin-editor-add-many-input {
    width: 64px;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.2);
    color: #f1f5f9;
    box-sizing: border-box;
}
.admin-editor-add-many-input:focus {
    outline: none;
    border-color: rgba(123, 196, 176, 0.6);
}
.admin-editor-add-many-btn {
    padding: 8px 14px;
    font-size: 13px;
}
.admin-editor-question-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.admin-editor-task-name-label {
    flex: 0 0 100%;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
}
.admin-editor-task-name-input {
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 320px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
}
.admin-editor-task-name-input::placeholder {
    color: rgba(255,255,255,0.45);
}
.admin-editor-remove-task-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    border-radius: 8px;
}
.admin-editor-remove-task-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}
.admin-editor-question {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}
.admin-editor-question h3 {
    color: #f1f5f9;
    font-size: 14px;
    margin: 0;
}
.admin-editor-answer-row {
    margin-top: 16px;
}
.admin-editor-answer-as-photo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
}
.admin-editor-answer-as-photo input { cursor: pointer; }
.admin-editor-answer-photo-wrap {
    margin-top: 8px;
}
.admin-editor-answer-photo-wrap .admin-upload-answer-btn {
    margin-right: 8px;
}
.admin-editor-answer-photo-preview {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.admin-editor-answer-photo-preview img {
    max-width: 180px;
    border-radius: 8px;
}
.admin-editor-question .admin-delete-answer-photo-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.admin-editor-question .admin-delete-answer-photo-btn:hover {
    background: rgba(239, 68, 68, 0.5);
}
.admin-editor-question textarea,
.admin-editor-question input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.2);
    color: #f1f5f9;
    font-size: 14px;
    margin-bottom: 8px;
}
.admin-editor-question textarea {
    min-height: 80px;
    resize: vertical;
}
.admin-editor-question input[type="file"] {
    display: none;
}
.admin-editor-question .admin-upload-btn {
    margin-top: 4px;
    padding: 8px 14px;
    font-size: 13px;
}
.admin-editor-photo-top {
    margin-bottom: 12px;
}
.admin-editor-question .admin-add-more-photo-btn {
    display: inline-block;
}
.admin-editor-question .admin-editor-photo-row {
    margin-bottom: 8px;
}
.admin-editor-question .admin-editor-photo-preview-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.admin-editor-question .admin-editor-photo-preview-row .admin-question-preview {
    margin-top: 0;
}
.admin-editor-question .admin-delete-photo-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.admin-editor-question .admin-delete-photo-btn:hover {
    background: rgba(239, 68, 68, 0.5);
}
.admin-editor-question input[data-field="answer"] {
    margin-top: 0;
}
.admin-editor-question .admin-question-preview {
    margin-top: 8px;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
}
.admin-editor-question .admin-question-preview img {
    width: 100%;
    height: auto;
    display: block;
}
.admin-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}
.admin-editor-actions .admin-btn {
    width: 100%;
}
#admin-save-variant-btn {
    margin-top: 0;
}
.admin-editor-delete-btn {
    padding: 10px 16px;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}
.admin-editor-delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}
.admin-editor-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-btn-secondary {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: #e2e8f0;
}
.admin-btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.admin-task-fill-questions.admin-task-fill-same-as-editor {
    gap: 20px;
    margin: 20px 0;
}
.admin-editor-photo-label {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}
.admin-editor-photo-hint {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    margin-left: 4px;
}
.admin-task-fill-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 16px 0;
    max-height: 60vh;
    overflow-y: auto;
}
.admin-task-fill-block {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}
.admin-task-fill-block-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #f1f5f9;
}
.admin-task-fill-block .admin-input-label {
    margin-top: 10px;
}
.admin-task-fill-block .admin-input-label:first-of-type {
    margin-top: 0;
}
.admin-task-fill-text,
.admin-task-fill-answer {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.2);
    color: #f1f5f9;
    margin-top: 4px;
    font-family: inherit;
}
.admin-task-fill-text {
    min-height: 80px;
    resize: vertical;
}
.admin-task-fill-answer {
    margin-bottom: 0;
}

.admin-task-view-questions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
    max-height: 65vh;
    overflow-y: auto;
}
.admin-task-view-block {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
}
.admin-task-view-block-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #94a3b8;
}
.admin-task-view-text {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-task-view-answer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #a5b4fc;
    font-size: 14px;
}

.results-container {
    text-align: center;
    padding: 48px 20px;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(45, 212, 191, 0.1) 0%, transparent 55%);
    border-radius: var(--border-radius-xl);
    margin: 0 12px;
}


.results-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: bounce 0.6s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.cat-fallback {
    font-size: 80px;
    margin-bottom: 24px;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.results-title {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 32px;
    color: var(--chalk-white);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.results-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.score-value {
    font-size: 72px;
    font-weight: 900;
    color: var(--accent-green-light);
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5), 0 0 32px rgba(45, 212, 191, 0.25);
    line-height: 1;
    letter-spacing: 2px;
}

.score-total {
    font-size: 32px;
    color: var(--chalk-white);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.results-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    margin-bottom: 32px;
}

.results-percentage {
    font-size: 42px;
    font-weight: 900;
    color: var(--chalk-yellow);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.results-test-score {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.results-details {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    max-height: 400px;
    overflow-y: auto;
}

.results-details-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.4s ease;
    animation-fill-mode: both;
    gap: 16px;
}

.results-details-item:nth-child(1) { animation-delay: 0.1s; }
.results-details-item:nth-child(2) { animation-delay: 0.2s; }
.results-details-item:nth-child(3) { animation-delay: 0.3s; }
.results-details-item:nth-child(4) { animation-delay: 0.4s; }
.results-details-item:nth-child(5) { animation-delay: 0.5s; }

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

.results-details-label {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    flex: 1;
}

.results-details-value {
    font-weight: 700;
    font-size: 24px;
    margin-left: 16px;
}

/* Адаптивность для мобильных устройств */

/* Планшеты и маленькие экраны */
@media (max-width: 768px) {
    .container {
        padding: 12px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .header {
        padding: 8px 0;
        margin-bottom: 12px;
    }

    .cat-mascot-container {
        height: 280px;
        margin-bottom: 18px;
    }

    .cat-icon {
        width: 280px;
        max-height: 340px;
    }

    .title {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .subtitle {
        font-size: 15px;
    }


    .btn-large {
        padding: 18px 24px;
        font-size: 16px;
        gap: 10px;
    }

    .btn-icon {
        width: 28px;
        height: 28px;
    }

    .test-card {
        padding: 18px;
    }

    .test-card-title {
        font-size: 20px;
    }

    .test-card-description {
        font-size: 14px;
    }

    .question {
        font-size: 17px;
        padding: 18px;
        line-height: 1.6;
    }

    .answer-input {
        padding: 16px;
        font-size: 16px;
        min-height: 100px;
    }

    .cat-test-side {
        top: 10px;
        right: 10px;
    }

    .cat-test-image {
        width: 150px;
        max-height: 180px;
    }

    .timer {
        font-size: 20px;
        padding: 12px 20px;
        margin: 0 auto;
        min-width: 180px;
    }
    
    .timer-icon {
        font-size: 20px;
    }
    
    .timer-text {
        letter-spacing: 1px;
    }

    .timer-cat-icon {
        width: 50px;
        height: 50px;
    }

    .results-container {
        padding: 32px 16px;
    }

    .cat-results-image {
        width: 380px;
        max-height: 460px;
    }

    .results-title {
        font-size: 28px;
    }

    .score-value {
        font-size: 56px;
    }

    .score-total {
        font-size: 28px;
    }

    .results-percentage {
        font-size: 36px;
    }

    .results-details {
        padding: 20px;
        max-height: 50vh;
    }

    .progress-chart-container {
        padding: 16px;
    }

    .chart-title {
        font-size: 18px;
    }

    .progress-chart {
        min-width: 350px;
        height: 180px;
    }

    .empty-state-cat {
        width: 320px;
        max-height: 380px;
    }
}

/* Телефоны */
@media (max-width: 480px) {
    body::before {
        background: #000000;
        background-image: url('images/bg-oge-ege.png');
        background-size: auto;
        background-position: 0 0;
        background-repeat: repeat;
        background-attachment: scroll;
        -webkit-background-size: auto;
        -moz-background-size: auto;
        -o-background-size: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    body::after {
        background: rgba(0, 0, 0, 0.6);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .container {
        padding: 12px;
    }

    .header {
        padding: 6px 0;
        margin-bottom: 12px;
    }

    .cat-mascot-container {
        height: 220px;
        margin-bottom: 16px;
    }

    .cat-icon {
        width: 220px;
        max-height: 270px;
    }

    .title {
        font-size: 22px;
        margin-bottom: 4px;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 20px rgba(255, 255, 255, 0.1);
    }

    .subtitle {
        font-size: 14px;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
    }


    .btn-large {
        padding: 16px 20px;
        font-size: 15px;
        gap: 8px;
    }

    .btn-icon {
        width: 24px;
        height: 24px;
    }

    .action-buttons {
        gap: 12px;
        margin-top: 12px;
        margin-bottom: 16px;
        max-width: 90%;
    }
    
    .btn-large {
        max-width: 100%;
    }

    .test-card {
        padding: 16px;
        background: rgba(25, 25, 25, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .test-card:hover {
        background: rgba(35, 35, 35, 0.98);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .test-card-title {
        font-size: 18px;
        color: #ffffff;
    }

    .test-card-description {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
    }

    .test-card-meta {
        font-size: 12px;
        gap: 16px;
    }

    .question {
        font-size: 16px;
        padding: 16px;
        line-height: 1.5;
        background: rgba(25, 25, 25, 0.9) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        color: #ffffff !important;
    }

    .answer-input {
        padding: 14px;
        font-size: 16px;
        min-height: 90px;
        background: rgba(25, 25, 25, 0.9);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #ffffff;
    }
    
    .answer-input:focus {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .back-arrow-btn {
        top: max(12px, env(safe-area-inset-top)) !important;
        left: max(12px, env(safe-area-inset-left)) !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
    }

    .back-arrow-icon {
        font-size: 28px;
    }

    /* Ещё крупнее зоны тапа на маленьких экранах */
    .task-item .task-btn-decrease,
    .task-item .task-btn-increase {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }

    .variant-btn {
        min-height: 54px !important;
    }

    .test-actions .btn {
        min-height: 54px;
        padding: 20px 24px;
    }

    #start-custom-test-btn {
        min-height: 54px;
        padding: 20px 24px;
    }

    .answer-option {
        min-height: 54px;
        padding: 20px;
    }

    .answer-input {
        min-height: 60px;
        padding: 20px;
    }

    .timer {
        font-size: 18px;
        padding: 10px 16px;
        gap: 8px;
        margin: 0 auto;
        min-width: 160px;
        background: rgba(30, 30, 30, 0.98);
        border: 2px solid rgba(255, 255, 255, 0.5);
        color: #ffffff;
    }
    
    .timer-icon {
        font-size: 20px;
    }

    .timer-cat-icon {
        width: 40px;
        height: 40px;
        margin-right: 6px;
    }

    .timer-text {
        letter-spacing: 1px;
    }

    .progress-bar {
        height: 10px;
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.4);
    }

    .progress-text {
        font-size: 13px;
        color: #fff9c4;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    }

    .test-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 24px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .btn-primary {
        background: var(--accent-green);
        color: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
    
    .btn-primary:hover {
        background: var(--accent-green-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    }
    
    .btn-skip, .btn-back {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
    
    .btn-skip:hover, .btn-back:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .results-container {
        padding: 24px 12px;
    }

    .cat-results-image {
        width: 340px;
        max-height: 400px;
    }

    .results-title {
        font-size: 24px;
        margin-bottom: 20px;
        color: #ffffff;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
    }

    .score-value {
        font-size: 48px;
    }

    .score-total {
        font-size: 24px;
    }

    .results-percentage {
        font-size: 32px;
        margin-bottom: 24px;
    }

    .results-details {
        padding: 16px;
        max-height: 45vh;
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(20px);
    }

    .results-details-item {
        padding: 12px 0;
        gap: 12px;
    }

    .results-details-label {
        font-size: 14px;
    }

    .results-details-value {
        font-size: 20px;
    }

    .progress-chart-container {
        padding: 12px;
        margin-bottom: 20px;
    }

    .chart-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .progress-chart {
        min-width: 300px;
        height: 160px;
    }

    .chart-stats {
        gap: 12px;
        padding-top: 12px;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 18px;
    }

    .results-history-container {
        padding: 16px 12px;
    }

    .results-history-title {
        font-size: 24px;
        margin-bottom: 20px;
        letter-spacing: 1px;
    }

    .result-history-card {
        padding: 16px;
    }

    .result-history-header {
        margin-bottom: 10px;
    }

    .result-history-test {
        font-size: 15px;
    }

    .result-history-date {
        font-size: 12px;
    }

    .result-history-value {
        font-size: 28px;
    }

    .result-history-total {
        font-size: 18px;
    }

    .result-history-percentage {
        font-size: 20px;
    }

    .empty-results {
        padding: 40px 16px;
    }

    .empty-results p {
        font-size: 16px;
    }

    .empty-hint {
        font-size: 14px;
    }

    .empty-state-cat {
        width: 280px;
        max-height: 340px;
        margin-bottom: 20px;
    }

    .variant-selection-container {
        padding: 12px;
        min-height: calc(100vh - 80px);
        justify-content: center;
    }

    .variant-selection-title {
        font-size: 22px;
        margin-bottom: 6px;
        margin-top: 60px; /* Отступ сверху для мобильных */
    }

    .variant-selection-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .exam-type-selection-container {
        padding: 16px 12px;
    }

    .exam-type-selection-title {
        font-size: 22px;
        margin-bottom: 8px;
        margin-top: 60px; /* Отступ сверху для мобильных */
    }

    .exam-type-selection-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .exam-type-buttons {
        gap: 16px;
        margin-bottom: 24px;
    }

    .exam-type-btn {
        padding: 24px 20px;
        min-height: 140px;
    }

    .variant-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
        margin-bottom: 16px;
        padding: 0;
        align-items: stretch;
        justify-items: stretch;
    }

    .variant-btn {
        height: 50px;
        width: 100%;
        aspect-ratio: 1;
        font-size: 18px;
        padding: 0;
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #ffffff;
    }
    
    .variant-btn:hover {
        background: rgba(50, 50, 50, 0.98);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .task-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-bottom: 16px;
        align-items: stretch;
        justify-items: stretch;
    }

    .task-grid:has(.task-item) {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-btn {
        height: 48px;
        width: 100%;
        aspect-ratio: 1;
        font-size: 15px;
        padding: 4px;
        gap: 2px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    }

    .task-number {
        font-size: 17px;
    }

    .task-count {
        font-size: 11px;
        padding: 2px 5px;
    }

    .task-selection-container {
        padding: 12px;
        min-height: calc(100vh - 80px);
        justify-content: center;
    }

    .task-selection-title {
        font-size: 22px;
        margin-bottom: 4px;
        margin-top: 60px; /* Отступ сверху для мобильных */
    }

    .task-selection-subtitle {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .task-selection-actions {
        gap: 10px;
        margin-top: 12px;
    }

    .task-selection-count {
        font-size: 14px;
    }
}

/* Маленькие телефоны */
@media (max-width: 360px) {
    body::before {
        background: #000000;
        background-image: url('images/bg-oge-ege.png');
        background-size: auto;
        background-position: 0 0;
        background-repeat: repeat;
        background-attachment: scroll;
        -webkit-background-size: auto;
        -moz-background-size: auto;
        -o-background-size: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    body::after {
        background: rgba(0, 0, 0, 0.6);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .container {
        padding: 10px;
    }

    .cat-mascot-container {
        height: 160px;
        margin-bottom: 8px;
    }

    .cat-icon {
        width: 150px;
        max-height: 180px;
    }

    .title {
        font-size: 20px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
    }

    .subtitle {
        font-size: 13px;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
    }

    .btn-large {
        padding: 14px 18px;
        font-size: 14px;
    }

    .cat-test-image {
        width: 80px;
        max-height: 100px;
    }

    .timer {
        font-size: 16px;
        padding: 8px 14px;
        margin: 0 auto;
        min-width: 140px;
    }
    
    .timer-icon {
        font-size: 18px;
    }

    .question {
        font-size: 15px;
        padding: 14px;
    }

    .answer-input {
        padding: 12px;
        min-height: 80px;
    }

    .cat-results-image {
        width: 240px;
        max-height: 300px;
    }

    .score-value {
        font-size: 40px;
    }

    .results-percentage {
        font-size: 28px;
    }

    .progress-chart {
        min-width: 280px;
        height: 140px;
    }

    .variant-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        align-items: stretch;
        justify-items: stretch;
    }

    .variant-btn {
        height: 48px;
        width: 100%;
        aspect-ratio: 1;
        font-size: 16px;
        padding: 0;
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #ffffff;
    }
    
    .variant-btn:hover {
        background: rgba(50, 50, 50, 0.98);
        border-color: rgba(255, 255, 255, 0.6);
    }
}

/* Маленькие телефоны */
@media (max-width: 360px) {
    body::before {
        background: #000000;
        background-image: url('images/bg-oge-ege.png');
        background-size: auto;
        background-position: 0 0;
        background-repeat: repeat;
        background-attachment: scroll;
        -webkit-background-size: auto;
        -moz-background-size: auto;
        -o-background-size: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    body::after {
        background: rgba(0, 0, 0, 0.6);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .container {
        padding: 10px;
    }

    .cat-mascot-container {
        height: 160px;
        margin-bottom: 8px;
    }

    .cat-icon {
        width: 150px;
        max-height: 180px;
    }

    .title {
        font-size: 20px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
    }

    .subtitle {
        font-size: 13px;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
    }

    .btn-large {
        padding: 14px 18px;
        font-size: 14px;
    }

    .cat-test-image {
        width: 80px;
        max-height: 100px;
    }

    .timer {
        font-size: 16px;
        padding: 8px 14px;
        margin: 0 auto;
        min-width: 140px;
    }
    
    .timer-icon {
        font-size: 18px;
    }

    .question {
        font-size: 15px;
        padding: 14px;
    }

    .answer-input {
        padding: 12px;
        min-height: 80px;
    }

    .cat-results-image {
        width: 240px;
        max-height: 300px;
    }

    .score-value {
        font-size: 40px;
    }

    .results-percentage {
        font-size: 28px;
    }

    .progress-chart {
        min-width: 280px;
        height: 140px;
    }

    .variant-selection-container {
        padding: 10px;
        min-height: calc(100vh - 70px);
        justify-content: center;
    }

    .variant-selection-title {
        font-size: 20px;
        margin-bottom: 4px;
        margin-top: 56px; /* Отступ сверху для маленьких экранов */
    }

    .variant-selection-subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .variant-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 12px;
        align-items: stretch;
        justify-items: stretch;
    }

    .variant-btn {
        height: 48px;
        width: 100%;
        aspect-ratio: 1;
        font-size: 16px;
        padding: 0;
        background: rgba(30, 30, 30, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #ffffff;
    }
    
    .variant-btn:hover {
        background: rgba(50, 50, 50, 0.98);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .task-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        margin-bottom: 12px;
        align-items: stretch;
        justify-items: stretch;
    }

    .task-grid:has(.task-item) {
        grid-template-columns: 1fr;
    }

    .task-btn {
        height: 44px;
        width: 100%;
        aspect-ratio: 1;
        font-size: 14px;
        padding: 4px;
        gap: 2px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    }

    .task-number {
        font-size: 15px;
    }

    .task-count {
        font-size: 10px;
        padding: 1px 4px;
    }

    .task-selection-container {
        padding: 10px;
        min-height: calc(100vh - 70px);
        justify-content: center;
    }

    .task-selection-title {
        font-size: 20px;
        margin-bottom: 4px;
        margin-top: 56px; /* Отступ сверху для маленьких экранов */
    }

    .task-selection-subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .task-selection-actions {
        gap: 8px;
        margin-top: 10px;
    }

    .task-selection-count {
        font-size: 13px;
    }
}

/* Скроллбар */
.results-details::-webkit-scrollbar {
    width: 8px;
}

.results-details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.results-details::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-green-light), var(--accent-green));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.results-details::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-green), var(--accent-emerald));
}

/* Экран моих результатов */
.results-history-container {
    padding: 24px 20px;
    animation: fadeIn 0.4s ease;
}

.results-history-title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 24px;
    color: var(--chalk-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    letter-spacing: 2px;
}

/* График прогресса */
.progress-chart-container {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.chart-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.chart-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 16px;
}

.progress-chart {
    width: 100%;
    height: 200px;
    min-width: 400px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.chart-stats {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 2px solid rgba(240, 240, 240, 0.3);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 100px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.stat-value.positive {
    color: var(--success-color);
}

.stat-value.negative {
    color: var(--danger-color);
}

.results-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.empty-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}

.empty-results p {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.result-history-card {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease;
    animation-fill-mode: both;
}

.result-history-card:nth-child(1) { animation-delay: 0.1s; }
.result-history-card:nth-child(2) { animation-delay: 0.2s; }
.result-history-card:nth-child(3) { animation-delay: 0.3s; }
.result-history-card:nth-child(4) { animation-delay: 0.4s; }
.result-history-card:nth-child(5) { animation-delay: 0.5s; }

.result-history-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    background: rgba(40, 40, 40, 0.98);
    border-color: rgba(255, 255, 255, 0.5);
}

.result-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-history-date {
    font-size: 14px;
    color: var(--text-soft);
    font-weight: 500;
}

.result-history-test {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
}

.result-history-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.result-history-value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #7bc4b0, #5a9b8c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-history-total {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.result-history-percentage {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #5a9b8c, #4a8578);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: auto;
}

.result-history-meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.9;
}

.results-history-list::-webkit-scrollbar {
    width: 6px;
}

.results-history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.results-history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7bc4b0, #5a9b8c);
    border-radius: 10px;
}

.results-history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a9b8c, #4a8578);
}

/* Экран выбора типа экзамена */
.exam-type-selection-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Экран теории */
.theory-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

.theory-title {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 60px; /* Отступ сверху, чтобы не перекрывалась стрелочка */
    color: var(--chalk-white);
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.theory-subtitle {
    font-size: 15px;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 400;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.exam-type-selection-title {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 60px; /* Отступ сверху, чтобы не перекрывалась стрелочка */
    color: var(--chalk-white);
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.exam-type-selection-subtitle {
    font-size: 15px;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
    opacity: 0.8;
}

.exam-type-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.exam-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    min-height: 160px;
}

/* Экран выбора задания в теории */
.theory-container.theory-choice {
    min-height: auto;
    padding-bottom: 40px;
}

.theory-task-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.theory-task-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    min-height: 100px;
    border-radius: var(--border-radius-md, 16px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(40, 45, 55, 0.9);
    backdrop-filter: blur(12px);
    color: var(--chalk-white);
    font-family: 'Unbounded', 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.theory-task-btn:hover,
.theory-task-btn:focus {
    border-color: rgba(184, 230, 200, 0.6);
    background: rgba(50, 60, 75, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.theory-task-num {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.theory-task-label {
    font-size: 14px;
    opacity: 0.85;
}

/* Экран контента теории */
#theory-content-screen .theory-content-wrapper {
    padding: 60px 20px 40px;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    overflow-y: auto;
}

.theory-content-inner {
    width: 100%;
}

.theory-page {
    color: var(--chalk-white);
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.theory-page-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--chalk-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.theory-page-subtitle {
    font-size: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 24px;
    line-height: 1.4;
}

.theory-pdf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    margin-bottom: 32px;
    border-radius: 16px;
    border: 2px solid rgba(184, 230, 200, 0.5);
    background: linear-gradient(135deg, rgba(50, 80, 60, 0.6), rgba(30, 50, 40, 0.8));
    backdrop-filter: blur(12px);
    color: var(--chalk-white);
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.theory-pdf-card:hover,
.theory-pdf-card:focus {
    border-color: rgba(184, 230, 200, 0.8);
    background: linear-gradient(135deg, rgba(60, 95, 70, 0.7), rgba(40, 65, 50, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.theory-pdf-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.theory-pdf-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.theory-pdf-desc {
    font-size: 13px;
    opacity: 0.9;
}

.theory-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.theory-section {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(35, 40, 50, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.theory-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--chalk-white);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.theory-section-icon {
    font-size: 22px;
    opacity: 0.95;
}

.theory-section-body {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.theory-section-body p {
    margin-bottom: 10px;
}

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

.theory-section-body strong {
    color: #7bc4b0;
    font-weight: 600;
}

.theory-section-body em {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.theory-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* Темы ОГЭ: заголовок + картинки */
.theory-oge-theme {
    padding: 0 0 24px;
}
.theory-oge-theme-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--chalk-white);
    margin: 0 0 20px;
    padding: 0 4px;
}
.theory-oge-theme-img-wrap {
    margin-top: 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(30, 35, 45, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.theory-oge-theme-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}
.theory-oge-theme-examples-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--chalk-white);
    margin: 20px 0 10px;
    padding: 0 4px;
}
.theory-oge-theme-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 12px 4px 0;
}
.theory-oge-theme-example {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-mono), monospace;
}
.theory-theme-btn .theory-task-num {
    font-size: 16px;
    margin-bottom: 0;
}

/* Теория ОГЭ по заданию: страницы (фото) как у ЕГЭ */
.theory-oge-pages {
    padding: 0 0 24px;
}
.theory-oge-pages-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--chalk-white);
    margin: 0 0 20px;
    padding: 0 4px;
}
.theory-oge-page-wrap {
    margin-top: 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(30, 35, 45, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.theory-oge-page-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Теория: текст + рисунки */
.theory-page-text-and-figures .theory-page-title {
    margin-bottom: 4px;
}

.theory-text-and-figures {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 16px;
}

.theory-block-with-figure {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(35, 40, 50, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.theory-block-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--chalk-white);
    line-height: 1.4;
}

.theory-block-body {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 20px;
}

.theory-block-body p {
    margin-bottom: 10px;
}

.theory-block-body p:last-child {
    margin-bottom: 0;
}

.theory-block-body strong {
    color: #7bc4b0;
    font-weight: 600;
}

.theory-block-with-figure .theory-page-figure {
    margin: 0;
    margin-top: 8px;
}

/* Теория: разделы с отдельными рисунками */
.theory-page-sections-figures .theory-page-title {
    margin-bottom: 4px;
}

.theory-sections-with-figures {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 16px;
}

.theory-sec-fig {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(35, 40, 50, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.theory-sec-fig-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--chalk-white);
    line-height: 1.4;
}

.theory-sec-fig-body {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 16px;
}

.theory-sec-fig-body p {
    margin-bottom: 14px;
}

.theory-sec-fig-body p:last-child {
    margin-bottom: 0;
}

/* Формула отдельной строкой (в столбик), не слипаются */
.theory-sec-fig-body .theory-fml {
    display: block;
    margin: 8px 0 14px;
    padding: 6px 0;
}

.theory-sec-fig-body strong {
    color: #7bc4b0;
    font-weight: 600;
}

.theory-figures-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    align-items: flex-start;
}

.theory-single-figure {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: rgba(20, 22, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.theory-fig-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    width: auto;
}

/* Система уравнений с фигурной скобкой (теория 8) */
.theory-eq-system {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 12px 0;
    font-family: inherit;
}
.theory-eq-brace {
    font-size: 2em;
    line-height: 1.15;
    color: var(--chalk-white);
    padding-right: 10px;
    user-select: none;
    display: inline-block;
    vertical-align: middle;
}
.theory-eq-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 2px;
}
.theory-eq-line {
    font-size: 1.05em;
    white-space: nowrap;
}

/* Дроби с горизонтальной чертой (все теории) */
.theory-frac {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    margin: 0 1px;
}
.theory-frac-num {
    display: block;
    padding: 0 4px;
    border-bottom: 1px solid currentColor;
}
.theory-frac-den {
    display: block;
    padding: 2px 4px 0;
}

/* Теория: только страницы PDF как изображения */
.theory-page-pdf .theory-page-title {
    margin-bottom: 4px;
}

.theory-pages-gallery {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 16px;
}

.theory-page-figure {
    margin: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(20, 22, 28, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.theory-page-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.theory-page-caption {
    padding: 10px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theory-loading {
    text-align: center;
    padding: 48px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.theory-export-hint {
    padding: 20px;
    margin-bottom: 28px;
    border-radius: 12px;
    border: 1px solid rgba(184, 230, 200, 0.35);
    background: rgba(40, 55, 50, 0.6);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.theory-export-hint p {
    margin-bottom: 10px;
}

.theory-export-hint code {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 13px;
}

.theory-export-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

/* Экран выбора варианта */
.variant-selection-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

.variant-selection-title {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    text-align: center;
    margin-bottom: 8px;
    margin-top: 60px; /* Отступ сверху, чтобы не перекрывалась стрелочка */
    color: var(--chalk-white);
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.variant-selection-subtitle {
    font-size: 15px;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    opacity: 0.8;
}

.variant-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
    padding: 0 4px;
    align-items: stretch;
    justify-items: stretch;
}

.variant-empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 24px 16px;
    font-size: 15px;
    line-height: 1.5;
}

.variant-btn {
    height: 60px;
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius-sm);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
    user-select: none;
    -webkit-user-select: none;
}


.variant-btn:hover {
    background: rgba(50, 50, 50, 0.98);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.variant-btn:active {
    box-shadow: var(--shadow-md);
}

.variant-btn-completed {
    background: rgba(70, 75, 85, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

.variant-btn-completed:hover {
    background: rgba(80, 85, 95, 1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 255, 255, 0.2) !important;
}

/* Экран выбора заданий */
.task-selection-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: calc(100vh - 100px);
    position: relative;
}

/* Контейнер для прокручиваемого списка заданий - серое окошко */
.task-selection-scrollable {
    background: rgba(60, 60, 60, 0.95);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(60, 60, 60, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task-selection-scrollable::-webkit-scrollbar {
    width: 8px;
}

.task-selection-scrollable::-webkit-scrollbar-track {
    background: rgba(40, 40, 40, 0.5);
    border-radius: 4px;
}

.task-selection-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.task-selection-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.task-selection-title {
    font-size: 26px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    text-align: center;
    margin-bottom: 8px;
    margin-top: 60px; /* Отступ сверху, чтобы не перекрывалась стрелочка */
    color: var(--chalk-white);
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.task-selection-subtitle {
    font-size: 15px;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 400;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    padding: 0;
    align-items: stretch;
    justify-items: stretch;
}

/* Вертикальная сетка заданий для примерного результата */
.task-grid-vertical {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 0;
    padding: 0;
    width: 100%;
}

@media (max-width: 480px) {
    .task-grid-vertical {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .task-btn-stats {
        height: 65px;
        padding: 8px 16px;
        gap: 20px;
    }
    
    .task-number-stats {
        font-size: 18px;
    }
    
    .task-percent-stats {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .task-grid-vertical {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .task-btn-stats {
        height: 60px;
        padding: 6px 12px;
        gap: 16px;
    }
    
    .task-number-stats {
        font-size: 16px;
    }
    
    .task-percent-stats {
        font-size: 13px;
    }
}

/* Строка выбора задания: номер, −, счётчик, + */
.task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.task-item .task-number {
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

.task-item .task-count {
    min-width: 28px;
    text-align: center;
}

.task-item .task-btn-decrease,
.task-item .task-btn-increase {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(50, 50, 50, 0.95);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
    user-select: none;
    -webkit-user-select: none;
}

.task-item .task-btn-increase:hover:not(:disabled),
.task-item .task-btn-decrease:hover:not(:disabled) {
    background: rgba(70, 70, 70, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
}

.task-item .task-btn-increase:disabled,
.task-item .task-btn-decrease:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.task-btn {
    height: 50px;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    background: rgba(28, 38, 48, 0.85);
    backdrop-filter: blur(12px);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.task-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 24px rgba(45, 212, 191, 0.12);
    background: rgba(35, 50, 65, 0.95);
}
.task-btn:active {
    transform: translateY(0);
}
.task-btn-selected {
    border-color: var(--accent-green);
    background: rgba(45, 212, 191, 0.15);
    box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}

.task-btn-count {
    font-size: 0.85em;
    opacity: 0.9;
    margin-left: 2px;
}

/* Кнопка задания для статистики - вертикальная */
.task-btn-stats {
    width: 100% !important;
    height: 70px;
    aspect-ratio: unset !important;
    padding: 10px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 40, 0.8);
}

.task-number-stats {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #ffffff;
    margin-right: auto;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.task-percent-stats {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin-left: auto;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.task-number {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.task-count {
    font-size: 12px;
    font-weight: 600;
    background: rgba(70, 75, 85, 0.5);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    display: none;
}

.task-btn:hover {
    background: rgba(50, 50, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.task-btn-selected {
    background: rgba(70, 75, 85, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

.task-btn-selected:hover {
    background: rgba(80, 85, 95, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.task-btn-limit-reached {
    border: 2px solid #ff9800 !important;
    background-color: rgba(255, 152, 0, 0.2) !important;
    position: relative;
}

.task-btn-limit-reached::after {
    content: 'MAX';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    font-weight: bold;
    color: #ff9800;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 3px;
    border-radius: 3px;
}

.task-btn-decrease:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.task-btn-decrease:disabled:hover {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
}

.task-selection-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: max(20px, env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    flex-shrink: 0;
}

.task-selection-count {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}


/* Базовые стили для всех мобильных */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        background-attachment: scroll;
    }
    
    body::before {
        background: #000000;
        background-image: url('images/bg-oge-ege.png');
        background-size: auto;
        background-position: 0 0;
        background-repeat: repeat;
        background-attachment: scroll;
        -webkit-background-size: auto;
        -moz-background-size: auto;
        -o-background-size: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    body::after {
        background: rgba(0, 0, 0, 0.6);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Предотвращение проблем с масштабированием на iOS */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    /* Улучшение отображения кнопок на мобильных — удобный тап */
    button, .btn {
        min-height: 48px;
        min-width: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    /* Кнопка "Назад" — крупнее для пальца */
    .back-arrow-btn {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
    }

    .back-arrow-icon {
        font-size: 30px;
    }

    /* Строки заданий: крупнее ± и отступы */
    .task-item {
        padding: 12px 14px;
        gap: 10px;
        min-height: 56px;
    }

    .task-item .task-btn-decrease,
    .task-item .task-btn-increase {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 26px;
    }

    .task-item .task-number {
        min-width: 36px;
        font-size: 19px;
    }

    /* Кнопки вариантов — удобный тап */
    .variant-btn {
        min-height: 52px !important;
        padding: 14px !important;
    }

    .variant-grid {
        gap: 10px !important;
    }

    /* Поле ответа и кнопки "Назад"/"Далее" */
    .answer-input {
        min-height: 56px;
        padding: 18px;
    }

    .test-actions {
        gap: 16px;
        margin-top: 24px;
    }

    .test-actions .btn {
        min-height: 52px;
        padding: 18px 24px;
        font-size: 17px;
    }

    /* Варианты ответа (1, 2, 3, 4) — крупная зона тапа */
    .answer-option {
        min-height: 52px;
        padding: 18px 20px;
    }

    /* Кнопка "Начать тест" / "Выбрать вариант" */
    #start-custom-test-btn {
        min-height: 52px;
        padding: 18px 28px;
        font-size: 17px;
    }
    
    /* Предотвращение случайных кликов при прокрутке */
    button:active, .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    /* Улучшение скролла на мобильных */
    .results-details,
    .results-history-list {
        -webkit-overflow-scrolling: touch;
    }

    /* Оптимизация изображений */
    .question-image {
        max-width: 100%;
        height: auto;
    }
    
    /* Улучшение читаемости текста на темном фоне */
    .title {
        text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 255, 255, 0.15);
    }
    
    .subtitle {
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    }
}

/* Предотвращение проблем с прокруткой на iOS */
@supports (-webkit-overflow-scrolling: touch) {
    body,
    .container,
    .main-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Оптимизация для телефонов в портретной ориентации */
@media (max-width: 480px) and (orientation: portrait) {
    .cat-test-side {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 100;
    }

    .test-header {
        margin-top: 60px;
    }
}

/* Исправление проблем с viewport на мобильных */
@viewport {
    width: device-width;
    initial-scale: 1.0;
    maximum-scale: 1.0;
    user-scalable: no;
}

