@font-face {
    font-family: 'IBM MDA';
    src: url('/uploads/web_ibm_mda.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

/* Модуль уведомлений (Toast Notifications) */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    border-left: 4px solid;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.4;
    color: #333;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.notification-info {
    border-left-color: #3b82f6;
}

.notification-success {
    border-left-color: #22c55e;
    background: linear-gradient(to right, #f0fdf4, white);
}

.notification-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb, white);
}

.notification-error {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fef2f2, white);
}

.notification-ban {
    border-left-color: #dc2626;
    background: linear-gradient(to right, #fef2f2, white);
    border: 2px solid #dc2626;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}

/* Темная тема для уведомлений */
body.dark-theme .notification,
html.dark-theme .notification {
    background: #1f2937;
    color: #f3f4f6;
}

body.dark-theme .notification-message,
html.dark-theme .notification-message {
    color: #f3f4f6;
}

body.dark-theme .notification-close,
html.dark-theme .notification-close {
    color: #9ca3af;
}

body.dark-theme .notification-close:hover,
html.dark-theme .notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

body.dark-theme .notification-success,
html.dark-theme .notification-success {
    background: linear-gradient(to right, #064e3b, #1f2937);
}

body.dark-theme .notification-warning,
html.dark-theme .notification-warning {
    background: linear-gradient(to right, #78350f, #1f2937);
}

body.dark-theme .notification-error,
html.dark-theme .notification-error {
    background: linear-gradient(to right, #7f1d1d, #1f2937);
}

body.dark-theme .notification-ban,
html.dark-theme .notification-ban {
    background: linear-gradient(to right, #7f1d1d, #1f2937);
}

/* Оверлей для бана */
.banned-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 20px;
}

.banned-message {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    border: 3px solid #dc2626;
}

.banned-message h2 {
    color: #dc2626;
    font-size: 2em;
    margin-bottom: 20px;
}

.banned-message p {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 10px;
}

body.dark-theme .banned-message,
html.dark-theme .banned-message {
    background: #1f2937;
    border-color: #dc2626;
}

body.dark-theme .banned-message h2,
html.dark-theme .banned-message h2 {
    color: #f87171;
}

body.dark-theme .banned-message p,
html.dark-theme .banned-message p {
    color: #f3f4f6;
}

html {
    height: 100%;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2ff 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}


/* Обёртка для основного контента (header уже вне, только container внутри) */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Главный header на всю ширину экрана */
.main-header {
    width: 100%;
    background: linear-gradient(135deg, #5f6efb 0%, #8ea4ff 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 100;
    overflow: visible;
    box-sizing: border-box;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 15px;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.header-container button,
.main-header button,
.header-menu button,
.header-right button,
.avatar-wrapper button,
.header-menu .header-menu-item,
.header-right .avatar-btn {
    transition: none !important;
    transform: none !important;
}

.header-container button:hover,
.main-header button:hover,
.header-menu button:hover,
.header-right button:hover,
.avatar-wrapper button:hover,
.header-menu .header-menu-item:hover,
.header-right .avatar-btn:hover {
    transform: none !important;
    transition: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 100px;
    flex: 0 0 auto;
    overflow: visible;
    min-width: 0;
}

.animated-title-link {
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.animated-title {
    color: #fff;
    margin: 0;
    transition: opacity 0.2s;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.animated-title-link:hover .animated-title {
    opacity: 0.8;
}

.main-header h1,
header h1 {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 30px;
    margin-top: 0;
    position: relative;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    width: 100%;
    box-sizing: border-box;
}

/* Минималистичный акцент для главной страницы */
body.home-page .main-content-wrapper {
    padding: 10px 0 40px;
}

body.home-page .container {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.18);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

body.dark-theme.home-page .container {
    background: linear-gradient(180deg, #23263b 0%, #2b2f4b 100%);
    border-color: rgba(125, 145, 255, 0.25);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

body.home-page .quizzes-section h3 {
    font-weight: 600;
    letter-spacing: 0.01em;
}

body.home-page .quizzes-list {
    gap: 18px;
}

/* Для обратной совместимости - стили для header внутри container (если где-то используется) */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.header-menu-item {
    background: transparent;
    border: 2px solid transparent;
    color: white;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.header-menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none !important;
}

body.dark-theme .header-menu-item {
    color: white;
}

body.dark-theme .header-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: none !important;
}

/* Hamburger menu button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    max-width: min(90vw, 300px);
    background: linear-gradient(135deg, #5f6efb 0%, #8ea4ff 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    gap: 10px;
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    border-radius: 0 0 0 15px;
    box-sizing: border-box;
}

.mobile-menu.active {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-item {
    background: transparent;
    border: 2px solid transparent;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-theme .mobile-menu {
    background: #2d2d44;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .mobile-menu-item {
    color: white;
}

body.dark-theme .mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-wrapper {
    position: relative;
}

.avatar-btn {
    height: 40px;
    border-radius: 20px;
    border: 2px solid transparent;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    padding: 0 12px;
    gap: 8px;
}

.avatar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.avatar-btn-text {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.avatar-btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-btn-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

html.dark-theme .avatar-btn,
body.dark-theme .avatar-btn {
    background: transparent;
    border-color: transparent;
    color: white;
}

html.dark-theme .avatar-btn:hover,
body.dark-theme .avatar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.35);
    min-width: 170px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    transform-origin: top right;
}

.avatar-dropdown.show {
    display: block;
    animation: dropdownPop 0.22s ease;
}

@keyframes dropdownPop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.avatar-dropdown-item {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    text-decoration: none;
    box-sizing: border-box;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
}

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

.avatar-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #111827;
}

/* Темная тема для dropdown */
html.dark-theme .avatar-dropdown,
body.dark-theme .avatar-dropdown {
    background: rgba(31, 35, 58, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(125, 145, 255, 0.2);
}

html.dark-theme .avatar-dropdown-item,
body.dark-theme .avatar-dropdown-item {
    color: #e0e0e0;
    border-bottom-color: rgba(125, 145, 255, 0.12);
}

html.dark-theme .avatar-dropdown-item:hover,
body.dark-theme .avatar-dropdown-item:hover {
    background: rgba(125, 145, 255, 0.12);
    color: #ffffff;
}

.language-toggle-btn {
    border-bottom: none !important;
}

.language-toggle-btn:first-child {
    border-right: 1px solid #e5e7eb;
}

html.dark-theme .language-toggle-btn:first-child,
body.dark-theme .language-toggle-btn:first-child {
    border-right-color: #4a4a65;
}

.user-info {
    border-bottom: 1px solid #e5e7eb;
}

html.dark-theme .user-info,
body.dark-theme .user-info {
    border-bottom-color: #4a4a65;
}

html.dark-theme .user-info div:first-child,
body.dark-theme .user-info div:first-child {
    color: #e0e0e0 !important;
}

html.dark-theme .user-info div:last-child,
body.dark-theme .user-info div:last-child {
    color: #999 !important;
}

.user-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-steam-id {
    font-size: 12px;
    color: #666;
}

body.dark-theme .user-name {
    color: #e0e0e0;
}

body.dark-theme .user-steam-id {
    color: #999;
}


.theme-toggle-item {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin: 4px 0;
}

body.dark-theme .theme-toggle-item {
    border-top-color: #4a4a65;
    border-bottom-color: #4a4a65;
}



/* floating-controls больше не используются (кнопки в header) */

/* Темная тема */
body.dark-theme {
    background: linear-gradient(135deg, #151728 0%, #1f233a 100%);
}

body.dark-theme .container {
    background: #2d2d44;
    color: #e0e0e0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-theme .main-header {
    background: #1f233a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .main-header h1,
body.dark-theme header h1 {
    color: #e0e0e0;
}

body.dark-theme .animated-title {
    color: #e0e0e0;
}


body.dark-theme .welcome-section h2 {
    color: #e0e0e0;
}

body.dark-theme .welcome-section p {
    color: #b0b0b0;
}

body.dark-theme .quizzes-section h3 {
    color: #e0e0e0;
}

body.dark-theme .quiz-item {
    background: #4a5568;
    color: #e0e0e0;
    border: none;
}

body.dark-theme .quiz-item:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 85, 104, 0.4);
}

body.dark-theme .quiz-item.disabled {
    background: repeating-linear-gradient(
        45deg,
        #4a5568,
        #4a5568 10px,
        #5a6578 10px,
        #5a6578 20px
    );
    opacity: 0.6;
}

body.dark-theme .quiz-item.disabled::before {
    background: rgba(0, 0, 0, 0.3);
}

/* Белый текст на запланированных квизах в темной теме */
body.dark-theme .quiz-item.disabled .quiz-title,
body.dark-theme .quiz-item.disabled .quiz-status,
body.dark-theme .quiz-item.disabled .quiz-game-name,
body.dark-theme .quiz-item.disabled .quiz-attempts-text {
    color: #ffffff !important;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

body.dark-theme .quiz-item.completed-success {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
}

body.dark-theme .quiz-item.completed-success:hover {
    background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

body.dark-theme .quiz-item.completed-fail {
    background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
    color: white;
}

body.dark-theme .quiz-item.completed-fail:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.3);
}

body.dark-theme .quiz-item.completed-fail .quiz-status.quiz-locked {
    color: #ffffff;
}

body.dark-theme .quiz-item.completed-fail.quiz-locked .quiz-title,
body.dark-theme .quiz-item.completed-fail.quiz-locked .quiz-status.quiz-locked {
    color: #ffffff;
}

body.dark-theme .life-mini {
    border-color: #5a6578;
    background: #3a3a55;
    color: #ef4444;
}

body.dark-theme .life-mini.life-used {
    background: #ef4444;
    border-color: #ef4444;
    color: #fca5a5;
}

body.dark-theme .life-mini.life-correct {
    background: #10b981;
    border-color: #10b981;
    color: #86efac;
}


body.dark-theme .loading {
    color: #e0e0e0;
}

body.dark-theme .quiz-status-icon {
    color: #e0e0e0;
}

body.dark-theme .quiz-item.completed-success .quiz-status-icon {
    color: #86efac;
}

body.dark-theme .quiz-item.completed-fail .quiz-status-icon {
    color: rgba(239, 68, 68, 0.6);
}

body.dark-theme .quiz-attempts-text {
    color: #e0e0e0;
}

.quiz-item.disabled .quiz-stars {
    opacity: 0.6;
}

body.dark-theme .modal-content {
    background: #2d2d44;
    color: #e0e0e0;
}

/* Кастомный скроллбар для темной темы */
body.dark-theme .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .modal-content::-webkit-scrollbar-thumb {
    background: rgba(139, 154, 255, 0.5);
}

body.dark-theme .modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 154, 255, 0.7);
}

body.dark-theme .modal-content {
    scrollbar-color: rgba(139, 154, 255, 0.5) rgba(255, 255, 255, 0.05);
}

body.dark-theme .close {
    color: #b0b0b0;
}

body.dark-theme .close:hover {
    color: #e0e0e0;
}

/* Пиксельная тема */
body.pixel-theme {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    font-family: 'IBM MDA', monospace;
}

body.pixel-theme .container {
    background: #0f0f1e;
    color: #00ff41;
    border: 3px solid #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5), inset 0 0 20px rgba(0, 255, 65, 0.1);
    font-family: 'IBM MDA', monospace;
}

body.pixel-theme .main-header {
    background: #0a0a1a;
    border-bottom: 2px solid #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

body.pixel-theme .main-header h1,
body.pixel-theme header h1 {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8), 2px 2px 0 #000;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.6em;
    letter-spacing: 3px;
    font-weight: bold;
}

body.pixel-theme .quizzes-section h3 {
    color: #00ff41;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.6);
    border-bottom: 2px solid #00ff41;
    padding-bottom: 10px;
}

body.pixel-theme .quiz-item {
    background: #1a1a2e;
    border: 2px solid #00ff41;
    border-radius: 0;
    color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transition: all 0.1s;
}

body.pixel-theme .quiz-item:hover:not(.disabled) {
    background: #2a2a3e;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
    transform: translateY(-2px);
}

body.pixel-theme .quiz-item.disabled {
    background: #0a0a1a;
    border-color: #004d1a;
    color: #004d1a;
    opacity: 0.5;
}

body.pixel-theme .quiz-item.completed-success {
    background: #0a2e0a;
    border-color: #00ff41;
    color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

body.pixel-theme .quiz-item.completed-success:hover {
    background: #0a3e0a;
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.7);
}

body.pixel-theme .quiz-item.completed-fail {
    background: #2e0a0a;
    border-color: #ff0041;
    color: #ff0041;
    box-shadow: 0 0 15px rgba(255, 0, 65, 0.5);
}

body.pixel-theme .quiz-item.completed-fail:hover {
    background: #3e0a0a;
    border-color: #ff0066;
    box-shadow: 0 0 20px rgba(255, 0, 65, 0.7);
}

body.pixel-theme .quiz-item.available {
    background: linear-gradient(135deg, #0a2e0a 0%, #1a3e1a 100%);
    border-color: #00ff41;
    color: #00ff41;
}

html.pixel-theme .quiz-item,
body.pixel-theme .quiz-item {
    background: #0a2e0a;
    border: 2px solid #00ff41;
    color: #00ff41;
    border-radius: 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6em;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

html.pixel-theme .quiz-item:hover:not(.disabled),
body.pixel-theme .quiz-item:hover:not(.disabled) {
    background: #1a3e1a;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
}

html.pixel-theme .quiz-item.disabled,
body.pixel-theme .quiz-item.disabled {
    background: #0a0a1a;
    border-color: #004d1a;
    color: #004d1a;
    opacity: 0.5;
}

html.pixel-theme .quiz-item.completed-success,
body.pixel-theme .quiz-item.completed-success {
    background: #0a2e0a;
    border-color: #00ff41;
}

html.pixel-theme .quiz-item.completed-fail,
body.pixel-theme .quiz-item.completed-fail {
    background: #2e0a0a;
    border-color: #ff0041;
    color: #ff0041;
}

html.pixel-theme .life-mini,
body.pixel-theme .life-mini {
    border: 2px solid #00ff41;
    background: #0a0a1a;
    color: #ff0041;
    border-radius: 6px;
    font-family: 'Press Start 2P', monospace;
}

html.pixel-theme .life-mini.life-used,
body.pixel-theme .life-mini.life-used {
    background: #2e0a0a;
    border-color: #ff0041;
    color: #ff0041;
}

html.pixel-theme .life-mini.life-correct,
body.pixel-theme .life-mini.life-correct {
    background: #0a2e0a;
    border-color: #00ff41;
    color: #00ff41;
}


body.pixel-theme .life-mini {
    border: 1px solid #00ff41;
    border-radius: 0;
    box-shadow: 0 0 3px rgba(0, 255, 65, 0.5);
}

body.pixel-theme .life-mini.life-used {
    background: #ff0041;
    border-color: #ff0041;
    box-shadow: 0 0 5px rgba(255, 0, 65, 0.7);
}

body.pixel-theme .life-mini.life-correct {
    background: #00ff41;
    border-color: #00ff41;
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.7);
}

/* Космическая тема */
body.cosmos-theme {
    background: #000000;
    position: relative;
    overflow-x: hidden;
    font-family: 'Exo 2', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Звездное небо - статичные звезды */
body.cosmos-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Большие звезды */
        radial-gradient(2px 2px at 15% 25%, #fff, transparent),
        radial-gradient(2px 2px at 35% 45%, #fff, transparent),
        radial-gradient(2px 2px at 55% 15%, #fff, transparent),
        radial-gradient(2px 2px at 75% 65%, #fff, transparent),
        radial-gradient(2px 2px at 85% 35%, #fff, transparent),
        radial-gradient(2px 2px at 25% 75%, #fff, transparent),
        radial-gradient(2px 2px at 45% 85%, #fff, transparent),
        radial-gradient(2px 2px at 65% 55%, #fff, transparent),
        radial-gradient(2px 2px at 90% 80%, #fff, transparent),
        radial-gradient(2px 2px at 10% 60%, #fff, transparent),
        /* Средние звезды */
        radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 40% 50%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 80% 70%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 30% 10%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 50% 90%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 70% 40%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 90% 15%, #fff, transparent),
        /* Маленькие звезды */
        radial-gradient(1px 1px at 12% 18%, #fff, transparent),
        radial-gradient(1px 1px at 28% 42%, #fff, transparent),
        radial-gradient(1px 1px at 48% 28%, #fff, transparent),
        radial-gradient(1px 1px at 68% 58%, #fff, transparent),
        radial-gradient(1px 1px at 88% 22%, #fff, transparent),
        radial-gradient(1px 1px at 18% 68%, #fff, transparent),
        radial-gradient(1px 1px at 38% 88%, #fff, transparent),
        radial-gradient(1px 1px at 58% 48%, #fff, transparent),
        radial-gradient(1px 1px at 78% 78%, #fff, transparent),
        radial-gradient(1px 1px at 92% 52%, #fff, transparent),
        radial-gradient(1px 1px at 5% 35%, #fff, transparent),
        radial-gradient(1px 1px at 95% 65%, #fff, transparent),
        radial-gradient(1px 1px at 22% 82%, #fff, transparent),
        radial-gradient(1px 1px at 72% 12%, #fff, transparent),
        radial-gradient(1px 1px at 42% 38%, #fff, transparent);
    background-size: 100% 100%;
    background-position: 0% 0%;
    pointer-events: none;
    z-index: 0;
}


body.cosmos-theme .container {
    background: rgba(15, 10, 30, 0.95);
    color: #ffffff;
    border: 2px solid #ffffff;
    font-family: 'Exo 2', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), inset 0 0 30px rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

body.cosmos-theme .main-header {
    background: rgba(15, 10, 30, 0.95);
    border-bottom: 2px solid #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

body.cosmos-theme .main-header h1,
body.cosmos-theme header h1 {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.4);
    font-family: 'Orbitron', 'Exo 2', sans-serif;
    font-weight: bold;
    letter-spacing: 2px;
}

body.cosmos-theme .quizzes-section h3 {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    border-bottom: 2px solid #ffffff;
    padding-bottom: 10px;
}

body.cosmos-theme .quiz-item {
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid #ffffff;
    border-radius: 8px;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

body.cosmos-theme .quiz-item:hover:not(.disabled) {
    background: rgba(40, 40, 40, 0.9);
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

body.cosmos-theme .quiz-item.disabled {
    background: rgba(15, 15, 15, 0.6);
    border-color: #666666;
    color: #999999;
    opacity: 0.6;
}

body.cosmos-theme .quiz-item.completed-success {
    background: rgba(16, 185, 129, 0.6);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

body.cosmos-theme .quiz-item.completed-success:hover {
    background: rgba(16, 185, 129, 0.75);
    border-color: #34d399;
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.9);
}

body.cosmos-theme .quiz-item.completed-fail {
    background: rgba(239, 68, 68, 0.6);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

body.cosmos-theme .quiz-item.completed-fail:hover {
    background: rgba(239, 68, 68, 0.75);
    border-color: #f87171;
    box-shadow: 0 0 30px rgba(248, 113, 113, 0.9);
}

body.cosmos-theme .quiz-item.available {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(40, 40, 40, 0.9) 100%);
    border-color: #ffffff;
    color: #ffffff;
}

html.cosmos-theme .quiz-item,
body.cosmos-theme .quiz-item {
    background: rgba(30, 30, 30, 0.9);
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

html.cosmos-theme .quiz-item:hover:not(.disabled),
body.cosmos-theme .quiz-item:hover:not(.disabled) {
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

html.cosmos-theme .quiz-item.disabled,
body.cosmos-theme .quiz-item.disabled {
    background: rgba(15, 15, 15, 0.6);
    border-color: #666666;
    color: #999999;
    opacity: 0.6;
}

html.cosmos-theme .quiz-item.completed-success,
body.cosmos-theme .quiz-item.completed-success {
    background: rgba(16, 185, 129, 0.6);
    border-color: #10b981;
}

html.cosmos-theme .quiz-item.completed-fail,
body.cosmos-theme .quiz-item.completed-fail {
    background: rgba(239, 68, 68, 0.6);
    border-color: #ef4444;
}

html.cosmos-theme .life-mini,
body.cosmos-theme .life-mini {
    border: 2px solid #ffffff;
    background: rgba(15, 15, 15, 0.6);
    color: #ef4444;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

html.cosmos-theme .life-mini.life-used,
body.cosmos-theme .life-mini.life-used {
    background: rgba(239, 68, 68, 0.6);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

html.cosmos-theme .life-mini.life-correct,
body.cosmos-theme .life-mini.life-correct {
    background: rgba(16, 185, 129, 0.6);
    border-color: #10b981;
    color: #6ee7b7;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}


body.cosmos-theme .life-mini {
    border: 1px solid #ffffff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

body.cosmos-theme .life-mini.life-used {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

body.cosmos-theme .life-mini.life-correct {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #666;
    font-size: 1.1em;
}

.quizzes-section h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.quizzes-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 100%;
    /* Плавное смещение элементов при добавлении новых */
    transition: grid-template-rows 0.3s ease-out;
}

.quiz-item {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #60a5fa;
    border: none;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.3s ease-out, box-shadow 0.3s ease-out, transform 0.3s ease-out;
    will-change: transform; /* Оптимизация для браузера */
    min-height: 120px;
    color: white;
    overflow: hidden;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Анимация появления нового квиза */
.quiz-item-new {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
    transition: none !important;
    pointer-events: none; /* Отключаем hover во время анимации */
}

.quiz-item-new.quiz-item-animate {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    pointer-events: auto; /* Включаем hover после анимации */
}

/* Анимация смещения существующих элементов */
.quiz-item-shift {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    pointer-events: none; /* Отключаем hover во время анимации */
}

.quiz-item[style*="background-image"] {
    background-color: rgba(96, 165, 250, 0.9);
}

.quiz-item[style*="background-image"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
    border-radius: 12px;
}

.quiz-item[style*="background-image"] .quiz-title,
.quiz-item[style*="background-image"] .quiz-game-name {
    position: relative;
    z-index: 2;
}

.quiz-item[style*="background-image"] .quiz-status-icon,
.quiz-item[style*="background-image"] .quiz-attempts-text {
    z-index: 2;
}

.quiz-item:hover:not(.disabled):not(.completed-success):not(.completed-fail) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
}

.quiz-item.disabled {
    background: repeating-linear-gradient(
        45deg,
        #9ca3af,
        #9ca3af 10px,
        #d1d5db 10px,
        #d1d5db 20px
    );
    cursor: not-allowed;
    opacity: 0.8;
    position: relative;
}

.quiz-item.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.quiz-title {
    font-size: 0.9em;
    font-weight: 500;
    margin: 0;
    text-align: left;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.quiz-game-name {
    font-size: 0.75em;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.9;
    text-align: left;
    line-height: 1.2;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.quiz-status {
    font-size: 0.9em;
    margin-top: 4px;
    opacity: 0.95;
    text-align: left;
    color: #ffffff;
    font-weight: normal;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.quiz-status.quiz-locked {
    color: #ffffff;
}

.quiz-status-icon {
    position: absolute;
    top: 4px;
    right: 12px;
    font-size: 24px;
    font-weight: 500;
}

.quiz-item .quiz-status-icon {
    z-index: 2;
}

.quiz-item.completed-success .quiz-status-icon {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quiz-item.completed-fail .quiz-status-icon {
    color: #ffffff;
    opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Стили для значка паузы на квизах в процессе */
.quiz-item:not(.completed-success):not(.completed-fail) .quiz-status-icon {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quiz-item.completed-fail:hover .quiz-status-icon {
    color: #ffffff;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Темная тема - белый цвет для иконок статуса */
body.dark-theme .quiz-item.completed-success .quiz-status-icon,
body.dark-theme .quiz-item.completed-fail .quiz-status-icon,
body.dark-theme .quiz-item.completed-fail:hover .quiz-status-icon {
    color: #ffffff;
}

.quiz-attempts-text {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-size: 0.85em;
    opacity: 0.9;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.quiz-stars {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 2px;
    align-items: center;
}

.quiz-star {
    width: 16px;
    height: 16px;
    display: block;
}

/* Текст на неопубликованных (disabled) квизах делаем темно-серым для лучшей читаемости */
.quiz-item.disabled .quiz-title,
.quiz-item.disabled .quiz-status,
.quiz-item.disabled .quiz-game-name,
.quiz-item.disabled .quiz-attempts-text {
    color: #4b5563;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.quiz-play-btn:hover:not(:disabled) {
    background: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.quiz-play-btn:disabled {
    background: #9ca3af;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Отгаданные квизы - зеленый цвет с градиентом (высокий приоритет, должен идти до правила available) */
.quiz-item.completed-success,
.quiz-item.completed-success.available,
.quiz-item.available.completed-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
}

.quiz-item.completed-fail {
    background: linear-gradient(135deg, #f87171 0%, #ee3f3f 100%); /* Градиент для неотгаданных квизов */
    animation: pulse-red 2s ease-in-out infinite;
}

.quiz-item.completed-fail:hover {
    background: linear-gradient(135deg, #fc5555 0%, #f87171 100%); /* Градиент при ховере */
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.3);
    animation: pulse-red-hover 1.5s ease-in-out infinite;
    transform: translateY(-3px);
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(248, 113, 113, 0.5);
    }
}

@keyframes pulse-red-hover {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(248, 113, 113, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(248, 113, 113, 0.6);
    }
}

/* Заблокированные квизы имеют такой же фон как completed-fail (розовый) */
.quiz-item.completed-fail.quiz-locked {
    background: #e70000; /* Такой же розовый как у неотгаданных квизов */
}

.quiz-item.completed-fail.quiz-locked:hover {
    background: #f87171; /* Немного темнее при наведении, но все еще розовый */
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.3);
}

.quiz-item.completed-fail .quiz-status.quiz-locked {
    color: #ffffff;
}

.quiz-item.available.quiz-locked .quiz-title,
.quiz-item.completed-fail.quiz-locked .quiz-title,
.quiz-item.available.quiz-locked .quiz-status.quiz-locked,
.quiz-item.completed-fail.quiz-locked .quiz-status.quiz-locked {
    color: #ffffff;
}

.quiz-item:hover:not(.quiz-item-new):not(.quiz-item-shift):not(.completed-success):not(.completed-fail) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
}

.quiz-item.available:not(.completed-success):not(.completed-fail) {
    background: linear-gradient(135deg, #8264d6 0%, #6944cf 100%); /* Бирюзовый градиент */
    color: white;
}

.quiz-item.available:hover:not(.quiz-item-new):not(.quiz-item-shift):not(.completed-success):not(.completed-fail) {
    background: linear-gradient(135deg, #7056b8 0%, #5436a5 100%) !important; /* Бирюзовый для новых квизов */
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3) !important; /* Бирюзовая тень */
    transform: translateY(-3px);
}

/* Отгаданные квизы при hover должны оставаться зелеными с градиентом - правило идет после available:hover для приоритета */
.quiz-item.completed-success:hover,
.quiz-item.completed-success.available:hover,
.quiz-item.available.completed-success:hover,
.quiz-item.completed-success:hover.available,
.quiz-item.available.completed-success:hover,
.quiz-item.completed-success.available:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%) !important;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4) !important;
    transform: translateY(-3px) !important;
}

/* Если квиз имеет статус completed-fail, он должен быть розовым с градиентом, даже если есть класс available */
.quiz-item.available.completed-fail,
.quiz-item.completed-fail.available,
.quiz-item.available.completed-fail.quiz-locked,
.quiz-item.completed-fail.available.quiz-locked {
    background: linear-gradient(135deg, #f87171 0%, #ff5858 100%) !important; /* Градиент для неотгаданных квизов */
}

.quiz-item.available.completed-fail:hover,
.quiz-item.completed-fail.available:hover,
.quiz-item.available.completed-fail.quiz-locked:hover,
.quiz-item.completed-fail.available.quiz-locked:hover {
    background: linear-gradient(135deg, #fc5555 0%, #f87171 100%) !important;
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.3);
}

.quiz-item.disabled {
    background: repeating-linear-gradient(
        45deg,
        #d1d5db,
        #d1d5db 10px,
        #e5e7eb 10px,
        #e5e7eb 20px
    );
    color: #6b7280;
    cursor: default;
    pointer-events: none;
    border-color: #9ca3af;
    position: relative;
}

.quiz-item.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 0;
}

.quiz-item.completed-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
    color: white;
    border-color: #16a34a;
}

.quiz-item.completed-fail {
    background: linear-gradient(135deg, #f87171 0%, #ee3f3f 100%);
    color: white;
    border-color: #ef4444;
}

.quiz-content {
    display: none; /* Скрываем старую структуру */
}

.quiz-attempts {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attempts-bar-mini {
    display: flex;
    gap: 8px;
    align-items: center;
}

.life-mini {
    width: 32px;
    height: 32px;
    border: 2px solid #d1d5db;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: normal;
    color: #ef4444;
    transition: all 0.2s;
}

.life-mini.life-used {
    background: #fca5a5; /* Розоватый цвет как у кнопки "Пропустить" */
    border-color: #fca5a5;
    color: #991b1b; /* Более мягкий темно-розовый вместо ярко-красного */
}

.life-mini.life-correct {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}

/* Для карточек с градиентом (available) - темные иконки */
.quiz-item.available .life-mini {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.3);
}

.quiz-item.available .life-mini.life-used {
    background: rgba(252, 165, 165, 0.9); /* Розоватый цвет как у кнопки "Пропустить" */
    border-color: rgba(252, 165, 165, 1);
}

.quiz-item.available .life-mini.life-correct {
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 1);
}

/* Для зеленых карточек (completed-success) - яркие контрастные цвета */
.quiz-item.completed-success .life-mini {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
}

.quiz-item.completed-success .life-mini.life-used {
    background: rgba(200, 200, 200, 0.7);
    border-color: rgba(180, 180, 180, 0.9);
}

.quiz-item.completed-success .life-mini.life-correct {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* Для красных карточек (completed-fail) - яркие контрастные цвета */
.quiz-item.completed-fail .life-mini {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
}

.quiz-item.completed-fail .life-mini.life-used {
    background: rgba(220, 180, 180, 0.7); /* Мягкий пастельный розовато-серый */
    border-color: rgba(200, 160, 160, 0.9);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: #ffffff;
    padding: 28px 30px;
    border-radius: 18px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    animation: modalPop 0.28s ease;
}

/* Кастомный скроллбар для модальных окон */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    transition: background 0.2s;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Firefox */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.5) rgba(0, 0, 0, 0.05);
}

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

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.close:hover {
    color: #1f2937;
    border-color: rgba(99, 102, 241, 0.4);
    background: #eef2ff;
}

.modal-content h2 {
    color: #111827;
    margin-bottom: 18px;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.35em;
    letter-spacing: 0.2px;
}

.modal-text-content {
    color: #4b5563;
    line-height: 1.65;
    font-size: 0.98em;
}

.modal-text-content p {
    margin-bottom: 12px;
}

.modal-text-content strong {
    color: #333;
    font-weight: 600;
}

.modal-text-content ul {
    margin: 14px 0;
    padding-left: 0;
    list-style: none;
}

.modal-text-content li {
    margin-bottom: 10px;
    padding-left: 14px;
    border-left: 2px solid rgba(148, 163, 184, 0.35);
}

body.dark-theme .modal-text-content {
    color: #cbd5f5;
}

body.dark-theme .modal-text-content strong {
    color: #e5e7eb;
}

body.dark-theme .modal-content {
    background: #1f233a;
    border-color: rgba(71, 85, 105, 0.55);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

body.dark-theme .close {
    background: rgba(31, 35, 58, 0.9);
    color: #cbd5f5;
    border-color: rgba(125, 145, 255, 0.25);
}

body.dark-theme .close:hover {
    color: #ffffff;
    border-color: rgba(125, 145, 255, 0.5);
    background: rgba(45, 51, 80, 0.95);
}

body.dark-theme .modal-text-content li {
    border-left-color: rgba(125, 145, 255, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal-content {
        animation: none !important;
    }
}

/* Улучшенное оформление модальных окон */
.modal-welcome {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-welcome .modal-icon {
    font-size: 28px;
    line-height: 1;
}

.modal-welcome p {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.modal-section {
    margin-bottom: 12px;
}

.modal-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 17px;
}

.modal-section-header .modal-icon {
    font-size: 20px;
    line-height: 1;
}

.modal-section-header strong {
    color: #667eea;
    font-weight: 600;
}

.modal-section p {
    margin: 0 0 8px 0;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    transition: background 0.2s;
}

.modal-list li:hover {
    background: #f3f4f6;
}

.modal-list .list-icon {
    font-size: 16px;
    line-height: 1.4;
    flex-shrink: 0;
}

.modal-list li {
    margin-bottom: 6px;
}

.modal-section.highlight {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #667eea30;
    margin: 12px 0;
}

.modal-section.highlight p {
    margin: 0;
    color: #555;
    font-size: 16px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
}

.modal-footer .modal-icon {
    font-size: 24px;
    line-height: 1;
}

.modal-footer p {
    margin: 0;
    font-size: 16px;
}

/* Темная тема для улучшенных модальных окон */
body.dark-theme .modal-welcome {
    border-bottom-color: #4a4a65;
}

body.dark-theme .modal-welcome p {
    color: #e0e0e0;
}

body.dark-theme .modal-section-header strong {
    color: #8b9aff;
}

body.dark-theme .modal-list li {
    background: #2d2d44;
    border-left-color: #8b9aff;
}

body.dark-theme .modal-list li:hover {
    background: #353550;
}

body.dark-theme .modal-section.highlight {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border-color: #667eea50;
}

body.dark-theme .modal-section.highlight p {
    color: #d1d5db;
}

body.dark-theme .modal-footer {
    border-top-color: #4a4a65;
}

/* Стили для кнопки доната */
.donate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.donate-btn:active {
    transform: translateY(0);
}

/* Темная тема для кнопки доната */
body.dark-theme .donate-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

body.dark-theme .donate-btn:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

/* Пиксельная тема для кнопки доната */
body.pixel-theme .donate-btn {
    background: #1a1a2e;
    border: 2px solid #00ff41;
    color: #00ff41;
    border-radius: 0;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7em;
}

body.pixel-theme .donate-btn:hover {
    background: #2a2a3e;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
}

/* Космическая тема для кнопки доната */
body.cosmos-theme .donate-btn {
    background: rgba(30, 30, 30, 0.9);
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

body.cosmos-theme .donate-btn:hover {
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

/* Стили для модального окна входа */
.login-modal-content {
    max-width: 400px;
    width: 90%;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-login-btn {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #1a1a2e; /* Более насыщенный темный цвет */
    font-size: 16px;
    font-weight: 600; /* Более жирный шрифт */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.social-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-login-btn svg {
    width: 24px;
    height: 24px;
}

.steam-btn {
    border-color: #171a21;
    color: #171a21;
}

.steam-btn:hover {
    background: #171a21;
    color: white;
    border-color: #171a21;
}

.google-btn {
    border-color: #4285F4;
    color: #4285F4;
}

.google-btn:hover {
    background: #4285F4;
    color: white;
    border-color: #4285F4;
}

.yandex-btn {
    border-color: #FC3F1D;
    color: #FC3F1D;
}

.yandex-btn:hover {
    background: #FC3F1D;
    color: white;
    border-color: #FC3F1D;
}

.error-message {
    color: #ef4444;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

/* Темная тема для модального окна входа */
body.dark-theme .social-login-btn {
    background: #3a3a55;
    border-color: #4a4a65;
    color: #e0e0e0;
}

body.dark-theme .steam-btn:hover {
    background: #171a21;
    color: white;
    border-color: #171a21;
}

body.dark-theme .google-btn:hover {
    background: #4285F4;
    color: white;
    border-color: #4285F4;
}

body.dark-theme .yandex-btn:hover {
    background: #FC3F1D;
    color: white;
    border-color: #FC3F1D;
}

body.dark-theme .modal-content h2 {
    color: #e0e0e0;
}

/* Адаптивный дизайн для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Скрываем обычное меню на планшетах */
    .header-menu {
        display: none;
    }

    /* Показываем hamburger menu */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Показываем мобильное меню */
    .mobile-menu {
        display: flex;
    }
}

/* Адаптивный дизайн для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .main-header {
        padding: 8px 0;
    }

    .main-footer {
        padding: 10px 0;
    }

    .header-container {
        padding: 0 15px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
        margin-top: 0;
    }

    .main-header .header-container,
    header {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .main-header h1,
    header h1 {
        font-size: 1.8em;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
    }

    /* Скрываем обычное меню на мобильных */
    .header-menu {
        display: none;
    }

    /* Показываем hamburger menu */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Показываем мобильное меню */
    .mobile-menu {
        display: flex;
    }

    .header-left {
        gap: 20px;
        min-width: 0;
    }

    .header-right {
        flex-shrink: 0;
        margin-left: auto;
        gap: 10px;
    }

    .avatar-wrapper {
        display: block; /* Показываем значок профиля на мобильных */
        position: relative;
    }

    .avatar-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
        max-width: calc(100vw - 30px);
        width: auto;
        transform: translateX(0);
    }

    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }

    .notification {
        min-width: auto;
        max-width: 100%;
        padding: 12px 16px;
    }

    .quizzes-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quiz-item {
        min-width: 100%;
        padding: 15px;
    }

    .quiz-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .quiz-item-title {
        font-size: 1.1em;
    }

    .quiz-status-icon {
        font-size: 1.5em;
    }


    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
        margin: 10px auto;
    }

    .modal-content h2 {
        font-size: 1.5em;
    }

    .social-login-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .social-login-btn {
        width: 100%;
        padding: 14px;
        font-size: 1em;
    }

    .avatar-dropdown {
        right: 0;
        left: auto;
        min-width: 200px;
        max-width: calc(100vw - 40px);
        width: auto;
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .main-header {
        padding: 8px 0;
    }

    .header-container {
        padding: 0 12px;
    }

    .container {
        padding: 15px;
        border-radius: 12px;
        margin-top: 0;
    }

    .main-header h1,
    header h1 {
        font-size: 1.8em;
    }


    .quiz-item {
        padding: 12px;
    }

    .quiz-item-title {
        font-size: 1em;
    }

    .quiz-info {
        font-size: 0.85em;
    }

    .quiz-status-icon {
        font-size: 1.3em;
    }

    .notification {
        padding: 10px 14px;
        font-size: 0.9em;
    }

    .notification-icon {
        font-size: 1.3em;
    }

    .modal-content {
        padding: 15px;
        max-width: 98%;
    }

    .modal-content h2 {
        font-size: 1.3em;
    }

    .banned-message {
        padding: 25px 15px;
        max-width: 95%;
    }

    .banned-message h2 {
        font-size: 1.5em;
    }

    .banned-message p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 6px 0;
    }

    .main-footer {
        padding: 8px 0;
    }

    .header-container {
        padding: 0 10px;
    }

    .main-header h1,
    header h1 {
        font-size: 1.3em;
        line-height: 1.3;
    }

    .header-menu {
        display: none;
    }

    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }

    .mobile-menu {
        padding: 15px;
    }

    .mobile-menu-item {
        padding: 12px 16px;
        font-size: 14px;
    }

    .header-left {
        gap: 15px;
        min-width: 0;
    }

    .header-right {
        flex-shrink: 0;
        margin-left: auto;
        gap: 8px;
    }
}

/* Рейтинг */
.rating-section {
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
}

.container:has(.rating-section) {
    max-width: 980px;
}

.rating-list {
    display: grid;
    gap: 14px;
}

.rating-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.rating-title {
    font-size: 1.8em;
    color: #1f2937;
    margin: 0;
    text-align: center;
}

.rating-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rating-card.top-1 {
    border-color: #f59e0b;
    box-shadow: 0 18px 36px rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
}

.rating-card.top-2 {
    border-color: #94a3b8;
    box-shadow: 0 16px 32px rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.rating-card.top-3 {
    border-color: #f59e0b;
    box-shadow: 0 16px 32px rgba(245, 158, 11, 0.2);
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
}

.rating-card:hover {
    transform: translateY(-2px);
    border-color: #c7d2fe;
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.15);
}

.rating-rank {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7em;
    font-weight: 700;
    color: #4f46e5;
    box-shadow: none;
}

.rating-card.top-1 .rating-rank {
    color: #b45309;
    font-size: 1.9em;
    text-shadow: 0 6px 12px rgba(245, 158, 11, 0.45);
}

.rating-card.top-2 .rating-rank {
    color: #374151;
}

.rating-card.top-3 .rating-rank {
    color: #92400e;
}

.rating-card.top-1 .rating-rank-badge {
    animation: topGlow 2.4s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes topGlow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    }
    50% {
        transform: scale(1.06);
        text-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
    }
}

.rating-user {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.rating-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating-avatar-placeholder {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.rating-user-info {
    min-width: 0;
}

.rating-name {
    font-size: 1.05em;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.rating-chip {
    font-size: 0.82em;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.rating-score {
    text-align: right;
    min-width: 96px;
    margin-left: auto;
    flex-shrink: 0;
}

.rating-score-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #4f46e5;
    line-height: 1;
}

.rating-score-label {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 4px;
}

.rating-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

html.dark-theme .rating-title,
body.dark-theme .rating-title {
    color: #e5e7eb;
}

html.dark-theme .rating-card,
body.dark-theme .rating-card {
    background: #2d2d44;
    border-color: #3b3b55;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

html.dark-theme .rating-card.top-1,
body.dark-theme .rating-card.top-1 {
    background: linear-gradient(135deg, #3b2f1f 0%, #2f261a 100%);
    border-color: #f59e0b;
    box-shadow: 0 18px 36px rgba(245, 158, 11, 0.25);
}

html.dark-theme .rating-card.top-2,
body.dark-theme .rating-card.top-2 {
    background: linear-gradient(135deg, #2b2f4b 0%, #25283f 100%);
    border-color: #94a3b8;
    box-shadow: 0 16px 32px rgba(148, 163, 184, 0.18);
}

html.dark-theme .rating-card.top-3,
body.dark-theme .rating-card.top-3 {
    background: linear-gradient(135deg, #3a2e20 0%, #2f261a 100%);
    border-color: #f59e0b;
    box-shadow: 0 16px 32px rgba(245, 158, 11, 0.2);
}

html.dark-theme .rating-card:hover,
body.dark-theme .rating-card:hover {
    border-color: #667eea;
    box-shadow: 0 16px 26px rgba(0, 0, 0, 0.45);
}

html.dark-theme .rating-rank,
body.dark-theme .rating-rank {
    background: transparent;
    color: #c7d2fe;
}

html.dark-theme .rating-card.top-1 .rating-rank,
body.dark-theme .rating-card.top-1 .rating-rank {
    color: #fcd34d;
}

html.dark-theme .rating-avatar-placeholder,
body.dark-theme .rating-avatar-placeholder {
    color: #6b7280;
}

html.dark-theme .rating-name,
body.dark-theme .rating-name {
    color: #e5e7eb;
}

html.dark-theme .rating-chip,
body.dark-theme .rating-chip {
    background: #1f233a;
    border-color: #353550;
    color: #cbd5f5;
}

html.dark-theme .rating-score-value,
body.dark-theme .rating-score-value {
    color: #c7d2fe;
}

html.dark-theme .rating-score-label,
body.dark-theme .rating-score-label {
    color: #cbd5f5;
}

html.dark-theme .rating-empty,
body.dark-theme .rating-empty {
    color: #cbd5f5;
}

@media (max-width: 768px) {
    .rating-card {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .rating-rank {
        width: 48px;
        height: 48px;
        font-size: 1.2em;
    }
    
    .rating-avatar {
        width: 50px;
        height: 50px;
    }
    
    .rating-name {
        font-size: 1em;
    }
    
    .rating-stats {
        gap: 10px;
    }
    
    .rating-chip {
        font-size: 0.78em;
    }
    
    .rating-score {
        min-width: auto;
        width: auto;
        text-align: right;
        margin-top: 0;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .rating-score-value {
        font-size: 1.4em;
    }

    .avatar-wrapper {
        display: block; /* Показываем значок профиля на мобильных */
        position: relative;
    }

    .avatar-dropdown {
        right: 0;
        left: auto;
        min-width: 160px;
        max-width: calc(100vw - 20px);
        width: auto;
        transform: translateX(0);
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    header h1 {
        flex: 1;
        min-width: 0;
        margin: 0;
    }


    .quiz-item {
        padding: 10px;
    }

    .quiz-item-title {
        font-size: 0.95em;
    }

    .quiz-info {
        font-size: 0.8em;
    }
}

/* Футер - минималистичный дизайн */
.main-footer {
    margin-top: auto;
    padding: 12px 0;
    border-top: 1px solid #cfd6f6;
    background: linear-gradient(135deg, #e7ecff 0%, #d7ddff 100%);
    text-align: center;
    font-size: 0.9em;
    color: #4b5563;
    flex-shrink: 0;
}

body.dark-theme .main-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1f233a 0%, #2b2f4b 100%);
    color: #cbd5f5;
}

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

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.footer-links a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-links a:hover {
    color: #3730a3;
    text-decoration: underline;
}

body.dark-theme .footer-links a {
    color: #cbd5f5;
}

body.dark-theme .footer-links a:hover {
    color: #ffffff;
}

.footer-copyright {
    color: #6b7280;
    font-size: 0.85em;
}

body.dark-theme .footer-copyright {
    color: #94a3b8;
}

@media (max-width: 600px) {
    .main-footer {
        margin-top: 40px;
        padding: 10px 0;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-content {
        gap: 12px;
    }
}

