html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.app-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    margin-bottom: 0;
    overflow: hidden;
    background-color: #0d3f1b;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 2px, transparent 2px),
        radial-gradient(circle at center, transparent 0 8.2rem, rgba(255, 255, 255, 0.42) 8.25rem 8.35rem, transparent 8.4rem),
        linear-gradient(90deg, transparent 0 calc(50% - 1px), rgba(255, 255, 255, 0.42) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 9vw, rgba(0, 0, 0, 0.08) 9vw 18vw),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.12), transparent 24%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08), transparent 26%),
        linear-gradient(135deg, #145f24, #0b3b18 52%, #176a29);
    background-size:
        min(82vw, 1180px) min(56vw, 690px),
        min(82vw, 1180px) min(56vw, 690px),
        min(82vw, 1180px) min(56vw, 690px),
        min(82vw, 1180px) min(56vw, 690px),
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
    background-position:
        center 96px,
        center 96px,
        center 96px,
        center 96px,
        center,
        center,
        center,
        center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, no-repeat, no-repeat, no-repeat;
    background-attachment: fixed;
}

.app-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 9%, rgba(255, 255, 255, 0.38) 9% calc(9% + 2px), transparent calc(9% + 2px) 23%, rgba(255, 255, 255, 0.32) 23% calc(23% + 2px), transparent calc(23% + 2px) 77%, rgba(255, 255, 255, 0.32) 77% calc(77% + 2px), transparent calc(77% + 2px) 91%, rgba(255, 255, 255, 0.38) 91% calc(91% + 2px), transparent calc(91% + 2px)),
        linear-gradient(transparent 0 14%, rgba(255, 255, 255, 0.38) 14% calc(14% + 2px), transparent calc(14% + 2px) 86%, rgba(255, 255, 255, 0.38) 86% calc(86% + 2px), transparent calc(86% + 2px));
    opacity: 0.42;
}

.app-body > header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-navbar {
    margin-bottom: 0 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(8px);
}

.app-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.app-body .app-shell main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0 !important;
}

.app-body main > .dashboard-page,
.app-body main > .teams-page,
.app-body main > .competitions-page,
.app-body main > .competition-country-details-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.app-body main > .bet-provider-grid,
.app-body main > .country-details-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.app-body #countriesGrid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.app-footer {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.88);
}

.app-body .footer {
    position: static;
    line-height: 26px;
}

.app-body .app-page-header,
.app-body .countries-toolbar,
.app-body .details-header {
    color: #102018;
}

.bet-provider-grid {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 24px;
    align-items: start;
    min-height: 0;
}

