﻿body {
    background: #f7f8fa;
    overflow-x: hidden;
}

.app-auth-body {
    background: #eaf2fb;
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.modal-backdrop {
    z-index: 1990 !important;
}

.modal {
    z-index: 2000 !important;
}

.profile-avatar-btn {
    line-height: 0;
}

.nav-messages-btn {
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    position: relative;
    background: #000000;
    border: 1px solid #3a3a3a;
    color: #d8b89a;
}

.nav-messages-btn:hover,
.nav-messages-btn:focus {
    background: #000000;
    border-color: #5a5a5a;
    color: #f0d5b8;
}

.nav-messages-icon {
    transform: translateY(-1px);
    font-size: 1.15rem;
}

.nav-messages-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 1px solid #fff;
}

.messages-list {
    display: grid;
    gap: 0.7rem;
}

.messages-item {
    border: 1px solid rgba(16, 40, 63, 0.16);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    background: #ffffff;
}

.messages-item.is-unread {
    border-color: rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.06);
}

.messages-item.is-read {
    opacity: 0.9;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: #d4dbe3;
    color: #1a2b3f;
    font-weight: 700;
}

.avatar img,
img.avatar {
    object-fit: cover;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
}

.avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 1.5rem;
}

.avatar-fallback {
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.app-topbar {
    min-height: 84px;
}

.app-topbar .navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
}

.nav-competition-select {
    min-width: 210px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.92);
}

.app-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-link-admin-highlight {
    font-weight: 700;
    color: #ffd166 !important;
}

.nav-link-admin-highlight:hover,
.nav-link-admin-highlight:focus {
    color: #ffe29a !important;
}

.oldschool-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7em;
    height: 1.35em;
    margin-right: 0.45em;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #101823;
    background: #f2f5f8;
    border-radius: 0.25rem;
}

.app-navbar .dropdown-menu {
    background-color: rgba(28, 28, 28, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-navbar .dropdown-item {
    color: #f1f4f8;
}

.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.app-navbar .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.18);
}

#world-bg-layer {
    position: fixed;
    top: 138px;
    left: 0;
    right: 0;
    bottom: 8px;
    opacity: 0.95;
    pointer-events: none;
    z-index: 0;
}

#app-fifa-bg-layer {
    position: fixed;
    top: 84px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url('/assets/img/fifa.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.3;
}

#world-svg-container,
#world-svg-container svg {
    width: 100%;
    height: 100%;
}

#world-svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0.5rem 0.5rem;
}

#world-svg-container svg {
    width: min(calc(100vw - 320px), 1360px);
    height: auto;
    max-height: calc(100vh - 170px);
    filter: brightness(0.9) contrast(1.05) saturate(0.08);
    pointer-events: none;
}

#world-svg-container svg [id] {
    transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
    fill: #a6a6a6 !important;
    stroke: none !important;
    stroke-width: 0 !important;
}

#world-svg-container svg [id].country-highlighted {
    fill: #ff0000 !important;
    stroke: none !important;
    stroke-width: 0 !important;
    filter: none !important;
}

#portugal-bg-layer {
    position: fixed;
    top: 138px;
    left: 0;
    right: 0;
    bottom: 8px;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#portugal-map-container {
    position: relative;
    width: min(calc(100vw - 320px), 1220px);
    height: calc(100vh - 190px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#portugal-map-image {
    max-width: 100%;
    max-height: 100%;
    filter: contrast(1.05) brightness(0.96);
}

#portugal-city-markers {
    position: absolute;
    inset: 0;
}

.pt-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    background: rgba(255, 70, 70, 0.85);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.38), 0 0 0 7px rgba(255, 70, 70, 0.18);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.pt-marker.is-active {
    opacity: 1;
    transform: scale(1.1);
}

.pt-clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 0.2rem;
}

.pt-club-item {
    border: 1px solid rgba(12, 28, 44, 0.2);
    background: rgba(248, 250, 253, 0.95);
    border-radius: 6px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem;
    cursor: pointer;
}

.pt-club-item:hover,
.pt-club-item:focus {
    transform: translateY(-1px);
    border-color: rgba(222, 53, 53, 0.62);
}

.pt-club-logo {
    max-width: 34px;
    max-height: 30px;
    object-fit: contain;
}

.pt-club-fallback {
    font-size: 0.68rem;
    font-weight: 700;
    color: #12263c;
    letter-spacing: 0.04em;
}

.world-flags-strip {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(10, 31, 56, 0.12);
}

.world-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 0.1rem;
}

