/* games.css - исправленная версия */

.games-container {
    padding: 4px 16px 16px 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 600px;
}

#games-page .game-item {
    background:
        linear-gradient(180deg, rgba(43, 50, 70, 0.96), rgba(24, 29, 42, 0.98)),
        linear-gradient(145deg, #2a2f42, #1e2332);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(126, 136, 164, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: visible;
}

#games-page .game-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.32), transparent);
    opacity: 0.76;
}

#games-page .game-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 223, 143, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#games-page .game-item-secondary-rating {
    background:
        linear-gradient(180deg, rgba(50, 52, 62, 0.94), rgba(27, 30, 39, 0.98)),
        linear-gradient(90deg, rgba(116, 94, 35, 0.22), rgba(42, 47, 66, 0.03) 58%);
    border-color: rgba(184, 156, 99, 0.22);
    box-shadow:
        inset 4px 0 0 rgba(178, 149, 88, 0.42),
        0 14px 34px rgba(0, 0, 0, 0.24);
}

#games-page .game-item-secondary-rating::before {
    background: linear-gradient(90deg, transparent, rgba(186, 160, 105, 0.44), transparent);
}

#games-page .game-item-secondary-rating:hover {
    border-color: rgba(194, 166, 107, 0.34);
    box-shadow:
        inset 4px 0 0 rgba(188, 158, 98, 0.54),
        0 7px 22px rgba(0, 0, 0, 0.34);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 223, 143, 0.18);
    position: relative;
    flex-wrap: wrap;
    gap: 12px;
    overflow: visible;
}

.game-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    justify-content: center;
    overflow: visible;
}

.game-title-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
    overflow: visible;
    position: relative;
}

.game-title-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
    flex: 1;
    min-width: 0;
    gap: 8px;
    overflow: visible;
}

.game-id {
    color: #ffdf8f;
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.game-date {
    color: #b8b8b8;
    font-size: 0.95em;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-creator {
    color: #ffdf8f;
    font-size: 0.95em;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-creator .creator-label {
    color: #b8b8b8;
    font-weight: 500;
    margin-right: 4px;
}

.auto-badge, .manual-badge, .game-duration-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
    white-space: nowrap;
    height: fit-content;
    flex-shrink: 0;
}

.auto-badge {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.2), rgba(160, 160, 160, 0.1));
    color: #b8b8b8;
    border: 1px solid rgba(160, 160, 160, 0.3);
}

.manual-badge {
    background: linear-gradient(135deg, rgba(255, 223, 143, 0.2), rgba(255, 223, 143, 0.1));
    color: #ffdf8f;
    border: 1px solid rgba(255, 223, 143, 0.3);
}

.game-duration-badge {
    padding: 4px 9px;
    background: linear-gradient(135deg, rgba(107, 255, 113, 0.18), rgba(107, 255, 113, 0.08));
    color: #8dff92;
    border: 1px solid rgba(107, 255, 113, 0.28);
    text-transform: none;
    letter-spacing: 0.15px;
    font-size: 0.78em;
    line-height: 1.1;
}

.game-duration-badge.short {
    background: linear-gradient(135deg, rgba(126, 136, 164, 0.18), rgba(126, 136, 164, 0.07));
    color: rgba(214, 221, 237, 0.72);
    border: 1px solid rgba(126, 136, 164, 0.24);
}

.game-duration-badge.medium {
    background: linear-gradient(135deg, rgba(255, 196, 92, 0.24), rgba(96, 190, 255, 0.1));
    color: #ffd98a;
    border: 1px solid rgba(255, 196, 92, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.game-duration-badge.long {
    background: linear-gradient(135deg, rgba(86, 220, 128, 0.27), rgba(52, 185, 212, 0.12));
    color: #a8ffbe;
    border: 1px solid rgba(107, 255, 147, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 16px rgba(86, 220, 128, 0.12);
}

.game-status {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    line-height: 1.2;
    flex-shrink: 0;
    height: fit-content;
    margin-left: 0;
}

.game-status.pending {
    background: linear-gradient(135deg, rgba(255, 223, 143, 0.15), rgba(255, 223, 143, 0.05));
    color: #ffdf8f;
    border: 1px solid rgba(255, 223, 143, 0.25);
    box-shadow: 0 2px 8px rgba(255, 223, 143, 0.1);
}

.game-status.completed {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    color: #6bff71;
    border: 1px solid rgba(76, 175, 80, 0.25);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

/* ИСПРАВЛЕННОЕ КЕБАБ-МЕНЮ */
.kebab-menu {
    position: relative;
    flex-shrink: 0;
    align-self: center;
    z-index: 100;
}

/* УМЕНЬШЕННАЯ КНОПКА 30x30 */
.kebab-btn {
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 223, 143, 0.16), transparent 45%),
        linear-gradient(180deg, rgba(66, 72, 94, 0.96), rgba(36, 41, 58, 0.96));
    border: 1px solid rgba(150, 161, 191, 0.24);
    color: #d8def0;
    padding: 6px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    box-shadow:
        0 10px 22px rgba(5, 8, 16, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    z-index: 101;
}

.kebab-btn:hover {
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 223, 143, 0.24), transparent 45%),
        linear-gradient(180deg, rgba(82, 88, 112, 0.98), rgba(46, 52, 72, 0.98));
    transform: translateY(-1px);
    border-color: rgba(255, 223, 143, 0.38);
    box-shadow:
        0 14px 28px rgba(5, 8, 16, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #fff4d0;
}

.kebab-btn:focus-visible {
    outline: none;
    border-color: rgba(255, 223, 143, 0.6);
    box-shadow:
        0 0 0 3px rgba(255, 223, 143, 0.18),
        0 14px 28px rgba(5, 8, 16, 0.34);
}

.civilization-import-modal {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.civilization-import-modal-content {
    position: relative;
    width: min(440px, 100%);
    margin: 0;
}

.civilization-import-modal-content h2 {
    margin: 0 36px 10px 0;
}

.civilization-import-description {
    margin: 0 0 20px;
    color: var(--text-secondary, #aeb6c2);
    line-height: 1.45;
}

.civilization-import-modal-content label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

#civilization-import-match-id {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
}

#completed-match-import-match-id,
#completed-match-import-player {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
}

.completed-match-import-modal label:not(:first-of-type) {
    margin-top: 14px;
}

.civilization-import-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    cursor: pointer;
}

.civilization-import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.civilization-import-submit,
.completed-match-import-submit,
.civilization-import-cancel.secondary,
.completed-match-import-cancel.secondary {
    min-height: 42px;
    padding: 11px 20px;
    border: 2px solid #3a3f5a;
    border-radius: 10px;
    background: linear-gradient(145deg, #2a2f42, #1e2332);
    color: #ffdf8f;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
        box-shadow 0.3s ease, transform 0.3s ease;
}

.civilization-import-submit:hover:not(:disabled),
.completed-match-import-submit:hover:not(:disabled) {
    background: linear-gradient(145deg, #32374e, #242940);
    border-color: #ffdf8f;
    box-shadow: 0 4px 15px rgba(255, 223, 143, 0.3);
    transform: translateY(-2px);
}

.civilization-import-cancel.secondary,
.completed-match-import-cancel.secondary {
    border-color: #5a5f73;
    color: #aeb3c5;
}

.civilization-import-cancel.secondary:hover,
.completed-match-import-cancel.secondary:hover {
    background: linear-gradient(145deg, #32374e, #242940);
    border-color: #8a8fa3;
    color: #ffdf8f;
    box-shadow: 0 3px 12px rgba(138, 143, 163, 0.28);
    transform: translateY(-1px);
}

.civilization-import-submit:focus-visible,
.completed-match-import-submit:focus-visible,
.civilization-import-cancel.secondary:focus-visible,
.completed-match-import-cancel.secondary:focus-visible {
    outline: 3px solid rgba(255, 223, 143, 0.18);
    outline-offset: 2px;
}

.civilization-import-submit:disabled,
.completed-match-import-submit:disabled {
    cursor: wait;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

/* ИСПРАВЛЕННЫЙ DROPDOWN */
.kebab-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background:
        linear-gradient(180deg, rgba(40, 46, 64, 0.98), rgba(20, 24, 36, 0.98));
    border: 1px solid rgba(255, 223, 143, 0.22);
    border-radius: 16px;
    padding: 6px;
    z-index: 1000;
    backdrop-filter: blur(18px);
    box-shadow:
        0 22px 44px rgba(2, 4, 10, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    overflow: hidden;
}

.kebab-dropdown button {
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: #edf2ff;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid rgba(122, 133, 163, 0.16);
    border-radius: 10px;
    font-size: 0.92em;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kebab-dropdown button:hover {
    background: linear-gradient(135deg, rgba(255, 223, 143, 0.12), rgba(119, 130, 166, 0.12));
    color: #ffdf8f;
    transform: translateX(2px);
}

.kebab-dropdown button:focus-visible {
    outline: none;
    background: linear-gradient(135deg, rgba(255, 223, 143, 0.14), rgba(119, 130, 166, 0.14));
    color: #ffdf8f;
}

.kebab-dropdown button:last-child {
    border-bottom: none;
}

.kebab-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.game-map-info {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 4px;
    min-width: 0;
    white-space: nowrap;
}

.game-rating-type {
    font-size: 0.78em;
    font-weight: 700;
    color: #d9e7f5;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 3px 8px;
}

.map-name {
    color: #ffdf8f;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.map-name::before {
    content: '🗺️';
    font-size: 0.9em;
}

.game-mode {
    color: #b8b8b8;
    font-size: 0.9em;
    font-weight: 500;
    background: rgba(255, 223, 143, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 223, 143, 0.2);
    flex-shrink: 0;
}

.game-teams {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
}

#games-page .game-team {
    flex: 1;
    background: rgba(24, 29, 42, 0.58);
    border-radius: 9px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(126, 136, 164, 0.14);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    min-width: 0;
    overflow: hidden;
}

#games-page .game-team:hover {
    border-color: rgba(255, 223, 143, 0.28);
    background: rgba(30, 37, 52, 0.7);
    transform: translateY(-1px);
}

#games-page .game-team.winner {
    border: 1px solid rgba(107, 255, 113, 0.5);
    background:
        linear-gradient(90deg, rgba(59, 118, 64, 0.24), rgba(24, 29, 42, 0.72) 66%),
        rgba(24, 29, 42, 0.58);
    box-shadow:
        inset 4px 0 0 rgba(107, 255, 113, 0.54),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#games-page .game-team.loser {
    border: 1px solid rgba(255, 107, 107, 0.48);
    background:
        linear-gradient(90deg, rgba(120, 36, 54, 0.22), rgba(24, 29, 42, 0.72) 66%),
        rgba(24, 29, 42, 0.58);
    box-shadow:
        inset 4px 0 0 rgba(255, 107, 107, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.game-team h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #ffdf8f;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-team.winner h4 {
    color: #6bff71;
}

.game-team.loser h4 {
    color: #ff6b6b;
}

.team-rating {
    color: #b8b8b8;
    font-size: 0.9em;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

.players-list {
    list-style: none;
    margin-bottom: 8px;
    flex-grow: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#games-page .players-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background:
        linear-gradient(180deg, rgba(36, 43, 59, 0.92), rgba(24, 30, 43, 0.94)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.035), transparent 64%);
    border-radius: 9px;
    border: 1px solid rgba(126, 136, 164, 0.18);
    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    min-height: 44px;
}

#games-page .players-list li:hover {
    background:
        linear-gradient(180deg, rgba(43, 52, 70, 0.96), rgba(28, 36, 51, 0.98)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.06), transparent 64%);
    border-color: rgba(255, 223, 143, 0.26);
    box-shadow:
        0 7px 16px rgba(0, 0, 0, 0.24),
        0 0 10px rgba(255, 223, 143, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transform: translateY(-1px);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.player-color-indicator {
    width: 10px;
    height: 22px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.civilization-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.civilization-icon:not(.fallback) {
    background: none;
    border: none;
}

.civilization-icon:not(.fallback):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 223, 143, 0.2);
}

.civilization-icon img {
    width: 27px;
    height: 27px;
    object-fit: contain;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.civilization-icon:not(.fallback):hover img {
    transform: scale(1.1);
}

.civilization-icon.fallback {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.4);
    backdrop-filter: blur(5px);
}

.civilization-icon.fallback:hover {
    border-color: rgba(59, 130, 246, 0.6);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.civ-fallback {
    font-size: 10px;
    font-weight: 800;
    color: #bfdbfe;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: none;
}

.civilization-icon.fallback .civ-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.player-name {
    color: #fff9e7;
    font-weight: 600;
    flex: 1;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95em;
}

.rating-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.original-rating {
    color: #b8b8b8;
    font-size: 0.9em;
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

.rating-change {
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    min-width: 45px;
    text-align: center;
    background: rgba(30, 35, 50, 0.9);
    border: 1px solid;
    transition: all 0.3s ease;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
}

.rating-change:hover {
    transform: scale(1.05);
}

.rating-positive {
    color: #6bff71;
    border-color: #6bff71;
    background: linear-gradient(135deg, rgba(107, 255, 113, 0.15), rgba(107, 255, 113, 0.05));
    box-shadow: 0 2px 8px rgba(107, 255, 113, 0.2);
}

.rating-negative {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.rating-neutral {
    color: #b8b8b8;
    border-color: #b8b8b8;
    background: linear-gradient(135deg, rgba(184, 184, 184, 0.15), rgba(184, 184, 184, 0.05));
}

.player-rating-badge {
    background: linear-gradient(135deg, rgba(255, 223, 143, 0.15), rgba(255, 223, 143, 0.05));
    color: #ffdf8f;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
    border: 1px solid rgba(255, 223, 143, 0.2);
    backdrop-filter: blur(5px);
}

.win-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ffdf8f, #e6c97d);
    color: #181c29 !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 800;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(255, 223, 143, 0.4);
    width: 100%;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.win-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.win-btn:hover {
    background: linear-gradient(135deg, #ffe6a8, #f0d58a);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 223, 143, 0.6);
    color: #181c29 !important;
}

.win-btn:hover::before {
    left: 100%;
}

.win-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 15px rgba(255, 223, 143, 0.4);
}

.auto-match-info {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.15), rgba(160, 160, 160, 0.08));
    border: 1px solid rgba(160, 160, 160, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    text-align: center;
    font-size: 0.85em;
    color: #b8b8b8;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.auto-match-info:hover {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.2), rgba(160, 160, 160, 0.12));
    border-color: rgba(160, 160, 160, 0.4);
    transform: translateY(-1px);
}

.vs {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffdf8f;
    font-weight: 800;
    font-size: 1.5em;
    text-shadow: 0 2px 8px rgba(255, 223, 143, 0.4);
    padding: 0 12px;
    min-width: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Game page visual experiment */
#games-page .games-list {
    gap: 18px;
}

#games-page .game-item {
    padding: 18px 24px 22px;
    background:
        linear-gradient(180deg, rgba(39, 46, 64, 0.96), rgba(18, 23, 34, 0.985)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.04), transparent 42%);
    border-color: rgba(126, 136, 164, 0.24);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#games-page .game-item:hover {
    border-color: rgba(255, 223, 143, 0.28);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

#games-page .game-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom-color: rgba(126, 136, 164, 0.24);
}

#games-page .game-title-content {
    gap: 9px;
}

#games-page .game-id {
    font-size: 1.34rem;
    letter-spacing: 0;
}

#games-page .game-date,
#games-page .game-creator,
#games-page .game-creator .creator-label {
    color: rgba(214, 221, 237, 0.72);
}