.bet-provider-form,
.bet-provider-edit-form,
.bet-provider-list {
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.bet-provider-form,
.bet-provider-edit-form {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.bet-provider-form h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.bet-provider-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.bet-provider-list table {
    margin: 0;
}

.my-game-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.my-game-table {
    margin: 0;
}

.dashboard-table thead th,
.my-game-table thead th,
.teams-tree-table thead th,
.bet-provider-list thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: rgba(248, 250, 249, 0.98);
    box-shadow: inset 0 -1px #102018;
}

.my-game-team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.my-game-team-badge {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.my-game-country-flag {
    width: 34px;
    height: 22px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.my-game-series-count {
    font-weight: 700;
    font-size: 18px;
}

.my-game-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 16px;
}

.my-game-summary {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.my-game-summary div {
    min-width: 128px;
    padding: 10px 14px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    text-align: right;
}

.my-game-summary span {
    display: block;
    color: #5b665f;
    font-size: 13px;
}

.my-game-summary strong {
    color: #102018;
    font-size: 24px;
    line-height: 1;
}

.my-game-series-nav {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.my-game-series-nav button,
.my-game-sort-actions button {
    min-width: 34px;
    height: 32px;
    border: 1px solid #cbd5d0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.86);
    color: #102018;
    font-weight: 800;
}

.my-game-series-nav button:hover,
.my-game-series-nav button:focus,
.my-game-sort-actions button:hover,
.my-game-sort-actions button:focus {
    border-color: #147a4d;
    color: #147a4d;
}

.my-game-sort-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: auto;
}

.my-game-sort-actions button {
    min-width: 0;
    padding: 0 12px;
    color: #145f3f;
}

.my-game-bet-plan {
    display: grid;
    gap: 3px;
    color: #5b665f;
    font-size: 13px;
    line-height: 1.25;
}

.my-game-bet-plan strong {
    color: #102018;
}

.my-game-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.my-game-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dc3545;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #dc3545;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.my-game-remove-button:hover,
.my-game-remove-button:focus {
    background: #dc3545;
    color: #fff;
}

.bet-history-actions {
    display: inline-flex;
    justify-content: flex-end;
}

.bet-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5d0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #145f3f;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.bet-edit-button:hover,
.bet-edit-button:focus {
    border-color: #147a4d;
    background: #e7f4ed;
    color: #0f5132;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.dashboard-summary {
    display: grid;
    gap: 4px;
    min-width: 150px;
    padding: 12px 16px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    text-align: right;
}

.dashboard-summary span {
    color: #5b665f;
    font-size: 14px;
}

.dashboard-summary strong {
    color: #102018;
    font-size: 26px;
    line-height: 1;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-card {
    display: grid;
    gap: 14px;
    min-height: 220px;
    padding: 18px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.dashboard-card-heading {
    display: grid;
    gap: 3px;
}

.dashboard-card-heading span {
    color: #147a4d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dashboard-card-heading h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.dashboard-empty {
    display: flex;
    align-items: center;
    min-height: 120px;
    padding: 16px;
    border: 1px dashed #b7c5bd;
    border-radius: 8px;
    color: #5b665f;
    background: rgba(255, 255, 255, 0.5);
}

.dashboard-match-list {
    display: grid;
    gap: 10px;
}

.dashboard-match {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce4df;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.dashboard-match-time {
    display: grid;
    align-content: start;
    gap: 3px;
}

.dashboard-match-time strong {
    font-size: 18px;
}

.dashboard-match-time span {
    color: #5b665f;
    font-size: 12px;
}

.dashboard-match-main {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dashboard-match-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5b665f;
    font-size: 13px;
}

.dashboard-match-meta img {
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.dashboard-match-meta em {
    font-style: normal;
}

.dashboard-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.dashboard-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
}

.dashboard-team:last-child {
    justify-content: flex-end;
    text-align: right;
}

.dashboard-team img {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    object-fit: contain;
}

.dashboard-team.tracked-team {
    color: #116b44;
}

.dashboard-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 6px;
    background: #102018;
    color: #fff;
}

.dashboard-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-table {
    margin: 0;
}

.dashboard-table thead th {
    border-bottom: 1px solid #102018;
    white-space: nowrap;
}

.dashboard-table th:nth-child(7),
.dashboard-table td:nth-child(7) {
    text-align: center;
}

.dashboard-day-row {
    cursor: pointer;
    background: rgba(20, 122, 77, 0.12);
}

.dashboard-day-row td {
    padding: 12px 14px;
    border-top: 1px solid #cfdad4;
    border-bottom: 1px solid #cfdad4;
}

.dashboard-day-row strong {
    margin-left: 8px;
    font-size: 18px;
}

.dashboard-day-row span {
    margin-left: 14px;
    color: #147a4d;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-day-row em {
    margin-left: 12px;
    color: #5b665f;
    font-style: normal;
}

.dashboard-empty-row td {
    padding: 18px 48px;
    color: #5b665f;
    font-style: italic;
}

.dashboard-time-cell {
    width: 72px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-table-team,
.dashboard-table-competition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
}

.dashboard-table-team img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.dashboard-table-team.tracked-team {
    color: #116b44;
}

.dashboard-series-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 4px;
    border: 1px solid #b48717;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffe08a 0%, #d8a524 100%);
    color: #102018;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dashboard-table-competition {
    color: #5b665f;
    font-weight: 600;
}

.dashboard-table-competition img {
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.dashboard-table-competition em {
    color: #6e7771;
    font-style: normal;
}

.dashboard-table-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    background: #102018;
    color: #fff;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dashboard-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.dashboard-result-icon.success {
    background: #15803d;
}

.dashboard-result-icon.fail {
    background: #b42318;
}

.dashboard-bet-cell {
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
}

.dashboard-bet-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bet-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 82px;
    min-height: 30px;
    padding: 4px 14px;
    border: 1px solid #137d4c;
    border-radius: 6px;
    background: #198754;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.bet-action-button:hover,
.bet-action-button:focus {
    background: #137d4c;
    border-color: #106a40;
    color: #fff;
}

.bet-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.bet-status-pending {
    background: #fff3cd;
    color: #7a5700;
}

.bet-status-won {
    background: #d1e7dd;
    color: #0f5132;
}

.bet-status-lost {
    background: #f8d7da;
    color: #842029;
}

.bet-status-cancelled {
    background: #e2e3e5;
    color: #41464b;
}

.bet-positive {
    color: #0f7a45;
    font-weight: 800;
}

.bet-negative {
    color: #b42318;
    font-weight: 800;
}

.bet-history-panel,
.my-game-details-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.my-game-details-panel h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.bet-history-row,
.xgame-history-row {
    display: grid;
    grid-template-columns: 130px minmax(140px, 1.2fr) minmax(160px, 2fr) minmax(100px, 1fr) 80px 90px 100px;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-top: 1px solid #dce5e0;
    font-size: 14px;
}

.bet-history-row-rich {
    grid-template-columns: 130px minmax(180px, 1.4fr) minmax(90px, 0.7fr) minmax(130px, 1fr) minmax(200px, 1.6fr) minmax(130px, 1fr) 96px 34px;
}

.bet-history-original-match {
    color: #20272c;
    font-weight: 700;
}

.bet-history-provider {
    color: #0d6efd;
    font-weight: 900;
}

.bet-history-competition {
    color: #147a4d;
    font-weight: 800;
}

.bet-history-match {
    color: #20272c;
    font-weight: 700;
}

.bet-history-amount {
    display: inline-flex;
    justify-content: flex-end;
    font-weight: 800;
    white-space: nowrap;
}

.bet-history-amount small {
    color: inherit;
    font-size: 12px;
    font-weight: 800;
}

.xgame-history-row {
    grid-template-columns: 44px 130px minmax(140px, 1fr) minmax(180px, 2fr) 80px;
}

.bets-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bets-summary div {
    min-width: 120px;
    padding: 10px 14px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    text-align: right;
}

.bets-summary span {
    display: block;
    color: #5b665f;
    font-size: 13px;
}

.bets-summary strong {
    font-size: 22px;
}

.bets-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid #d5ded9;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.bets-filters label {
    display: grid;
    gap: 4px;
    margin: 0;
    color: #223028;
    font-weight: 700;
}

.bets-filters label span {
    font-size: 13px;
}

.bets-filters input[type="date"],
.bets-filters select {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #cfd9d4;
    border-radius: 6px;
    background: #fff;
    color: #223028;
}

.bets-show-all-toggle {
    display: inline-flex !important;
    grid-template-columns: auto auto;
    gap: 8px !important;
    align-items: center;
    min-height: 36px;
}

.bets-show-all-toggle input {
    width: 16px;
    height: 16px;
}

.bets-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    color: #5b665f;
    font-weight: 700;
}

.bets-pagination nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bets-match-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.bets-match-cell span {
    color: #6b7670;
}

.bets-match-cell strong {
    color: #20272c;
}

.bets-status-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bet-match-result {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #102018;
    color: #fff !important;
    font-weight: 800;
}

.bet-modal {
    border: 0;
    border-radius: 10px;
    overflow: hidden;
}

.bet-modal .modal-header {
    align-items: flex-start;
    border-bottom: 1px solid #dce5e0;
    background: #f6faf8;
}

.bet-modal-subtitle {
    margin: 4px 0 0;
    color: #5b665f;
    font-size: 14px;
}

.bet-modal-grid {
    display: grid;
    gap: 14px;
}

.bet-modal-grid label {
    display: grid;
    gap: 6px;
    color: #26312b;
    font-weight: 800;
}

.bet-modal-grid label span {
    font-size: 14px;
}

.bet-modal .modal-footer {
    border-top: 1px solid #dce5e0;
}

@media (max-width: 900px) {
    .bet-provider-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        display: grid;
    }

    .dashboard-summary {
        text-align: left;
    }

    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

.home-body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
}

.home-login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background-image: url('/images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.home-login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 14, 0.58);
}

.home-login-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 400px);
}

