:root {
    --bg: #071421;
    --surface: #ffffff;
    --surface-soft: #f3f8fd;
    --ink: #071421;
    --muted: #5f7184;
    --line: #d8e6f2;
    --primary: #0a4f91;
    --primary-strong: #062c55;
    --accent: #6fc8ff;
    --accent-strong: #159ce8;
    --milk: #f8fbff;
    --warning: #8a5a00;
    --warning-bg: #fff6d8;
    --success: #0f6b56;
    --success-bg: #e6f7f2;
    --error: #a83232;
    --error-bg: #ffe7e7;
    --shadow: 0 18px 48px rgba(3, 15, 28, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-bottom: 22px;
    overflow-x: hidden;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(230, 241, 250, 0.96)),
        url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23cfe4f6' stroke-width='1'%3E%3Cpath d='M0 80h160M80 0v160'/%3E%3Ccircle cx='80' cy='80' r='34'/%3E%3C/g%3E%3C/svg%3E");
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.home-hero {
    background:
        linear-gradient(90deg, rgba(3, 13, 27, 0.82) 0%, rgba(4, 22, 45, 0.58) 42%, rgba(4, 22, 45, 0.22) 100%),
        url("../images/copadeleche.png") center center / contain no-repeat fixed,
        #03101f;
    color: var(--milk);
}

body.dashboard-bg {
    position: relative;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(230, 241, 250, 0.94)), #e6f1fa;
}

body.dashboard-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("../images/icono.png") center center / min(780px, 78vw) no-repeat;
    opacity: 0.13;
}

body.dashboard-bg .page,
body.dashboard-bg .site-header {
    position: relative;
}

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

.powered-tab {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 16px 4px;
    color: rgba(248, 251, 255, 0.78);
    background: rgba(3, 13, 27, 0.92);
    border-top: 1px solid rgba(111, 200, 255, 0.18);
    border-bottom: 0;
    box-shadow: 0 -8px 22px rgba(3, 15, 28, 0.18);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    pointer-events: none;
}

.powered-tab a {
    pointer-events: auto;
}

.powered-tab a:hover {
    color: white;
}

input,
select,
button {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 4vw, 56px);
    color: var(--milk);
    background: rgba(3, 13, 27, 0.86);
    border-bottom: 1px solid rgba(111, 200, 255, 0.22);
    backdrop-filter: blur(14px);
}

body:not(.home-hero) .site-header {
    box-shadow: 0 10px 30px rgba(3, 15, 28, 0.16);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(111, 200, 255, 0.55);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    color: rgba(248, 251, 255, 0.78);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-app-button {
    min-height: 38px;
    padding: 8px 14px;
    color: #062c55;
    background: linear-gradient(135deg, #fff2bd, #d9a72f);
    border: 1px solid rgba(255, 246, 197, 0.72);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(223, 178, 74, 0.20);
    cursor: pointer;
    font-weight: 900;
    white-space: nowrap;
}

.install-app-button:hover {
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    place-items: center;
    align-content: center;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 8px;
    color: var(--milk);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(111, 200, 255, 0.22);
    border-radius: 8px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav a:hover,
.link-button:hover {
    color: var(--accent);
}

.nav form {
    margin: 0;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.nav-dropdown summary {
    cursor: pointer;
    list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    z-index: 100;
    min-width: 170px;
    max-width: calc(100vw - 32px);
    padding: 8px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.nav-dropdown[open] .nav-menu,
.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
    display: block;
}

.nav-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
}

.nav-menu a:hover {
    color: var(--primary);
    background: var(--surface-soft);
}

.link-button {
    padding: 0;
    border: 0;
    color: rgba(248, 251, 255, 0.78);
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.home-hero .page {
    min-height: calc(100vh - 71px);
    display: grid;
    align-items: center;
    padding: 18px 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) 410px;
    align-items: center;
    gap: clamp(28px, 6vw, 80px);
    min-height: auto;
}

.auth-copy h1,
.dashboard-header h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(2rem, 5vw, 4.4rem);
    line-height: 1;
}

.home-hero .auth-copy h1 {
    color: white;
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
}

.auth-copy p:not(.eyebrow) {
    max-width: 520px;
    color: rgba(248, 251, 255, 0.82);
    font-size: 1.1rem;
    line-height: 1.7;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(111, 200, 255, 0.35);
    padding: 22px;
    backdrop-filter: blur(18px);
}

.mobile-auth-trigger,
.auth-card-close {
    display: none;
}

.tabs,
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.tab {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface-soft);
    cursor: pointer;
    font-weight: 800;
}

.tab.is-active {
    color: white;
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent-strong));
}

