:root {
    --page-bg: #102019;
    --overlay-bg: rgba(8, 18, 13, 0.52);
    --panel-bg: rgba(17, 33, 25, 0.76);
    --panel-bg-strong: rgba(15, 29, 22, 0.86);
    --panel-border: rgba(186, 231, 199, 0.24);
    --text-main: #f5fbf7;
    --text-muted-ui: #deece1;
    --accent: #a9eb7f;
    --accent-strong: #88d95a;
    --accent-soft: rgba(169, 235, 127, 0.18);
    --link: #a8e0ff;
    --danger: #dc5a5a;
    --title-font: "Trebuchet MS", "Segoe UI", sans-serif;
    --body-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --mono-font: "Consolas", "Courier New", monospace;
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.input-group-text {
    height: 100%;
}

body {
    position: relative;
    background-color: var(--page-bg);
    background-image: linear-gradient(180deg, rgba(12, 24, 18, 0.16), rgba(12, 24, 18, 0.42)), url("./soccer-field.dbf91b275fac.avif") !important;
    background-position: center;
    background-size: cover;
    background-attachment: fixed !important;
    color: var(--text-main);
    font-family: var(--body-font);
}

body.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

.site-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

.page-content {
    flex: 1 0 auto;
    padding-top: 148px;
    padding-bottom: 24px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(169, 235, 127, 0.16), transparent 28%),
        radial-gradient(circle at bottom left, rgba(168, 224, 255, 0.14), transparent 26%),
        var(--overlay-bg);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--link) !important;
}

.bg-color-main {
    background-color: rgb(10, 22, 16) !important;
    backdrop-filter: none;
}

.title {
    font-size: clamp(1.6rem, 1.6rem + 1vw, 2.35rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--title-font);
    text-align: center;
}

.title-nav-bar {
    padding-top: 18px;
    padding-bottom: 14px;
}

.nav-link {
    padding-inline: 1rem !important;
    width: fit-content !important;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active-nav {
    color: #061008 !important;
    background-color: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.navbar-toggler {
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.navbar-brand {
    color: var(--text-main);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted-ui) !important;
}

.generic-card {
    padding: 28px;
    background: linear-gradient(180deg, rgba(22, 41, 31, 0.84), rgba(14, 29, 22, 0.86));
    border-radius: 22px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-soft);
}

.card-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.site-footer {
    margin-top: auto;
    position: relative;
    z-index: 1;
    padding: 16px 12px;
    background-color: rgb(10, 22, 16);
    color: #edf4ee;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: none;
}

.site-footer .legal-links a {
    color: #b7e7ff !important;
    text-decoration: none;
    font-weight: 600;
}

.site-footer .legal-links a:hover,
.site-footer .legal-links a:focus {
    color: #def3ff !important;
    text-decoration: underline;
}

.site-footer .legal-sep {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.4);
}

.table {
    margin-bottom: 0;
}

.table-compact th,
.table-compact td {
    padding: 0.6rem 0.7rem;
    font-size: 0.96rem;
    white-space: normal;
    word-break: break-word;
}

.table-sticky tr th:first-child,
.table-sticky td:first-child {
    position: sticky;
    width: 100px;
    left: 0;
    z-index: 10;
}

.table-sticky tr th:first-child {
    z-index: 11;
}

.table-sticky tr th {
    position: sticky;
    top: 0;
    z-index: 9;
}

.truncate-mobile {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-inner-scroll {
    overflow: visible !important;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.filters .btn-link {
    color: #bce9ff !important;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid rgba(142, 216, 255, 0.24);
    line-height: 1.2;
}

.filters .btn-link:hover,
.filters .btn-link:focus {
    color: white !important;
    border-color: rgba(142, 216, 255, 0.7);
    background: rgba(142, 216, 255, 0.12);
}

.champion-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    align-items: center;
    margin: 10px 0 18px;
}

.champion-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.champion-label {
    font-weight: 700;
}

.champ-select {
    min-width: 160px;
    max-width: 260px;
    text-align: center;
}

.score-input {
    min-width: 60px;
    max-width: 110px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
}

.score-lock-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.14);
    color: #ffe9a2;
    border: 1px solid rgba(255, 193, 7, 0.25);
    font-size: 0.92rem;
}

.results-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 0;
}

.summary-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted-ui);
    font-size: 0.92rem;
}

.table-matches tr.is-past {
    opacity: 0.88;
}

.table-matches tr.is-upcoming {
    box-shadow: inset 3px 0 0 var(--accent);
}

.table-matches .official-score {
    color: #7fc6ff;
    font-weight: 700;
}

.table-matches .user-score {
    color: #ffffff;
    font-weight: 700;
}

.empty-state {
    padding: 18px;
    color: var(--text-muted-ui);
    text-align: center;
}

.tight-row {
    --bs-gutter-x: 0.6rem;
    --bs-gutter-y: 0.6rem;
}

form {
    margin: 0 auto;
}

.chat-shell {
    gap: 12px;
}

.chat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f4f7f4;
    font-size: 0.82rem;
}