.home-login-form {
    box-sizing: border-box;
    display: grid;
    gap: 20px;
    padding: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    color: #102018;
}

.home-login-heading {
    text-align: center;
}

    .home-login-heading h1 {
        margin: 0;
        font-size: 30px;
        font-weight: 700;
    }

    .home-login-form .form-group {
        display: grid;
        gap: 8px;
    }

    .home-login-form label {
        font-weight: 600;
    }

    .home-login-form input[type="email"],
    .home-login-form input[type="password"] {
        box-sizing: border-box;
        display: block;
        width: 100%;
        height: 46px;
        padding: 0 14px;
        border: 1px solid #cfd7d3;
        border-radius: 6px;
        font-size: 16px;
    }

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin: -2px 0 0;
}

.home-login-form button {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 6px;
    background: #147a4d;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

    .home-login-form button:hover {
        background: #0f633e;
    }

.register-link {
    margin: -4px 0 0;
    color: #31443b;
    font-size: 15px;
    text-align: center;
}

    .register-link a {
        color: #147a4d;
        font-weight: 700;
        text-decoration: none;
    }

    .register-link a:hover {
        color: #0f633e;
        text-decoration: underline;
    }

.app-page-header {
    margin: 8px 0 24px;
}

.app-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

    .app-page-header-row > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-page-header h1 {
        margin: 0 0 6px;
        font-size: 32px;
        font-weight: 700;
    }

    .app-page-header p {
        margin: 0;
        color: #5b665f;
    }

.table-logo {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    object-fit: contain;
    vertical-align: middle;
}

.countries-toolbar {
    display: grid;
    gap: 18px;
    margin: 8px 0 24px;
}

.countries-title-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

    .countries-title-row h1 {
        margin: 0;
        font-size: 32px;
        font-weight: 700;
    }

.countries-search {
    width: min(100%, 360px);
}

.countries-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.countries-filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

    .countries-filters label {
        display: grid;
        gap: 6px;
        min-width: 160px;
        font-weight: 600;
    }

.countries-sync {
    text-align: right;
}

    .countries-sync p {
        margin: 8px 0 0;
        color: #5b665f;
        font-size: 14px;
    }

.countries-no-results {
    margin-top: 20px;
}

.country-group {
    margin: 28px 0;
}

    .country-group h2 {
        margin: 0 0 12px;
        padding-bottom: 6px;
        border-bottom: 1px solid #d8dedb;
        font-size: 22px;
        font-weight: 700;
    }

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 12px;
}