form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.14);
}

.auth-card form {
    gap: 16px;
}

.auth-card form,
.panel form,
.match-list {
    display: grid;
}

.tab-panel:not(.is-active) {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.auth-card form.tab-panel.is-active {
    display: grid;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent-strong));
    box-shadow: 0 10px 22px rgba(10, 79, 145, 0.25);
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.secondary-button {
    min-height: 36px;
    color: var(--primary);
    background: #e7f4ff;
}

.compact {
    min-height: 40px;
    width: fit-content;
}

.form-note,
.muted {
    color: var(--muted);
}

.team-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    vertical-align: middle;
}

.team-flag {
    width: 24px;
    height: 16px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid rgba(7, 20, 33, 0.18);
    border-radius: 3px;
    background: white;
}

.match-teams {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.versus {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-header .eyebrow {
    color: var(--primary-strong);
}

.user-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.user-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    color: white;
    background: linear-gradient(135deg, rgba(6, 44, 85, 0.92), rgba(10, 79, 145, 0.84));
    border: 1px solid rgba(111, 200, 255, 0.28);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(10, 79, 145, 0.16);
    font-size: 1.04rem;
    font-weight: 800;
}

.user-summary strong {
    color: #ffe18a;
    font-size: 1.16rem;
}

.grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.two-columns {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.side-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 18px;
}

.panel {
    padding: 20px;
}

.podium-panel {
    background:
        linear-gradient(145deg, rgba(6, 44, 85, 0.92), rgba(10, 79, 145, 0.76)),
        rgba(255, 255, 255, 0.78);
    border-color: rgba(223, 178, 74, 0.42);
}

.podium-panel .panel-title h2 {
    color: #fff7da;
}

.podium-panel .panel-title span {
    color: rgba(255, 247, 218, 0.78);
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    min-height: 255px;
}

.podium-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 10px;
    width: min(180px, 32%);
    min-height: 178px;
    padding: 18px 14px;
    color: white;
    background:
        linear-gradient(160deg, rgba(10, 79, 145, 0.94), rgba(6, 44, 85, 0.92));
    border: 1px solid rgba(223, 178, 74, 0.36);
    border-radius: 8px;
    box-shadow: 0 18px 34px rgba(3, 15, 28, 0.24);
    overflow: hidden;
}

.podium-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 222, 117, 0.22), transparent 52%);
    pointer-events: none;
}

.podium-card > * {
    position: relative;
}

.podium-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.15;
}

.podium-card strong {
    color: #ffe18a;
    font-size: 1.65rem;
    line-height: 1;
}

