/* ==========================================================================
   ValueStats · Live dashboard
   ========================================================================== */

.live-dashboard {
    --live-canvas: var(--vs-color-canvas);
    --live-surface: var(--vs-color-surface);
    --live-surface-muted: var(--vs-color-surface-muted);
    --live-border: var(--vs-color-border);
    --live-border-strong: var(--vs-color-border-strong);
    --live-ink: var(--vs-color-ink);
    --live-muted: var(--vs-color-muted);
    --live-primary: var(--vs-color-primary);
    --live-danger: #dc3f4f;
    min-height: 100vh;
    color: var(--live-ink);
    background: var(--live-canvas) !important;
}

.live-dashboard-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(77, 123, 101, .18);
    background:
        radial-gradient(circle at 82% 8%, rgba(21, 150, 106, .12), transparent 30%),
        linear-gradient(142deg, #f4f7f5 0%, #e7eee9 62%, #dfe9e3 100%);
    box-shadow: 0 10px 28px rgba(25, 52, 38, .08);
}

.live-dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .055;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(8, 74, 49, .32) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 74, 49, .32) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 88%);
    mask-image: linear-gradient(90deg, #000, transparent 88%);
}

.live-dashboard-hero::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, #dc3f4f, rgba(21, 150, 106, .24) 38%, transparent 82%);
}

.live-dashboard-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 10.5rem;
    padding: clamp(1.7rem, 3.1vw, 2.6rem) clamp(1rem, 2.6vw, 2rem);
}

.live-dashboard-hero-copy {
    min-width: 0;
    max-width: 54rem;
}

.live-dashboard-live-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .62rem;
    color: #9f2835;
    font-size: .67rem;
    font-weight: 760;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.live-dashboard-live-label > span {
    width: .48rem;
    height: .48rem;
    border-radius: 50%;
    background: var(--live-danger);
    box-shadow: 0 0 0 4px rgba(220, 63, 79, .12);
}

.live-dashboard-hero h1 {
    margin: 0;
    color: #10231a;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 690;
    line-height: 1.04;
    letter-spacing: -.045em;
}

.live-dashboard-hero-copy > p {
    max-width: 48rem;
    margin: .75rem 0 0;
    color: #607269;
    font-size: .86rem;
    line-height: 1.58;
}

.live-dashboard-hero-actions {
    display: flex;
    align-items: stretch;
    gap: .65rem;
    flex: 0 0 auto;
}

.live-dashboard-count,
.live-dashboard-legend-button {
    min-height: 3.45rem;
    border: 1px solid rgba(77, 123, 101, .2);
    border-radius: .42rem;
    background: rgba(255, 255, 255, .54);
    box-shadow: none;
}

.live-dashboard-count {
    display: grid;
    min-width: 5.4rem;
    place-content: center;
    text-align: center;
}

