﻿:root {
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    --bg-main: #5a0f16;
    --bg-header: #050505;
    --text-soft: #9b9b9b;
    --text-strong: #f5f5f5;
    --accent-link: lightgoldenrodyellow;
    --card-bg: rgba(0, 0, 0, 0.18);
    --card-border: rgba(255, 255, 255, 0.12);
    --table-shell: #d8d8d8;
    --table-bg: #f2f2f2;
    --table-head: #5a0f16;
    --row-even: #c9c9c9;
    --row-odd: #f4f4f4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-strong);
}

a {
    color: inherit;
    text-decoration: none;
}

.wrap {
    width: min(100% - 16px, 1040px);
    margin: 0 auto;
}

.site-header {
    background: var(--bg-header);
    color: var(--text-strong);
    border-bottom: 1px solid #2b2b2b;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.main-nav a {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-soft);
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
}

.nav-user {
    color: #e2e8f0;
    padding: 6px 0;
}

.nav-version {
    color: #d6d3d1;
    font-size: 0.82rem;
    padding: 6px 0;
    white-space: nowrap;
}

.nav-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.nav-link-button:hover {
    color: var(--text-strong);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--text-soft);
}

.page-body {
    padding: 12px 0 40px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.hero-card {
    margin-bottom: 20px;
}

.eyebrow {
    color: #d0d0d0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin-top: 0;
}

.lead {
    color: #e6e6e6;
    font-size: 1.05rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.simple-list {
    margin: 0;
    padding-left: 18px;
}

.simple-list li + li {
    margin-top: 8px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.compact-filter-form {
    margin-bottom: 16px;
}

.compact-filter-shell {
    max-width: 320px;
}

.compact-filter-field {
    margin-bottom: 0;
}

.primary-link-button,
button,
.table-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #a61d2d;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.primary-link-button:disabled,
button:disabled,
.table-link-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.field-hint {
    margin: 0 0 0.75rem;
    color: rgba(255, 244, 226, 0.86);
    font-size: 0.95rem;
}

.danger-button {
    background: #991b1b;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--table-shell);
}

.table-link-button {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.95rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--table-bg);
    color: #111111;
}

.admin-table th,
.admin-table td {
    padding: 9px 8px;
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.admin-table th:last-child,
.admin-table td:last-child {
    border-right: 0;
}

.admin-table thead th {
    background: var(--table-head);
    color: var(--text-strong);
}

.admin-table tbody tr:nth-child(even) {
    background: var(--row-even);
}

.admin-table tbody tr:nth-child(odd) {
    background: var(--row-odd);
}

.actions-col {
    white-space: nowrap;
    width: 1%;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 6px;
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="number"],
.field-group input[type="date"],
.field-group input[type="datetime-local"],
.field-group select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
}

.field-group label {
    color: var(--text-strong);
}

.checkbox-group {
    padding-top: 4px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.split-actions {
    justify-content: space-between;
}

.back-link {
    color: var(--accent-link);
    text-decoration: underline;
}

.form-error,
.field-validation {
    color: #ffb4b4;
}

.admin-login-card {
    max-width: 480px;
    margin: 0 auto;
}

.number-col {
    text-align: right !important;
    white-space: nowrap;
}

.strikethrough {
    text-decoration: line-through;
}

.compact-matrix th,
.compact-matrix td {
    padding-left: 6px;
    padding-right: 6px;
}

.compact-matrix th,
.compact-matrix td {
    text-align: center !important;
}

.compact-matrix th:first-child,
.compact-matrix td:first-child {
    text-align: left !important;
}

.ranking-matrix-empty {
    background: lightyellow !important;
}

.ranking-matrix-first {
    background: lightgreen !important;
}

@media (max-width: 720px) {
    .header-row {
        min-height: 50px;
        padding: 5px 0;
        flex-wrap: wrap;
        position: relative;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-basis: 100%;
        gap: 8px;
        padding: 10px 0 12px;
        border-top: 1px solid #2b2b2b;
    }

    .main-nav.is-open {
        display: grid;
        gap: 4px;
    }

    .main-nav a,
    .nav-version,
    .nav-user,
    .nav-link-button {
        width: 100%;
        text-align: left;
    }

    .nav-toggle {
        display: inline-block;
        margin-left: auto;
    }

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

    .section-header {
        flex-direction: column;
    }
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
}

.plain-list li + li {
    margin-top: 4px;
}

.fecha-meta,
.partido-meta,
.subtitle {
    color: #d8d8d8;
    font-size: 0.95rem;
    font-weight: 500;
}

.home-ranking-card {
    margin-top: 24px;
}

.home-bottom-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.home-bottom-actions .primary-link-button {
    min-height: 42px;
    padding: 9px 16px;
    font-size: 1rem;
}

.home-table-wrap {
    margin-top: 2px;
}

.home-data-table tbody td {
    color: #020617;
    font-size: 18px;
    height: 46px;
    vertical-align: middle;
}

.home-data-table .fecha-meta {
    color: brown;
    font-size: 0.78rem;
}

.attendance-meta {
    color: brown;
    font-size: 0.78rem;
}

.home-action-col {
    text-align: center !important;
}

.home-action-col .table-link-button {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.9rem;
}

.home-number-col {
    text-align: center !important;
}

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

.player-row {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #111111;
}

.player-row span {
    color: #111111;
}

.selection-title {
    font-weight: 700;
}

.draw-number {
    color: #6b6b6b;
    font-size: 0.9rem;
}

.partido-start-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.hero-card > h1 + .stack-form {
    margin-top: -4px;
}

.hero-card > h1 {
    margin-bottom: 8px;
}

.partido-refresh-button {
    min-height: 34px;
    min-width: 42px;
    padding: 6px 12px;
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.partido-start-player-list {
    margin-top: 0;
}

.partido-start-player-row {
    justify-content: flex-start;
    border: 1px solid rgba(128, 37, 45, 0.14);
    box-shadow: none;
}

.partido-start-player-row .draw-number {
    margin-left: auto;
    display: none;
}

@media (max-width: 720px) {
    .partido-start-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.partido-table th,
.partido-table td {
    vertical-align: middle;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 15px;
}

.partido-col-center {
    text-align: center !important;
    white-space: nowrap;
}

.partido-table th:nth-child(5),
.partido-table td:nth-child(5) {
    width: 74px;
    min-width: 74px;
}

.result-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.secondary-action {
    background: rgba(120, 120, 120, 0.85);
}

.partido-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.champion-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.champion-name-link,
.champion-name-block {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.champion-name-link {
    color: inherit;
    text-decoration: none;
}

.champion-ranking-type {
    color: brown;
    font-size: 0.82rem;
}

.champion-podium-col {
    text-align: center !important;
    vertical-align: middle;
}

.secondary-inline-link {
    color: #475569;
    font-size: 0.9rem;
    text-decoration: underline;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.info-grid article h2 {
    margin-bottom: 8px;
}

.info-grid article p {
    margin: 0;
    color: #e6e6e6;
    line-height: 1.5;
}

.result-note {
    color: rgba(17, 17, 17, 0.62);
    font-size: 0.9rem;
}

.partido-finished-meta {
    margin-top: 20px;
}

.fecha-header-block {
    display: grid;
    gap: 0;
}

.fecha-title {
    margin-bottom: 0;
    line-height: 1.05;
}

.fecha-place {
    margin-top: 0;
    margin-bottom: 0;
}

.fecha-start-title {
    margin-bottom: 0;
}

.fecha-start-location-group {
    margin-top: -12px;
}

.fecha-start-players-group {
    margin-top: 0;
}

.fecha-players-title {
    margin-top: 42px;
    margin-bottom: 10px;
}

.fecha-partidos-table th,
.fecha-partidos-table td {
    text-align: center !important;
    font-size: 18px;
    padding: 6px 6px;
}

.fecha-partidos-table th:nth-child(2),
.fecha-partidos-table td:nth-child(2),
.fecha-partidos-table th:nth-child(3),
.fecha-partidos-table td:nth-child(3) {
    width: 82px;
    min-width: 82px;
}

.fecha-partidos-table .table-link-button {
    font-size: 0.95rem;
    min-height: 30px;
    padding: 4px 10px;
}

.partido-hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}

.partido-hero-title h1 {
    margin-bottom: 0;
}

.partido-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 14px;
}

.partido-card .section-header {
    margin-bottom: 4px;
}

.partido-table-wrap {
    overflow-x: hidden;
}

.fecha-partidos-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.fecha-closed-partido-card h2 {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .champions-card .table-wrap {
        margin-left: -2px;
        margin-right: -2px;
    }

    .champions-card .admin-table th,
    .champions-card .admin-table td {
        padding: 7px 5px;
        font-size: 0.92rem;
    }

    .champions-card h1,
    .champions-card h2 {
        margin-bottom: 10px;
    }

    .partido-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 16px;
    }

    .home-bottom-actions {
        justify-content: stretch;
    }

    .home-bottom-actions .primary-link-button {
        width: 100%;
    }

    .partido-card {
        padding: 14px;
    }

    .partido-footer .inline-form {
        align-self: auto;
    }

    .partido-footer .primary-link-button {
        width: auto;
    }

    .partido-hero-title {
        gap: 4px 8px;
    }

    .partido-table th,
    .partido-table td {
        padding: 6px 3px;
        font-size: 15px;
    }

    .partido-table th:first-child,
    .partido-table td:first-child {
        min-width: 72px;
    }

    .partido-table th:nth-child(2),
    .partido-table td:nth-child(2),
    .partido-table th:nth-child(3),
    .partido-table td:nth-child(3),
    .partido-table th:nth-child(4),
    .partido-table td:nth-child(4),
    .partido-table th:nth-child(5),
    .partido-table td:nth-child(5) {
        min-width: 44px;
    }

    .partido-table th:nth-child(6),
    .partido-table td:nth-child(6) {
        min-width: 28px;
    }

    .result-time {
        min-width: 0;
        font-size: 0.72rem;
    }

    .result-cell {
        min-height: 26px;
    }

    .table-link-button {
        min-height: 28px;
        padding: 4px 7px;
        font-size: 0.78rem;
    }
}


