
/* Основной контейнер */

body.page-games .games-container {
    width: min(var(--content-w), calc(100% - var(--page-gutter) * 2));
    margin-inline: auto;
    padding: var(--page-padding) 0 80px;
    min-height: calc(100vh - 200px);
}

body.page-games .games-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(var(--palette-primary-rgb), 0.3);
}

body.page-games .games-title i {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

/* Секция игр */

body.page-games .games-section {
    margin-bottom: 40px;
}

body.page-games .section-subtitle {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-games .section-subtitle i {
    color: var(--accent-gold);
    font-size: 1.6rem;
}

/* Матрица игр */

body.page-games .games-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    overflow: visible;
    position: relative;
}

body.page-games .game-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    border: 1px solid var(--color-border);
    cursor: pointer;
    position: relative;
    height: 100%;
    min-height: 372px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    will-change: transform;
}

/* Кафедральные инженерные кейсы */

body.page-games .case-department {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-bottom: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(var(--palette-primary-rgb), 0.16);
    border-radius: 999px;
    background: rgba(var(--palette-primary-rgb), 0.14);
    color: var(--bold-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.page-games .case-source-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 14px;
}

body.page-games .case-department-modal {
    margin-bottom: 0;
}

body.page-games .case-department-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

body.page-games .task-question-text {
    white-space: pre-line;
}

body.page-games .case-task-figure {
    margin: 18px 0 2px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(88, 199, 255, 0.24);
    border-radius: 12px;
    background: #fff;
}

body.page-games .case-task-figure img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

body.page-games .case-task-figure figcaption {
    margin-top: 8px;
    color: #34495e;
    font-size: 0.82rem;
    text-align: center;
}

body.page-games .case-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

body.page-games .case-answer-input.is-invalid {
    border-color: #ff6574;
    box-shadow: 0 0 0 3px rgba(255, 101, 116, 0.14);
}

@media (max-width: 640px) {
    body.page-games .case-answer-grid {
        grid-template-columns: 1fr;
    }

    body.page-games .case-task-figure {
        margin-inline: -8px;
        padding: 6px;
    }
}

body.page-games .game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
    z-index: 5;
}

body.page-games .game-image {
    height: 164px;
    width: 100%;
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.page-games .game-image::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18));
}

body.page-games .game-cover {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-smooth);
}

body.page-games .game-card[data-game-id="pong"] .game-cover,
        body.page-games .game-card[data-game-id="traffic-racer"] .game-cover {
    object-fit: contain;
    padding: 8px;
    background: var(--palette-night);
}

body.page-games .game-cover-fallback {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 22px 18px 18px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 34%),
                linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.22));
}

body.page-games .game-cover-grid,
        body.page-games .game-cover-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body.page-games .game-cover-grid {
    background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.2;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), #000 44%, rgba(0, 0, 0, 0.2));
}

body.page-games .game-cover-lines {
    background: linear-gradient(118deg, transparent 0 30%, rgba(255, 255, 255, 0.16) 30% 31%, transparent 31% 100%),
                linear-gradient(58deg, transparent 0 54%, rgba(255, 255, 255, 0.12) 54% 55%, transparent 55% 100%);
    opacity: 0.68;
}

body.page-games .game-cover-fallback i {
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(3.4rem, 5vw, 4.8rem);
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.28));
}

body.page-games .game-cover-fallback strong {
    display: none;
}

body.page-games .game-card:hover .game-cover {
    transform: scale(1.06);
    filter: saturate(1.12) contrast(1.04);
}

body.page-games .game-image i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition-smooth);
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}

body.page-games .game-card:hover .game-image i {
    transform: scale(1.2) rotate(5deg);
    color: white;
    filter: drop-shadow(0 0 30px rgba(255,255,255,0.6));
}

body.page-games .game-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: var(--jet-black);
    background: #ffffff;
}