.country-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #d8dedb;
    border-radius: 8px;
    color: #102018;
    text-decoration: none;
    background: #fff;
}

    .country-card:hover {
        border-color: #147a4d;
        color: #102018;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    }

.country-flag {
    display: grid;
    place-items: center;
    width: 42px;
    height: 32px;
    flex: 0 0 auto;
    background: #eef2f0;
}

    .country-flag img {
        max-width: 42px;
        max-height: 32px;
        object-fit: contain;
    }

.country-card-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

    .country-card-text strong,
    .country-card-text span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .country-card-text strong {
        font-size: 17px;
    }

    .country-card-text span {
        color: #5b665f;
        font-size: 14px;
    }

.competitions-note {
    margin: 0;
    color: #5b665f;
}

.competitions-page {
    display: grid;
    grid-template-rows: auto auto 1fr;
    min-height: 0;
}

.competitions-sticky-header {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-bottom: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.competitions-toolbar {
    display: grid;
    grid-template-columns: auto minmax(260px, 370px) 1fr auto;
    align-items: center;
    gap: 18px;
}

    .competitions-toolbar h1 {
        margin: 0;
        font-size: 32px;
        font-weight: 700;
    }

.competitions-search {
    width: 100%;
}

.competitions-sync-info {
    display: grid;
    gap: 4px;
    justify-items: end;
    color: #5b665f;
    font-size: 14px;
}

.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #d8dedb;
}

    .letter-nav button {
        min-width: 32px;
        height: 32px;
        border: 1px solid #cbd5d0;
        border-radius: 6px;
        background: #fff;
        color: #102018;
        font-weight: 700;
    }

    .letter-nav button:hover {
        border-color: #147a4d;
        color: #147a4d;
    }

.competitions-scroll-area {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.teams-page {
    display: grid;
    gap: 18px;
}

.teams-toolbar {
    display: grid;
    grid-template-columns: auto minmax(190px, 260px) minmax(260px, 360px) 1fr auto;
    align-items: center;
    gap: 16px;
}

.xgames-toolbar,
.matches-toolbar {
    grid-template-columns: auto 1fr auto;
}

    .teams-toolbar h1 {
        margin: 0;
        font-size: 32px;
        font-weight: 700;
    }

.teams-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid #d8dedb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.teams-tree-table {
    margin: 0;
}

.xgames-table th:nth-child(2),
.xgames-table td:nth-child(2),
.xgames-table th:nth-child(3),
.xgames-table td:nth-child(3) {
    width: 110px;
    text-align: center;
}

    .teams-tree-table thead th {
        background: #eef2f0;
        border-bottom-color: #cbd5d0;
        white-space: nowrap;
    }

.tree-country-row td {
    background: #f7faf8;
    font-size: 17px;
}

.team-country-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.team-country-sync {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #5b665f;
    font-size: 14px;
    white-space: nowrap;
}

.tree-competition-row td {
    background: #fff;
    padding-left: 32px;
}

.tree-team-row td {
    background: #fff;
}

.team-cell {
    padding-left: 64px !important;
}

.empty-team-row td {
    padding-left: 64px !important;
    color: #5b665f;
    font-style: italic;
}

.tree-toggle {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border: 1px solid #cbd5d0;
    border-radius: 6px;
    background: #fff;
    color: #102018;
    font-weight: 700;
    line-height: 1;
}

.tree-toggle:hover {
    border-color: #147a4d;
    color: #147a4d;
}

.team-sync-modal .modal-header {
    align-items: flex-start;
}

.team-sync-subtitle {
    margin: 4px 0 0;
    color: #5b665f;
    font-size: 14px;
}

.team-sync-list {
    display: grid;
    gap: 8px;
}

.team-sync-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.team-progress-modal .modal-body {
    display: grid;
    gap: 10px;
}

.team-sync-country,
.team-sync-competition {
    display: grid;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid #d8dedb;
    border-radius: 6px;
    background: #f7faf8;
}

.team-sync-country {
    grid-template-columns: auto auto 1fr auto;
}

.team-sync-competitions {
    display: grid;
    gap: 6px;
    margin: -4px 0 8px 38px;
}

.team-sync-competitions[hidden] {
    display: none;
}

.team-sync-competition {
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    background: #fff;
    cursor: pointer;
}

.team-sync-competition:hover {
    border-color: #147a4d;
}

.team-sync-meta,
.team-sync-count,
.team-sync-selected {
    color: #5b665f;
    font-size: 14px;
    white-space: nowrap;
}

.team-sync-count {
    min-width: 78px;
    text-align: right;
}

.team-sync-selected {
    margin-right: auto;
}

.muted-inline {
    margin-left: 8px;
    color: #5b665f;
    font-size: 14px;
    font-weight: 400;
}

.competition-country-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: flex-start;
    align-content: flex-start;
    min-height: 132px;
}

    .competition-country-card .country-card-text {
        align-self: center;
    }

    .competition-country-card .country-card-text a {
        overflow: hidden;
        color: #102018;
        font-size: 17px;
        font-weight: 700;
        text-decoration: none;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .competition-country-card .country-card-text a:hover {
        color: #147a4d;
    }

.competition-card-sync {
    grid-column: 2;
    color: #5b665f;
    font-size: 12px;
}

.competition-list {
    display: grid;
    grid-column: 2;
    gap: 6px;
    padding-top: 2px;
}

.competition-followed-count {
    grid-column: 2;
    color: #5b665f;
    font-size: 13px;
}

    .competition-followed-count strong {
        color: #102018;
    }

.competition-list-title {
    color: #5b665f !important;
    font-size: 13px;
    font-weight: 700;
}

    .competition-list span {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        color: #102018;
        font-size: 14px;
    }

    .competition-list em {
        color: #5b665f;
        font-style: normal;
        white-space: nowrap;
    }

    .competition-list .empty-competition {
        color: #5b665f;
    }

.competition-follow-row {
    display: grid !important;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.competition-card-follow-form {
    margin: 0;
}

    .competition-card-follow-form .form-check-input {
        margin: 0;
        cursor: pointer;
    }

.competition-hidden-count {
    display: block;
    color: #5b665f;
    font-size: 13px;
    text-decoration: none;
}

    .competition-hidden-count:hover {
        color: #147a4d;
        text-decoration: underline;
    }

.follow-toggle-form {
    margin: 0;
}

.competition-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.follow-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 178px;
    justify-content: flex-end;
    font-weight: 700;
}

    .follow-switch .form-check-input {
        width: 46px;
        height: 24px;
        margin: 0;
        cursor: pointer;
    }

    .follow-switch .form-check-label {
        cursor: pointer;
        white-space: nowrap;
    }

.details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0 24px;
}

    .details-header h1 {
        margin: 0;
        font-size: 32px;
        font-weight: 700;
    }