.live-dashboard-count strong {
    color: #10231a;
    font-size: 1.2rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.live-dashboard-count span {
    margin-top: .28rem;
    color: #68786f;
    font-size: .61rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.live-dashboard-legend-button {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: 0 .9rem;
    color: #405149;
    font-size: .72rem;
    font-weight: 680;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.live-dashboard-legend-button:hover {
    border-color: rgba(21, 150, 106, .42);
    color: #075f45;
    background: rgba(255, 255, 255, .78);
}

.live-dashboard-legend-button svg {
    width: 1.15rem;
    height: 1.15rem;
}

.live-dashboard-shell {
    width: 100%;
    padding: 1rem clamp(.75rem, 1.7vw, 1.5rem) 2.5rem;
}

.live-dashboard-filters {
    display: flex;
    width: 100%;
    margin-bottom: .9rem;
    overflow-x: auto;
    border: 1px solid var(--live-border);
    border-radius: .48rem;
    background: var(--live-surface);
    box-shadow: 0 6px 18px rgba(25, 45, 35, .045);
    scrollbar-width: thin;
    scrollbar-color: #b9c8c0 transparent;
}

.live-dashboard-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-width: max-content;
    min-height: 3.55rem;
    padding: .52rem .88rem;
    border-right: 1px solid var(--live-border);
    color: #5e7067;
    background: transparent;
    font-size: .69rem;
    font-weight: 670;
    transition: color .18s ease, background-color .18s ease;
}

.live-dashboard-filter:last-child {
    border-right: 0;
}

.live-dashboard-filter::after {
    content: '';
    position: absolute;
    right: .55rem;
    bottom: 0;
    left: .55rem;
    height: 2px;
    background: transparent;
}

.live-dashboard-filter:hover {
    color: #075f45;
    background: #f4f8f6;
}

.live-dashboard-filter.bg-green-100,
.live-dashboard-filter[aria-pressed="true"] {
    color: #075f45;
    background: #edf7f2 !important;
}

.live-dashboard-filter.bg-green-100::after,
.live-dashboard-filter[aria-pressed="true"]::after {
    background: #15966a;
}

.live-dashboard-filter img {
    width: 1.7rem;
    height: 1.7rem;
}

.live-dashboard-filter--all {
    min-width: 4.25rem;
    justify-content: center;
    letter-spacing: .04em;
}

.live-dashboard-subscription,
.live-dashboard-empty,
.live-dashboard-info {
    border-color: var(--live-border) !important;
    border-radius: .46rem !important;
    background: var(--live-surface) !important;
    box-shadow: 0 6px 18px rgba(25, 45, 35, .045) !important;
}

.live-dashboard-subscription {
    border-left-color: #87988f !important;
}

.live-dashboard-favorites {
    margin: 1rem 0 1.2rem !important;
    padding: 1rem;
    border: 1px solid rgba(207, 162, 32, .3);
    border-radius: .46rem;
    background: rgba(255, 250, 231, .64);
}

.live-dashboard-favorites h2 {
    margin-bottom: .8rem !important;
    color: #6e5716 !important;
    font-size: .86rem !important;
}

.live-dashboard-grid {
    gap: .85rem !important;
}

.live-dashboard-card {
    border-color: var(--live-border) !important;
    border-radius: .52rem !important;
    background: var(--live-surface) !important;
    box-shadow: 0 7px 22px rgba(25, 45, 35, .055), 0 1px 2px rgba(25, 45, 35, .04) !important;
}

.live-dashboard-card .live-match-header {
    border-color: var(--live-border) !important;
    background:
        radial-gradient(circle at 50% 100%, rgba(21, 150, 106, .09), transparent 44%),
        var(--live-surface-muted) !important;
}

.live-dashboard-card .live-match-header > div:first-child > span.absolute {
    border-radius: .28rem !important;
    box-shadow: none !important;
    letter-spacing: .02em;
}

.live-dashboard-card .live-match-action {
    border: 1px solid transparent;
    border-radius: .3rem !important;
}

.live-dashboard-card .live-match-action:hover {
    border-color: var(--live-border);
}

.live-dashboard-card .live-match-crest {
    border-radius: .48rem !important;
    box-shadow: 0 5px 14px rgba(20, 45, 32, .09) !important;
}

.live-dashboard-card .live-match-crest img {
    border-radius: .32rem !important;
}

.live-dashboard-card .live-match-score {
    font-size: clamp(2rem, 2.7vw, 2.55rem) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.04em !important;
}

.live-dashboard-card .statistics-section {
    border-color: var(--live-border) !important;
}

.live-dashboard-card .statistics-section > div {
    border-radius: .24rem !important;
}

.live-dashboard-card [x-show] .bg-gray-50,
.live-dashboard-card [x-show].bg-gray-50 {
    background: var(--live-surface-muted) !important;
}

.live-dashboard-info {
    display: grid;
    grid-template-columns: minmax(15rem, .8fr) minmax(20rem, 1.2fr);
    column-gap: 2rem;
    padding: 1.25rem !important;
}

.live-dashboard-info h2,
.live-dashboard-info > p,
.live-dashboard-info > div:last-child {
    grid-column: 1;
}

.live-dashboard-info > div:nth-of-type(1) {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-content: center;
    margin-bottom: 0 !important;
}

.live-dashboard-info h2 {
    color: #203029 !important;
    font-size: 1rem !important;
    letter-spacing: -.018em;
}

.live-dashboard-info p,
.live-dashboard-info span {
    color: var(--live-muted) !important;
}

.live-dashboard-info a {
    border-radius: .3rem !important;
}

.live-dashboard [x-show="showLegend"] > div > div:last-child > div > div {
    border-left: 1px solid var(--live-border);
    background: var(--live-surface) !important;
    box-shadow: -18px 0 48px rgba(10, 30, 20, .18) !important;
}

/* Dark mode */
[data-theme="dark"] .live-dashboard {
    color-scheme: dark;
    color: var(--live-ink);
    background: var(--live-canvas) !important;
}

[data-theme="dark"] .live-dashboard-hero {
    border-bottom-color: rgba(151, 190, 171, .17);
    background:
        radial-gradient(circle at 82% 10%, rgba(52, 211, 153, .15), transparent 28%),
        linear-gradient(142deg, #0b241b 0%, #081c15 62%, #061711 100%);
    box-shadow: 0 12px 32px rgba(3, 18, 13, .18);
}

[data-theme="dark"] .live-dashboard-hero::before {
    opacity: .09;
    background-image:
        linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px);
}

[data-theme="dark"] .live-dashboard-live-label {
    color: #ff9aa5;
}

[data-theme="dark"] .live-dashboard-hero h1 {
    color: #f6fbf8;
}

[data-theme="dark"] .live-dashboard-hero-copy > p {
    color: #aebfb6;
}

[data-theme="dark"] .live-dashboard-count,
[data-theme="dark"] .live-dashboard-legend-button {
    border-color: rgba(207, 229, 218, .15);
    color: #d3e1da;
    background: rgba(255, 255, 255, .045);
}

[data-theme="dark"] .live-dashboard-count strong {
    color: #f3faf6;
}

[data-theme="dark"] .live-dashboard-count span {
    color: #9caf9f;
}

[data-theme="dark"] .live-dashboard-legend-button:hover {
    border-color: rgba(110, 231, 183, .3);
    color: #9af2c8;
    background: rgba(52, 211, 153, .08);
}

[data-theme="dark"] .live-dashboard-filters,
[data-theme="dark"] .live-dashboard-subscription,
[data-theme="dark"] .live-dashboard-empty,
[data-theme="dark"] .live-dashboard-info,
[data-theme="dark"] .live-dashboard-card {
    border-color: var(--live-border) !important;
    background: var(--live-surface) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .live-dashboard-filter {
    border-color: var(--live-border);
    color: #a8b9b0;
}

[data-theme="dark"] .live-dashboard-filter:hover {
    color: #ddf6e9;
    background: rgba(52, 211, 153, .055);
}

[data-theme="dark"] .live-dashboard-filter.bg-green-100,
[data-theme="dark"] .live-dashboard-filter[aria-pressed="true"] {
    color: #8cf0c2;
    background: rgba(52, 211, 153, .09) !important;
}

[data-theme="dark"] .live-dashboard-favorites {
    border-color: rgba(250, 204, 21, .2);
    background: rgba(250, 204, 21, .045);
}

[data-theme="dark"] .live-dashboard-favorites h2 {
    color: #fde68a !important;
}

[data-theme="dark"] .live-dashboard-card .live-match-header {
    border-color: var(--live-border) !important;
    background:
        radial-gradient(circle at 50% 100%, rgba(52, 211, 153, .08), transparent 44%),
        var(--live-surface-muted) !important;
}

[data-theme="dark"] .live-dashboard-card .live-match-crest {
    border-color: rgba(110, 231, 183, .55) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .live-dashboard-info h2 {
    color: #e7f1ec !important;
}

[data-theme="dark"] .live-dashboard-info .bg-white {
    color: #8cf0c2 !important;
    background: transparent !important;
}

[data-theme="dark"] .live-dashboard [x-show="showLegend"] > div > div:last-child > div > div {
    border-color: var(--live-border);
    background: var(--live-surface) !important;
}

@media (max-width: 1023px) {
    .live-dashboard-filter > span {
        display: none;
    }

    .live-dashboard-filter {
        min-width: 3.6rem;
        justify-content: center;
        padding-inline: .7rem;
    }

    .live-dashboard-filter--all {
        min-width: 4.25rem;
    }

    .live-dashboard-filter--all > span {
        display: inline;
    }
}

@media (max-width: 767px) {
    .live-dashboard {
        padding-bottom: .5rem !important;
    }

    .live-dashboard-hero-inner {
        align-items: flex-end;
        min-height: 0;
        padding: 1.2rem .9rem 1rem;
    }

    .live-dashboard-live-label {
        margin-bottom: .42rem;
        font-size: .58rem;
    }

    .live-dashboard-hero h1 {
        font-size: 1.68rem;
        line-height: 1.08;
    }

    .live-dashboard-hero-copy > p {
        display: none;
    }

    .live-dashboard-hero-actions {
        gap: .42rem;
    }

    .live-dashboard-count,
    .live-dashboard-legend-button {
        min-height: 2.75rem;
    }

    .live-dashboard-count {
        min-width: 3.55rem;
    }

    .live-dashboard-count strong {
        font-size: .98rem;
    }

    .live-dashboard-count span,
    .live-dashboard-legend-button > span {
        display: none;
    }

    .live-dashboard-legend-button {
        width: 2.75rem;
        justify-content: center;
        padding: 0;
    }

    .live-dashboard-shell {
        padding: .62rem .5rem 1.15rem;
    }

    .live-dashboard-filters {
        margin-bottom: .62rem;
        border-radius: .38rem;
    }

    .live-dashboard-filter {
        min-width: 3.35rem;
        min-height: 3.2rem;
        padding: .45rem .62rem;
    }

    .live-dashboard-filter img {
        width: 1.6rem;
        height: 1.6rem;
    }

    .live-dashboard-filter--all {
        min-width: 3.75rem;
        font-size: .62rem;
    }

    .live-dashboard-grid {
        gap: .62rem !important;
    }

    .live-dashboard-card {
        border-radius: .42rem !important;
    }

    .live-dashboard-card .live-match-crest {
        border-radius: .42rem !important;
    }

    .live-dashboard-card .live-match-crest img {
        border-radius: .28rem !important;
    }

    .live-dashboard-info {
        display: block;
        margin: 1rem 0 !important;
        padding: 1rem !important;
    }

    .live-dashboard-info > div:nth-of-type(1) {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 380px) {
    .live-dashboard-hero-inner {
        gap: .75rem;
    }

    .live-dashboard-hero h1 {
        font-size: 1.48rem;
    }

    .live-dashboard-count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dashboard *,
    .live-dashboard *::before,
    .live-dashboard *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
