:root {
    color-scheme: light;
    --bg: #edf3fc;
    --card: #ffffff;
    --text: #102446;
    --muted: #597196;
    --primary: #01539a;
    --primary-dark: #003f78;
    --accent: #0c67d1;
    --border: #cdd9ee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
}

body.modal-open {
    overflow: hidden;
}

.modal-open .app-shell {
    filter: blur(3px) brightness(0.82);
    pointer-events: none;
    user-select: none;
}

.start-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: radial-gradient(circle at top, rgba(8, 94, 188, 0.35), rgba(5, 16, 34, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.start-modal {
    width: min(520px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #cfe0fb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(6, 20, 45, 0.45);
}

.mode-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0a5cb6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.start-modal h2 {
    margin: 0;
    font-size: 28px;
    color: #0f2a4f;
}

.start-modal p {
    margin: 8px 0 18px;
    color: #5d7392;
}

.start-notice {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    min-height: 0;
    margin: -4px 0 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    transition: opacity 0.2s ease, transform 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}

.start-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
    margin: 2px 0 2px;
    padding: 10px 12px;
}

.start-notice.is-info {
    background: linear-gradient(180deg, #e8f3ff 0%, #dcecff 100%);
    border: 1px solid #bdd8fb;
    color: #114f95;
}

.start-notice.is-warning {
    background: linear-gradient(180deg, #fff4e7 0%, #ffebcf 100%);
    border: 1px solid #f4c98a;
    color: #91550b;
}

.start-form {
    display: grid;
    gap: 12px;
}

.choice-group {
    display: grid;
    gap: 8px;
}

.choice-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #375176;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.choice-card {
    border: 1px solid #cbdaf0;
    background: #f7fbff;
    color: #294368;
    border-radius: 12px;
    min-height: 56px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.choice-card:hover {
    background: #eef5ff;
    border-color: #9ec2f3;
}

.choice-card.is-active {
    background: linear-gradient(180deg, #0f69ce 0%, #0a5cb6 100%);
    border-color: #0a5cb6;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(10, 92, 182, 0.24);
}

.choice-card-category {
    min-height: 48px;
}

.choice-hint {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6c84a3;
}

.start-btn {
    margin-top: 4px;
}

.start-btn:disabled {
    background: #9eb5d4;
    cursor: not-allowed;
}

.top-strip {
    background: #003a6e;
    color: #d5e8ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.top-strip-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    padding: 0 18px;
}

.hero {
    background: linear-gradient(135deg, #005da9 0%, #014b89 58%, #003d73 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 22px;
    padding: 40px 18px 34px;
}

.hero-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-logo-slot {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    background: rgb(255, 255, 255);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(2px);
}

.hero-logo-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.hero-logo-placeholder {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.07em;
}

.brand {
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-shadow: 0 6px 18px rgba(2, 18, 43, 0.28);
}

.hero-title-block {
    padding-bottom: 6px;
}

.hero-title-block h1 {
    margin: 0;
    font-size: 58px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 6px 20px rgba(3, 18, 42, 0.28);
}

.hero-title-block p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 21px;
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 18px 48px;
}

.control-card,
.partido-card,
.results-header,
.calendar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(18, 36, 64, 0.06);
}

.control-card {
    padding: 22px;
    margin-top: -48px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.calendar-card {
    margin-bottom: 14px;
    padding: 14px 14px 12px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 12px;
}

.calendar-header h2 {
    margin: 0;
    font-size: 24px;
}

.calendar-header span {
    font-size: 15px;
    color: var(--muted);
    font-weight: 600;
}

.calendar-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px;
    scroll-snap-type: x mandatory;
}

.calendar-scroll::-webkit-scrollbar {
    height: 10px;
}

.calendar-scroll::-webkit-scrollbar-thumb {
    background: #cfd9e8;
    border-radius: 999px;
}

.calendar-day {
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: #2c4264;
    background: #f8fbff;
    min-height: 108px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 0 0 108px;
    scroll-snap-align: start;
    transition: all 0.18s ease;
}

.calendar-day:hover {
    border-color: #9fc5f9;
    background: #eef5ff;
}

.calendar-day.is-active {
    background: linear-gradient(180deg, #0f69ce 0%, #0a5cb6 100%);
    border-color: #0a5cb6;
    color: #fff;
    box-shadow: 0 8px 18px rgba(10, 92, 182, 0.24);
}

.calendar-day.is-today {
    outline: 2px solid #9ac5ff;
    outline-offset: 1px;
}

.calendar-all {
    background: #f2f6fd;
    flex-basis: 128px;
}

.calendar-all .day-number {
    font-size: 22px;
    line-height: 1.06;
    white-space: normal;
    word-break: break-word;
    text-align: center;
}

.day-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.07em;
    margin-bottom: 4px;
}

.day-number {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.day-month {
    margin-top: 5px;
    font-size: 14px;
    font-weight: 600;
}

.filters {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    align-items: end;
}

.field {
    min-width: 0;
}

.search-field {
    grid-column: 4 / 5;
}

label {
    font-size: 14px;
    color: var(--muted);
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

input,
select,
button,
.btn-light {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 16px;
    background: #fff;
    color: #20324f;
}

input::placeholder {
    color: #9ca9bd;
}

input:focus,
select:focus {
    outline: none;
    border-color: #9ec8ff;
    box-shadow: 0 0 0 3px rgba(10, 99, 201, 0.15);
}

select:disabled {
    background: #f1f4f9;
    color: #99a8bf;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary:hover {
    background: #0058b8;
}

.btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    color: #2a3d5d;
    background: #f6f8fc;
}

.btn-light:hover {
    background: #eef3fb;
}

.partidos {
    display: grid;
    gap: 16px;
}

.results-header {
    margin-bottom: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h2 {
    margin: 0;
    font-size: 28px;
}

.results-header span {
    color: var(--muted);
    font-weight: 600;
    font-size: 17px;
}

.partido-card {
    padding: 22px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.partido-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(18, 36, 64, 0.12);
}

.partido-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tournament-tag {
    font-size: 15px;
    color: #214b80;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.85;
}

.meta-value {
    font-weight: 800;
}

.meta-disciplina {
    background: #e6f1ff;
    border-color: #bdd7fb;
    color: #0e4f9f;
}

.meta-categoria {
    background: #e9f8ee;
    border-color: #bfeacc;
    color: #157443;
}

.meta-jornada {
    background: #fff5e8;
    border-color: #ffd9a8;
    color: #9a5a00;
}

.meta-fecha {
    background: #f3efff;
    border-color: #d5c8ff;
    color: #5f46b5;
}

.meta-hora {
    background: linear-gradient(180deg, #0c77c9 0%, #095ea4 100%);
    border-color: #084e88;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    padding: 8px 16px;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 14px rgba(9, 94, 164, 0.28);
}

.meta-hora::before {
   
    font-size: 13px;
    margin-right: 6px;
    line-height: 1;
}

.meta-hora .meta-label {
    color: rgba(255, 255, 255, 0.85);
}

.meta-sede {
    background: #f0f3f9;
    border-color: #d6dfec;
    color: #405979;
}

.enfrentamiento {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 2px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.equipo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.team-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f1ff;
    color: #0b4c98;
    font-size: 16px;
    font-weight: 800;
    border: 1px solid #bfd6f8;
}

.team-logo-image {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #bfd6f8;
    background: #eef5ff;
}

.team-name {
    font-size: clamp(30px, 3vw, 30px);
    font-weight: 700;
    color: #0f2a4f;
    line-height: 1.1;
    word-break: normal;
    overflow-wrap: anywhere;
}

.vs {
    font-size: 30px;
    font-weight: 800;
    color: #3f5f87;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.estado {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.estado-programado {
    background: #e9f2ff;
    color: #1552a1;
}

.estado-en-juego {
    background: #fff1e8;
    color: #a24900;
}

.estado-finalizado {
    background: #ebf8ef;
    color: #1f7d45;
}

.estado-suspendido {
    background: #ffecef;
    color: #b11e41;
}

.vacio {
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert-error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.alert-success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.admin-page {
    max-width: 1280px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-header h1 {
    margin: 0;
    font-size: 30px;
    color: #12325e;
}

.admin-login {
    max-width: 460px;
}

.admin-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.admin-card {
    padding: 16px;
}

.admin-card h2,
.admin-list-card h2,
.admin-login h2 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #163963;
}

.admin-card-wide {
    grid-column: 1 / -1;
}

.admin-form {
    display: grid;
    gap: 10px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px;
}

.field-full {
    grid-column: 1 / -1;
}

.admin-list-card {
    padding: 16px;
    margin-bottom: 14px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e7edf7;
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.admin-table th {
    color: #4a6080;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mini-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #c7d8f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
}

.mini-logo-text {
    font-size: 11px;
    color: #486182;
}

@media (max-width: 980px) {
    .hero-inner {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 8px;
        padding: 26px 18px 44px;
    }

    .brand {
        font-size: 30px;
    }

    .hero-logo-slot {
        width: 66px;
        height: 66px;
    }

    .hero-logo-image {
        width: 56px;
        height: 56px;
    }

    .hero-title-block h1 {
        font-size: 48px;
    }

    .hero-title-block p {
        font-size: 18px;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .actions {
        grid-column: 1 / -1;
    }

    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .team-name {
        font-size: clamp(26px, 3.4vw, 30px);
    }

    .vs {
        font-size: 24px;
    }
}

@media (max-width: 680px) {
    .top-strip-inner {
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .hero-inner {
        padding: 20px 14px 48px;
        gap: 6px;
    }

    .hero-brand-block {
        gap: 10px;
    }

    .hero-logo-slot {
        width: 54px;
        height: 54px;
        border-radius: 12px;
    }

    .hero-logo-image {
        width: 46px;
        height: 46px;
    }

    .container {
        padding: 16px 12px 28px;
    }

    .control-card,
    .calendar-card,
    .results-header,
    .partido-card {
        border-radius: 16px;
    }

    .control-card,
    .partido-card {
        padding: 14px;
    }

    .calendar-card {
        padding: 12px 10px 10px;
    }

    .calendar-scroll {
        gap: 8px;
        padding: 2px;
    }

    .calendar-day {
        flex-basis: 92px;
        min-height: 92px;
        padding: 10px 8px;
    }

    .calendar-all {
        flex-basis: 110px;
    }

    .day-name {
        font-size: 12px;
    }

    .day-number {
        font-size: 22px;
    }

    .calendar-all .day-number {
        font-size: 18px;
    }

    .day-month {
        font-size: 12px;
    }

    .brand {
        font-size: 26px;
    }

    .hero-title-block h1 {
        font-size: 38px;
    }

    .hero-title-block p {
        margin-top: 8px;
        font-size: 16px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .enfrentamiento {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .equipo {
        width: 100%;
        justify-content: center;
    }

    .team-logo {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .team-logo-image {
        width: 40px;
        height: 40px;
    }

    .team-name {
        font-size: clamp(28px, 8.5vw, 30px);
        text-align: center;
        line-height: 1.04;
    }

    .vs {
        font-size: 22px;
        align-self: center;
    }

    .start-modal {
        padding: 18px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-grid,
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .start-modal h2 {
        font-size: 24px;
    }

    .meta-pill {
        font-size: 13px;
    }

    .meta-hora {
        font-size: 14px;
        padding: 7px 13px;
    }

    .meta {
        justify-content: center;
    }

    .partido-top {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .hero-logo-slot {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .hero-logo-image {
        width: 38px;
        height: 38px;
    }

    .hero-logo-placeholder {
        font-size: 10px;
    }

    .hero-title-block h1 {
        font-size: 32px;
    }

    .hero-title-block p {
        font-size: 14px;
    }

    .results-header h2 {
        font-size: 24px;
    }

    .calendar-day {
        flex-basis: 88px;
        min-height: 86px;
    }

    .calendar-all {
        flex-basis: 102px;
    }

    .calendar-all .day-number {
        font-size: 16px;
    }

    .team-name {
        font-size: clamp(24px, 10vw, 30px);
    }
}