#games-page .auto-badge,
#games-page .manual-badge,
#games-page .game-duration-badge,
#games-page .game-status,
#games-page .game-mode,
#games-page .game-rating-type {
    border-radius: 999px;
    box-shadow: none;
}

#games-page .game-map-info {
    margin-top: 0;
    gap: 8px;
}

#games-page .map-name {
    color: #f7d986;
}

#games-page .game-mode {
    padding: 3px 8px;
    color: rgba(235, 240, 250, 0.78);
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(126, 136, 164, 0.2);
}

#games-page .game-duration-badge.short {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#games-page .game-duration-badge.medium {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#games-page .game-duration-badge.long {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 16px rgba(86, 220, 128, 0.12);
}

@media (min-width: 1180px) {
    #games-page .game-title-content {
        flex-wrap: nowrap;
    }

    #games-page .game-creator {
        max-width: 230px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #games-page .game-map-info {
        flex: 0 1 auto;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    #games-page .map-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

#games-page .game-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

#games-page .game-team {
    padding: 16px 17px 18px;
    background:
        linear-gradient(180deg, rgba(23, 29, 43, 0.86), rgba(14, 19, 30, 0.9)),
        linear-gradient(145deg, rgba(126, 136, 164, 0.06), transparent 54%);
    border-color: rgba(126, 136, 164, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 10px 24px rgba(0, 0, 0, 0.16);
}

#games-page .game-team:hover {
    background:
        linear-gradient(180deg, rgba(27, 34, 49, 0.92), rgba(17, 23, 35, 0.94)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.035), transparent 54%);
}

#games-page .game-team.winner {
    border-color: rgba(95, 223, 117, 0.52);
    background:
        linear-gradient(90deg, rgba(54, 115, 67, 0.3), transparent 42%),
        linear-gradient(180deg, rgba(23, 38, 36, 0.92), rgba(14, 24, 25, 0.94));
    box-shadow:
        inset 4px 0 0 rgba(95, 223, 117, 0.68),
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 24px rgba(0, 0, 0, 0.18);
}

#games-page .game-team.loser {
    border-color: rgba(229, 97, 105, 0.48);
    background:
        linear-gradient(90deg, rgba(112, 43, 60, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(35, 25, 37, 0.92), rgba(21, 18, 30, 0.94));
    box-shadow:
        inset 4px 0 0 rgba(229, 97, 105, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 10px 24px rgba(0, 0, 0, 0.18);
}

#games-page .game-team h4 {
    margin: 0 0 6px;
    font-size: 1.03rem;
    letter-spacing: 0.01em;
    text-shadow: none;
}

#games-page .team-rating {
    margin-bottom: 14px;
    color: rgba(226, 232, 244, 0.66);
    font-size: 0.86rem;
}

#games-page .players-list {
    gap: 7px;
    margin-bottom: 0;
}

#games-page .players-list li {
    min-height: 48px;
    padding: 8px 10px;
    background:
        linear-gradient(180deg, rgba(34, 41, 57, 0.94), rgba(22, 28, 41, 0.98)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.025), transparent 62%);
    border-color: rgba(126, 136, 164, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 4px 10px rgba(0, 0, 0, 0.12);
}

#games-page .players-list li:hover {
    background:
        linear-gradient(180deg, rgba(39, 48, 66, 0.98), rgba(25, 33, 48, 0.98)),
        linear-gradient(145deg, rgba(255, 223, 143, 0.045), transparent 62%);
    border-color: rgba(255, 223, 143, 0.24);
}

#games-page .player-name {
    font-size: 0.94rem;
    color: rgba(255, 249, 231, 0.94);
}

#games-page .original-rating {
    color: rgba(226, 232, 244, 0.72);
}

#games-page .player-rating-badge,
#games-page .rating-change {
    min-width: 56px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(12, 17, 27, 0.52);
    box-shadow: none;
}

#games-page .rating-positive {
    color: #72ff8c;
    border-color: rgba(114, 255, 140, 0.74);
    background: rgba(30, 90, 45, 0.24);
}

#games-page .rating-negative {
    color: #ff7078;
    border-color: rgba(255, 112, 120, 0.72);
    background: rgba(100, 34, 45, 0.24);
}

#games-page .vs {
    align-self: center;
    justify-self: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 223, 143, 0.3), rgba(255, 223, 143, 0.08) 54%, transparent 72%),
        rgba(13, 18, 28, 0.72);
    border: 1px solid rgba(255, 223, 143, 0.18);
    color: #ffe39a;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-shadow: 0 0 12px rgba(255, 223, 143, 0.28);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.games-toolbar-title {
    position: relative;
    flex: 0 0 auto;
    margin: 0 8px 0 0;
    color: #ffd76c;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    text-shadow:
        0 1px 0 rgba(86, 54, 15, 0.44),
        0 0 12px rgba(255, 189, 63, 0.18),
        0 0 22px rgba(255, 153, 37, 0.1);
}

.games-toolbar-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.games-toolbar-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: min(88px, 100%);
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(255, 188, 67, 0.14), rgba(255, 212, 108, 0.72), rgba(255, 188, 67, 0.14), transparent);
    box-shadow: 0 0 16px rgba(255, 179, 54, 0.42);
    pointer-events: none;
}

.games-add-completed-match {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    padding: 0 0 2px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 108, 0.38);
    background: linear-gradient(180deg, rgba(71, 90, 121, 0.92), rgba(32, 46, 69, 0.96));
    color: #ffe39a;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.games-add-completed-match[hidden] {
    display: none !important;
}

.games-add-completed-match:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 215, 108, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.28);
}

.games-add-completed-match:focus-visible {
    outline: 3px solid rgba(255, 215, 108, 0.2);
    outline-offset: 2px;
}

.games-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: 12px;
    flex-wrap: wrap;
    background:
        radial-gradient(circle at 18% -20%, rgba(255, 209, 91, 0.07), transparent 30%),
        linear-gradient(180deg, rgba(14, 25, 40, 0.86), rgba(8, 16, 29, 0.94));
    border: 1px solid rgba(77, 101, 138, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 14px 30px rgba(0, 0, 0, 0.22);
}

.games-toolbar.has-pagination {
    padding-top: 7px;
    padding-bottom: 7px;
    gap: 9px 12px;
}

.games-search {
    display: block;
    min-width: 250px;
    max-width: 286px;
    flex: 0 1 286px;
    overflow: visible;
}

body.mobile-nav-open .games-search,
body.mobile-nav-open .games-search-input-wrap,
body.mobile-nav-open .games-search-suggestions {
    z-index: 1 !important;
}

body.mobile-nav-open .games-search-suggestions {
    display: none !important;
}

.games-search-input-wrap {
    position: relative;
    width: 100%;
    overflow: visible;
    z-index: 40;
}

.games-search-input-wrap::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 223, 143, 0.9);
    border-radius: 50%;
    pointer-events: none;
}

.games-search-input-wrap::after {
    content: "";
    position: absolute;
    top: calc(50% + 9px);
    left: 29px;
    width: 8px;
    height: 2px;
    transform: rotate(45deg);
    border-radius: 999px;
    background: rgba(255, 223, 143, 0.9);
    pointer-events: none;
}

.games-search-input {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 48px;
    border-radius: 10px;
    border: 1px solid rgba(77, 101, 138, 0.42);
    background: rgba(7, 17, 31, 0.68);
    color: rgba(239, 244, 255, 0.94);
    font-size: 0.95em;
    font-weight: 500;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 6px 18px rgba(0, 0, 0, 0.1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.games-search-submit {
    display: none;
}

.games-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(255, 223, 143, 0.28);
    filter: brightness(1.03);
}

.games-search-submit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
    filter: none;
}

.games-search-input::placeholder {
    color: rgba(200, 208, 230, 0.7);
}

.games-search-input:focus {
    outline: none;
    border-color: rgba(255, 223, 143, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 223, 143, 0.08);
}

.games-search-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 249, 231, 0.62);
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.games-search-clear:hover {
    color: #fff9e7;
    transform: translateY(-50%) scale(1.04);
}

.games-filter-btn,
.games-page-size {
    height: 50px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(126, 136, 164, 0.2);
    background: rgba(15, 24, 38, 0.72);
    color: rgba(239, 244, 255, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.games-filter-btn {
    gap: 12px;
    padding: 0 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.games-filter-icon {
    position: relative;
    width: 17px;
    height: 14px;
}

.games-filter-icon::before,
.games-filter-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 223, 143, 0.85);
    box-shadow: 0 6px 0 rgba(255, 223, 143, 0.85);
}

.games-filter-icon::before {
    top: 1px;
}

.games-filter-icon::after {
    bottom: 1px;
    width: 13px;
    left: 2px;
    box-shadow: none;
}

.games-filter-chevron {
    color: #ffdf8f;
    font-size: 1.05rem;
    line-height: 1;
}

.games-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 160;
    display: grid;
    gap: 6px;
    width: min(368px, calc(100vw - 24px));
    padding: 8px;
    border-radius: 14px;
    background: rgba(16, 20, 30, 0.96);
    border: 1px solid rgba(255, 223, 143, 0.18);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(10px);
}