.podium-rank {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #062c55;
    background: linear-gradient(135deg, #fff2bd, #d9a72f);
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(223, 178, 74, 0.26);
}

.podium-breakdown {
    display: grid;
    gap: 5px;
    margin-top: auto;
    color: rgba(248, 251, 255, 0.82);
    font-size: 0.8rem;
    font-weight: 800;
}

.podium-card.rank-1 {
    order: 2;
    min-height: 230px;
    background:
        linear-gradient(160deg, rgba(255, 218, 102, 0.96), rgba(191, 129, 20, 0.94));
    color: #09223c;
    border-color: rgba(255, 246, 197, 0.82);
}

.podium-card.rank-1 strong {
    color: #062c55;
}

.podium-card.rank-1 .podium-breakdown {
    color: rgba(9, 34, 60, 0.76);
}

.podium-card.rank-2 {
    order: 1;
    min-height: 198px;
}

.podium-card.rank-3 {
    order: 3;
    min-height: 168px;
}

.podium-table-wrap {
    margin-top: 16px;
}

.podium-table {
    min-width: 640px;
    color: white;
    background: rgba(3, 13, 27, 0.30);
    border-radius: 8px;
    overflow: hidden;
}

.podium-table th {
    color: #fff2bd;
    background: rgba(3, 13, 27, 0.20);
}

.podium-table td {
    border-bottom-color: rgba(255, 242, 189, 0.18);
}

.podium-table strong {
    color: #ffe18a;
}

.match-results-panel {
    background:
        linear-gradient(145deg, rgba(10, 79, 145, 0.14), rgba(111, 200, 255, 0.20)),
        rgba(255, 255, 255, 0.72);
    border-color: rgba(10, 79, 145, 0.24);
    backdrop-filter: blur(10px);
}

.match-results-panel .panel-title {
    padding: 14px 16px;
    color: white;
    background: linear-gradient(135deg, rgba(6, 44, 85, 0.92), rgba(10, 79, 145, 0.82));
    border: 1px solid rgba(111, 200, 255, 0.28);
    border-radius: 8px;
}

.match-results-panel .panel-title h2,
.match-results-panel .panel-title span {
    color: white;
}

.panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-title h2 {
    margin: 0;
    font-size: 1.2rem;
}

.panel-title span,
.match-info span,
.match-status {
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.leaderboard-table {
    min-width: 860px;
}

th,
td {
    padding: 13px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.rules-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.rules-panel {
    display: grid;
    align-items: stretch;
    margin-bottom: 0;
}

.rules-button {
    display: grid;
    place-items: center;
    gap: 14px;
    height: 100%;
    min-height: 220px;
    padding: 26px;
    color: white;
    background: linear-gradient(135deg, var(--primary-strong), var(--primary), var(--accent-strong));
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(10, 79, 145, 0.28);
    font-weight: 900;
}

.rules-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(10, 79, 145, 0.34);
}

.rules-button img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.46);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

.rules-button span {
    font-size: 1.7rem;
}

.prize-panel {
    display: grid;
    align-content: center;
    gap: 14px;
    margin-bottom: 0;
    color: white;
    background:
        linear-gradient(145deg, rgba(8, 84, 70, 0.94), rgba(10, 79, 145, 0.86)),
        var(--primary-strong);
    border-color: rgba(255, 225, 138, 0.38);
    box-shadow: 0 16px 34px rgba(10, 79, 145, 0.24);
}

.prize-panel .eyebrow {
    color: #fff2bd;
}

.prize-panel strong {
    display: block;
    color: #ffe18a;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.prize-panel p {
    margin: 0;
    color: rgba(248, 251, 255, 0.82);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.45;
}

.modal {
    width: min(560px, calc(100% - 32px));
    padding: 22px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(3, 13, 27, 0.58);
    backdrop-filter: blur(4px);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.45rem;
}

.modal-close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--primary);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}

.auth-card-close {
    display: none;
}

.install-help {
    display: grid;
    gap: 14px;
}

.install-help p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.grouped-matches {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.group-block {
    padding: 16px;
    background:
        linear-gradient(145deg, rgba(231, 244, 255, 0.82), rgba(207, 232, 250, 0.58)),
        rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(10, 79, 145, 0.20);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 28px rgba(10, 79, 145, 0.10);
}

.group-block h3 {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 12px;
    padding: 7px 12px;
    color: white;
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
    border: 1px solid rgba(111, 200, 255, 0.30);
    border-radius: 8px;
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(10, 79, 145, 0.18);
}

.prediction-group {
    padding: 0;
    overflow: hidden;
}

.prediction-group summary {
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.results-group summary {
    grid-template-columns: 1fr;
}

.prediction-group summary::-webkit-details-marker {
    display: none;
}

.prediction-group summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    color: var(--accent-strong);
    font-size: 1.5rem;
    font-weight: 900;
}

.prediction-group[open] summary::after {
    content: "-";
}

.prediction-group summary > span:first-child {
    display: grid;
    gap: 4px;
    padding-right: 28px;
}

.prediction-group summary strong {
    color: var(--primary-strong);
}

.prediction-group summary small {
    color: var(--muted);
    font-weight: 800;
}

.group-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-right: 34px;
    color: var(--muted);
    line-height: 1.45;
}

.prediction-group .match-list {
    padding: 0 16px 16px;
}

.group-block table {
    min-width: 620px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 8px;
}

.group-block th {
    color: #0a4f91;
    background: rgba(111, 200, 255, 0.18);
}

.group-block td {
    border-bottom-color: rgba(10, 79, 145, 0.13);
}

.group-block tbody tr:nth-child(even) {
    background: rgba(231, 244, 255, 0.34);
}

.group-block tbody tr:hover {
    background: rgba(111, 200, 255, 0.22);
}

.group-block td:first-child {
    font-weight: 900;
}

.group-block td:first-child {
    width: 1%;
    white-space: nowrap;
}

.group-block td:first-child {
    background: transparent;
}

