/* ============================================================
   Liga Liceelor Live Score – Dark Theme
   ============================================================ */

:root {
    --ll-bg:           #0d1117;
    --ll-surface:      #161b22;
    --ll-surface-alt:  #1c2333;
    --ll-border:       #30363d;
    --ll-text:         #e6edf3;
    --ll-text-muted:   #8b949e;
    /* --ll-accent:       #f0b630; */
    --ll-accent:       #ffd446;
    /* --ll-accent-dark:  #c99520; */
    --ll-accent-dark:  #d29922;
    --ll-accent-glow:  rgba(240, 182, 48, .12);
    --ll-green:        #3fb950;
    --ll-red:          #f85149;
    --ll-yellow:       #d29922;
    --ll-blue:         #46c2ff;
    --ll-radius:       8px;
    --ll-radius-sm:    4px;
    --ll-font:         'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --ll-font-display: 'Sora', 'DM Sans', sans-serif;
    --ll-max-width:    1200px;
    --ll-transition:   .2s ease;
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=Sora:wght@600;700;800&display=swap');

/* ---- Container ---- */

.ll-live-score-app {
    font-family: var(--ll-font);
    color: var(--ll-text);
    /* background: var(--ll-bg); */
    line-height: 1.5;
    padding: 2rem 1rem 4rem;
    -webkit-font-smoothing: antialiased;
}

.ll-live-score-app *,
.ll-live-score-app *::before,
.ll-live-score-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ll-wrap {
    max-width: var(--ll-max-width);
    margin: 0 auto;
}

/* ---- Page Title ---- */

.ll-page-title {
    font-family: var(--ll-font-display);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    color: var(--ll-text);
    letter-spacing: .02em;
    margin-bottom: 2.5rem;
}

.ll-page-title span {
    color: var(--ll-accent);
}

/* ---- Live Indicator ---- */

.ll-live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ll-text-muted);
    background: var(--ll-surface);
    border: 1px solid var(--ll-border);
    border-radius: 999px;
    padding: .45rem 1.2rem;
    margin: -1rem auto 2rem;
    max-width: max-content;
    flex-wrap: wrap;
}

.ll-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ll-green);
    flex-shrink: 0;
    animation: ll-dot-pulse 2s ease-in-out infinite;
}

.ll-live-dot--polling {
    background: var(--ll-accent);
    animation: ll-dot-spin .8s linear infinite;
}

.ll-live-separator {
    color: var(--ll-border);
}

.ll-live-error {
    color: var(--ll-red);
}

@keyframes ll-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.7); }
}

@keyframes ll-dot-spin {
    0%   { opacity: .3; }
    50%  { opacity: 1; }
    100% { opacity: .3; }
}

/* ---- Section Badge ---- */

.ll-section-badge {
    display: flex;
    justify-content: center;
    margin: 3rem 0 1.5rem;
}

.ll-section-badge h2 {
    font-family: var(--ll-font-display);
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ll-bg);
    background: var(--ll-accent);
    padding: .55rem 2rem;
    border-radius: 999px;
    display: inline-block;
}

.ll-competition-info {
    /* text-align: center; */
    font-size: .85rem;
    color: var(--ll-text-muted);
    margin-bottom: 2rem;
    background-color: #000;
    padding:16px;
    border-radius: 12px;

    /* max-height: 170px; */
    overflow: scroll;
    white-space: pre;
    text-wrap: wrap;
}

/* ---- Group Standings ---- */

.ll-standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.ll-group-table {
    background: var(--ll-surface);
    border: 1px solid var(--ll-border);
    border-radius: var(--ll-radius);
    overflow: hidden;
}

.ll-group-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.ll-group-table thead th {
    font-family: var(--ll-font-display);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .7rem .5rem;
    text-align: center;
    color: var(--ll-accent);
    border-bottom: 1px solid var(--ll-border);
}

.ll-group-table thead th:first-child {
    text-align: left;
    padding-left: .85rem;
}