.games-search-suggestions[hidden] {
    display: none !important;
}

.games-search-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(42, 47, 66, 0.7);
    color: #fff9e7;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.games-search-suggestion:hover,
.games-search-suggestion.active {
    background: rgba(255, 223, 143, 0.12);
    border-color: rgba(255, 223, 143, 0.28);
    transform: translateY(-1px);
}

.games-search-suggestion-name {
    font-weight: 700;
}

.games-search-suggestion-rating {
    color: #c8d0e6;
    font-size: 0.85em;
    white-space: nowrap;
}

.games-loading {
    display: grid;
    place-items: center;
    min-height: 220px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(36, 41, 58, 0.76), rgba(24, 29, 42, 0.72));
    border: 1px solid rgba(126, 136, 164, 0.16);
    color: #c8d0e6;
    font-weight: 700;
}

.games-summary {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    height: 42px;
    color: rgba(239, 244, 255, 0.94);
    font-size: 0.92em;
    font-weight: 600;
    padding: 0 16px;
    border-radius: 10px;
    background: rgba(7, 17, 31, 0.68);
    border: 1px solid rgba(77, 101, 138, 0.42);
    flex: 0 0 auto;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.games-summary::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ac56b;
    box-shadow: 0 0 12px rgba(74, 197, 107, 0.35);
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.games-toolbar.has-pagination .pagination {
    gap: 6px 8px;
}

.games-toolbar .pagination {
    margin-left: auto;
}

.pagination-bottom {
    margin-top: 18px;
}

.pagination-pages {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.pagination-page-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pagination-page-list::-webkit-scrollbar {
    display: none;
}

.pagination button {
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    background: rgba(7, 17, 31, 0.68);
    color: rgba(239, 244, 255, 0.94);
    border: 1px solid rgba(77, 101, 138, 0.42);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 6px 18px rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
    backdrop-filter: blur(5px);
}

.pagination button.pagination-nav {
    min-width: 42px;
    padding: 0 11px;
    background: rgba(7, 17, 31, 0.68);
}

.pagination button:hover:not(:disabled) {
    background: rgba(255, 223, 143, 0.08);
    transform: translateY(-1px);
    border-color: rgba(255, 223, 143, 0.4);
    box-shadow: 0 6px 20px rgba(255, 223, 143, 0.2);
}

.pagination button.active {
    background: linear-gradient(180deg, #ffd777, #e8ad33);
    color: #181c29;
    border-color: rgba(255, 216, 117, 0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.36),
        0 0 18px rgba(255, 185, 57, 0.44),
        0 8px 18px rgba(194, 128, 26, 0.2);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination button.active:disabled {
    opacity: 1;
    cursor: default;
}

.pagination-ellipsis {
    color: #9ea9c4;
    font-weight: 700;
    letter-spacing: 0.2em;
    padding: 0 2px;
}

.pagination-info {
    display: none;
}

.pagination-total {
    display: none;
}

.games-page-size {
    padding: 0 12px 0 16px;
}

.games-page-size-select {
    min-width: 150px;
    height: 100%;
    padding: 0 30px 0 0;
    border: 0;
    outline: 0;
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, #ffdf8f 50%) right 9px center / 6px 6px no-repeat,
        linear-gradient(135deg, #ffdf8f 50%, transparent 50%) right 3px center / 6px 6px no-repeat;
    color: rgba(239, 244, 255, 0.94);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.color-blue { background: linear-gradient(135deg, #0047AB, #003399); }
.color-red { background: linear-gradient(135deg, #DC143C, #B22222); }
.color-green { background: linear-gradient(135deg, #228B22, #006400); }
.color-yellow { background: linear-gradient(135deg, #FFD700, #DAA520); }
.color-teal { background: linear-gradient(135deg, #40E0D0, #20B2AA); }
.color-purple { background: linear-gradient(135deg, #8A2BE2, #6A0DAD); }
.color-gray { background: linear-gradient(135deg, #808080, #696969); }
.color-orange { background: linear-gradient(135deg, #FF8C00, #FF7F00); }
.color-unknown { background: linear-gradient(135deg, #666666, #555555); }

.error-message {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    font-weight: 700;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2);
}

.placeholder {
    text-align: center;
    color: #b8b8b8;
    padding: 40px;
    font-style: italic;
    font-size: 1.1em;
    font-weight: 500;
}

.game-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 35, 50, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.18s ease-out;
    will-change: opacity, transform;
}

.game-loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 223, 143, 0.2);
    border-top: 3px solid #ffdf8f;
    border-radius: 50%;
    animation: spin 0.72s linear infinite;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(255, 223, 143, 0.3);
}

.game-loading-text {
    color: #ffdf8f;
    font-weight: 600;
    font-size: 0.95em;
    text-align: center;
    letter-spacing: 0.5px;
}

.game-success-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    animation: scaleIn 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-shadow: 0 4px 15px rgba(107, 255, 113, 0.5);
}

.game-loading-overlay.success {
    background: linear-gradient(135deg, rgba(107, 255, 113, 0.1), rgba(30, 35, 50, 0.95));
    border: 1px solid rgba(107, 255, 113, 0.3);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Мобильная адаптация */
@media (max-width: 1024px) {
    .game-header {
        flex-wrap: wrap;
        overflow: visible;
    }

    .game-title-content {
        gap: 10px;
        flex-wrap: wrap;
        overflow: visible;
    }

    .game-id {
        font-size: 1.2em;
    }

    .game-date, .game-creator {
        font-size: 0.9em;
    }

    .game-status {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}

@media (max-width: 768px) {
    .games-toolbar {
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }

    .games-toolbar-title {
        margin-right: 0;
        font-size: 1.08rem;
        letter-spacing: 0.04em;
    }

    .games-toolbar.has-pagination .games-toolbar-heading {
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }

    .games-search {
        min-width: 100%;
        max-width: none;
        flex-basis: 100%;
    }

    .games-toolbar.has-pagination .games-search {
        min-width: 0;
        flex: 1 1 0;
    }

    .games-toolbar.has-pagination .games-summary {
        display: none;
    }

    .games-summary {
        flex: 1 1 100%;
        text-align: center;
        white-space: normal;
    }

    .pagination {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 12px;
        white-space: nowrap;
    }

    .pagination-pages {
        flex: 1 1 100%;
    }

    .pagination-info {
        width: auto;
        margin-left: auto;
        text-align: right;
        white-space: nowrap;
    }

    .pagination-total {
        display: inline-flex;
        align-items: center;
        color: rgba(200, 208, 230, 0.82);
        font-size: 0.8em;
        font-weight: 600;
        line-height: 1.2;
    }

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

    .game-item {
        padding: 16px;
        border-radius: 14px;
        overflow: visible;
    }

    .game-header {
        gap: 8px;
        align-items: flex-start;
        overflow: visible;
        position: relative;
    }

    .game-title-section {
        width: 100%;
        flex: none;
        order: 1;
        overflow: visible;
    }

    .game-title-main {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        overflow: visible;
    }

    .game-title-content {
        gap: 8px;
        flex-wrap: wrap;
        overflow: visible;
    }

    .game-id {
        font-size: 1.2em;
    }

    .game-date, .game-creator {
        font-size: 0.85em;
    }

    .game-status {
        font-size: 0.7em;
        padding: 3px 6px;
    }

    /* ИСПРАВЛЕННОЕ ПОЗИЦИОНИРОВАНИЕ КЕБАБ-МЕНЮ НА МОБИЛЬНЫХ */
    .kebab-menu {
        position: relative;
        flex-shrink: 0;
        align-self: center;
        z-index: 100;
    }

    .kebab-dropdown {
        position: absolute;
        top: calc(100% + 5px);
        right: 0;
        min-width: 180px;
        z-index: 1000;
        /* Убираем фиксированное позиционирование, которое уводило dropdown вниз */
        position: absolute !important;
    }

    .kebab-dropdown.show {
        transform: translateY(0);
    }

    .game-teams {
        flex-direction: column;
        gap: 16px;
        order: 2;
    }

    .vs {
        order: 2;
        margin: 8px 0;
        padding: 8px 0;
        font-size: 1.3em;
    }

    #games-page .game-team:first-child {
        order: 1;
    }

    #games-page .game-team:last-child {
        order: 3;
    }

    .game-map-info {
        margin-top: 4px;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .game-title-main {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        overflow: visible;
    }

    .game-title-content {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: wrap;
        overflow: visible;
    }

    .kebab-menu {
        align-self: center;
        margin-left: auto;
    }

    .kebab-btn {
        width: 30px;
        height: 30px;
        padding: 6px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .games-toolbar-title {
        font-size: 1.14rem;
    }

    .games-search-input {
        height: 40px;
        font-size: 0.9em;
    }

    .games-search {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .games-search-submit {
        height: 42px;
        padding: 0 12px;
        white-space: nowrap;
    }

    .games-search-input-wrap {
        width: 100%;
        min-width: 0;
    }

    .pagination {
        gap: 8px;
    }

    .pagination-pages {
        width: 100%;
        padding: 6px 8px;
    }

    .pagination-page-list {
        justify-content: flex-start;
    }

    .pagination button,
    .pagination button.pagination-nav {
        min-width: 0;
        flex: 0 0 auto;
        height: 38px;
        padding: 0 11px;
        font-size: 0.85em;
    }

    .pagination button.pagination-nav {
        min-width: 36px;
        padding: 0 10px;
    }

    .pagination-info {
        width: auto;
        margin-left: auto;
        text-align: right;
        white-space: nowrap;
        font-size: 0.82em;
    }

    .pagination-total {
        font-size: 0.78em;
    }

    .games-container {
        padding: 0 8px 8px 8px;
    }

    .game-item {
        padding: 12px;
        border-radius: 12px;
        overflow: visible;
    }

    .game-header {
        flex-direction: row;
        gap: 8px;
        align-items: flex-start;
        overflow: visible;
        position: relative;
        min-height: auto;
        flex-wrap: nowrap;
    }

    .game-title-section {
        width: calc(100% - 40px);
        flex: 1;
        order: 1;
        overflow: visible;
        padding-right: 0;
    }

    .game-title-main {
        flex-wrap: wrap;
        gap: 6px;
        row-gap: 4px;
        align-items: center;
        overflow: visible;
    }

    .game-title-content {
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        overflow: visible;
    }

    .game-id {
        font-size: 1.1em;
    }

    .game-date, .game-creator {
        font-size: 0.85em;
    }

    .game-status {
        font-size: 0.65em;
        padding: 2px 5px;
    }

    /* Исправления для кебаб-меню в мобильной версии */
    .kebab-menu {
        position: relative;
        top: auto;
        right: auto;
        z-index: 100;
        align-self: flex-start;
        margin-top: 2px;
    }

    .kebab-btn {
        width: 30px;
        height: 30px;
        padding: 6px;
        font-size: 16px;
        z-index: 101;
    }

    /* Кебаб-меню остается абсолютным, но рядом с кнопкой */
    .kebab-dropdown {
        position: absolute;
        top: calc(100% + 5px);
        right: 0;
        min-width: 160px;
        z-index: 1000;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
        /* Убираем фиксированное позиционирование */
        position: absolute !important;
        left: auto !important;
        transform: none !important;
        bottom: auto !important;
    }

    .kebab-dropdown.show {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }

    .game-map-info {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
    }

    .game-mode {
        margin-left: 0;
    }

    #games-page .players-list li {
        padding: 8px 10px;
        min-height: 40px;
    }

    .player-info {
        gap: 4px;
    }

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

    .civilization-icon img {
        width: 22px;
        height: 22px;
    }

    .player-color-indicator {
        width: 8px;
        height: 20px;
    }

    .player-name {
        font-size: 0.9em;
        padding: 0 6px;
    }

    .rating-change, .player-rating-badge {
        font-size: 0.8em;
        padding: 5px 8px;
        min-width: 40px;
    }

    .original-rating {
        font-size: 0.85em;
        min-width: 30px;
    }

    .win-btn {
        padding: 10px 16px;
        font-size: 0.85em;
    }

    .vs {
        font-size: 1.2em;
        padding: 6px 0;
    }
}

@media (max-width: 375px) {
    .game-title-content {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
        row-gap: 4px;
        overflow: visible;
    }

    .game-id, .game-date, .game-creator, .auto-badge, .manual-badge, .game-duration-badge, .game-status {
        margin-bottom: 0;
    }

    .kebab-menu {
        position: relative;
        margin-left: auto;
        align-self: flex-start;
    }

    .kebab-dropdown {
        right: 0;
        left: auto;
        min-width: 140px;
        transform-origin: top right;
    }
}

@media (max-width: 320px) {
    .game-header {
        gap: 6px;
        min-height: auto;
    }

    .kebab-btn {
        width: 28px;
        height: 28px;
        padding: 5px;
        font-size: 14px;
    }

    .kebab-dropdown {
        min-width: 130px;
    }

    .kebab-dropdown button {
        padding: 4px 6px;
        font-size: 0.85em;
    }
}

@media (max-width: 768px) {
    #games-page .game-item {
        padding: 16px;
    }

    #games-page .game-teams {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    #games-page .vs {
        width: 100%;
        height: 34px;
        border-radius: 9px;
        order: 2;
    }

    #games-page .game-team:first-child {
        order: 1;
    }

    #games-page .game-team:last-child {
        order: 3;
    }
}

/* Event-style match history cards */
#games-page .game-item {
    padding: 14px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 16% 26%, rgba(255, 223, 143, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(21, 28, 41, 0.97), rgba(10, 16, 26, 0.99));
    border-color: rgba(139, 153, 184, 0.3);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
    overflow: hidden;
}

#games-page .game-item::before {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.35), transparent);
}

#games-page .game-header {
    margin-bottom: 14px;
    padding: 0 2px 10px;
    border-bottom: 0;
}

#games-page .game-title-main {
    align-items: flex-start;
    gap: 14px;
}

#games-page .game-title-content {
    display: grid;
    grid-template-columns: 44px minmax(160px, 0.78fr) minmax(280px, 1.6fr);
    align-items: center;
    gap: 12px;
    width: 100%;
}

#games-page .game-event-lead {
    display: flex;
    justify-content: center;
}

#games-page .game-event-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #ffdf8f;
    font-size: 1rem;
    font-weight: 900;
    border: 1px solid rgba(255, 223, 143, 0.45);
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 223, 143, 0.2), transparent 62%),
        rgba(12, 18, 29, 0.88);
    box-shadow: 0 0 18px rgba(255, 223, 143, 0.08);
}

#games-page .game-event-title-block {
    display: grid;
    gap: 2px;
    min-width: 0;
}

#games-page .game-id {
    color: #ffdf8f;
    font-size: 1.15rem;
    line-height: 1.15;
}

#games-page .game-date,
#games-page .game-creator,
#games-page .game-creator .creator-label {
    color: rgba(224, 230, 243, 0.78);
    font-size: 0.82rem;
    line-height: 1.25;
}

#games-page .game-creator {
    overflow: hidden;
    text-overflow: ellipsis;
}

#games-page .game-event-track {
    --event-line-color: rgba(255, 223, 143, 0.28);
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr)) minmax(118px, 1.05fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
}

#games-page .game-event-track::before {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    top: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--event-line-color), transparent);
    pointer-events: none;
}

#games-page .game-event-node,
#games-page .game-duration-badge,
#games-page .game-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
}