.world-flag-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.08rem 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.world-flag-img {
    width: 34px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.world-flag-item:hover,
.world-flag-item:focus {
    transform: scale(1.18);
}

.country-info-panel {
    position: fixed;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 290px;
    z-index: 3;
    background: rgba(8, 14, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    color: #f3f6fb;
    padding: 0.95rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.country-info-title {
    color: #ff5e5e;
    font-weight: 700;
}

.table td,
.table th {
    vertical-align: middle;
}

.match-sticky-head {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #8c8c8c !important;
    color: #000 !important;
    border: 1px solid #c6c6c6 !important;
    box-shadow: inset 0 -2px 0 #7a7a7a;
}

.matches-sticky-toolbar {
    position: sticky;
    top: 84px;
    z-index: 7;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.45rem 0 0.5rem;
}

main {
    position: relative;
}

.landing-body {
    background-color: #0b1e35;
}

.landing-hero {
    min-height: calc(100dvh - 84px);
    position: relative;
    background-image: url('/assets/img/fifa.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #ffffff;
}

.landing-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(8, 20, 37, 0.82), rgba(8, 20, 37, 0.45));
}

.landing-content {
    position: relative;
    z-index: 2;
}

.landing-card {
    background: rgba(8, 24, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 1.25rem;
    backdrop-filter: blur(4px);
}

.landing-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #9ed0ff;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.countdown-box {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    padding: 0.85rem;
    text-align: center;
}

.countdown-value {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 700;
}

.countdown-label {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .landing-card {
        padding: 2rem;
    }

    .countdown-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-topbar {
        min-height: 74px;
    }

    #world-bg-layer {
        top: 128px;
        left: 0;
        right: 0;
        bottom: 6px;
    }

    #portugal-bg-layer {
        top: 128px;
        bottom: 6px;
    }

    #app-fifa-bg-layer {
        top: 74px;
        background-position: center top;
    }

    #world-svg-container svg {
        width: min(100vw, 880px);
        max-height: calc(100vh - 210px);
    }

    #portugal-map-container {
        width: min(100vw - 14px, 860px);
        height: calc(100vh - 240px);
    }

    .landing-hero {
        min-height: calc(100dvh - 74px);
        background-position: center top;
    }

    .landing-content {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .landing-card {
        padding: 1rem;
    }

    .table {
        font-size: 0.92rem;
    }

    .matches-sticky-toolbar {
        top: 74px;
    }

    .world-flags-grid {
        grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
        gap: 0.06rem;
    }

    .world-flag-item {
        font-size: 0.95rem;
    }

    .world-flag-img {
        width: 28px;
        height: 20px;
    }

    .country-info-panel {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: auto;
        margin: 0.6rem 0.75rem 0;
        max-height: 42dvh;
        overflow: auto;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 42px;
    }

    .nav-competition-select {
        min-width: 160px;
        max-width: 190px;
    }
}

.matches-table-wrap {
    max-height: calc(100vh - 280px);
    overflow: auto;
}

@media (max-width: 1100px) {
    #world-svg-container svg {
        width: min(calc(100vw - 280px), 1200px);
    }

    .country-info-panel {
        width: 250px;
    }

    .world-flag-img {
        width: 30px;
        height: 22px;
    }
}

.chat-card,
.chat-online-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(16, 40, 63, 0.12);
    box-shadow: 0 8px 24px rgba(6, 25, 42, 0.08);
}

.chat-messages {
    height: min(62vh, 620px);
    overflow: auto;
    padding: 0.9rem;
    background: linear-gradient(180deg, rgba(234, 242, 251, 0.65), rgba(248, 250, 253, 0.95));
}

.chat-message-row {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
    align-items: flex-start;
}

.chat-message-row-me {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    flex: 0 0 auto;
}

.chat-message-bubble-wrap {
    max-width: min(78%, 740px);
}

.chat-message-meta {
    font-size: 0.72rem;
    color: #4a5f74;
    margin-bottom: 0.22rem;
}

.chat-message-bubble {
    background: #ffffff;
    border: 1px solid rgba(7, 26, 46, 0.12);
    border-radius: 12px;
    padding: 0.52rem 0.68rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message-quoted {
    border-left: 3px solid rgba(11, 94, 215, 0.6);
    background: rgba(11, 94, 215, 0.08);
    padding: 0.22rem 0.42rem;
    margin-bottom: 0.28rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #274a69;
}

.chat-message-bubble-me {
    background: #0b5ed7;
    border-color: #0b5ed7;
    color: #ffffff;
}

.chat-reply-btn {
    margin-top: 0.25rem;
    padding: 0.07rem 0.45rem;
    font-size: 0.76rem;
}

.chat-form .form-control {
    min-height: 44px;
}

.chat-reply-preview {
    border: 1px solid rgba(11, 94, 215, 0.25);
    background: rgba(11, 94, 215, 0.08);
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.55rem;
}

.chat-reply-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #244865;
}

