/* ============================================================
   LiveScoreModern.css — redesigned Badminton live-score board
   Mobile-first, accessible, brand-aligned. Used by Live/LiveScore.
   ============================================================ */
:root {
    --lsm-navy: #16357e;
    --lsm-navy-2: #1c3f99;
    --lsm-blue: #2a59c8;
    --lsm-cyan: #0ca7d5;
    --lsm-ink: #14233b;
    --lsm-ink-soft: #5a6b84;
    --lsm-ink-faint: #8a98ad;
    --lsm-line: #e6ecf4;
    --lsm-bg: #eef2f8;
    --lsm-surface: #ffffff;
    --lsm-lead: #1d4ed8;
    --lsm-lead-bg: #e8f0ff;
    --lsm-lead-bd: #9fc0fb;
    --lsm-gold: #f5b942;
    --lsm-radius: 16px;
    --lsm-shadow: 0 8px 26px rgba(22, 53, 126, .10), 0 1px 3px rgba(20, 35, 59, .06);
    --lsm-font: 'Manrope', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.ls-page {
    background: var(--lsm-bg);
    font-family: var(--lsm-font);
    color: var(--lsm-ink);
    padding-bottom: 36px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- streaming banner ---------- */
.ls-stream {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    text-decoration: none;
    background: var(--lsm-surface);
    border-bottom: 1px solid var(--lsm-line);
    padding: 14px 60px;
    overflow: hidden;
}
.ls-stream::before, .ls-stream::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 120px;
    background: linear-gradient(135deg, var(--lsm-gold), #f7d27a);
    opacity: .92;
}
.ls-stream::before { left: 0; clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%); }
.ls-stream::after { right: 0; clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); }
.ls-stream-text { font-size: 17px; font-weight: 800; letter-spacing: .01em; color: var(--lsm-ink); z-index: 1; }
.ls-stream-brand { display: inline-flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 800; color: var(--lsm-navy); z-index: 1; }
.ls-stream-brand .ls-play { color: var(--lsm-cyan); }
.ls-stream-brand b { background: var(--lsm-navy); color: #fff; border-radius: 5px; padding: 1px 6px; font-size: 13px; letter-spacing: .04em; }
.ls-stream-sep { width: 1px; height: 22px; background: var(--lsm-line); z-index: 1; }
.ls-stream-yt { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--lsm-ink-soft); z-index: 1; }
.ls-stream-yt svg { width: 26px; height: 18px; }

/* ---------- shell ---------- */
.ls-shell { max-width: 1200px; margin: 0 auto; padding: 18px 16px 0; }

/* ---------- header ---------- */
.ls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(110deg, var(--lsm-navy) 0%, var(--lsm-navy-2) 45%, var(--lsm-blue) 100%);
    border-radius: var(--lsm-radius);
    padding: 16px 20px;
    box-shadow: var(--lsm-shadow);
}
.ls-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(20px, 3.4vw, 27px);
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
}
.ls-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 4px 11px;
    border-radius: 999px;
}
.ls-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 0 0 rgba(255,91,91,.6); animation: ls-pulse 1.5s infinite; }
@keyframes ls-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,91,91,.6);} 70% { box-shadow: 0 0 0 7px rgba(255,91,91,0);} 100% { box-shadow: 0 0 0 0 rgba(255,91,91,0);} }

.ls-select { position: relative; min-width: 260px; flex: 0 1 360px; }
.ls-select::after {
    content: "";
    position: absolute; right: 16px; top: 50%;
    width: 9px; height: 9px;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}
.ls-select select {
    width: 100%;
    appearance: none; -webkit-appearance: none;
    font-family: inherit; font-size: 14.5px; font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 11px;
    padding: 11px 38px 11px 16px;
    cursor: pointer;
}
.ls-select select option { color: #14233b; }
.ls-select select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(12,167,213,.5); }