#games-page .game-event-node,
#games-page .game-duration-badge {
    color: rgba(227, 234, 248, 0.82);
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(14, 20, 32, 0.9);
    border: 1px solid rgba(255, 223, 143, 0.24);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#games-page .game-event-node-map {
    color: rgba(255, 231, 172, 0.9);
}

#games-page .game-status {
    border-radius: 10px;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

#games-page .game-status.completed {
    color: #40ea68;
    background:
        radial-gradient(circle at 50% 35%, rgba(64, 234, 104, 0.18), transparent 62%),
        rgba(9, 30, 23, 0.9);
    border-color: rgba(64, 234, 104, 0.5);
}

#games-page .game-status.pending {
    color: rgba(224, 231, 245, 0.84);
    background:
        radial-gradient(circle at 50% 35%, rgba(148, 163, 184, 0.16), transparent 62%),
        rgba(16, 22, 34, 0.92);
    border-color: rgba(148, 163, 184, 0.34);
}

#games-page .game-teams {
    grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    position: relative;
}

#games-page .game-team {
    padding: 18px 16px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(23, 31, 46, 0.94), rgba(16, 22, 34, 0.98));
    border-color: rgba(139, 153, 184, 0.2);
}

#games-page .game-team:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#games-page .game-team:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#games-page .game-team.winner {
    border-color: rgba(64, 218, 92, 0.56);
    background:
        linear-gradient(100deg, rgba(33, 119, 58, 0.28), rgba(16, 27, 32, 0.94) 56%),
        linear-gradient(180deg, rgba(17, 43, 34, 0.94), rgba(12, 24, 24, 0.98));
    box-shadow:
        inset 4px 0 0 rgba(64, 218, 92, 0.62),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#games-page .game-team.loser {
    border-color: rgba(235, 88, 88, 0.52);
    background:
        linear-gradient(100deg, rgba(120, 38, 48, 0.28), rgba(31, 22, 33, 0.94) 56%),
        linear-gradient(180deg, rgba(43, 24, 35, 0.94), rgba(25, 19, 30, 0.98));
    box-shadow:
        inset 4px 0 0 rgba(235, 88, 88, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#games-page .game-item-pending .game-team,
#games-page .game-item-pending .game-team:hover {
    border-color: rgba(139, 153, 184, 0.24);
    background:
        linear-gradient(180deg, rgba(24, 32, 48, 0.94), rgba(15, 22, 35, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.14);
}

#games-page .game-item-pending .game-team h4,
#games-page .game-item-pending .team-rating {
    color: rgba(229, 235, 248, 0.82);
}

#games-page .game-team h4 {
    justify-content: flex-start;
    text-align: left;
    margin-bottom: 4px;
    font-size: 1.08rem;
}

#games-page .game-team.winner h4 {
    color: #6aff84;
}

#games-page .game-team.loser h4 {
    color: #ff7474;
}

#games-page .team-rating {
    text-align: left;
    margin-bottom: 14px;
}

#games-page .players-list li {
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(34, 42, 60, 0.94), rgba(22, 29, 43, 0.98));
}

#games-page .vs {
    z-index: 2;
    align-self: center;
    width: 48px;
    height: 48px;
    margin: 0 -1px;
    border-radius: 12px;
    color: #ffe39a;
    background:
        linear-gradient(180deg, rgba(23, 29, 42, 0.98), rgba(13, 18, 29, 0.98));
    border-color: rgba(255, 223, 143, 0.35);
}

#games-page .game-item-pending .vs {
    color: rgba(226, 233, 246, 0.84);
    border-color: rgba(148, 163, 184, 0.3);
    text-shadow: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

#games-page .game-item-pending .player-rating-badge {
    color: rgba(226, 233, 246, 0.8);
    border-color: rgba(148, 163, 184, 0.26);
    background: rgba(13, 19, 30, 0.54);
}

@media (max-width: 980px) {
    #games-page .game-title-content {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    #games-page .game-event-track {
        grid-column: 1 / -1;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #games-page .game-item {
        padding: 12px;
    }

    #games-page .game-title-main {
        gap: 8px;
    }

    #games-page .game-title-content {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 8px;
    }

    #games-page .game-event-emblem {
        width: 36px;
        height: 36px;
    }

    #games-page .game-event-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #games-page .game-event-track::before {
        display: none;
    }

    #games-page .game-event-node,
    #games-page .game-duration-badge,
    #games-page .game-status {
        min-height: 34px;
        padding: 6px 8px;
    }

    #games-page .game-teams {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    #games-page .game-team,
    #games-page .game-team:first-child,
    #games-page .game-team:last-child {
        border-radius: 10px;
    }

    #games-page .vs {
        width: 100%;
        height: 34px;
        margin: 0;
        border-radius: 9px;
    }
}

@media (max-width: 420px) {
    #games-page .game-event-track {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Completed game cards: event timeline view */
#games-page .game-item.game-item-completed {
    padding: 16px 16px 14px;
    border-radius: 12px;
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    background:
        radial-gradient(circle at 9% 20%, rgba(55, 137, 99, 0.1), transparent 22%),
        radial-gradient(circle at 78% 14%, rgba(255, 223, 143, 0.08), transparent 20%),
        linear-gradient(180deg, rgba(22, 30, 43, 0.96), rgba(9, 15, 25, 0.99));
    border: 1px solid rgba(139, 153, 184, 0.34);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

#games-page .game-item.game-item-completed::before {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.28), transparent);
}

#games-page .game-item.game-item-completed .game-header {
    margin-bottom: 28px;
    padding: 0;
}

#games-page .game-item.game-item-completed .game-title-main {
    align-items: flex-start;
}

#games-page .game-item.game-item-completed .game-title-content {
    grid-template-columns: 70px minmax(180px, 250px) minmax(360px, 1fr);
    gap: 14px;
}

#games-page .game-item.game-item-completed .game-event-lead {
    padding-top: 0;
}

#games-page .game-item.game-item-completed .game-event-emblem {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: transparent;
    border: 1px solid rgba(255, 196, 58, 0.36);
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 211, 84, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(24, 34, 47, 0.98), rgba(10, 16, 27, 0.99));
    box-shadow:
        inset 0 0 0 1px rgba(255, 223, 143, 0.1),
        0 0 24px rgba(255, 210, 74, 0.1);
}

#games-page .game-item.game-item-completed .game-event-emblem::before {
    content: "";
    position: absolute;
    inset: 10px 14px 9px;
    clip-path: polygon(50% 0, 88% 14%, 88% 48%, 75% 72%, 50% 100%, 25% 72%, 12% 48%, 12% 14%);
    background:
        linear-gradient(135deg, #fff184 0%, #ffd640 48%, #b98518 100%);
    box-shadow:
        inset 0 0 0 3px rgba(13, 19, 30, 0.92),
        inset 0 0 0 6px rgba(255, 226, 91, 0.92),
        0 0 16px rgba(255, 218, 77, 0.22);
}

#games-page .game-item.game-item-completed .game-event-emblem::after {
    content: "";
    position: absolute;
    top: 23px;
    left: 21px;
    width: 22px;
    height: 22px;
    background:
        linear-gradient(90deg,
            rgba(13, 19, 30, 0.96) 0 22%,
            transparent 22% 39%,
            rgba(13, 19, 30, 0.96) 39% 61%,
            transparent 61% 78%,
            rgba(13, 19, 30, 0.96) 78% 100%);
    box-shadow:
        inset 0 -5px 0 -2px rgba(13, 19, 30, 0.96),
        0 0 8px rgba(255, 218, 77, 0.12);
    clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
}

#games-page .game-item.game-item-completed .game-event-emblem {
    color: #ffda4d;
}

#games-page .game-item.game-item-completed .game-id {
    color: #ffda4d;
    font-size: 1.28rem;
    line-height: 1.1;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(255, 218, 77, 0.26);
}

#games-page .game-item.game-item-completed .game-date,
#games-page .game-item.game-item-completed .game-creator,
#games-page .game-item.game-item-completed .creator-label {
    color: rgba(225, 231, 244, 0.78);
    font-size: 0.9rem;
    font-weight: 700;
}

#games-page .game-item.game-item-completed .game-event-track {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 16px;
    padding: 0 4px;
}

#games-page .game-item.game-item-completed .game-event-track::before {
    left: -64px;
    right: 30px;
    top: 29px;
    background: linear-gradient(90deg, transparent, rgba(255, 214, 90, 0.34) 7%, rgba(255, 214, 90, 0.58) 18%, rgba(255, 214, 90, 0.46) 86%, transparent);
}