body.page-games .game-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--jet-black);
    margin-bottom: 6px;
    min-height: 1.35em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body.page-games .game-description {
    color: var(--color-muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
    flex: 1;
    min-height: 4.05em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

body.page-games .game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

body.page-games .game-xp {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bold-blue);
    font-weight: 600;
    font-size: 1rem;
}

body.page-games .game-play-btn {
    background: var(--bold-blue);
    color: var(--soft-white);
    border: 1px solid var(--bold-blue);
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

body.page-games .game-play-btn:hover {
    background: color-mix(in srgb, var(--bold-blue), var(--jet-black) 18%);
    border-color: color-mix(in srgb, var(--bold-blue), var(--jet-black) 18%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(var(--palette-primary-rgb), 0.18);
}

body.page-games .game-play-btn.completed {
    border-color: var(--color-border);
    background: var(--surface-2);
    color: var(--navy);
}

/* Стили для задач */

body.page-games .task-card {
    min-height: 480px;
    background: #ffffff;
    border-left: 0;
}

body.page-games .case-card {
    min-height: 480px;
    border-left-color: var(--palette-aqua);
}

body.page-games .task-preview {
    background: rgba(var(--palette-primary-rgb), 0.12);
    border-radius: 8px;
    padding: 10px;
    margin: 12px 0;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--bold-blue);
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
}

body.page-games .task-preview code {
    color: var(--jet-black);
    font-weight: 700;
}

body.page-games .task-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Статистика */

body.page-games .games-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

body.page-games .stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease;
}

body.page-games .stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-strong);
}

body.page-games .stat-number {
    font-size: 2.2rem;
    font-weight: bold;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

body.page-games .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Поиск и фильтры */

body.page-games .search-container {
    position: relative;
    margin-bottom: 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

body.page-games .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bold-blue);
    pointer-events: none;
}

body.page-games .search-box {
    width: 100%;
    padding: 14px 18px 14px 50px;
    background: transparent;
    border: 0;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s;
}

body.page-games .search-box::placeholder {
    color: var(--color-muted-foreground);
}

body.page-games .search-box:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(var(--palette-primary-rgb), 0.72), 0 0 0 4px rgba(var(--palette-primary-rgb), 0.16);
}

body.page-games .filters-container {
    display: flex;
    align-items: stretch;
    gap: 14px 18px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 14px;
}

body.page-games .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.page-games .filter-group-label {
    color: var(--bold-blue);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

body.page-games .filter-btn {
    padding: 8px 16px;
    background: rgba(var(--palette-primary-rgb), 0.14);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

body.page-games .filter-btn.active {
    background: var(--bold-blue);
    color: var(--soft-white);
    box-shadow: 0 8px 18px rgba(var(--palette-primary-rgb), 0.18);
}

body.page-games .filter-btn:not(.active):hover {
    transform: translateY(-2px);
    background: rgba(var(--palette-primary-rgb), 0.24);
    color: var(--bold-blue);
}

/* Игровое поле - УЛУЧШЕННЫЙ ДИЗАЙН */

body.page-games .game-canvas-container {
    background: linear-gradient(145deg, var(--palette-night), #030812);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid var(--primary-blue);
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 50px rgba(var(--palette-primary-rgb), 0.2);
}

body.page-games .game-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
}

body.page-games .game-screen .game-canvas-container {
    width: min(100%, 720px);
}

body.page-games .game-canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(0, 200, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

body.page-games #tetrisCanvas,
body.page-games #flappyCanvas,
body.page-games #snakeCanvas,
body.page-games #pongCanvas,
body.page-games #memoryCanvas {
    background: var(--palette-night);
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 30px rgba(var(--palette-primary-rgb), 0.3);
    position: relative;
    z-index: 2;
}

body.page-games .game-help {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 720px;
    width: 100%;
    padding: 0 10px;
}

body.page-games .game-help kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 2px 7px;
    font-size: 0.82rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.page-games .game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(var(--palette-primary-rgb), 0.3);
    z-index: 2;
}

body.page-games .game-score {
    color: var(--accent-gold);
    font-weight: 600;
}

body.page-games .game-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 2;
}