.date-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    color: white;
    background: linear-gradient(135deg, rgba(6, 44, 85, 0.86), rgba(10, 79, 145, 0.74));
    border-radius: 7px;
    box-shadow: inset 0 0 0 1px rgba(111, 200, 255, 0.20);
    font-size: 0.82rem;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid;
    font-weight: 800;
}

.alert.success {
    color: var(--success);
    background: var(--success-bg);
    border-color: #bfe6cc;
}

.alert.error {
    color: var(--error);
    background: var(--error-bg);
    border-color: #ffc2c2;
}

.alert.warning {
    color: var(--warning);
    background: var(--warning-bg);
    border-color: #f3dd98;
}

.match-list {
    gap: 12px;
    margin-bottom: 18px;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(230px, 330px) 130px;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.match-info {
    display: grid;
    gap: 6px;
}

.pill {
    width: fit-content;
    padding: 4px 8px;
    color: var(--primary);
    background: #e7f4ff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.score-inputs,
.result-fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 10px;
}

.score-inputs input,
.result-fields input {
    text-align: center;
}

.score-separator,
.result-fields span {
    padding-bottom: 11px;
    color: var(--muted);
    font-weight: 900;
}

.admin-tabs {
    width: min(420px, 100%);
}

.profile-tabs {
    width: min(760px, 100%);
}

.compare-form,
.profile-form {
    display: grid;
    align-items: end;
    gap: 14px;
}

.compare-form {
    grid-template-columns: minmax(240px, 420px) auto;
}

.profile-form {
    max-width: 460px;
}

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

.profile-data div {
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-data dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-data dd {
    margin: 0;
    font-weight: 800;
}

.big-number {
    margin: 0;
    color: var(--primary-strong);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
}

.score-summary .panel {
    margin-bottom: 0;
}

.stats-table {
    min-width: 920px;
}

.stats-general-table {
    min-width: 940px;
}

.vote-stat {
    display: grid;
    gap: 7px;
    min-width: 130px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.stat-meter {
    display: block;
    height: 8px;
    overflow: hidden;
    background: #dceaf5;
    border-radius: 999px;
}

.stat-meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-strong));
}

