.julecup-kp {
    --jkp-red: #E00000;
    --jkp-red-light: rgba(224, 0, 0, 0.1);
    --jkp-border: rgba(0, 0, 0, 0.08);
    --jkp-text-muted: #6b7280;
    --jkp-text-faint: #9ca3af;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    max-width: 720px;
    margin: 0 auto;
    color: #111827;
    box-sizing: border-box;
}
.julecup-kp *, .julecup-kp *::before, .julecup-kp *::after { box-sizing: border-box; }

.jkp-loading, .jkp-empty {
    text-align: center;
    color: var(--jkp-text-faint);
    padding: 32px 16px;
    font-size: 15px;
}

.julecup-kp-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px;
    color: #991b1b;
}

/* ── Header / breadcrumb-bar ─────────────────────────────────────────── */
.jkp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--jkp-border);
}
.jkp-title {
    font-weight: 700;
    font-size: 16px;
    flex: 1;
}
.jkp-refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--jkp-text-muted);
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
}
.jkp-refresh-btn:hover { background: #f3f4f6; }

/* ── Nav-tabs (Vælg række / Pr. dato / Pr. bane) ─────────────────────── */
.jkp-nav-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.jkp-tab-btn {
    flex: 1;
    background: #f3f4f6;
    border: 1px solid transparent;
    color: #4b5563;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
}
.jkp-tab-btn:hover { background: #e5e7eb; }
.jkp-tab-btn.active {
    background: var(--jkp-red-light);
    border-color: var(--jkp-red);
    color: var(--jkp-red);
}

/* ── Sektion-labels ───────────────────────────────────────────────────── */
.jkp-section-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #111827;
    margin: 20px 0 12px;
}
.jkp-section-label::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--jkp-red);
    border-radius: 2px;
    margin-right: 8px;
}
.jkp-section-label.jkp-sub {
    font-size: 11px;
    letter-spacing: 1px;
    color: #6b7280;
}
.jkp-section-label.jkp-sub::before { background: #6b7280; height: 14px; }

.jkp-category-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--jkp-text-muted);
    text-transform: uppercase;
    margin: 12px 0 8px;
}
.jkp-category-label .jkp-count { color: var(--jkp-text-faint); font-weight: 400; }

/* ── Rækkevalg-grid ───────────────────────────────────────────────────── */
.jkp-class-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
@media (max-width: 420px) {
    .jkp-class-grid { grid-template-columns: 1fr; }
}
.jkp-class-tile {
    background: var(--jkp-red);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    min-height: 52px;
}
.jkp-class-tile:hover { filter: brightness(1.08); }
.jkp-class-tile .jkp-class-name {
    font-weight: 700;
    font-size: 15px;
}
.jkp-class-tile .jkp-class-underline {
    width: 22px; height: 3px;
    background: #fff;
    border-radius: 2px;
    margin-top: 4px;
}
.jkp-class-tile .jkp-chevron { color: rgba(255,255,255,0.7); font-size: 16px; }

/* ── Liste-rækker (dato/bane/gruppe-valg) ────────────────────────────── */
.jkp-list { display: flex; flex-direction: column; gap: 8px; }
.jkp-row-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--jkp-border);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.jkp-row-btn:hover { background: #fafafa; }
.jkp-row-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--jkp-red-light);
    color: var(--jkp-red);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.jkp-row-label { flex: 1; font-weight: 600; font-size: 14px; }
.jkp-row-count { font-size: 12px; color: var(--jkp-text-muted); }
.jkp-row-chevron { color: var(--jkp-text-faint); }

