﻿:root {
    --bg: #CFCFCF;
    --surface: #FFFFFF;
    --ink: #17151B;
    --ink-dim: #6B6672;
    --dark: #0E0D11;
    --dark-2: #1B191F;
    --gold: #A6863B;
    --gold-bright: #C9AD6A;
    --line: #E6E1D6;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --radius: 10px;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@font-face {
    font-family: Caladea;
    src: url("./Fonts/Caladea-Regular.ttf");
}

@font-face {
    font-family: Calligraffitti;
    src: url("./Fonts/Calligraffitti-Regular.ttf");
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    /*font-family: 'Inter', -apple-system, sans-serif;*/
    font-family: 'Caladea';
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

h1, h2, h3, .brand {
    /*font-family: 'Fraunces', serif;*/
    letter-spacing: -0.01em;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--dark);
    color: #EDEAE2;
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 5px 10px 10px 10px;
    gap: 26px;
    transition: width .2s ease, padding .2s ease;
    position: sticky;
    top: 0;
    align-self:flex-start;
    height: 100dvh;
    overflow-x:hidden;
    overflow-y:auto;
}

    .sidebar.collapsed {
        width: auto;
        /*width: 100px;*/
        /*padding: 5px 12px 12px 12px;*/
    }

.brand-row {
    display: flex;
    align-items: center;
    /*gap: 12px;*/
    padding: 0 5px;
}

.mark {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--dark-2);
    border: 1.5px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 20px;
}

.markImage
{
    width:80%;
    height:80%;
}

.brand {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    padding-left:10px;
}

.sidebar.collapsed .section-label {
    opacity: 0;
    width: 0;
    padding-left:0px;
}

.sidebar.collapsed .brand {
    display: none;
}

.sidebar.collapsed .brand-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.sidebar.collapsed .collapse-btn {
    margin-left: 0;
}

.collapse-btn {
    background: none;
    border: 1px solid #3A3742;
    color: #9C97A3;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    /*position: relative;
    left: -50px;*/
}

.sidebar.collapsed .collapse-btn svg {
    transform: rotate(180deg);
}

    .collapse-btn svg {
        display: block;
        transition: transform .2s ease;
    }

    .collapse-btn:hover {
        border-color: var(--gold);
        color: var(--gold-bright);
    }

.section-label {
    font-size: 11px;
    text-transform: none;
    color: #726D7A;
    padding: 0 10px;
    margin-bottom: -14px;
    white-space: nowrap;
}

nav.primary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 11px;
    border-radius: 8px;
    color: #C7C2CC;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-item .ic {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--dark-2);
    color: #fff;
}

.nav-item.active {
    background: var(--dark-2);
    color: #fff;
    border-color: #322E38;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gold);
    border-radius: 2px;
}

.SubmenuTorn {
    display: none;
    flex-direction: column;
}

.tourney-wrapper {
    display: flex;
    width: 100%;
    gap: 13px;
}

.sidebar.collapsed .nav-item .tourney-wrapper {
    justify-content: center;
}

.TornMenu {
    display: flex;
    flex-direction: column;
}

    .TornMenu:hover .SubmenuTorn {
        display: flex;
    }

.sidebar.collapsed .TornMenu:hover .SubmenuTorn {
    display: none;
}

.sidebar.collapsed .nav-item span.label {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

.sidebar-foot {
    margin-top: auto;
}

.player-chip {
    /*display: flex;*/
    display:none;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--dark-2);
    border: 1px solid #2C2933;
}

.player-chip .av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3A3742;
    flex-shrink: 0;
}

.player-chip .who {
    font-size: 13px;
    color: #E2DEE5;
    white-space: nowrap;
    overflow: hidden;
}

.player-chip .who small {
    display: block;
    color: #8E899A;
    font-size: 11px;
}

.sidebar.collapsed .player-chip .who {
    display: none;
}

.sidebar.collapsed .player-chip {
    justify-content: center;
}

/* ---------- Main ---------- */
main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    /*justify-content: space-between;*/
    padding: 0 30px;
    background: var(--surface);
}

.topbar.collapsed{
    padding-left:40px;
}

.crumb {
    color: var(--ink-dim);
    font-size: 20px;
}

    .crumb a {
        color: inherit;
        text-decoration: none;
    }

        .crumb a:hover {
            color: var(--gold);
            text-decoration: underline;
        }

.crumb b {
    color: var(--ink);
    font-weight: 600;
}

.content {
    padding: 30px 30px;
    /*max-width: 1080px;*/
}