.ll-group-table tbody td {
    padding: .55rem .5rem;
    text-align: center;
    border-bottom: 1px solid var(--ll-border);
    color: var(--ll-text-muted);
}

.ll-group-table tbody tr:last-child td {
    border-bottom: none;
}

.ll-group-table tbody td:first-child {
    text-align: left;
    padding-left: .85rem;
    color: var(--ll-text);
    font-weight: 500;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-group-table tbody td.ll-pts {
    color: var(--ll-accent);
    font-weight: 700;
}

/*
 .ll-group-table tbody tr:nth-child(-n+2) td:first-child {
    color: var(--ll-green);
}
*/

/* ---- Match Cards Grid ---- */

.ll-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    grid-template-rows: 1fr 1fr;
    grid-auto-flow: column;
    gap: .85rem;
    margin-bottom: .5rem;
}

/* ---- Match Card ---- */

.ll-match-card {
    background: var(--ll-surface);
    border: 1px solid var(--ll-border);
    border-radius: var(--ll-radius);
    padding: .9rem 1rem;
    transition: border-color var(--ll-transition), box-shadow var(--ll-transition);
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    /* min-width: 280px; */
}

.ll-match-card:hover {
    border-color: var(--ll-accent);
    box-shadow: 0 0 20px var(--ll-accent-glow);
}

.ll-match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.ll-team-name {
    flex: 1;
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ll-text);
}

.ll-team-name.ll-winner {
    color: var(--ll-green);
    font-weight: 700;
}

.ll-score {
    font-family: var(--ll-font-display);
    font-weight: 800;
    font-size: .95rem;
    min-width: 1.6rem;
    text-align: center;
    color: var(--ll-text);
}

.ll-match-meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .7rem;
    color: var(--ll-text-muted);
    padding-top: .25rem;
    border-top: 1px solid var(--ll-border);
}

.ll-match-meta svg {
    flex-shrink: 0;
    opacity: .6;
}

.ll-match-status {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .15rem .45rem;
    border-radius: 999px;
    margin-left: auto;
}

.ll-status-finished {
    background: rgba(63, 185, 80, .15);
    color: var(--ll-green);
}

.ll-status-live {
    background: rgba(248, 81, 73, .15);
    color: var(--ll-red);
    animation: ll-pulse 1.5s ease-in-out infinite;
}
.ll-status-paused {
    background: rgba(10, 53, 254, .15);
    color: var(--ll-blue);
    animation: ll-pulse 1.5s ease-in-out infinite;
}

.ll-status-upcoming {
    background: rgba(210, 153, 34, .15);
    color: var(--ll-yellow);
}

@keyframes ll-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ---- Knockout Section ---- */

.ll-knockout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
    margin-bottom: .5rem;
}
.ll-knockout-flex-center {
    display: flex;
    justify-content: center;
    gap: .85rem;
    margin-bottom: .5rem;
}

.ll-knockout-grid.ll-cols-2 {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ---- Final highlight ---- */

.ll-match-card.ll-final {
    /* border-color: var(--ll-accent); */
    border-color: #46c2ff;
    
    background: linear-gradient(135deg, var(--ll-surface) 0%, var(--ll-surface-alt) 100%);
    box-shadow: 0 0 24px var(--ll-accent-glow), inset 0 1px 0 rgba(240, 182, 48, .15);

    min-width: 300px;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    #ll-live-score-app {
        padding: 1rem .5rem 3rem;
    }

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

    .ll-matches-grid,
    .ll-knockout-grid {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }

    .ll-section-badge {
        margin: 2rem 0 1rem;
    }

    .ll-section-badge h2 {
        font-size: .95rem;
        padding: .45rem 1.4rem;
    }

    .ll-live-indicator {
        font-size: .6rem;
        padding: .35rem .8rem;
    }

    .ll-competition-info {
        max-height: 170px;
    }
}

/* ---- Error Message ---- */

.ll-error {
    background: rgba(248, 81, 73, .1);
    border: 1px solid var(--ll-red);
    color: var(--ll-red);
    padding: 1rem;
    border-radius: var(--ll-radius);
    font-size: .9rem;
}