.chat-reply-text {
    font-size: 0.82rem;
    color: #1f3348;
    margin-bottom: 0.42rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-toolbar-top {
    display: flex;
    justify-content: center;
    padding: 0.55rem 0.55rem 0;
}

.chat-emoji-toolbar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.chat-typing-indicator {
    font-size: 0.82rem;
    color: #33506c;
    padding: 0.35rem 0.85rem 0.75rem;
}

.chat-reactions {
    margin-top: 0.32rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.chat-reaction-btn {
    border: 1px solid rgba(7, 26, 46, 0.18);
    background: #f8fbff;
    padding: 0.08rem 0.42rem;
    line-height: 1.2;
    font-size: 0.78rem;
}

.chat-reaction-btn.active {
    background: #dbeafe;
    border-color: #0b5ed7;
    color: #0b3f8f;
}

.chat-online-users {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 0.45rem;
    max-height: min(62vh, 620px);
    overflow: auto;
}

.chat-online-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: 1px solid rgba(16, 40, 63, 0.08);
    border-radius: 8px;
    background: rgba(248, 250, 253, 0.9);
}

@media (max-width: 767.98px) {
    .chat-messages,
    .chat-online-users {
        max-height: none;
        height: 46vh;
    }

    .chat-message-bubble-wrap {
        max-width: 88%;
    }
}

.oldschool-list-card,
.oldschool-frame-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(16, 40, 63, 0.12);
    box-shadow: 0 8px 24px rgba(6, 25, 42, 0.08);
}

.oldschool-frame-card .card-body {
    overflow: hidden;
}

.oldschool-iframe {
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 0;
    border: 0;
    display: block;
    background: #0a1726;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .oldschool-iframe {
        height: calc(100vh - 300px);
        min-height: 0;
    }
}


.oldschool-mini-icon {
    width: 1.7em;
    height: 1.35em;
    margin-right: 0.45em;
    border-radius: 0.25rem;
    object-fit: cover;
    vertical-align: -0.2em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.whats-new-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1080;
    border-radius: 999px;
    font-weight: 600;
    padding: 0.48rem 0.86rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.whats-new-modal-dialog {
    max-width: 620px;
    width: min(92vw, 620px);
}

.whats-new-modal-body {
    max-height: 52vh;
    overflow-y: auto;
}

.all-bets-table th,
.all-bets-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.all-bets-table {
    border-collapse: separate;
    border-spacing: 0;
}

.all-bets-wrap {
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.all-bets-table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #9a9a9a !important;
    color: #000;
    border-color: #c6c6c6;
}

.all-bets-table thead .all-bets-head-row-1 th {
    position: sticky;
    top: 0;
    z-index: 8;
    background: #9a9a9a !important;
}

.all-bets-table thead .all-bets-head-row-2 th {
    position: sticky;
    top: 46px;
    z-index: 7;
    background: #9a9a9a !important;
}

.bets-themed-table {
    border-collapse: collapse;
}

.bets-themed-table thead th {
    background: #9a9a9a !important;
    color: #000 !important;
    border: 1px solid #c6c6c6;
    text-align: center;
    font-size: 1.02rem;
}

.bets-themed-table tbody td {
    border: 1px solid #c6c6c6;
    background: #dedede;
    font-size: 1.02rem;
}

.my-bets-table > tbody > tr:nth-child(odd),
.all-bets-table > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.my-bets-table > tbody > tr:nth-child(even),
.all-bets-table > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.ranking-user-col {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.ranking-metric-col {
    width: 116px;
    min-width: 116px;
    max-width: 116px;
    white-space: nowrap;
}

.ranking-table th,
.ranking-table td {
    white-space: nowrap;
}

.ranking-table > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.ranking-table > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.all-bets-cell-win {
    --bs-table-bg: #00ff5e !important;
    --bs-table-accent-bg: #00ff5e !important;
    background: #00ff5e !important;
    color: #003312;
    font-weight: 700;
}

.all-bets-cell-loss {
    --bs-table-bg: #ff1f1f !important;
    --bs-table-accent-bg: #ff1f1f !important;
    background: #ff1f1f !important;
    color: #ffffff;
    font-weight: 700;
}

.admin-single-bar,
.admin-stack-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #e8edf3;
    border: 1px solid rgba(12, 28, 44, 0.12);
}

.admin-single-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2d8cff, #0b5ed7);
}