#games-page .game-item.game-item-completed .game-event-node-source {
    display: none;
}

#games-page .game-item.game-item-completed .game-event-node,
#games-page .game-item.game-item-completed .game-duration-badge,
#games-page .game-item.game-item-completed .game-status {
    min-height: 94px;
    padding: 64px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(226, 231, 242, 0.82);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

#games-page .game-item.game-item-completed .game-event-node::before,
#games-page .game-item.game-item-completed .game-duration-badge::before,
#games-page .game-item.game-item-completed .game-status::before {
    position: absolute;
    top: 0;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    width: 56px;
    border-radius: 50%;
    transform: translateX(-50%);
    color: #ffda4d;
    font-family: 'Segoe UI Symbol', 'Segoe UI', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 214, 90, 0.28);
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 214, 90, 0.16), transparent 58%),
        rgba(19, 26, 39, 0.96);
    box-shadow:
        0 0 0 2px rgba(11, 17, 28, 0.94),
        0 0 18px rgba(255, 214, 90, 0.09);
}

#games-page .game-item.game-item-completed .game-duration-badge::before {
    content: "\23F1\FE0E";
}

#games-page .game-item.game-item-completed .game-event-node-map::before {
    content: "\2691\FE0E";
}

#games-page .game-item.game-item-completed .game-event-node-mode::before {
    content: "\26C9\FE0E";
    font-size: 1.22rem;
}

#games-page .game-item.game-item-completed .game-status.completed {
    color: #3bed67;
    text-transform: uppercase;
}

#games-page .game-item.game-item-completed .game-status.completed::before {
    content: "";
    border-color: rgba(56, 238, 100, 0.42);
    background:
        radial-gradient(circle at 50% 40%, rgba(56, 238, 100, 0.28), transparent 58%),
        rgba(11, 45, 27, 0.96);
    box-shadow:
        0 0 0 2px rgba(11, 17, 28, 0.94),
        0 0 20px rgba(56, 238, 100, 0.24);
}

#games-page .game-item.game-item-completed .game-status.completed::after {
    content: "\2713";
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 32px;
    transform: translateX(-50%) rotate(-8deg);
    clip-path: polygon(50% 0, 88% 13%, 88% 53%, 50% 100%, 12% 53%, 12% 13%);
    color: rgba(6, 32, 17, 0.96);
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #64ff75 0%, #28e34e 54%, #109c32 100%);
    text-shadow: 0 1px 0 rgba(168, 255, 177, 0.45);
    box-shadow:
        inset 0 0 0 2px rgba(74, 255, 103, 0.36),
        0 0 16px rgba(38, 227, 77, 0.24);
}

#games-page .game-item.game-item-completed .game-teams {
    grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr);
    gap: 0;
    align-items: start;
    position: relative;
}

#games-page .game-item.game-item-completed .game-teams::before {
    content: "";
    position: absolute;
    top: 78px;
    bottom: 0;
    left: 50%;
    z-index: 1;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(255, 213, 74, 0.28), rgba(55, 226, 79, 0.48) 52%, rgba(198, 72, 78, 0.42));
    box-shadow: 0 0 12px rgba(255, 213, 74, 0.14);
    pointer-events: none;
}

#games-page .game-item.game-item-completed .game-team {
    position: relative;
    min-height: 330px;
    padding: 46px 36px 28px;
    border-radius: 12px;
    background: rgba(16, 24, 35, 0.82);
    overflow: hidden;
}

#games-page .game-item.game-item-completed .game-team.winner {
    border-color: rgba(53, 214, 78, 0.58);
    background:
        radial-gradient(circle at 8% 12%, rgba(53, 214, 78, 0.27), transparent 34%),
        radial-gradient(circle at 38% 9%, rgba(119, 255, 67, 0.1), transparent 18%),
        linear-gradient(105deg, rgba(23, 113, 55, 0.56) 0%, rgba(11, 36, 31, 0.9) 58%, rgba(5, 14, 22, 0.99) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(53, 214, 78, 0.16),
        0 0 20px rgba(53, 214, 78, 0.1);
    clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 86px, 100% 100%, 0 100%);
}

#games-page .game-item.game-item-completed .game-team.loser {
    border-color: rgba(196, 72, 78, 0.54);
    background:
        radial-gradient(circle at 92% 12%, rgba(190, 78, 78, 0.16), transparent 36%),
        linear-gradient(105deg, rgba(5, 14, 22, 0.99) 0%, rgba(36, 25, 36, 0.92) 42%, rgba(98, 40, 49, 0.4) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(196, 72, 78, 0.12),
        0 0 20px rgba(196, 72, 78, 0.07);
    clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%, 0 86px);
}

#games-page .game-item.game-item-completed .game-team:first-child,
#games-page .game-item.game-item-completed .game-team:last-child {
    border-radius: 12px;
}

#games-page .game-item.game-item-completed .game-team:first-child {
    clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 86px, 100% 100%, 0 100%);
}

#games-page .game-item.game-item-completed .game-team:last-child {
    clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%, 0 86px);
}

#games-page .game-item.game-item-completed .game-team:first-child.loser {
    background:
        radial-gradient(circle at 8% 12%, rgba(190, 78, 78, 0.16), transparent 36%),
        linear-gradient(105deg, rgba(98, 40, 49, 0.4) 0%, rgba(36, 25, 36, 0.92) 58%, rgba(5, 14, 22, 0.99) 100%);
}

#games-page .game-item.game-item-completed .game-team:last-child.winner {
    background:
        radial-gradient(circle at 92% 12%, rgba(53, 214, 78, 0.27), transparent 34%),
        radial-gradient(circle at 62% 9%, rgba(119, 255, 67, 0.1), transparent 18%),
        linear-gradient(105deg, rgba(5, 14, 22, 0.99) 0%, rgba(11, 36, 31, 0.9) 42%, rgba(23, 113, 55, 0.56) 100%);
}

#games-page .game-item.game-item-completed .game-team:last-child h4,
#games-page .game-item.game-item-completed .game-team:last-child .team-rating {
    justify-content: flex-end;
    text-align: right;
    padding-right: 24%;
    box-sizing: border-box;
}

#games-page .game-item.game-item-completed .game-team h4 {
    margin: 0 0 8px;
    font-size: 1.28rem;
    line-height: 1.2;
    font-weight: 700;
}

#games-page .game-item.game-item-completed .game-team.winner::before {
    content: "\041F\041E\0411\0415\0414\0410";
    position: absolute;
    top: 16px;
    left: 36px;
    color: #82ff73;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-shadow: 0 0 14px rgba(98, 255, 89, 0.26);
}

#games-page .game-item.game-item-completed .game-team:last-child.winner::before {
    right: 36px;
    left: auto;
}

#games-page .game-item.game-item-completed .game-team.winner h4 {
    color: #9af68e;
}

#games-page .game-item.game-item-completed .game-team.loser h4 {
    color: #ff7470;
}

#games-page .game-item.game-item-completed .team-rating {
    margin-bottom: 24px;
    color: rgba(221, 228, 241, 0.78);
    font-size: 0.98rem;
    font-weight: 700;
}

#games-page .game-item.game-item-completed .players-list {
    gap: 10px;
}

#games-page .game-item.game-item-completed .players-list li {
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(31, 40, 58, 0.94), rgba(20, 29, 44, 0.98));
    border: 1px solid rgba(105, 122, 153, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

#games-page .game-item.game-item-completed .player-info {
    gap: 12px;
}

#games-page .game-item.game-item-completed .player-color-indicator {
    position: relative;
    width: 12px;
    height: 32px;
    border-radius: 5px;
    border-color: rgba(255, 255, 255, 0.18);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(0, 0, 0, 0.16));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.34);
}

#games-page .game-item.game-item-completed .civilization-icon {
    width: 32px;
    height: 32px;
}

#games-page .game-item.game-item-completed .civilization-icon img {
    width: 32px;
    height: 32px;
}

#games-page .game-item.game-item-completed .civilization-icon.fallback .civ-fallback {
    font-size: 12px;
}

#games-page .game-item.game-item-completed .player-name {
    color: rgba(242, 246, 255, 0.96);
    font-weight: 700;
    font-size: 0.98rem;
}

#games-page .game-item.game-item-completed .original-rating {
    color: rgba(218, 226, 243, 0.78);
    font-weight: 700;
    font-size: 0.92rem;
    min-width: 44px;
}

#games-page .game-item.game-item-completed .rating-change {
    min-width: 56px;
    padding: 7px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.94rem;
    background: rgba(16, 25, 38, 0.72);
}

#games-page .game-item.game-item-completed .rating-change.rating-positive {
    color: #6dff7f;
    border-color: rgba(91, 244, 115, 0.28);
}

#games-page .game-item.game-item-completed .rating-change.rating-negative {
    color: #ff766e;
    border-color: rgba(255, 118, 110, 0.3);
}

#games-page .game-item.game-item-completed .vs {
    position: relative;
    isolation: isolate;
    z-index: 4;
    align-self: start;
    justify-self: center;
    width: 74px;
    height: 66px;
    margin: 28px -37px 0;
    padding: 0;
    color: #ffdf56;
    font-size: 1.36rem;
    font-weight: 900;
    background: transparent;
    border: 0;
    text-shadow: 0 0 12px rgba(255, 223, 86, 0.34);
    box-shadow: 0 0 20px rgba(255, 202, 58, 0.08);
}

#games-page .game-item.game-item-completed .vs::before,
#games-page .game-item.game-item-completed .vs::after {
    content: "";
    position: absolute;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    pointer-events: none;
}

#games-page .game-item.game-item-completed .vs::before {
    z-index: -2;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 202, 58, 0.72), rgba(111, 78, 26, 0.58));
}

#games-page .game-item.game-item-completed .vs::after {
    z-index: -1;
    inset: 1px;
    background:
        linear-gradient(180deg, rgba(28, 35, 47, 0.94), rgba(11, 17, 27, 0.96));
}

#games-page .game-item.game-item-completed .kebab-menu {
    align-self: flex-start;
    padding-top: 10px;
}

#games-page .game-item.game-item-completed .kebab-btn {
    width: 44px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: transparent;
    background: transparent;
    box-shadow: none;
}

#games-page .game-item.game-item-completed .kebab-btn::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(235, 239, 249, 0.92);
    box-shadow:
        0 -10px 0 rgba(235, 239, 249, 0.92),
        0 10px 0 rgba(235, 239, 249, 0.92);
}

#games-page .game-item.game-item-completed .kebab-btn:hover,
#games-page .game-item.game-item-completed .kebab-btn:focus-visible {
    color: transparent;
    background: rgba(255, 255, 255, 0.05);
    border: 0;
    box-shadow: none;
    transform: none;
}

/* Completed game cards: compact result row */
#games-page .game-item.game-item-completed {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 0;
    min-height: 270px;
    padding: 26px 16px 18px 28px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 84% 16%, rgba(58, 226, 84, 0.08), transparent 18%),
        radial-gradient(circle at 8% 78%, rgba(53, 214, 78, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(18, 27, 39, 0.96), rgba(8, 14, 23, 0.99));
}

#games-page .game-item.game-item-completed .game-completed-summary {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    margin: -26px 0 -18px -28px;
    padding: 22px 12px 22px 18px;
    border-right: 1px solid rgba(105, 122, 153, 0.16);
    background:
        linear-gradient(90deg, rgba(10, 18, 30, 0.66), rgba(12, 21, 33, 0.3));
    color: rgba(229, 235, 248, 0.8);
    position: relative;
}

#games-page .game-item.game-item-completed > .game-header .kebab-menu,
#games-page .game-item.game-item-pending > .game-header .kebab-menu {
    display: none;
}

#games-page .game-item.game-item-completed .game-completed-summary,
#games-page .game-item.game-item-pending .game-completed-summary {
    position: relative;
    overflow: visible;
}

#games-page .game-completed-summary:has(.kebab-menu-summary) {
    padding-left: 46px;
}

#games-page .game-completed-summary .kebab-menu-summary {
    position: absolute;
    top: 22px;
    left: 12px;
    align-self: auto;
    margin: 0;
    z-index: 30;
}