.country-title-with-flag {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .country-title-with-flag img {
        width: 46px;
        height: 34px;
        object-fit: contain;
    }

    .country-title-with-flag p {
        margin: 2px 0 0;
        color: #5b665f;
    }

.competition-season-list {
    display: grid;
    gap: 18px;
}

.competition-country-details-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.competition-country-details-page .details-header {
    flex: 0 0 auto;
}

.competition-country-details-page .competition-season-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.competition-season-card {
    padding: 18px;
    border: 1px solid #d8dedb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.competition-season-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

    .competition-season-heading img {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .competition-season-heading h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
    }

    .competition-season-heading p {
        margin: 2px 0 0;
        color: #5b665f;
    }

.country-details-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 28px;
}

.country-edit-panel,
.country-fields-panel {
    padding: 20px;
    border: 1px solid #d8dedb;
    border-radius: 8px;
    background: #fff;
}

.country-detail-flag {
    display: grid;
    place-items: center;
    height: 120px;
    margin-bottom: 18px;
    background: #eef2f0;
}

    .country-detail-flag img {
        max-width: 160px;
        max-height: 95px;
        object-fit: contain;
    }

.country-fields-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
}

.country-fields {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
    margin: 0;
}

    .country-fields dt {
        color: #5b665f;
        font-weight: 700;
    }

    .country-fields dd {
        min-width: 0;
        margin: 0;
        overflow-wrap: anywhere;
    }