.admin-stack-bar > span {
    display: block;
    height: 100%;
    float: left;
}

.admin-seg-na {
    background: #111111;
}

.admin-seg-lost {
    background: #dc3545;
}

.admin-seg-won {
    background: #198754;
}

.history-map-shell {
    position: relative;
    border: 1px solid rgba(12, 28, 44, 0.12);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.history-map-bg {
    height: min(50vh, 460px);
    position: relative;
    overflow: hidden;
}

.history-map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.05) saturate(0.15);
}

.history-map-euro .history-map-image {
    object-position: 67% 32%;
    transform: scale(1.65);
    transform-origin: center center;
}

.history-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
    gap: 0.15rem;
    padding: 0.35rem 0.5rem 0.5rem;
    background: rgba(8, 14, 24, 0.88);
}

.history-flag-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-flag-img {
    width: 26px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.history-side-menu {
    position: fixed;
    top: 60%;
    transform: translateY(-50%);
    left: -172px;
    z-index: 1035;
    width: 210px;
    transition: left 0.2s ease;
}

.history-side-menu:hover {
    left: 0;
}

.history-side-handle {
    position: absolute;
    right: -38px;
    top: 0;
    width: 38px;
    height: 140px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    padding: 0.35rem 0.25rem;
    border-radius: 0 8px 8px 0;
    background: #111;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.history-side-links {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(12, 28, 44, 0.16);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    padding: 0.45rem;
    display: grid;
    gap: 0.3rem;
}

.history-side-link {
    text-decoration: none;
    color: #0f2134;
    border: 1px solid rgba(10, 45, 88, 0.16);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-size: 0.88rem;
}

.history-side-link:hover,
.history-side-link.active {
    background: #0b5ed7;
    color: #fff;
    border-color: #0b5ed7;
}

.history-content-card {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.history-content-card-wide {
    max-width: 1320px;
}

.history-topbar {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.history-table-wrap {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.history-table-wrap .table {
    font-size: 0.95rem;
}

.history-2002-layout {
    display: grid;
    grid-template-columns: minmax(700px, 1.3fr) minmax(480px, 1fr);
    gap: 0.9rem;
}

.history-2002-matches {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    overflow: auto;
    max-height: 72vh;
    background: #f3f3f3;
}

.history-2002-excel {
    border-collapse: collapse;
}

.history-2002-excel th,
.history-2002-excel td {
    border: 1px solid #c6c6c6;
}

.history-2002-matches table thead th {
    background: #9a9a9a;
    color: #000;
    font-size: 1.15rem;
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: center;
}

.history-2002-matches table tbody td {
    background: #dedede;
    font-size: 1.02rem;
}

.history-2002-matches table tbody tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.history-2002-matches table tbody tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.history-2002-date {
    white-space: nowrap;
    text-align: center;
}

.history-2002-match-cell {
    display: flex;
    justify-content: space-between;
    gap: 0.45rem;
    align-items: center;
}

.history-2002-team {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.history-2002-code {
    font-weight: 700;
    min-width: 2.8rem;
    text-align: right;
}

.history-2002-flag {
    width: 24px;
    height: 16px;
    border: 1px solid #444;
    object-fit: cover;
}

.history-2002-city {
    text-align: left;
}

.history-2002-match-cell {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.45rem;
}

.history-2002-match-cell .history-2002-team:first-child {
    justify-content: flex-end;
}

.history-2002-match-cell .history-2002-team:last-child {
    justify-content: flex-start;
}

.history-2002-match-cell strong {
    min-width: 86px;
    text-align: center;
}

.matches-game-cell {
    display: table-cell !important;
    text-align: center;
    white-space: nowrap;
}

.matches-game-cell .history-2002-team {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    vertical-align: middle;
}

.matches-game-cell .history-2002-team:first-child {
    justify-content: flex-end;
}

.matches-game-cell .history-2002-team:last-child {
    justify-content: flex-start;
}

.matches-vs-label {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    vertical-align: middle;
}

.matches-team-emblem {
    object-fit: contain;
    background: transparent;
    border: 0 !important;
    box-shadow: none !important;
}

.matches-table-wrap .matches-main-table {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
    --bs-table-striped-bg: #d6d6d6;
    --bs-table-striped-color: #111;
}

.matches-table-wrap .matches-main-table > thead > tr > th {
    background-color: #8c8c8c !important;
    color: #000 !important;
    border: 1px solid #c6c6c6 !important;
    text-align: center;
    font-size: 1.02rem;
    box-shadow: inset 0 -2px 0 #7a7a7a;
}

.matches-table-wrap .matches-main-table > tbody > tr > td {
    color: #111 !important;
    border: 1px solid #c6c6c6 !important;
}

.matches-table-wrap .matches-main-table > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.matches-table-wrap .matches-main-table > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.matches-meta-cell {
    font-size: 0.9rem !important;
}

.history-2002-flag-placeholder {
    display: inline-block;
    background: #c8c8c8;
}

.history-2002-groups {
    display: grid;
    gap: 0.7rem;
    max-height: 72vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.history-group-card {
    border: 1px solid #202020;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.history-group-card-head {
    background: #00a53c;
    color: #fff;
    padding: 0.28rem 0.55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
}

.history-group-qualified {
    display: inline-flex;
    gap: 0.25rem;
}

.history-group-qualified img {
    width: 30px;
    height: 22px;
    border: 1px solid #111;
    object-fit: cover;
    opacity: 0.78;
}

.history-group-qualified img.is-qualified {
    opacity: 1;
    border-color: #f8f9fa;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.history-group-table thead th {
    background: #f4f4f4;
    text-align: center;
    white-space: nowrap;
    font-weight: 700;
}

.history-group-table tbody td {
    text-align: center;
    white-space: nowrap;
}

.history-group-table > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.history-group-table > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.history-group-table tbody td:first-child {
    text-align: center;
}

.history-group-table tbody td:nth-child(2) {
    text-align: left;
}

.history-group-team {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.history-group-team-flag {
    width: 20px;
    height: 14px;
    border: 1px solid #444;
    object-fit: cover;
}

.history-group-qualified-row {
    background: rgba(0, 105, 255, 0.08);
}

.history-group-qualified-row > td {
    background: rgba(0, 105, 255, 0.08) !important;
}

.history-bets-matrix th {
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.35rem 0.4rem;
}

.history-bets-matrix td {
    padding: 0.35rem 0.4rem;
}

.history-bets-matrix > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.history-bets-matrix > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.history-bets-matrix {
    table-layout: fixed;
}

.history-bets-matrix th:first-child,
.history-bets-matrix td:first-child {
    width: 205px;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.history-bets-wrap {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.history-bets-wrap > table > tbody > tr:nth-child(odd) {
    --bs-table-bg: #d6d6d6;
    --bs-table-accent-bg: #d6d6d6;
}

.history-bets-wrap > table > tbody > tr:nth-child(even) {
    --bs-table-bg: #ececec;
    --bs-table-accent-bg: #ececec;
}

.history-bets-game-cell {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    justify-items: center;
}

.history-bets-game-cell .history-2002-team:first-child {
    justify-content: flex-end;
}

.history-bets-game-cell .history-2002-team:last-child {
    justify-content: flex-start;
}

.history-pick-win {
    background: #00ff5e !important;
    color: #003312;
}

.history-pick-loss {
    background: #ff1f1f !important;
    color: #ffffff;
}

.history-phase-row td {
    background: #0b0b0b !important;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}

.history-total-row td {
    background: #e6e9ef !important;
    font-weight: 700;
}

.history-rules-frame-wrap {
    width: 100%;
    min-height: 70vh;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.history-rules-frame {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
    pointer-events: auto;
    user-select: none;
}

body.history-print-locked * {
    visibility: hidden !important;
}

.history-group-table {
    table-layout: fixed;
    min-width: 520px;
}

.history-group-table th:nth-child(1),
.history-group-table td:nth-child(1) {
    width: 34px;
}

.history-group-table th:nth-child(2),
.history-group-table td:nth-child(2) {
    width: 170px;
}

.history-group-table th:nth-child(n+3),
.history-group-table td:nth-child(n+3) {
    width: 44px;
}

@media (max-width: 991.98px) {
    .history-2002-layout {
        grid-template-columns: 1fr;
    }

    .history-2002-matches,
    .history-2002-groups {
        max-height: none;
    }

    .history-side-menu {
        position: static;
        width: auto;
        left: 0;
        transform: none;
        margin-bottom: 0.75rem;
    }

    .history-side-menu:hover {
        left: 0;
    }

    .history-side-handle {
        display: none;
    }

    .history-side-links {
        border-left: 1px solid rgba(12, 28, 44, 0.16);
        border-radius: 10px;
    }
}

.bulk-bet-floating {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1060;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    border-radius: 0.5rem;
}