#games-page .game-completed-summary .kebab-dropdown {
    top: 0;
    left: calc(100% + 8px) !important;
    right: auto !important;
    transform: translateX(-6px) scale(0.98) !important;
    transform-origin: top left;
}

#games-page .game-completed-summary .kebab-dropdown.show {
    transform: translateX(0) scale(1) !important;
}

#games-page .game-item.game-item-completed .game-completed-summary-game {
    color: rgba(235, 241, 252, 0.92);
    font-size: 1rem;
    font-weight: 700;
}

#games-page .game-item.game-item-completed .game-completed-summary-map,
#games-page .game-item.game-item-completed .game-completed-summary-date {
    color: rgba(210, 219, 238, 0.72);
    font-size: 0.95rem;
    font-weight: 500;
}

#games-page .game-item.game-item-completed .game-completed-summary-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(210, 219, 238, 0.72);
    font-size: 0.95rem;
    font-weight: 500;
}

#games-page .game-completed-summary-duration {
    font-size: 1em;
    font-weight: 700;
    white-space: nowrap;
}

#games-page .game-completed-summary-duration.short {
    color: #ffb074;
}

#games-page .game-completed-summary-duration.medium {
    color: #ffe08a;
}

#games-page .game-completed-summary-duration.long {
    color: #a8ffbe;
}

#games-page .game-item.game-item-completed .game-header {
    position: absolute;
    top: 18px;
    right: 8px;
    margin: 0;
    padding: 0;
    z-index: 5;
}

#games-page .game-item.game-item-completed .game-title-main {
    align-items: flex-start;
    gap: 0;
}

#games-page .game-item.game-item-completed .game-title-content {
    display: none;
}

#games-page .game-item.game-item-completed .game-event-lead,
#games-page .game-item.game-item-completed .game-date,
#games-page .game-item.game-item-completed .game-creator {
    display: none;
}

#games-page .game-item.game-item-completed .game-event-title-block {
    display: contents;
}

#games-page .game-item.game-item-completed .game-id {
    margin-left: auto;
    color: rgba(233, 238, 249, 0.92);
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow: none;
}

#games-page .game-item.game-item-completed .game-event-track {
    display: contents;
}

#games-page .game-item.game-item-completed .game-event-track::before,
#games-page .game-item.game-item-completed .game-event-node-source {
    display: none;
}

#games-page .game-item.game-item-completed .game-event-node,
#games-page .game-item.game-item-completed .game-duration-badge,
#games-page .game-item.game-item-completed .game-status {
    min-height: 0;
    padding: 0;
    color: rgba(198, 207, 226, 0.78);
    font-size: 0.95rem;
    font-weight: 600;
}

#games-page .game-item.game-item-completed .game-duration-badge::before,
#games-page .game-item.game-item-completed .game-event-node::before {
    content: "\2022";
    position: static;
    width: auto;
    height: auto;
    margin-right: 22px;
    transform: none;
    color: rgba(198, 207, 226, 0.56);
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.9rem;
}

#games-page .game-item.game-item-completed .game-status.completed {
    margin-left: auto;
    padding-left: 30px;
    color: #38e957;
    font-size: 1rem;
    font-weight: 900;
}

#games-page .game-item.game-item-completed .game-status.completed::before {
    content: "\2713";
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: #38e957;
    border: 1px solid rgba(56, 233, 87, 0.44);
    background: rgba(11, 45, 27, 0.52);
    box-shadow: 0 0 12px rgba(56, 233, 87, 0.18);
    font-size: 0.82rem;
}

#games-page .game-item.game-item-completed .game-status.completed::after {
    display: none;
}

#games-page .game-item.game-item-completed .kebab-menu {
    padding-top: 0;
}

#games-page .game-item.game-item-completed .kebab-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(150, 161, 191, 0.24);
    border-radius: 12px;
    color: #d8def0;
    background: transparent;
    box-shadow:
        0 10px 22px rgba(5, 8, 16, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#games-page .game-item.game-item-completed .kebab-btn::before {
    display: none;
    content: none;
}

#games-page .game-item.game-item-completed .kebab-btn:hover,
#games-page .game-item.game-item-completed .kebab-btn:focus-visible {
    border: 1px solid rgba(255, 223, 143, 0.38);
    color: #fff4d0;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 223, 143, 0.24), transparent 45%),
        linear-gradient(180deg, rgba(82, 88, 112, 0.98), rgba(46, 52, 72, 0.98));
    box-shadow:
        0 14px 28px rgba(5, 8, 16, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

#games-page .game-item.game-item-completed .game-teams {
    grid-column: 2;
    grid-row: 1 / 3;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    padding-left: 10px;
    padding-right: 0;
}

#games-page .game-item.game-item-completed .game-teams::before {
    display: none;
}

#games-page .game-item.game-item-completed .game-team,
#games-page .game-item.game-item-completed .game-team:first-child,
#games-page .game-item.game-item-completed .game-team:last-child {
    min-height: 0;
    padding: 16px 18px 12px;
    border-radius: 12px;
    clip-path: none;
}

#games-page .game-item.game-item-completed .game-team.winner {
    border-color: rgba(128, 202, 91, 0.28);
    background:
        radial-gradient(circle at 8% 24%, rgba(125, 197, 88, 0.14), transparent 34%),
        linear-gradient(90deg, rgba(48, 90, 43, 0.24), rgba(12, 22, 29, 0.64) 78%);
    box-shadow: inset 0 0 0 1px rgba(128, 202, 91, 0.1);
}

#games-page .game-item.game-item-completed .game-team.loser {
    border-color: rgba(196, 80, 74, 0.24);
    background:
        radial-gradient(circle at 14% 24%, rgba(198, 78, 72, 0.12), transparent 34%),
        linear-gradient(90deg, rgba(60, 27, 31, 0.42), rgba(12, 22, 29, 0.66) 78%);
    box-shadow: inset 0 0 0 1px rgba(196, 80, 74, 0.08);
}

#games-page .game-item.game-item-completed .game-team:last-child.winner {
    background:
        radial-gradient(circle at 10% 24%, rgba(125, 197, 88, 0.14), transparent 34%),
        linear-gradient(90deg, rgba(48, 90, 43, 0.24), rgba(12, 22, 29, 0.64) 78%);
}

#games-page .game-item.game-item-completed .game-team:last-child.loser {
    background:
        radial-gradient(circle at 10% 24%, rgba(198, 78, 72, 0.12), transparent 34%),
        linear-gradient(90deg, rgba(60, 27, 31, 0.42), rgba(12, 22, 29, 0.66) 78%);
}

#games-page .game-item.game-item-completed .game-team h4,
#games-page .game-item.game-item-completed .game-team:last-child h4 {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding-right: 0;
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
}

#games-page .game-item.game-item-completed .game-team h4::before {
    content: "";
    width: 38px;
    height: 44px;
    flex: 0 0 auto;
    clip-path: polygon(50% 0, 88% 14%, 88% 48%, 50% 100%, 12% 48%, 12% 14%);
    background:
        linear-gradient(135deg, rgba(166, 213, 86, 0.9), rgba(86, 125, 48, 0.78));
    box-shadow: inset 0 0 0 3px rgba(13, 19, 30, 0.84);
}

#games-page .game-item.game-item-completed .game-team.loser h4::before {
    background: linear-gradient(135deg, rgba(232, 80, 76, 0.88), rgba(113, 42, 42, 0.78));
}

#games-page .game-item.game-item-completed .game-team.winner::before {
    display: none;
}

#games-page .game-item.game-item-completed .game-team.winner h4 {
    color: #89d66a;
}

#games-page .game-item.game-item-completed .game-team.loser h4 {
    color: #e9655d;
}

#games-page .game-item.game-item-completed .team-rating-inline {
    font-size: 0.92em;
    font-weight: 700;
    opacity: 0.94;
}

#games-page .game-item.game-item-completed .team-rating {
    display: none;
}

#games-page .game-item.game-item-completed .players-list {
    gap: 0;
}

#games-page .game-item.game-item-completed .players-list li {
    min-height: 34px;
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid rgba(122, 139, 168, 0.09);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#games-page .game-item.game-item-completed .players-list li:last-child {
    border-bottom: 0;
}

#games-page .game-item.game-item-completed .player-info {
    gap: 9px;
}

#games-page .game-item.game-item-completed .player-color-indicator {
    display: block;
    width: 6px;
    height: 24px;
    border-radius: 999px;
    border-color: rgba(255, 255, 255, 0.16);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(0, 0, 0, 0.16));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 2px 7px rgba(0, 0, 0, 0.3);
}

#games-page .game-item.game-item-completed .civilization-icon {
    width: 28px;
    height: 28px;
}

#games-page .game-item.game-item-completed .civilization-icon img {
    width: 28px;
    height: 28px;
}

#games-page .game-item.game-item-completed .player-name {
    color: rgba(235, 240, 250, 0.88);
    font-size: 0.96rem;
    font-weight: 500;
}

#games-page .game-item.game-item-completed .rating-info {
    min-width: 128px;
    gap: 24px;
}

#games-page .game-item.game-item-completed .original-rating {
    color: rgba(205, 215, 235, 0.82);
    font-weight: 500;
    font-size: 0.94rem;
}

#games-page .game-item.game-item-completed .rating-change {
    min-width: 34px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.94rem;
    font-weight: 800;
}

#games-page .game-item.game-item-completed .rating-change.rating-positive {
    color: #53d86d;
}

#games-page .game-item.game-item-completed .rating-change.rating-negative {
    color: #e75b55;
}

#games-page .game-item.game-item-completed .vs {
    align-self: center;
    justify-self: center;
    width: 48px;
    height: auto;
    margin: 0;
    color: #ffcf37;
    font-size: 1.62rem;
    background: transparent;
    text-shadow: 0 0 12px rgba(255, 207, 55, 0.24);
    box-shadow: none;
}

#games-page .game-item.game-item-completed .vs::before,
#games-page .game-item.game-item-completed .vs::after {
    display: none;
}

/* Pending/manual game cards: event view before confirmation */
#games-page .game-item.game-item-pending {
    padding: 16px 16px 14px;
    border-radius: 12px;
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    background:
        radial-gradient(circle at 9% 20%, rgba(255, 223, 143, 0.08), transparent 22%),
        radial-gradient(circle at 78% 14%, rgba(93, 119, 164, 0.09), transparent 20%),
        linear-gradient(180deg, rgba(22, 30, 43, 0.96), rgba(9, 15, 25, 0.99));
    border: 1px solid rgba(139, 153, 184, 0.34);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

#games-page .game-item.game-item-pending::before {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.28), transparent);
}

#games-page .game-item.game-item-pending .game-header {
    margin-bottom: 16px;
    padding: 0;
}

#games-page .game-item.game-item-pending .game-title-main {
    align-items: flex-start;
}

#games-page .game-item.game-item-pending .game-title-content {
    grid-template-columns: 64px minmax(180px, 240px) minmax(360px, 1fr);
    gap: 12px;
}

#games-page .game-item.game-item-pending .game-event-lead {
    padding-top: 2px;
}

#games-page .game-item.game-item-pending .game-event-emblem {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: transparent;
    border-color: rgba(255, 196, 58, 0.34);
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 211, 84, 0.22), transparent 56%),
        linear-gradient(180deg, rgba(24, 34, 47, 0.96), rgba(12, 18, 29, 0.98));
    box-shadow:
        inset 0 0 0 1px rgba(255, 223, 143, 0.08),
        0 0 20px rgba(255, 210, 74, 0.08);
}

#games-page .game-item.game-item-pending .game-event-emblem::before {
    content: "";
    position: absolute;
    inset: 9px;
    clip-path: polygon(50% 0, 84% 13%, 84% 46%, 50% 90%, 16% 46%, 16% 13%);
    background:
        linear-gradient(90deg, transparent 44%, rgba(16, 22, 32, 0.95) 44% 56%, transparent 56%),
        linear-gradient(180deg, transparent 45%, rgba(16, 22, 32, 0.95) 45% 56%, transparent 56%),
        linear-gradient(135deg, #fff184, #ffcf34 54%, #b98518);
    box-shadow:
        inset 0 0 0 4px rgba(16, 22, 32, 0.88),
        inset 0 0 0 8px rgba(255, 229, 101, 0.88),
        0 0 16px rgba(255, 218, 77, 0.22);
}