/* ---------- empty / tip ---------- */
.ls-empty { text-align: center; padding: 40px 16px; color: var(--lsm-ink-soft); }
.ls-empty h3 { font-weight: 800; font-size: 18px; margin: 0; }
.ls-tip { text-align: center; margin-top: 20px; }
.ls-tip span {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--lsm-ink-soft);
    background: rgba(124, 58, 237, .05);
    border: 1px dashed rgba(124, 58, 237, .25);
    padding: 6px 14px; border-radius: 999px; font-weight: 600;
}
.ls-tip strong { color: #7c3aed; font-weight: 800; }

/* ---------- grid ---------- */
.ls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.ls-col { min-width: 0; cursor: pointer; }

/* ---------- card ---------- */
.ls-card {
    display: flex;
    min-width: 0;
    background: var(--lsm-surface);
    border: 1px solid var(--lsm-line);
    border-radius: var(--lsm-radius);
    box-shadow: var(--lsm-shadow);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ls-col:hover .ls-card { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(22,53,126,.16); }

.ls-court {
    flex: 0 0 38px;
    background: linear-gradient(180deg, var(--lsm-navy), #11285c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ls-court span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ls-body { flex: 1 1 auto; min-width: 0; padding: 14px 16px 12px; }

/* head: tournament + duration */
.ls-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--lsm-line);
}
.ls-tour {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.35;
    color: var(--lsm-ink-soft);
    text-transform: uppercase;
    min-width: 0;
}
.ls-dur {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--lsm-navy-2), var(--lsm-blue));
    border-radius: 999px;
    padding: 4px 12px;
}

/* score area */
.ls-score { padding: 6px 0 2px; }
.ls-row, .ls-scorehead {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ls-scorehead { padding: 2px 0 4px; }
.ls-row { padding: 9px 0; }
.ls-row + .ls-row { border-top: 1px solid #f1f4f9; }

.ls-players-h { flex: 1; }
.ls-players { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ls-pl { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ls-pname {
    font-size: 15px; font-weight: 700; color: var(--lsm-ink);
    line-height: 1.2; overflow-wrap: anywhere;
}
.ls-dist {
    font-size: 11.5px; font-weight: 700; color: var(--lsm-ink-faint);
    white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis;
    flex-shrink: 0;
}
.ls-flag { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; align-self: center; flex-shrink: 0; }

/* serve marker */
.ls-serve { width: 9px; flex-shrink: 0; display: inline-flex; }
.ls-row.is-serving .ls-serve::before {
    content: "";
    width: 8px; height: 8px;
    background: var(--lsm-cyan);
    transform: rotate(45deg);
    border-radius: 1px;
    box-shadow: 0 0 0 3px rgba(12,167,213,.18);
}

/* set cells */
.ls-cells { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.ls-gh {
    width: 34px; text-align: center;
    font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--lsm-ink-faint);
}
.ls-cell {
    width: 34px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    font-size: 16px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    border: 1.5px solid transparent;
}
.ls-cell.is-lead { color: var(--lsm-lead); background: var(--lsm-lead-bg); border-color: var(--lsm-lead-bd); }
.ls-cell.is-low { color: var(--lsm-ink-faint); background: #f4f6fa; }

/* AI insights button */
.ls-ai {
    display: block;
    margin: 12px auto 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7c3aed;
    background: rgba(124, 58, 237, .08);
    border: 1px solid rgba(124, 58, 237, .25);
    border-radius: 999px;
    padding: 6px 16px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ls-col:hover .ls-ai {
    background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(12,167,213,.16));
    color: #5b21b6;
    border-color: rgba(124,58,237,.4);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .ls-grid { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px) {
    .ls-stream { padding: 12px 28px; gap: 6px 12px; }
    .ls-stream::before, .ls-stream::after { width: 60px; }
    .ls-stream-text, .ls-stream-brand { font-size: 14px; }
    .ls-stream-yt { font-size: 12.5px; }
    .ls-stream-sep { display: none; }
    .ls-header { padding: 14px; }
    .ls-select { flex-basis: 100%; min-width: 0; width: 100%; }
    .ls-body { padding: 12px 12px 10px; }
    .ls-court { flex-basis: 30px; }
    .ls-pname { font-size: 14px; }
    .ls-dist { max-width: 74px; font-size: 10.5px; }
    .ls-cells { gap: 5px; }
    .ls-gh { width: 28px; }
    .ls-cell { width: 28px; height: 34px; font-size: 14px; border-radius: 8px; }
}
@media (max-width: 360px) {
    .ls-cell { width: 25px; height: 32px; font-size: 13px; }
    .ls-gh { width: 25px; }
}