/* ── Gruppekort ───────────────────────────────────────────────────────── */
.jkp-group-card {
    border: 1px solid var(--jkp-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    background: #fff;
}
.jkp-group-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.jkp-group-card-header {
    background: var(--jkp-red);
    color: #fff;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
}
.jkp-group-card-header .jkp-chevron { margin-left: auto; color: rgba(255,255,255,0.6); }
.jkp-group-card-body { padding: 12px; }
.jkp-team-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.jkp-team-row img { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.jkp-team-row .jkp-team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Datofilter-bar ───────────────────────────────────────────────────── */
.jkp-date-filter {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 9px 4px;
    margin-bottom: 4px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    -webkit-overflow-scrolling: touch;
}
.jkp-date-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.jkp-date-chip.active {
    background: var(--jkp-red);
    border-color: var(--jkp-red);
    color: #fff;
    font-weight: 700;
}

/* ── Stillingstabel ───────────────────────────────────────────────────── */
.jkp-standings {
    border: 1px solid var(--jkp-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0 8px;
}
.jkp-standings-header {
    background: var(--jkp-red);
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.jkp-standings table { width: 100%; border-collapse: collapse; font-size: 12px; }
.jkp-standings thead tr { background: #f3f4f6; }
.jkp-standings th {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    padding: 6px 4px;
    text-align: center;
}
.jkp-standings th.jkp-th-team { text-align: left; padding-left: 12px; }
.jkp-standings td { padding: 9px 4px; text-align: center; border-top: 1px solid #f3f4f6; }
.jkp-standings td.jkp-td-team {
    text-align: left;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.jkp-standings td.jkp-td-team img { width: 20px; height: 20px; object-fit: contain; }
.jkp-standings tr.jkp-qualify { background: rgba(22, 163, 74, 0.06); }
.jkp-standings tr.jkp-qualify td.jkp-td-team { font-weight: 700; }
.jkp-rank { color: #9ca3af; }
.jkp-rank.jkp-qualify-rank { color: #15803d; font-weight: 700; }
.jkp-points { font-weight: 700; }

/* ── Kampliste ────────────────────────────────────────────────────────── */
.jkp-date-heading {
    font-weight: 700;
    color: #6b7280;
    font-size: 13px;
    padding: 14px 4px 2px;
}
.jkp-time-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 4px 4px;
}
.jkp-time-header .jkp-time-text {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.6px;
}
.jkp-time-header .jkp-time-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.jkp-game-card {
    border: 1px solid var(--jkp-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 4px 0 12px;
    background: #fff;
}
.jkp-game-header {
    background: var(--jkp-red);
    color: #fff;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.jkp-class-badge {
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}
.jkp-game-header .jkp-pool-name { flex: 1; color: rgba(255,255,255,0.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jkp-game-header .jkp-match-no { color: rgba(255,255,255,0.35); font-size: 11px; }

.jkp-game-body {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    gap: 8px;
}
.jkp-team-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.jkp-team-col.jkp-home { align-items: flex-start; text-align: left; }
.jkp-team-col.jkp-away { align-items: flex-end; text-align: right; }
.jkp-team-logo {
    width: 44px; height: 44px;
    border-radius: 6px;
    background: #f9fafb;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: 6px;
}
.jkp-team-logo img { width: 100%; height: 100%; object-fit: contain; }
.jkp-team-name {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jkp-team-name.jkp-winner { font-weight: 700; color: #111827; }
.jkp-flag { font-size: 12px; margin-bottom: 2px; }

.jkp-score {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.jkp-score-box {
    width: 36px; height: 36px;
    background: #000;
    color: #fff;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    font-weight: 400;
}
.jkp-score-box.jkp-winner { font-weight: 700; }
.jkp-score-dash { color: #d1d5db; font-weight: 300; }
.jkp-vs { font-size: 14px; font-weight: 600; color: #d1d5db; letter-spacing: 1px; padding: 0 6px; }

.jkp-game-footer {
    background: #f9fafb;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
}

/* ── Team-tooltip / opponent list (klik på hold) ─────────────────────── */
.jkp-team-clickable { cursor: pointer; }
.jkp-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 9999;
}
.jkp-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    padding-bottom: 20px;
}
.jkp-modal-handle {
    width: 40px; height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 4px;
}
.jkp-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.jkp-modal-header img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.jkp-modal-header .jkp-modal-team-name { font-weight: 700; font-size: 16px; }
.jkp-modal-header .jkp-modal-count { color: #9ca3af; font-size: 12px; }
.jkp-modal-close {
    margin-left: auto;
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: #9ca3af; padding: 4px 8px;
}
.jkp-modal-game-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f9fafb;
}
.jkp-modal-game-row img { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; }
.jkp-modal-game-info { flex: 1; min-width: 0; }
.jkp-modal-opponent { font-size: 13px; font-weight: 500; }
.jkp-modal-meta { font-size: 11px; color: #9ca3af; }
.jkp-modal-score { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.jkp-modal-minibox {
    width: 26px; height: 26px;
    background: #000; color: #fff;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}
.jkp-modal-minibox.jkp-winner { font-weight: 700; }

/* ── Statistik ────────────────────────────────────────────────────────── */
.jkp-stat-strip {
    display: flex;
    background: #fff;
    border: 1px solid var(--jkp-border);
    border-radius: 10px;
    padding: 8px 6px;
    margin-bottom: 10px;
}
.jkp-stat-strip .jkp-stat { flex: 1; text-align: center; }
.jkp-stat-strip .jkp-stat-divider { width: 1px; background: #e5e7eb; margin: 2px 0; }
.jkp-stat-value { font-size: 13px; font-weight: 700; color: #111827; }
.jkp-stat-label { font-size: 9px; color: #9ca3af; }

.jkp-progress-card {
    background: #fff;
    border: 1px solid var(--jkp-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.jkp-progress-row { display: flex; justify-content: space-between; font-size: 11px; color: #6b7280; margin-bottom: 6px; }
.jkp-progress-row strong { color: #111827; }
.jkp-progress-bar-bg { height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow: hidden; }
.jkp-progress-bar-fill { height: 100%; background: var(--jkp-red); border-radius: 3px; }