@media (max-width: 768px) {
    .app-shell {
        margin-top: 12px;
        padding: 18px;
    }

    .home-login-page {
        padding: 20px;
        background-position: center;
    }

    .home-login-form {
        padding: 26px 22px;
    }

    .app-page-header-row {
        display: block;
    }

    .my-game-controls,
    .my-game-sort-actions {
        flex-wrap: wrap;
    }

    .my-game-sort-actions {
        margin-left: 0;
    }

        .app-page-header-row form {
            margin-top: 16px;
        }

    .countries-title-row,
    .countries-actions,
    .countries-filters,
    .details-header {
        display: block;
    }

    .countries-search,
    .countries-filters label {
        width: 100%;
    }

    .countries-title-row h1,
    .countries-filters label,
    .details-header h1 {
        margin-bottom: 12px;
    }

    .countries-sync {
        margin-top: 16px;
        text-align: left;
    }

    .country-details-layout,
    .country-fields {
        display: block;
    }

    .country-fields dt {
        margin-top: 12px;
    }

    .competitions-page {
        min-height: 0;
    }

    .competitions-toolbar {
        display: block;
    }

    .teams-toolbar {
        display: block;
    }

    .competitions-toolbar h1,
    .competitions-search,
    .competitions-sync-info,
    .teams-toolbar h1,
    .teams-country-filter,
    .teams-search {
        margin-bottom: 12px;
    }

    .competitions-sync-info {
        justify-items: start;
    }

    .competitions-scroll-area {
        overflow: auto;
    }

    .competition-season-heading,
    .competition-heading-actions {
        display: block;
    }

    .competition-heading-actions {
        margin-top: 14px;
        margin-left: 0;
    }

    .follow-switch {
        justify-content: flex-start;
        margin-top: 12px;
    }

}