.check {
    display: inline-flex;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.inline-grid {
    display: grid;
    grid-template-columns: 90px repeat(4, minmax(130px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

@media (max-width: 860px) {
    body.home-hero {
        background:
            linear-gradient(180deg, rgba(3, 13, 27, 0.36) 0%, rgba(4, 22, 45, 0.22) 44%, rgba(4, 22, 45, 0.94) 70%),
            url("../images/copadeleche.png") center 72px / 118vw auto no-repeat scroll,
            #03101f;
    }

    body.dashboard-bg::before {
        background-size: 118vw;
        opacity: 0.10;
    }

    .site-header,
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header {
        position: relative;
        z-index: 1000;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        overflow: visible;
    }

    .brand {
        width: auto;
        min-width: 0;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-left: 0;
        padding-top: 4px;
        font-size: 0.95rem;
    }

    .site-header.is-nav-open .nav {
        display: flex;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        gap: 8px;
    }

    .nav-toggle {
        display: inline-grid;
    }

    .site-header.is-nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header.is-nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .site-header.is-nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .install-app-button {
        min-height: 36px;
        padding: 7px 12px;
    }

    .nav > a,
    .nav-dropdown summary {
        min-height: 38px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(111, 200, 255, 0.16);
        border-radius: 8px;
    }

    .nav-menu {
        position: static;
        min-width: 0;
        max-width: none;
        margin-top: 6px;
        box-shadow: none;
        z-index: 1001;
    }

    .page {
        width: min(100% - 24px, 1180px);
        padding: 22px 0 38px;
    }

    .home-hero .page {
        min-height: calc(100vh - 86px);
        padding: 48vh 0 30px;
    }

    .auth-shell,
    .two-columns,
    .match-row,
    .inline-grid,
    .compare-form,
    .profile-data {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        gap: 22px;
    }

    .home-hero .auth-copy {
        padding: 14px;
        background: rgba(3, 13, 27, 0.36);
        border: 1px solid rgba(111, 200, 255, 0.18);
        border-radius: 8px;
        backdrop-filter: blur(4px);
    }

    .mobile-auth-trigger {
        display: inline-flex;
        margin-top: 8px;
    }

    .home-hero .auth-card {
        position: fixed;
        top: 50%;
        left: 50%;
        z-index: 1200;
        display: none;
        width: min(420px, calc(100vw - 24px));
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 42px 16px 16px;
        transform: translate(-50%, -50%);
    }

    .home-hero .auth-card.is-open {
        display: block;
    }

    body.auth-modal-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(3, 13, 27, 0.68);
        backdrop-filter: blur(5px);
    }

    .auth-card-close {
        position: absolute;
        top: 12px;
        right: 12px;
        display: inline-grid;
    }

    .auth-copy h1,
    .dashboard-header h1 {
        font-size: 2.2rem;
        line-height: 1.08;
    }

    .auth-copy p:not(.eyebrow) {
        font-size: 1rem;
        line-height: 1.55;
    }

    .auth-card,
    .panel {
        padding: 16px;
    }

    .podium {
        align-items: stretch;
        flex-direction: column;
        min-height: 0;
        gap: 10px;
    }

    .podium-card,
    .podium-card.rank-1,
    .podium-card.rank-2,
    .podium-card.rank-3 {
        order: initial;
        width: 100%;
        min-height: 0;
    }

    .side-stack {
        grid-template-rows: auto;
    }

    .panel-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    table {
        min-width: 620px;
    }

    .table-wrap {
        margin-inline: -4px;
        padding-bottom: 4px;
        max-width: calc(100vw - 18px);
        -webkit-overflow-scrolling: touch;
    }

    .group-block {
        padding: 12px;
    }

    .prediction-group {
        padding: 0;
    }

    .prediction-group summary {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
    }

    .prediction-group .match-list {
        padding: 0 12px 12px;
    }

    .score-inputs,
    .result-fields {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .mobile-card-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tr {
        margin-bottom: 10px;
        padding: 12px;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(10, 79, 145, 0.14);
        border-radius: 8px;
        box-shadow: 0 8px 18px rgba(10, 79, 145, 0.08);
    }

    .podium-table.mobile-card-table tr {
        background: rgba(3, 13, 27, 0.24);
        border-color: rgba(255, 242, 189, 0.22);
    }

    .mobile-card-table td {
        display: grid;
        grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 8px 0;
        border-bottom: 1px solid rgba(10, 79, 145, 0.10);
        overflow-wrap: anywhere;
    }

    .mobile-card-table td > * {
        min-width: 0;
    }

    .mobile-card-table td:last-child {
        border-bottom: 0;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        color: var(--primary);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .podium-table.mobile-card-table td::before {
        color: #fff2bd;
    }

    .group-block table.mobile-card-table,
    .stats-table.mobile-card-table,
    .stats-general-table.mobile-card-table,
    .podium-table.mobile-card-table {
        min-width: 0;
    }

    .group-block td:first-child {
        width: 100%;
        white-space: normal;
    }

    .date-badge {
        width: fit-content;
    }
}

@media (max-width: 560px) {
    .tabs,
    .admin-tabs {
        flex-direction: column;
    }

    .auth-copy h1,
    .dashboard-header h1 {
        font-size: 1.85rem;
    }

    .page {
        width: min(100% - 18px, 1180px);
        padding-top: 18px;
    }

    .panel,
    .auth-card {
        border-radius: 8px;
        box-shadow: 0 12px 28px rgba(3, 15, 28, 0.14);
    }

    .dashboard-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .primary-button,
    .secondary-button,
    .compact {
        width: 100%;
    }

    .install-app-button {
        width: 100%;
    }

    .header-actions .install-app-button {
        width: auto;
    }

    .auth-card {
        padding: 14px;
    }

    .home-hero .auth-card {
        padding: 42px 14px 14px;
    }

    .match-row {
        padding: 12px;
    }

    .match-info,
    .match-status {
        min-width: 0;
    }

    .match-teams,
    .team-badge {
        max-width: 100%;
    }

    .team-badge span {
        overflow-wrap: anywhere;
    }

    .score-inputs {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .score-separator {
        display: none;
    }

    th,
    td {
        padding: 11px 8px;
    }

    .rules-button {
        min-height: 150px;
        padding: 18px;
    }

    .rules-button img {
        width: 58px;
        height: 58px;
    }

    .rules-button span {
        font-size: 1.35rem;
    }

    .modal {
        width: min(100% - 18px, 560px);
        padding: 18px;
    }

    .grouped-matches {
        gap: 14px;
    }

    .group-block {
        padding: 10px;
    }

    .mobile-card-table td {
        grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    }
}