#games-page .game-item.game-item-pending .game-event-emblem::after {
    content: "";
    position: absolute;
    inset: 16px 20px 18px;
    border: 3px solid rgba(16, 22, 32, 0.92);
    border-top: 0;
    clip-path: polygon(0 0, 100% 0, 100% 54%, 50% 100%, 0 54%);
}

#games-page .game-item.game-item-pending .game-id {
    color: #ffda4d;
    font-size: 1.28rem;
    line-height: 1.1;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(255, 218, 77, 0.26);
}

#games-page .game-item.game-item-pending .game-date,
#games-page .game-item.game-item-pending .game-creator,
#games-page .game-item.game-item-pending .creator-label {
    color: rgba(225, 231, 244, 0.78);
    font-size: 0.9rem;
    font-weight: 800;
}

#games-page .game-item.game-item-pending .game-event-track {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 16px;
    padding: 0 4px;
}

#games-page .game-item.game-item-pending .game-event-track::before {
    left: 30px;
    right: 30px;
    top: 25px;
    background: linear-gradient(90deg, transparent, rgba(255, 214, 90, 0.32) 14%, rgba(255, 214, 90, 0.32) 86%, transparent);
}

#games-page .game-item.game-item-pending .game-event-node-source {
    display: none;
}

#games-page .game-item.game-item-pending .game-event-node,
#games-page .game-item.game-item-pending .game-duration-badge,
#games-page .game-item.game-item-pending .game-status {
    min-height: 72px;
    padding: 46px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(226, 231, 242, 0.82);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

#games-page .game-item.game-item-pending .game-event-node::before,
#games-page .game-item.game-item-pending .game-duration-badge::before,
#games-page .game-item.game-item-pending .game-status::before {
    position: absolute;
    top: 0;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    transform: translateX(-50%);
    color: #ffda4d;
    font-size: 1.2rem;
    line-height: 1;
    border: 1px solid rgba(255, 214, 90, 0.28);
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 214, 90, 0.16), transparent 58%),
        rgba(19, 26, 39, 0.96);
    box-shadow:
        0 0 0 2px rgba(11, 17, 28, 0.94),
        0 0 18px rgba(255, 214, 90, 0.09);
}

#games-page .game-item.game-item-pending .game-duration-badge::before {
    content: "\23F1";
}

#games-page .game-item.game-item-pending .game-event-node-map::before {
    content: "\2691";
}

#games-page .game-item.game-item-pending .game-event-node-mode::before {
    content: "\26C9";
}

#games-page .game-item.game-item-pending .game-status.pending {
    color: rgba(227, 235, 250, 0.88);
    text-transform: uppercase;
}

#games-page .game-item.game-item-pending .game-status.pending::before {
    content: "\22EF";
    color: rgba(227, 235, 250, 0.95);
    border-color: rgba(154, 171, 204, 0.42);
    background:
        radial-gradient(circle at 50% 40%, rgba(154, 171, 204, 0.22), transparent 58%),
        rgba(23, 31, 45, 0.96);
    box-shadow:
        0 0 0 2px rgba(11, 17, 28, 0.94),
        0 0 18px rgba(154, 171, 204, 0.12);
}

#games-page .game-item.game-item-pending .game-teams {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    gap: 0;
    align-items: start;
}

#games-page .game-item.game-item-pending .game-team {
    position: relative;
    min-height: 330px;
    padding: 46px 36px 28px;
    border-radius: 12px;
    background:
        radial-gradient(circle at 8% 10%, rgba(255, 223, 143, 0.09), transparent 34%),
        linear-gradient(105deg, rgba(20, 32, 48, 0.88), rgba(12, 22, 34, 0.92) 62%);
    border: 1px solid rgba(105, 122, 153, 0.28);
    box-shadow:
        inset 0 0 0 1px rgba(255, 223, 143, 0.06),
        0 0 22px rgba(255, 223, 143, 0.04);
    overflow: hidden;
}

#games-page .game-item.game-item-pending .game-team:first-child {
    clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 86px, 100% 100%, 0 100%);
}

#games-page .game-item.game-item-pending .game-team:last-child {
    clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%, 0 86px);
    background:
        radial-gradient(circle at 92% 10%, rgba(255, 223, 143, 0.075), transparent 34%),
        linear-gradient(105deg, rgba(18, 28, 43, 0.9), rgba(24, 29, 41, 0.92) 100%);
}

#games-page .game-item.game-item-pending .game-team:first-child,
#games-page .game-item.game-item-pending .game-team:last-child {
    border-radius: 12px;
}

#games-page .game-item.game-item-pending .game-team h4 {
    margin: 0 0 8px;
    color: rgba(226, 235, 250, 0.92);
    font-size: 1.28rem;
    line-height: 1.2;
    font-weight: 900;
}

#games-page .game-item.game-item-pending .team-rating {
    margin-bottom: 24px;
    color: rgba(221, 228, 241, 0.78);
    font-size: 0.98rem;
    font-weight: 800;
}

#games-page .game-item.game-item-pending .players-list {
    gap: 10px;
}

#games-page .game-item.game-item-pending .players-list li {
    min-height: 50px;
    padding: 8px 10px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(31, 40, 58, 0.94), rgba(20, 29, 44, 0.98));
    border: 1px solid rgba(105, 122, 153, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

#games-page .game-item.game-item-pending .player-name {
    color: rgba(246, 249, 255, 0.98);
    font-size: 0.98rem;
    font-weight: 800;
}

#games-page .game-item.game-item-pending .player-rating-badge {
    min-width: 54px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #d8e8ff;
    font-size: 0.94rem;
    font-weight: 900;
    background: rgba(12, 19, 31, 0.74);
    border-color: rgba(112, 132, 168, 0.34);
}

#games-page .game-item.game-item-pending .vs {
    position: relative;
    isolation: isolate;
    align-self: start;
    width: 70px;
    height: 70px;
    margin: 20px -1px 0;
    padding: 0;
    color: #ffdf56;
    font-size: 1.34rem;
    font-weight: 900;
    background: transparent;
    border: 0;
    text-shadow: 0 0 12px rgba(255, 223, 86, 0.34);
    box-shadow: 0 0 20px rgba(255, 202, 58, 0.08);
}

#games-page .game-item.game-item-pending .vs::before,
#games-page .game-item.game-item-pending .vs::after {
    content: "";
    position: absolute;
    clip-path: polygon(22% 0, 78% 0, 100% 50%, 78% 100%, 22% 100%, 0 50%);
    pointer-events: none;
}

#games-page .game-item.game-item-pending .vs::before {
    z-index: -2;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 202, 58, 0.5), rgba(111, 78, 26, 0.48));
}

#games-page .game-item.game-item-pending .vs::after {
    z-index: -1;
    inset: 1px;
    background:
        linear-gradient(180deg, rgba(31, 38, 50, 0.98), rgba(12, 18, 28, 0.99));
}

#games-page .game-item.game-item-pending .win-btn {
    width: 100%;
    margin-top: 18px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #070b12;
    font-size: 0.82rem;
    font-weight: 900;
    background: linear-gradient(180deg, #ffe49b, #f1c85f);
    border: 1px solid rgba(255, 233, 157, 0.7);
    box-shadow: 0 8px 18px rgba(240, 199, 95, 0.14);
}

/* Pending/manual game cards: compact neutral row */
#games-page .game-item.game-item-pending {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 0;
    min-height: 270px;
    padding: 26px 16px 18px 28px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 82% 16%, rgba(255, 223, 143, 0.06), transparent 18%),
        radial-gradient(circle at 8% 78%, rgba(93, 119, 164, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(18, 27, 39, 0.96), rgba(8, 14, 23, 0.99));
}

#games-page .game-item.game-item-pending .game-completed-summary {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    margin: -26px 0 -18px -28px;
    padding: 22px 12px 22px 18px;
    border-right: 1px solid rgba(105, 122, 153, 0.16);
    background:
        linear-gradient(90deg, rgba(10, 18, 30, 0.66), rgba(12, 21, 33, 0.3));
    color: rgba(229, 235, 248, 0.8);
}

#games-page .game-item.game-item-pending .game-completed-summary-game {
    color: rgba(235, 241, 252, 0.92);
    font-size: 1rem;
    font-weight: 700;
}

#games-page .game-item.game-item-pending .game-completed-summary-map,
#games-page .game-item.game-item-pending .game-completed-summary-date,
#games-page .game-item.game-item-pending .game-completed-summary-meta {
    color: rgba(210, 219, 238, 0.72);
    font-size: 0.95rem;
    font-weight: 500;
}

#games-page .game-item.game-item-pending .game-completed-summary-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

#games-page .game-item.game-item-pending .game-header {
    position: absolute;
    top: 18px;
    right: 8px;
    margin: 0;
    padding: 0;
    z-index: 5;
}

#games-page .game-item.game-item-pending .game-title-content,
#games-page .game-item.game-item-pending .game-event-lead,
#games-page .game-item.game-item-pending .game-date,
#games-page .game-item.game-item-pending .game-creator,
#games-page .game-item.game-item-pending .game-event-track {
    display: none;
}

#games-page .game-item.game-item-pending .kebab-menu {
    padding-top: 0;
}

#games-page .game-item.game-item-pending .kebab-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(150, 161, 191, 0.24);
    border-radius: 12px;
    background: transparent;
    box-shadow:
        0 10px 22px rgba(5, 8, 16, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#games-page .game-item.game-item-pending .game-teams {
    grid-column: 2;
    grid-row: 1 / 3;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    padding-left: 10px;
    padding-right: 0;
}

#games-page .game-item.game-item-pending .game-team,
#games-page .game-item.game-item-pending .game-team:first-child,
#games-page .game-item.game-item-pending .game-team:last-child {
    min-height: 0;
    padding: 16px 18px 12px;
    border-radius: 12px;
    clip-path: none;
    background:
        radial-gradient(circle at 8% 24%, rgba(117, 143, 184, 0.1), transparent 34%),
        linear-gradient(90deg, rgba(26, 43, 62, 0.3), rgba(12, 22, 29, 0.64) 78%);
    border-color: rgba(105, 122, 153, 0.24);
    box-shadow: inset 0 0 0 1px rgba(105, 122, 153, 0.08);
}

#games-page .game-item.game-item-pending .game-team h4,
#games-page .game-item.game-item-pending .game-team:last-child h4 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding-right: 0;
    color: rgba(226, 235, 250, 0.92);
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
}

#games-page .game-item.game-item-pending .game-team h4::before {
    content: "";
    width: 38px;
    height: 44px;
    flex: 0 0 auto;
    clip-path: polygon(50% 0, 88% 14%, 88% 48%, 50% 100%, 12% 48%, 12% 14%);
    background:
        linear-gradient(135deg, rgba(196, 171, 79, 0.86), rgba(101, 105, 76, 0.7));
    box-shadow: inset 0 0 0 3px rgba(13, 19, 30, 0.84);
}

#games-page .game-item.game-item-pending .team-rating-inline {
    color: rgba(255, 223, 143, 0.9);
    font-size: 0.92em;
    font-weight: 700;
}

#games-page .game-item.game-item-pending .team-rating {
    display: none;
}

#games-page .game-item.game-item-pending .players-list {
    gap: 0;
}

#games-page .game-item.game-item-pending .players-list li {
    min-height: 34px;
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid rgba(122, 139, 168, 0.09);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#games-page .game-item.game-item-pending .players-list li:last-child {
    border-bottom: 0;
}

/* Keep match-history player lists from inheriting the rating-page panel style. */
#games-page .game-item .players-list,
#games-page .game-item.game-item-completed .players-list,
#games-page .game-item.game-item-pending .players-list {
    position: static;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

#games-page .game-item .players-list::before,
#games-page .game-item.game-item-completed .players-list::before,
#games-page .game-item.game-item-pending .players-list::before {
    content: none;
    display: none;
}