body.page-games .game-btn {
    padding: 10px 25px;
    background: var(--primary-blue);
    color: white;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

body.page-games .game-btn:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--palette-primary-rgb), 0.4);
}

body.page-games .game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.page-games .game-btn.danger {
    background: var(--accent-red);
}

body.page-games .game-btn.danger:hover {
    background: #ff4d4d;
}

/* Пустое состояние */

body.page-games .empty-games {
    text-align: center;
    padding: 50px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px dashed rgba(var(--palette-primary-rgb), 0.3);
    grid-column: 1 / -1;
}

body.page-games .empty-games i {
    font-size: 4rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    opacity: 0.5;
}

body.page-games .empty-games h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

body.page-games .empty-games p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Модальное окно - УЛУЧШЕННЫЙ ДИЗАЙН */

body.page-games .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: clamp(10px, 2vh, 20px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

body.page-games #gameModal.game-modal-play {
    padding: 0;
    background: rgba(0, 0, 0, 0.94);
    overflow: hidden;
}

body.page-games:has(#gameModal.game-modal-play) .support-dock {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.page-games .modal-content {
    background: #ffffff;
    border-radius: 24px;
    width: 95%;
    max-width: 900px;
    max-height: calc(100dvh - 2 * clamp(10px, 2vh, 20px));
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.page-games .modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    box-shadow: none;
    line-height: 1;
}

body.page-games .modal-close:hover {
    color: var(--accent-red);
    background: transparent;
}

body.page-games .modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid var(--color-border);
}

body.page-games .modal-title {
    font-size: 1.6rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-games .modal-body {
    padding: 25px 30px;
}

body.page-games #gameModal.game-modal-play .modal-content.external-mode {
    max-width: none;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: radial-gradient(900px 520px at 50% 15%, rgba(0, 143, 224, 0.18), transparent 66%),
                linear-gradient(180deg, #050b13 0%, var(--palette-night) 100%);
}

body.page-games #gameModal.game-modal-play .modal-close {
    top: clamp(10px, 1.4vw, 18px);
    right: clamp(10px, 1.4vw, 18px);
    z-index: 40;
    width: 34px;
    height: 34px;
    font-size: 1.8rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    box-shadow: none;
}

body.page-games #gameModal.game-modal-play .modal-header {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.page-games #gameModal.game-modal-play .modal-title {
    font-size: 1rem;
}

body.page-games #gameModal.game-modal-play .modal-content.external-mode .modal-body {
    padding: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.page-games .external-game-shell {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    background: var(--palette-night);
}

body.page-games .external-game-toolbar {
    position: relative;
    z-index: 24;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 66px 8px clamp(12px, 1.4vw, 18px);
    border-bottom: 1px solid rgba(90, 176, 245, 0.2);
    background: rgba(4, 12, 22, 0.92);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

body.page-games .external-game-mini-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

body.page-games .external-game-mini-title span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

body.page-games .external-game-mini-title i {
    color: #fff;
    font-size: 1.1rem;
}

body.page-games .external-game-mini-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.98rem, 1.25vw, 1.12rem);
    line-height: 1.1;
}

body.page-games .external-game-frame-wrap {
    position: relative;
    border-radius: 0;
    border: 0;
    overflow: hidden;
    background: var(--palette-night);
    box-shadow: none;
    min-height: 0;
    height: 100%;
    contain: layout paint;
}

body.page-games .external-game-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
    opacity: 0;
    transition: opacity 0.28s ease;
}

body.page-games .external-game-shell.is-loaded .external-game-frame {
    opacity: 1;
}

