:root {
    --chip-h: 36px;
    /* altura visual de chips y del input */
    --chip-pad-x: 12px;
    /* padding horizontal de chips */
    --chip-fs: .9rem;
    /* tamaño de letra de chips */
}

/* Header */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 100px
}

/* Alineación del header según tu layout actual */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px
}

.wrap>header {
    display: flex;
    flex-direction: row;
    /* ← clave: horizontal */
    align-items: center;
    /* centra vertical dentro del header */
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 22px;
    /* conserva tu separación */
}

.wrap>header .brand {
    margin: 0;
    text-align: left;
}

.wrap>header .brand-name {
    display: inline-block;
    text-align: left;
}

/* ===== Brand textual (sin imagen) ===== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-name {
    font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1;
    /* gradiente gaming */
    background: linear-gradient(90deg, #e6eef7 0%, #37a1ff 40%, #5dd6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    padding-right: 18px;
    /* espacio para el “radar” */
}

/* “radar” puntito + pulso (solo decorativo) */
.brand-name::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #37a1ff;
    box-shadow: 0 0 0 0 rgba(55, 161, 255, .6);
    animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(55, 161, 255, .6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(55, 161, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(55, 161, 255, 0);
    }
}

.title {
    font-size: 34px;
    letter-spacing: .04em;
    font-weight: 900;
    text-transform: uppercase;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    /* ← alinea vertical con el input */
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    grid-template-columns: 1fr 320px;
    margin-bottom: 10px;
    /* para pantallas chicas, que baje el buscador */
}

.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tabs .tab {
    height: var(--chip-h);
    line-height: calc(var(--chip-h) - 2px);
    /* compensa borde interno */
    padding: 0 var(--chip-pad-x);
    font-size: var(--chip-fs);
    font-weight: 700;
    /* menos bold para que no “grite” */
    border-radius: 999px;
    border: 1px solid black;
    /* animaciones suaves */
    transition:
        background-color .18s ease,
        color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

/* Hover/preselección: sube 1px, gris un poco más oscuro y glow suave */
.tabs .tab:hover {
    background: #dde3ea;
    /* tono gris de preselección */
    color: #5a6775;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, .18),
        0 0 0 1px rgba(0, 0, 0, .12),
        0 0 0 2px rgba(55, 161, 255, .10) inset;
    /* glow interno leve */
    transform: translateY(-1px);
}

/* Activo (filtro elegido) */
.tabs .tab.active {
    height: var(--chip-h);
    background: #2ea0ff;
    /* tu azul activo */
    color: #0a1118;
    box-shadow:
        0 12px 28px rgba(46, 160, 255, .25),
        0 0 0 1px rgba(0, 0, 0, .15);
}

/* Activo + hover (ligerísimo énfasis) */
.tabs .tab.active:hover {
    filter: brightness(1.03);
}

/* Focus accesible (teclado) */
.tabs .tab:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(55, 161, 255, .35);
}

/* Click/press feedback */
.tabs .tab:active {
    transform: translateY(0);
    filter: brightness(.98);
}

.spacer {
    flex: 1
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(360px, 100%);
}

.search input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .06);
    color: #e6eef7;
    padding-right: 40px;
}

.search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.search input[type="search"]::-ms-clear {
    display: none;
}

.search .fa-solid {
    position: absolute;
    right: 12px;
    font-size: 18px;
    color: #fff;
    opacity: .9;
    pointer-events: none;
    /* no bloquea clics */
}

.search .ico-search,
.search .ico-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .9;
    cursor: pointer;
}

/* Por defecto: se ve la lupa; la X propia se oculta */
.search .ico-clear {
    display: none;
}

/* Cuando hay texto, cambia: se oculta la lupa y aparece la X */
.search.has-value .ico-search {
    display: none;
}

.search.has-value .ico-clear {
    display: block;
}

.search.has-text .ico-search {
    display: none;
}

.search.has-text .ico-clear {
    display: inline-block;
}

/* List (match-history style) */
.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px
}

.card {
    display: grid;
    grid-template-columns: 72px 1fr 220px;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--card), var(--card-2));
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.card-link {
    position: absolute;
    inset: 0;
    /* ocupa todo el card */
    z-index: 10;
    /* por encima de todo dentro del card */
    border-radius: inherit;
    /* mantiene el radio */
    background: transparent;
}

.card-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Hover: énfasis sin romper el layout ---------- */
.list .card {
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
    will-change: transform;
    text-decoration: none !important;
    border-bottom: 0 !important;
}

.list .card:hover,
.list .card:focus-within {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 14px 38px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(55, 161, 255, .25) inset;
    /* leve glow */
    z-index: 2;
    /* para que no lo tape la card de arriba/abajo */
}

.list .card .thumb {
    width: 64px;
    height: 64px;
}

.list .card:hover .thumb {
    transform: scale(1.03);
    transition: transform .18s;
}

.card::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    background:
        radial-gradient(450px 220px at 110% 30%, rgba(61, 142, 255, .18) 0%, transparent 60%),
        radial-gradient(300px 200px at -10% 120%, rgba(93, 214, 255, .12) 0%, transparent 60%);
}

.thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex: none;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #000000bb center/cover no-repeat;
}

.meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0
}

.titleRow {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.game {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: 1rem;
}

.subtitle {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    font-size: .9rem;
}

.muted {
    color: var(--muted);
    font-size: .9rem
}

.labels {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.label {
    font-size: .72rem;
    letter-spacing: .08em;
    font-weight: 800;
    color: #081219;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 999px;
    padding: 6px 10px;
}

/* Right side (countdown & release date) */
.right {
    justify-self: end;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px
}

.timer {
    font-weight: 900;
    letter-spacing: .05em;
    text-align: center;
    white-space: nowrap;
    color: #e9f4ff;
}

.status {
    font-weight: 900;
    letter-spacing: .08em;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(73, 224, 138, .15);
    color: var(--success);
    border: 1px solid rgba(73, 224, 138, .35);
}

.released {
    color: #e9f4ff;
}

.soon {
    color: #e9f4ff;
}

.right .date {
    color: var(--muted);
    font-size: .85rem;
    text-align: center
}

/* Hover focus */
.card:focus-within,
.card:hover {
    outline: 1px solid #b670cb
}

.card a {
    color: inherit;
    text-decoration: none
}

/* Footer */
footer {
    margin-top: 30px;
    color: #7f94a8;
    font-size: .9rem;
    text-align: center
}

footer span {
    opacity: .8
}

/* Responsive */
@media (max-width: 850px) {
    .right {
        flex-direction: column;
        align-items: flex-end
    }
}

@media (max-width: 720px) {
    .toolbar {
        grid-template-columns: 1fr;
        /* una columna */
        gap: 8px;
    }
}

@media (max-width: 560px) {
    header {
        gap: 14px
    }

    .title {
        font-size: 28px
    }

    .card {
        grid-template-columns: 54px 1fr;
        grid-auto-flow: row
    }

    .thumb {
        width: 54px;
        height: 54px
    }

    .right {
        grid-column: 1 / -1;
        align-items: flex-start
    }
}

@media (max-width: 640px) {
    :root {
        --chip-h: 34px;
        --chip-pad-x: 10px;
        --chip-fs: .85rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(-16px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .list .card {
        animation: slideIn .5s ease both;
        /* both = aplica estilos finales */
    }
}

@media (prefers-reduced-motion: reduce) {
    .tabs .tab {
        transition: none;
    }

    .tabs .tab:hover,
    .tabs .tab:active {
        transform: none;
    }
}