.competition-detail-page .page-head {
    padding: 26px 0 18px;
    background: linear-gradient(180deg, #fff, var(--bg-soft));
}

.competition-detail-page .page-head .page-title {
    margin-top: 10px;
    font-size: 26px;
    letter-spacing: -0.02em;
}

.competition-detail-page .badge.competition-badge {
    background: rgba(229, 57, 53, 0.08);
    color: var(--red);
    font-size: 12px;
    font-weight: 750;
    border-radius: 999px;
    padding: 6px 12px;
}

/* Filter bar */
.competition-detail-page .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.competition-detail-page .results-filter-select {
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
}

/* ==============================
   TABLE RED ROW STRIPED + RADIUS
================================= */

.competition-detail-page .table-responsive {
    width: 100%;
    overflow-x: auto;
}

.competition-detail-page table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Header */
.competition-detail-page table.table thead tr {
    background: var(--red);
}

.competition-detail-page table.table thead th {
    color: #fff;
}

/* Baris ganjil */
.competition-detail-page table.table tbody tr:nth-child(odd) {
    background: #fff;
    color: #000;
}

/* Baris genap */
.competition-detail-page table.table tbody tr:nth-child(even) {
    background: rgba(229, 57, 53, 0.15);
    color: #000;
}

/* Padding */
.competition-detail-page table.table th,
.competition-detail-page table.table td {
    padding: 8px 10px;
    vertical-align: middle;
}

/* Radius sudut atas */
.competition-detail-page table.table thead tr th:first-child {
    border-top-left-radius: 12px;
}

.competition-detail-page table.table thead tr th:last-child {
    border-top-right-radius: 12px;
}

/* Radius sudut bawah */
.competition-detail-page table.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.competition-detail-page table.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.competition-detail-page table.table td.text-end {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.text-start {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

/* Empty state dalam tabel */
.competition-detail-page .results-empty {
    text-align: center;
    color: var(--muted);
    padding: 14px 0;
}

/* Default: modal disembunyikan di desktop */
.attempt-modal,
#attemptModalBackdrop {
    display: none;
}

/* Responsive tablet */
@media (max-width: 992px) {
    .competition-detail-page .card.card-pad {
        padding: 16px 14px;
    }

    .competition-detail-page table.table {
        min-width: 960px;
    }
}

/* ==============================
   MOBILE RESULT TABLE
================================= */
@media (max-width: 768px) {
    .competition-detail-page .page-head {
        padding: 22px 0 16px;
    }

    .competition-detail-page .page-head .page-title {
        font-size: 24px;
    }

    /* Aktifkan modal hanya di mobile */
    .attempt-modal,
    #attemptModalBackdrop {
        display: block;
    }

    /* Sembunyikan kolom attempt di mobile */
    .competition-detail-page .attempt-col {
        display: none;
    }

    .competition-detail-page table.table {
        min-width: unset;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    }

    .competition-detail-page table.table th,
    .competition-detail-page table.table td {
        font-size: 13px;
        padding: 7px 8px;
    }

    .competition-detail-page table.table th:first-child,
    .competition-detail-page table.table td:first-child {
        width: 44px;
    }

    .competition-detail-page table.table th:nth-child(2),
    .competition-detail-page table.table td:nth-child(2) {
        min-width: 120px;
    }

    .competition-detail-page table.table tbody tr {
        cursor: pointer;
        transition: background-color 0.12s ease;
    }

    .competition-detail-page table.table tbody tr:active {
        background: rgba(229, 57, 53, 0.22);
    }

    .competition-detail-page .rank-cell {
        font-weight: 400;
    }

    .competition-detail-page .name-cell {
        font-weight: 400;
    }

    /* ==============================
       MODAL BACKDROP
    ================================= */
    .modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .modal-backdrop.open {
        opacity: 1;
        pointer-events: all;
    }

    /* ==============================
       ATTEMPT MODAL / BOTTOM SHEET
    ================================= */
    .attempt-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-radius: 22px 22px 0 0;
        padding: 20px;
        z-index: 999;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 78vh;
        overflow-y: auto;
        box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.22);
    }

    .attempt-modal.open {
        transform: translateY(0);
    }

    .attempt-modal-content {
        width: 100%;
    }

    .attempt-modal-head {
        margin-bottom: 14px;
    }

    .attempt-modal-meta {
        margin: 0 0 4px;
        font-size: 12px;
        font-weight: 700;
        color: rgba(17, 24, 39, 0.52);
    }

    .attempt-modal-content h3 {
        margin: 0;
        font-size: 18px;
        line-height: 1.35;
        letter-spacing: -0.02em;
        color: rgba(17, 24, 39, 0.95);
        font-weight: 400;
    }

    .attempt-modal-content h3 strong {
        font-weight: 700;
    }

    .attempt-modal-content h3 span {
        font-weight: 450;
    }

    .attempt-summary {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 14px 0;
    }

    .attempt-summary > div {
        padding: 12px;
        border-radius: 14px;
        background: rgba(17, 24, 39, 0.035);
        border: 1px solid rgba(17, 24, 39, 0.06);
    }

    .attempt-summary span {
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 700;
        color: rgba(17, 24, 39, 0.48);
    }

    .attempt-summary strong {
        font-size: 16px;
        color: rgba(17, 24, 39, 0.9);
        font-variant-numeric: tabular-nums;
    }

    .attempt-list-wrap {
        margin-top: 10px;
    }

    .attempt-list-wrap h4 {
        margin: 0 0 8px;
        font-size: 13px;
        font-weight: 800;
        color: rgba(17, 24, 39, 0.72);
    }

    #attemptList {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #attemptList li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(17, 24, 39, 0.07);
        font-variant-numeric: tabular-nums;
    }

    #attemptList li:last-child {
        border-bottom: none;
    }

    #attemptList li span {
        font-size: 13px;
        font-weight: 400;
        color: black;
    }

    #attemptList li strong {
        font-size: 14px;
        font-weight: 400;
        color: rgba(17, 24, 39, 0.9);
    }

    .attempt-modal-close {
        width: 44px;
        height: 34px;
        margin: 14px auto 0;
        border: none;
        border-radius: 999px;
        background: rgba(229, 57, 53, 0.1);
        color: var(--red);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 14px;
        cursor: pointer;
    }

    .attempt-modal-close:active {
        transform: translateY(1px);
        background: rgba(229, 57, 53, 0.16);
    }
}