/* Home hero */
.hero {
    background: var(--dark);
    border-radius: 14px;
    padding: 46px 40px;
    position: relative;
    overflow: hidden;
    color: #EDEAE2;
    margin-bottom: 34px;
}

.hero-mark {
    position: absolute;
    right: 50px;
    top: 0px;
    opacity: .25;
    /*width: 300px;*/
    height: 100%;
    padding: 10px 20px;
    color: var(--gold);
    user-select: none;
    pointer-events: none;
}

.hero h1 {
    font-size: 34px;
    margin: 0 0 10px;
    font-weight: 600;
    color: #fff;
    position: relative;
}

.hero p {
    max-width: 460px;
    color: #B7B2BE;
    margin: 0;
    position: relative;
    font-size: 16px;
}

.hero .gold-rule {
    width: 46px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    margin-bottom: 18px;
    position: relative;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width:400px;
}

    .tile:hover {
        border-color: var(--gold);
    }

    .tile .t-ic {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        background: #F1EDE1;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gold);

    }

    .tile h3 {
        margin: 0;
        font-size: 17px;
        font-weight: 600;
    }

    .tile p {
        margin: 0;
        font-size: 16px;
        color: var(--ink-dim);
    }

    .tile .go {
        font-size: 12.5px;
        color: var(--gold);
        font-weight: 600;
        margin-top: 4px;
    }

    .tile .tourneyList{
        display:grid;
        grid-template-columns:repeat(2,1fr);
    }

    .tile .tourneyLink {
        font-size: 15px;
        color: var(--gold);
        font-weight: 600;
    }

    .tile.ghost {
        border-style: dashed;
        color: var(--ink-dim);
        align-items: flex-start;
        justify-content: center;
    }

        .tile.ghost .t-ic {
            background: transparent;
            border: 1px dashed var(--line);
            color: var(--ink-dim);
        }

.tileTitle {
    font-size: 30px !important;
    padding-left:20px;
    align-content: center;

}

.section-title {
    font-size: 17px;
    color: var(--ink-dim);
    margin: 40px 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .section-title::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

.subpage {
    display: none;
}

    .subpage.active {
        display: block;
    }

table.lb {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

    table.lb th {
        text-align: left;
        font-size: 12px;
        color: var(--ink-dim);
        font-weight: 600;
        padding: 12px 16px;
        border-bottom: 1px solid var(--line);
        background: #FAF8F3;
    }

    table.lb td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--line);
        font-size: 14px;
    }

    table.lb tr:last-child td {
        border-bottom: none;
    }

.rank-gold {
    color: var(--gold);
    font-weight: 700;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
}

.p-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

    .p-card .av {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #EFEBDF;
    }

    .p-card .name {
        font-weight: 600;
        font-size: 14px;
    }

    .p-card .elo {
        font-size: 12px;
        color: var(--gold);
        font-weight: 600;
    }

.t-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

    .t-card .st {
        font-size: 12px;
        padding: 4px 9px;
        border-radius: 6px;
        background: #F1EDE1;
        color: var(--gold);
        font-weight: 600;
    }

.note {
    margin-top: 44px;
    font-size: 12.5px;
    color: var(--ink-dim);
    border-top: 1px dashed var(--line);
    padding-top: 16px;
}

/* Nombre del encabezado mientras no llega (esqueleto) */
  .skeleton { display:inline-block; vertical-align:middle; width:120px; height:12px; border-radius:6px; background:linear-gradient(90deg,#ECE7DA 25%,#F6F3EA 50%,#ECE7DA 75%); background-size:200% 100%; animation:shimmer 1.2s linear infinite; }
  @keyframes shimmer { to { background-position:-200% 0; } }
  @media (prefers-reduced-motion: reduce) { .skeleton { animation:none; } }

/* Estados de carga / error / vacío (dentro de cada vista) */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 56px 20px;
    color: var(--ink-dim);
    font-size: 13.5px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
}

    .loading p {
        margin: 0;
    }

.spinner {
    width: 100px;
    height: 100px;
    animation: spin .9s linear infinite;
}

.sp-track {
    fill: none;
    stroke: var(--line);
    stroke-width: 5;
}

.sp-arc {
    fill: none;
    stroke: var(--gold);
    stroke-width: 5;
    stroke-linecap: round;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}





.site-footer {
    border-top: 1px solid var(--line);
    padding: 16px 0px;
    margin: 0px 30px;
    text-align: center;
    font-size: 20px;
    color: var(--ink-dim);
    line-height:1;
}

madeby
{
    font-size:14px;
}

.activity {
    display: flex;
    flex-direction: column;
    gap: 10px;
    container-type: inline-size;
    container-name: partidas;
}

.retry-btn {
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--gold);
    background: var(--surface);
    color: var(--gold);
    cursor: pointer;
}

    .retry-btn:hover {
        background: var(--dark);
        color: #fff;
        border-color: var(--dark);
    }