#games-page .game-item.game-item-completed .players-list li,
#games-page .game-item.game-item-pending .players-list li {
    min-height: 34px;
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid rgba(122, 139, 168, 0.09);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#games-page .game-item.game-item-completed .players-list li:last-child,
#games-page .game-item.game-item-pending .players-list li:last-child {
    border-bottom: 0;
}

#games-page .game-item.game-item-pending .player-info {
    gap: 9px;
}

#games-page .game-item.game-item-pending .player-color-indicator {
    display: block;
    width: 6px;
    height: 24px;
    border-radius: 999px;
    border-color: rgba(255, 255, 255, 0.16);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(0, 0, 0, 0.16));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 2px 7px rgba(0, 0, 0, 0.3);
}

#games-page .game-item.game-item-pending .civilization-icon,
#games-page .game-item.game-item-pending .civilization-icon img {
    width: 28px;
    height: 28px;
}

#games-page .game-item.game-item-pending .player-name {
    color: rgba(235, 240, 250, 0.88);
    font-size: 0.96rem;
    font-weight: 500;
}

#games-page .game-item.game-item-pending .player-rating-badge {
    min-width: 54px;
    padding: 0;
    border: 0;
    color: rgba(205, 215, 235, 0.82);
    background: transparent;
    font-size: 0.94rem;
    font-weight: 500;
}

#games-page .game-item.game-item-pending .vs {
    align-self: center;
    justify-self: center;
    width: 48px;
    height: auto;
    margin: 0;
    color: #ffcf37;
    font-size: 1.62rem;
    background: transparent;
    border: 0;
    text-shadow: 0 0 12px rgba(255, 207, 55, 0.24);
    box-shadow: none;
}

#games-page .game-item.game-item-pending .vs::before,
#games-page .game-item.game-item-pending .vs::after {
    display: none;
}

#games-page .game-item.game-item-pending .win-btn {
    width: auto;
    min-width: 118px;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    color: #171b27 !important;
    font-size: 0.82rem;
    font-weight: 900;
    background:
        linear-gradient(180deg, #ffe59a, #d8af4e);
    border: 1px solid rgba(255, 232, 156, 0.72);
    box-shadow:
        0 8px 18px rgba(216, 175, 78, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

#games-page .game-item.game-item-pending .win-btn:hover {
    transform: translateY(-1px);
    color: #101522 !important;
    border-color: rgba(255, 238, 177, 0.9);
    background:
        linear-gradient(180deg, #fff0bd, #e4bf62);
    box-shadow:
        0 10px 24px rgba(216, 175, 78, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

#games-page .game-item.game-item-pending .auto-match-info {
    margin-top: 12px;
    color: rgba(210, 219, 238, 0.68);
    font-size: 0.82rem;
    font-weight: 600;
}

#games-page .game-item.game-item-completed.game-size-2,
#games-page .game-item.game-item-pending.game-size-2 {
    min-height: 210px;
}

#games-page .game-item.game-item-completed.game-size-3,
#games-page .game-item.game-item-pending.game-size-3 {
    min-height: 238px;
}

#games-page .game-item.game-item-completed.game-size-4,
#games-page .game-item.game-item-pending.game-size-4 {
    min-height: 270px;
}

@media (max-width: 980px) {
    #games-page .game-item.game-item-completed .game-title-content,
    #games-page .game-item.game-item-pending .game-title-content {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    #games-page .game-item.game-item-completed .game-event-track,
    #games-page .game-item.game-item-pending .game-event-track {
        grid-column: 1 / -1;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #games-page .game-item.game-item-completed .game-event-emblem,
    #games-page .game-item.game-item-pending .game-event-emblem {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 768px) {
    #games-page .game-item.game-item-completed,
    #games-page .game-item.game-item-pending {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        row-gap: 14px;
        min-height: 0;
        padding: 14px;
    }

    #games-page .game-item.game-item-completed .game-completed-summary,
    #games-page .game-item.game-item-pending .game-completed-summary {
        grid-column: 1;
        grid-row: 1;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 5px 10px;
        margin: 0;
        padding: 0 0 12px 44px;
        border-right: 0;
        border-bottom: 1px solid rgba(105, 122, 153, 0.18);
        background: transparent;
    }

    #games-page .game-completed-summary .kebab-menu-summary {
        top: 0;
        left: 0;
    }

    #games-page .game-item.game-item-completed .game-completed-summary-game,
    #games-page .game-item.game-item-pending .game-completed-summary-game {
        flex: 0 0 100%;
        font-size: 1rem;
        line-height: 1.2;
    }

    #games-page .game-item.game-item-completed .game-completed-summary-map,
    #games-page .game-item.game-item-completed .game-completed-summary-date,
    #games-page .game-item.game-item-completed .game-completed-summary-meta,
    #games-page .game-item.game-item-pending .game-completed-summary-map,
    #games-page .game-item.game-item-pending .game-completed-summary-date,
    #games-page .game-item.game-item-pending .game-completed-summary-meta {
        font-size: 0.88rem;
        line-height: 1.25;
    }

    #games-page .game-item.game-item-completed .game-header,
    #games-page .game-item.game-item-pending .game-header {
        top: 12px;
        right: 10px;
    }

    #games-page .game-item.game-item-completed .game-title-content,
    #games-page .game-item.game-item-pending .game-title-content {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    #games-page .game-item.game-item-completed .game-event-track,
    #games-page .game-item.game-item-pending .game-event-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #games-page .game-item.game-item-completed .game-event-track::before,
    #games-page .game-item.game-item-pending .game-event-track::before {
        display: none;
    }

    #games-page .game-item.game-item-completed .game-event-node,
    #games-page .game-item.game-item-completed .game-duration-badge,
    #games-page .game-item.game-item-completed .game-status,
    #games-page .game-item.game-item-pending .game-event-node,
    #games-page .game-item.game-item-pending .game-duration-badge,
    #games-page .game-item.game-item-pending .game-status {
        min-height: 64px;
        padding-top: 40px;
    }

    #games-page .game-item.game-item-completed .game-event-node::before,
    #games-page .game-item.game-item-completed .game-duration-badge::before,
    #games-page .game-item.game-item-completed .game-status::before,
    #games-page .game-item.game-item-pending .game-event-node::before,
    #games-page .game-item.game-item-pending .game-duration-badge::before,
    #games-page .game-item.game-item-pending .game-status::before {
        width: 42px;
        height: 42px;
    }

    #games-page .game-item.game-item-completed .game-teams,
    #games-page .game-item.game-item-pending .game-teams {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding-left: 0;
        padding-right: 0;
    }

    #games-page .game-item.game-item-completed .game-team,
    #games-page .game-item.game-item-completed .game-team:first-child,
    #games-page .game-item.game-item-completed .game-team:last-child,
    #games-page .game-item.game-item-pending .game-team,
    #games-page .game-item.game-item-pending .game-team:first-child,
    #games-page .game-item.game-item-pending .game-team:last-child {
        min-height: 0;
        width: 100%;
        padding: 14px 18px 12px;
        clip-path: none;
    }

    #games-page .game-item.game-item-completed .game-teams::before {
        display: none;
    }

    #games-page .game-item.game-item-completed .vs,
    #games-page .game-item.game-item-pending .vs {
        width: 100%;
        height: auto;
        min-height: 0;
        margin: -2px 0;
        clip-path: none;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        line-height: 1;
    }

    #games-page .game-item.game-item-completed .vs::before,
    #games-page .game-item.game-item-completed .vs::after,
    #games-page .game-item.game-item-pending .vs::before,
    #games-page .game-item.game-item-pending .vs::after {
        display: none;
    }
}

/* Match cards polish: larger civilization crests, solid team shields and a glowing VS divider. */
#games-page .game-item.game-item-completed .game-teams,
#games-page .game-item.game-item-pending .game-teams {
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
}

#games-page .game-item.game-item-completed .players-list li,
#games-page .game-item.game-item-pending .players-list li {
    min-height: 40px;
    padding-block: 5px;
}

#games-page .game-item.game-item-completed .player-info,
#games-page .game-item.game-item-pending .player-info {
    gap: 10px;
}

#games-page .game-item.game-item-completed .civilization-icon,
#games-page .game-item.game-item-completed .civilization-icon img,
#games-page .game-item.game-item-pending .civilization-icon,
#games-page .game-item.game-item-pending .civilization-icon img {
    width: 30px;
    height: 30px;
}

#games-page .game-item.game-item-completed .civilization-icon img,
#games-page .game-item.game-item-pending .civilization-icon img {
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.42));
}

#games-page .game-item.game-item-completed .civilization-icon.fallback .civ-fallback,
#games-page .game-item.game-item-pending .civilization-icon.fallback .civ-fallback {
    font-size: 12px;
}

#games-page .game-item.game-item-completed .game-team h4::before,
#games-page .game-item.game-item-pending .game-team h4::before {
    width: 38px;
    height: 45.6px;
    clip-path: polygon(50% 0, 92% 15%, 92% 50%, 76% 78%, 50% 100%, 24% 78%, 8% 50%, 8% 15%);
    box-shadow: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.34));
}

#games-page .game-item.game-item-completed .game-team.winner h4::before,
#games-page .game-item.game-item-pending .game-team:last-child h4::before {
    background: linear-gradient(145deg, #a7ef55 0%, #65ba38 52%, #39751f 100%);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 7px rgba(117, 220, 69, 0.24));
}

#games-page .game-item.game-item-completed .game-team.loser h4::before,
#games-page .game-item.game-item-pending .game-team:first-child h4::before {
    background: linear-gradient(145deg, #ff575c 0%, #d5323e 52%, #7e1d2a 100%);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 7px rgba(239, 61, 71, 0.22));
}

#games-page .game-item.game-item-completed .vs,
#games-page .game-item.game-item-pending .vs {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    width: 64px;
    height: auto;
    min-height: 100%;
    margin: 0;
    color: #ffd84d;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    text-shadow: 0 0 7px rgba(255, 216, 77, 0.95), 0 0 18px rgba(255, 182, 34, 0.58);
    background: radial-gradient(circle at center, rgba(255, 199, 47, 0.12), transparent 48%);
    box-shadow: none;
}

#games-page .game-item.game-item-completed .vs::before,
#games-page .game-item.game-item-completed .vs::after,
#games-page .game-item.game-item-pending .vs::before,
#games-page .game-item.game-item-pending .vs::after {
    content: "";
    position: static;
    z-index: 0;
    display: block;
    width: 1px;
    min-height: 24px;
    flex: 1 1 auto;
    clip-path: none;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255, 205, 68, 0.9));
    box-shadow: 0 0 5px rgba(255, 207, 76, 0.9), 0 0 13px rgba(255, 176, 35, 0.52);
}

#games-page .game-item.game-item-completed .vs::after,
#games-page .game-item.game-item-pending .vs::after {
    background: linear-gradient(to bottom, rgba(255, 205, 68, 0.9), transparent);
}

@media (max-width: 760px) {
    #games-page .game-item.game-item-completed .game-teams,
    #games-page .game-item.game-item-pending .game-teams {
        grid-template-columns: minmax(0, 1fr);
    }

    #games-page .game-item.game-item-completed .vs,
    #games-page .game-item.game-item-pending .vs {
        flex-direction: row;
        align-self: center;
        width: 100%;
        min-height: 28px;
        margin: 0;
        gap: 12px;
        font-size: 1.05rem;
        background: radial-gradient(ellipse at center, rgba(255, 199, 47, 0.1), transparent 42%);
    }

    #games-page .game-item.game-item-completed .vs::before,
    #games-page .game-item.game-item-completed .vs::after,
    #games-page .game-item.game-item-pending .vs::before,
    #games-page .game-item.game-item-pending .vs::after {
        display: block;
        width: auto;
        height: 1px;
        min-height: 0;
        flex: 1 1 auto;
        background: linear-gradient(to right, transparent, rgba(255, 205, 68, 0.82));
    }

    #games-page .game-item.game-item-completed .vs::after,
    #games-page .game-item.game-item-pending .vs::after {
        background: linear-gradient(to right, rgba(255, 205, 68, 0.82), transparent);
    }
}