/* Shared public authentication screens */
.auth-login-panel {
    width: min(100%, 440px);
}

.auth-form {
    gap: 16px;
}

.home-login-heading p {
    margin: 8px 0 0;
    color: #53645b;
    font-size: 15px;
    line-height: 1.45;
}

.auth-form input[type="text"] {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cfd7d3;
    border-radius: 6px;
    font-size: 16px;
}

.auth-form input:focus {
    border-color: #147a4d;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(20, 122, 77, 0.14);
}

.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -2px;
    font-size: 14px;
}

.auth-options-row .remember-me {
    justify-content: flex-start;
    margin: 0;
}

.auth-options-row a,
.auth-primary-link {
    color: #147a4d;
    font-weight: 700;
    text-decoration: none;
}

.auth-options-row a:hover,
.auth-primary-link:hover {
    color: #0f633e;
    text-decoration: underline;
}

.home-auth-options {
    margin-top: -10px;
}

.auth-validation:empty,
.auth-field-error:empty {
    display: none;
}

.auth-validation {
    padding: 10px 12px;
    border: 1px solid #efb8bd;
    border-radius: 6px;
    background: #fff2f3;
    color: #a52834;
    font-size: 14px;
}

.auth-validation ul {
    margin: 0;
    padding-left: 18px;
}

.auth-field-error {
    color: #b4232f;
    font-size: 13px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #718078;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #d9e0dc;
}

.home-login-form .auth-google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #cfd7d3;
    background: #f1f4f2;
    color: #6d7872;
    cursor: not-allowed;
}

.home-login-form .auth-google-button:hover {
    background: #f1f4f2;
}

.auth-google-button small {
    padding: 3px 6px;
    border-radius: 999px;
    background: #e0e6e2;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-google-mark {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #4285f4;
    font-size: 15px;
    font-weight: 800;
}

.auth-message-card {
    text-align: center;
}

.auth-note {
    margin: 0;
    padding: 12px;
    border-radius: 6px;
    background: #edf6f1;
    color: #365747;
    font-size: 14px;
    line-height: 1.45;
}

.auth-primary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 6px;
    background: #147a4d;
    color: #fff;
}

.auth-primary-link:hover {
    background: #0f633e;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 480px) {
    .auth-options-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .home-auth-options span {
        display: none;
    }
}