.m-legend {
    margin: 0 2px 2px;
    font-size: 12px;
    color: var(--ink-dim);
}

.m-head {
    display: flex;
    gap: 22px;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-dim);
}

    .m-head .l {
        width: 350px;
        flex-shrink: 0;
    }

    .m-head .t {
        flex: 1;
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 30px;
    }

        .m-head .t div {
            padding: 0 6px;
        }

.match {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 22px;
}

    .match.live {
        border-color: var(--gold);
    }

.m-left {
    width: 350px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.m-art {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

    .m-art .map {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

.m-result {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 20px;
    height: 20px;
    display: block;
}

.m-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.m-map {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.m-name {
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.m-date, .m-dur {
    font-size: 12px;
    color: var(--ink-dim);
    line-height: 1.35;
}

.m-live {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: 4px 9px;
    text-decoration: none;
}

.m-live:hover{
    background-color: var(--gold);
    color: white;
}

.m-teams {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
}

.team {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .team.b::before {
        content: "";
        position: absolute;
        left: -15px;
        top: 2px;
        bottom: 2px;
        width: 1px;
        background: var(--line);
    }

.prow {
    height: 32px;
    padding: 0 6px;
    border-radius: 7px;
    display: grid;
    grid-template-columns: 12px minmax(0,1fr) 28px 40px 36px;
    align-items: center;
    column-gap: 9px;
    font-size: 13px;
}

    .prow.me {
        background: #FAF6EA;
    }

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.25);
}

.ptag {
    color: var(--ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prow.me .ptag {
    font-weight: 600;
}

.ptag:hover {
    color: var(--gold);
    text-decoration: underline;
}

.civ {
    position: relative;
    width: 28px;
    height: 28px;
    display: block;
    border-radius: 50%;
}

    .civ img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        background: #EFEBDF;
    }

    .civ .tip {
        position: absolute;
        left: 50%;
        bottom: calc(100% + 8px);
        transform: translateX(-50%) translateY(4px);
        background: var(--dark);
        color: #F1EDE1;
        border: 1px solid var(--gold);
        font-size: 11.5px;
        font-weight: 600;
        padding: 4px 9px;
        border-radius: 6px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        z-index: 3;
    }

        .civ .tip::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: var(--gold);
        }

    .civ:hover .tip, .civ:focus-visible .tip {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .civ:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: 2px;
    }

.pelo {
    color: var(--ink-dim);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pdiff {
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink-dim);
}

    .pdiff.pos {
        color: #3E8E4F;
    }

    .pdiff.neg {
        color: #B0453D;
    }

.pagesContainer{
    display:flex;
    flex-direction:column;
    width:100%;
    align-items:center;
}

.pagePanel{
    display:flex;
    justify-content:center;
    background:var(--surface);
    border-radius:var(--radius);
    padding: 5px;
}

.actPage{
    padding:0 5px 0 5px;
    cursor: pointer;
    font-size:15px;
}

.actPage.current
{
    font-weight: 700;
    color:var(--gold);
}

/* Ancho reducido (por el contenedor, no por la ventana: el menú lateral puede estar abierto o colapsado) */
@container partidas (max-width: 900px) {
    .m-head {
        display: none;
    }

    .match {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 10px;
    }

    .m-left {
        width: 100%;
    }

    .m-teams {
        flex-basis: 100%;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .team {
        max-width: 460px;
    }

        .team.b::before {
            display: none;
        }

        .team.b {
            padding-top: 6px;
            border-top: 1px dashed var(--line);
        }
}

@media (prefers-reduced-motion: reduce) {
    .civ .tip {
        transition: none;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: 76px;
        padding: 22px 12px;
    }

        .sidebar .section-label {
            opacity: 0;
            width: 0;
        }

        .sidebar .brand {
            display: none;
        }

        .sidebar .brand-row {
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 0;
        }

        .sidebar .collapse-btn {
            display: none;
        }
        /* en celular no se expande */
        .sidebar .nav-item span.label {
            display: none;
        }

        .sidebar .nav-item {
            justify-content: center;
        }

        .sidebar .player-chip .who {
            display: none;
        }

        .sidebar .player-chip {
            justify-content: center;
        }

    .content {
        padding: 22px 16px 40px;
    }

    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }
}