.chat-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.chat-legend-item.user .chat-legend-dot {
    background: #0d6efd;
}

.chat-legend-item.assistant .chat-legend-dot {
    background: #e8f7d9;
    border: 1px solid rgba(27, 46, 17, 0.18);
}

.chat-log {
    height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(18, 35, 25, 0.78), rgba(28, 49, 36, 0.74));
    color: #101612;
}

.chat-message {
    margin-bottom: 14px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-message-inner {
    display: flex;
    max-width: min(92%, 760px);
}

.chat-bubble {
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.55;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-message.user .chat-bubble {
    background: linear-gradient(180deg, #1f7aff, #0d5bd7);
    color: #f8fbff;
    border-bottom-right-radius: 6px;
    border-color: rgba(8, 42, 108, 0.32);
}

.chat-message.assistant .chat-bubble {
    background: linear-gradient(180deg, #eff9e7, #dcefd0);
    color: #11200f;
    border-bottom-left-radius: 6px;
    border-color: rgba(25, 48, 18, 0.18);
}

.chat-meta {
    display: block;
    margin-bottom: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.72;
}

.chat-copy {
    white-space: normal;
    word-break: break-word;
    padding-top: 8px;
}

.chat-message.user .chat-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.chat-message.assistant .chat-copy {
    border-top: 1px solid rgba(16, 22, 18, 0.10);
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.chat-controls .form-control {
    flex: 1 1 auto;
}

.chat-controls .btn {
    min-width: 112px;
}

.chat-suggestions .btn {
    text-align: left;
}

.chat-status {
    min-height: 1.25rem;
    color: var(--text-muted-ui);
    font-size: 0.9rem;
}

.list-table-card .card-body {
    overflow: auto;
}

.page-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted-ui);
}

.filters .btn-link.is-active {
    color: #08120d !important;
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        background-attachment: fixed !important;
        background-position: center top !important;
        background-size: cover !important;
    }

    .page-content {
        padding-top: 170px;
    }

    .title {
        line-height: 1.2;
        text-align: center;
    }

    .title-nav-bar {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .navbar-nav .nav-link,
    .navbar-nav .btn {
        width: 100% !important;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        text-align: center;
        border-radius: 12px;
    }

    .generic-card {
        padding: 16px;
        border-radius: 18px;
    }

    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tight-row {
        --bs-gutter-x: 0.35rem;
        --bs-gutter-y: 0.35rem;
    }

    .card-header .btn {
        width: 100%;
    }

    .card-body.table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-body.no-inner-scroll {
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .btn,
    .form-control,
    .input-group-text,
    .navbar-toggler {
        min-height: 44px;
        font-size: 1rem;
    }

    .input-group {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .table-compact th,
    .table-compact td {
        padding: 0.45rem 0.55rem;
        font-size: 0.92rem;
    }

    .table-matches {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .truncate-mobile {
        max-width: 110px;
    }

    .table-matches thead {
        display: none !important;
    }

    .table-matches,
    .table-matches tbody,
    .table-matches tr,
    .table-matches td {
        display: block !important;
        width: 100% !important;
    }

    .table-matches tr {
        background: rgba(255, 255, 255, 0.05);
        margin: 10px 0;
        border-radius: 14px;
        padding: 12px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .table-matches td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 6px 4px;
        overflow: hidden;
    }

    .table-matches td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 10px;
        color: #cfe8ff;
        flex: 0 0 auto;
    }

    .table-matches td[data-label="Marcador"],
    .table-matches td[data-label="⚽ Marcador"] {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        overflow: hidden;
    }

    .table-matches td[data-label="Marcador"] .input-group,
    .table-matches td[data-label="⚽ Marcador"] .input-group {
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
        gap: 8px;
        overflow: hidden;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filters .btn-link {
        display: block;
        width: 100% !important;
        text-align: center;
        padding: 9px 12px;
    }

    .champion-row {
        flex-direction: column;
        align-items: stretch;
    }

    .champion-field {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .champ-select {
        max-width: none;
        width: 100%;
        font-size: 16px !important;
    }

    .score-input {
        flex: 1 1 0;
        width: calc((100% - 44px) / 2);
        min-width: 0;
        max-width: none;
        font-size: 16px !important;
        height: 50px;
        box-sizing: border-box;
    }

    .table-matches td[data-label="Marcador"] .input-group-text,
    .table-matches td[data-label="⚽ Marcador"] .input-group-text {
        flex: 0 0 28px;
        width: 28px;
        min-width: 28px;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    input[type="tel"],
    input[type="number"],
    select {
        font-size: 16px !important;
    }

    .chat-controls {
        flex-direction: column;
    }

    .chat-controls .btn {
        width: 100%;
    }

    .chat-log {
        height: 300px;
    }

    .chat-message-inner {
        max-width: 100%;
    }

}

.table-matches tr.is-filter-hidden,
.table-matches tbody tr.is-filter-hidden,
.table-matches tr.match-row.is-filter-hidden,
.table-matches tbody tr.match-row.is-filter-hidden {
    display: none !important;
}