body.page-games .external-game-loader {
    position: absolute;
    inset: 0;
    z-index: 18;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(540px 360px at 50% 42%, rgba(0, 143, 224, 0.24), transparent 72%),
                linear-gradient(180deg, rgba(5, 12, 22, 0.98), rgba(2, 7, 13, 0.98));
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.page-games .external-game-shell.is-loaded .external-game-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.page-games .external-game-loader-card {
    width: min(360px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    color: var(--text-primary);
}

body.page-games .external-game-loader-icon {
    width: clamp(82px, 10vw, 118px);
    height: clamp(82px, 10vw, 118px);
    display: grid;
    place-items: center;
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

body.page-games .external-game-loader-icon i {
    color: #fff;
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

body.page-games .external-game-loader-card strong {
    font-size: clamp(1.25rem, 2.6vw, 2rem);
    line-height: 1.1;
    text-transform: uppercase;
}

body.page-games .external-game-loader-card span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

body.page-games .external-game-loader-bar {
    width: min(220px, 72vw);
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

body.page-games .external-game-loader-bar i {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #45b8ff, #9ee7ff);
    animation: gameLoaderMove 1.05s ease-in-out infinite;
}

@keyframes gameLoaderMove {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(260%);
    }
}

body.page-games .task-card-full {
    background: rgba(var(--palette-primary-rgb), 0.1);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
}

body.page-games .task-card-full h3 {
    color: var(--bold-blue);
    margin-bottom: 12px;
    font-size: 1.15rem;
}

body.page-games .task-card-full p {
    color: var(--jet-black);
    line-height: 1.6;
}

body.page-games .task-hint-card {
    background: rgba(var(--palette-primary-rgb), 0.14);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 18px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Формы авторизации */

body.page-games .form-group {
    margin-bottom: 18px;
}

body.page-games .form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

body.page-games .form-input,
body.page-games .form-select {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

body.page-games .form-input:focus,
body.page-games .form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: rgba(var(--palette-primary-rgb), 0.1);
}

body.page-games .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

body.page-games .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    flex: 1;
    font-size: 0.95rem;
    transition: all 0.3s;
}

body.page-games .btn-primary {
    background: var(--primary-blue);
    color: white;
}

body.page-games .btn-primary:hover {
    background: var(--secondary-blue);
}

body.page-games .btn-secondary {
    background: rgba(var(--palette-primary-rgb), 0.14);
    color: var(--bold-blue);
    border: 1px solid var(--color-border);
}

body.page-games .btn-secondary:hover {
    background: rgba(var(--palette-primary-rgb), 0.24);
    color: var(--bold-blue);
}

/* Уведомления */

body.page-games .notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-heavy);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

body.page-games .notification.error {
    background: linear-gradient(135deg, #e63946, #ff6b6b);
}

/* Футер */
/* Адаптивность */

@media (max-width: 768px) {
    body.page-games .header {
        padding: 0 15px;
    }

    body.page-games .logo-text {
        font-size: 1rem;
    }

    body.page-games .xp-badge span:not(.fa-star) {
        display: none;
    }

    body.page-games .games-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    body.page-games .games-matrix {
        grid-template-columns: 1fr;
    }

    body.page-games .modal-content {
        width: 95%;
    }

    body.page-games .modal-body {
        padding: 20px;
    }

    body.page-games #gameModal.game-modal-play .modal-content.external-mode {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    body.page-games #gameModal.game-modal-play .modal-content.external-mode .modal-body {
        padding: 0;
    }

    body.page-games #gameModal.game-modal-play .modal-header {
        min-height: 0;
        padding: 0;
    }

    body.page-games .external-game-toolbar {
        min-height: 54px;
        padding: 7px 58px 7px 8px;
    }

    body.page-games .external-game-mini-title {
        gap: 8px;
    }

    body.page-games .external-game-mini-title span {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    body.page-games .external-game-mini-title strong {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body.page-games .games-stats {
        grid-template-columns: 1fr;
    }

    body.page-games .filters-container {
        justify-content: flex-start;
        padding: 12px;
    }

    body.page-games .filter-group {
        width: 100%;
        padding-right: 0;
        padding-bottom: 10px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    body.page-games .filter-group:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    body.page-games .filter-group-label {
        width: 100%;
    }

    body.page-games .filter-btn {
        flex: 1 1 calc(50% - 8px);
        padding: 7px 10px;
        font-size: 0.85rem;
        text-align: center;
    }
}
