/* Bowling Serie – frontend */
.bs-wrap {
    margin: 1.5em 0;
    font-size: 16px;
    color: #1a2233;
    --bs-primary: #1f2a44;
    --bs-accent: #e8531a;
    --bs-blue: #2f5bd0;
    --bs-win: #17974f;
    --bs-line: #e7ebf1;
    --bs-soft: #f5f7fa;
}
.bs-title {
    margin: 0 0 .7em;
    font-size: 1.4em;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--bs-primary);
}
.bs-round {
    margin: 1.3em 0 .5em;
    font-size: .8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--bs-accent);
}
.bs-empty {
    color: #6b7688;
    background: var(--bs-soft);
    padding: 14px 16px;
    border-radius: 10px;
}

/* Tabeller */
.bs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 1em;
    background: #fff;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--bs-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 30, 55, .04);
}
.bs-table th,
.bs-table td {
    padding: 11px 12px;
    text-align: left;
    font-size: 1em;
    border-bottom: 1px solid var(--bs-line);
}
.bs-table tbody tr:last-child td { border-bottom: 0; }
.bs-table thead th {
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    font-size: .82em;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bs-table tbody tr:nth-child(even) { background: var(--bs-soft); }
.bs-table tbody tr:hover { background: #eef3fb; }

.bs-team-badge { display: inline-flex; align-items: center; gap: 8px; }
.bs-logo {
    height: auto;
    max-height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    background: none;
    border: 0;
    border-radius: 0;
    flex: none;
}
/* Kompaktare logga i tabeller (schema/tabell) */
.bs-schema .bs-logo,
.bs-tabell .bs-logo { max-height: 30px; max-width: 30px; }
.bs-team-name { font-weight: 600; }
.bs-table .bs-team { font-weight: 600; }
.bs-vs { text-align: center; color: #9aa4b5; font-style: italic; }
.bs-oil { color: var(--bs-accent); font-weight: 600; text-decoration: none; }
.bs-oil:hover { text-decoration: underline; }

/* Tabell-vyn */
.bs-tabell .bs-table td,
.bs-tabell .bs-table th { text-align: center; }
.bs-tabell .bs-table td.bs-team,
.bs-tabell .bs-table th.bs-team-col { text-align: left; }
.bs-tabell .bs-points {
    font-weight: 800;
    color: var(--bs-primary);
    background: #eef3fb;
}
.bs-tabell .bs-diff { font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-diff-pos { color: #1f9d55; }
.bs-diff-neg { color: #d64545; }
.bs-legend {
    font-size: .8em;
    color: #7b8698;
    margin-top: -.3em;
}

/* Resultat – minimerad lista */
.bs-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bs-result-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--bs-line);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(20, 30, 55, .04);
}
.bs-rr-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bs-rr-team .bs-team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-rr-home { justify-content: flex-end; text-align: right; }
.bs-rr-home .bs-team-badge { flex-direction: row-reverse; }
.bs-rr-away { justify-content: flex-start; }
.bs-rr-score {
    font-weight: 800;
    font-size: 1.05em;
    color: var(--bs-primary);
    background: var(--bs-soft);
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.bs-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bs-primary);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: .85em;
    padding: 7px 14px;
    border-radius: 999px;
    white-space: nowrap;
    transition: background .15s ease;
}
.bs-result-item:hover .bs-result-btn { background: var(--bs-blue); }
.bs-chevron {
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-top: -2px;
}
.bs-result-item[open] .bs-chevron { transform: rotate(-135deg); margin-top: 2px; }
.bs-back { margin: 0 0 12px; }
.bs-back a { color: var(--bs-blue); font-weight: 600; text-decoration: none; }
.bs-back a:hover { text-decoration: underline; }

/* Banpoäng-brytning */
.bs-breakdown { padding: 16px 18px 0; }
.bs-breakdown-title {
    margin: 0 0 10px;
    font-size: .8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-accent);
}
.bs-serie-block { margin-bottom: 14px; }
.bs-serie-head {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--bs-primary);
}
.bs-bp-table th, .bs-bp-table td { padding: 8px 10px; font-size: .88em; }
.bs-bp-table td.bs-won { font-weight: 800; color: var(--bs-primary); }
.bs-serie-total td { background: var(--bs-soft); font-weight: 600; border-top: 2px solid var(--bs-line); }
.bs-bp {
    display: inline-block;
    font-size: .8em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}
.bs-bp-home { background: #e3f0ff; color: #1c5fb0; }
.bs-bp-away { background: #ffe9df; color: #c1461c; }
.bs-bp-tie  { background: #eef0f4; color: #6b7688; }

/* Resultat-kort */
.bs-result-card {
    border: 1px solid var(--bs-line);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20, 30, 55, .05);
}
.bs-result-head {
    padding: 16px 18px;
    background: linear-gradient(135deg, #1f2a44, #2c3c63);
    color: #fff;
}
.bs-result-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.bs-result-teams .bs-team-name { color: #fff; font-weight: 700; font-size: 1.05em; }
.bs-result-teams .bs-logo { max-height: 40px; max-width: 40px; }
.bs-rt-score {
    font-size: 1.35em;
    font-weight: 800;
    background: rgba(255,255,255,.14);
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
}
.bs-rt-home { flex-direction: row-reverse; }
.bs-result-meta {
    margin-top: 10px;
    text-align: center;
    font-size: .85em;
    color: #c7d0e2;
}
.bs-result-meta .bs-oil { color: var(--bs-blue); }
.bs-result-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 18px;
}
.bs-pt-title { margin-bottom: 8px; font-weight: 700; }
.bs-pt-table { margin: 0; }
.bs-pt-table th, .bs-pt-table td { padding: 7px 9px; font-size: .9em; }
.bs-pt-table th:not(:first-child),
.bs-pt-table td:not(:first-child) { text-align: center; }
.bs-pt-name { font-weight: 600; }
.bs-pt-total { font-weight: 800; color: var(--bs-primary); }
.bs-pt-table tfoot td {
    background: var(--bs-soft);
    font-weight: 700;
    border-top: 2px solid var(--bs-line);
}

.bs-picker code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
}

@media (max-width: 720px) {
    .bs-result-players { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .bs-table th,
    .bs-table td { padding: 8px 8px; font-size: .9em; }
    .bs-logo { max-height: 16px; max-width: 16px; }
    .bs-rt-score { font-size: 1.15em; }
    .bs-result-row { grid-template-columns: 1fr auto 1fr; }
    .bs-result-row .bs-result-btn { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }
}


/* Resultatprotokoll (per lag) */
.bs-result-sheets {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 18px;
}
.bs-sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--bs-primary);
}
.bs-sheet-role {
    font-size: .68em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #fff;
    background: var(--bs-primary);
    padding: 3px 9px;
    border-radius: 999px;
}
.bs-sheet-scroll { overflow-x: auto; }
.bs-sheet-table { margin: 0; min-width: 420px; }
.bs-sheet-table th,
.bs-sheet-table td {
    text-align: center;
    padding: 9px 8px;
    font-size: 1em;
}
.bs-sheet-table th.bs-c-name,
.bs-sheet-table td.bs-c-name { text-align: left; font-weight: 600; }
.bs-sheet-table .bs-c-total { font-weight: 800; color: var(--bs-primary); }
.bs-sheet-table .bs-c-hcp { color: #7b8698; }
/* Banpoäng-boxar (6-manna, mellan paren) */
.bs-sheet-6 .bs-banp {
    background: var(--bs-soft);
    font-weight: 800;
    color: #9aa4b5;
    border-left: 1px solid var(--bs-line);
    width: 34px;
}
.bs-sheet-6 .bs-banp-won {
    color: #fff;
    background: var(--bs-win);
}
/* Summarad */
.bs-sheet-sum td {
    background: var(--bs-soft);
    font-weight: 700;
    border-top: 2px solid #d7dee8;
}
/* Banpoäng-rad */
.bs-sheet-banp td {
    background: #eef3fb;
    font-weight: 800;
    color: var(--bs-primary);
}
.bs-banp-eq { font-size: 1.05em; }
.bs-banp-sum {
    background: var(--bs-win) !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    .bs-sheet-table th,
    .bs-sheet-table td { padding: 8px 6px; font-size: .95em; }
}

/* =========================================================================
 * Resultat – dropdown (details/summary)
 * ====================================================================== */
.bs-result-item {
    background: #fff;
    border: 1px solid var(--bs-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(20, 30, 55, .05);
    overflow: hidden;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.bs-result-item[open] {
    box-shadow: 0 6px 20px rgba(20, 30, 55, .10);
    border-color: #d5deec;
}
.bs-result-item > summary.bs-result-row {
    list-style: none;
    cursor: pointer;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    background: #fff;
}
.bs-result-item > summary::-webkit-details-marker { display: none; }
.bs-result-item[open] > summary.bs-result-row { border-bottom: 1px solid var(--bs-line); }
.bs-result-item > summary.bs-result-row:hover { background: var(--bs-soft); }

.bs-result-body { padding: 4px 16px 16px; }
.bs-result-body .bs-result-meta {
    margin: 12px 0 4px;
    text-align: center;
    font-size: .85em;
    color: #6b7688;
    font-weight: 600;
}
.bs-result-body .bs-result-sheets {
    padding: 6px 0 0;
    gap: 22px;
}

/* Totalsumma-bonusrad (2-manna) */
.bs-sheet-bonus td {
    background: var(--bs-soft);
    font-weight: 700;
    color: #6b7688;
    border-top: 1px solid var(--bs-line);
}
.bs-sheet-bonus .bs-c-total { color: #9aa4b5; }
.bs-sheet-bonus .bs-bonus-won { color: var(--bs-win); }

@media (max-width: 640px) {
    .bs-result-body { padding: 4px 10px 12px; }
}

/* Flera divisioner i samma shortcode */
.bs-division-block + .bs-division-block { margin-top: 2em; padding-top: 1.5em; border-top: 2px solid var(--bs-line); }

/* Horisontell scroll för breda tabeller på mobil */
.bs-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1em; }
.bs-table-scroll .bs-table { margin-bottom: 0; }

/* Topplistor (högsta lag-/spelarslagning) */
.bs-topp-table th, .bs-topp-table td { text-align: center; }
.bs-topp-table th.bs-team-col, .bs-topp-table td.bs-team { text-align: left; }
.bs-topp-table .bs-topp-score { font-weight: 800; color: var(--bs-primary); }
.bs-topp-table .bs-topp-meta { font-size: .82em; color: #7b8698; }
.bs-tabell .bs-avg { font-weight: 700; }

@media (max-width: 640px) {
    .bs-topp-table .bs-topp-meta { font-size: .75em; }
}
