:root {
    /* Softer, modern palette for modal/attempts UI */
    --attempt-color-muted: #9aaec0;      /* muted text */
    --attempt-color-link: #36a3b4;       /* calmer teal for links */
    --problem-link-color: #4da8ff;      /* blue for problems that have an external link */
    --attempt-color-accepted: #00c200;   /* keep bright accepted green */
    --attempt-color-wrong: #e06c75;      /* softened red/coral */
    --attempt-color-pending: #9c8fd1;    /* muted lavender */
    --attempt-color-compilation: #8f76d4;/* softer purple */
    --attempt-color-unknown: #9aa6b8;    /* neutral grey-blue */
    --attempt-time-width: 72px;
    --attempt-player-width: 140px;
}

.attempts-list { list-style: none; padding: 6px 12px; margin: 0; }
.attempts-list .attempt-line { margin: 6px 0; font-size: 14px; display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:6px; transition: background .12s ease; }
.attempts-list .attempt-line:hover { background: rgba(255,255,255,0.02); }
.attempt-time { color: var(--attempt-color-muted); font-family: monospace; width:var(--attempt-time-width); flex:0 0 var(--attempt-time-width); }
.attempt-verdict { flex:0 1 auto; margin-right:6px; color:var(--attempt-color-unknown); font-weight:600; }
.attempt-player { color: var(--attempt-color-muted); width:var(--attempt-player-width); flex:0 0 var(--attempt-player-width); font-weight:600; text-decoration: none; }
.attempt-player:focus { outline: none; box-shadow: none; }
.attempt-player-handle { color: var(--attempt-color-link); margin-left:6px; font-weight:600; font-size:13px; display:inline-block; }
.attempt-player:focus { outline: none; box-shadow: none; }
.attempt-verdict.accepted { color: var(--attempt-color-accepted); }
.attempt-verdict.wrong { color: var(--attempt-color-wrong); }
.attempt-verdict.pending { color: var(--attempt-color-pending); }
.attempt-verdict.compilation { color: var(--attempt-color-compilation); }
.attempt-verdict.unknown { color: var(--attempt-color-unknown); }
.attempt-id { flex:0 0 auto; margin-left:8px; color:var(--attempt-color-muted); }
.attempt-id a { color: var(--attempt-color-link); text-decoration: none; font-weight:600; }
.attempt-id a:hover { text-decoration: underline; }

/* Make the Total header look like a link but without underline by default */
.result-standings-table thead th .total-link,
.standings-table thead th .total-link { text-decoration: none; color: inherit; font-weight: 700; }
.result-standings-table thead th .total-link:hover,
.standings-table thead th .total-link:hover { text-decoration: underline; }
.result-standings-table thead th .total-link:focus,
.standings-table thead th .total-link:focus { outline: none; box-shadow: none; }

/* Problem header links (P1, P2...) */
.result-standings-table thead th .problem-link,
.standings-table thead th .problem-link { text-decoration: none; color: inherit; font-weight: 700; display: inline-block; }
.result-standings-table thead th .problem-link:hover,
.standings-table thead th .problem-link:hover { text-decoration: underline; }
.result-standings-table thead th .problem-link:focus,
.standings-table thead th .problem-link:focus { outline: none; box-shadow: none; }

/* Color problem header link when submissions/AC exist */
.result-standings-table thead th.has-link .problem-link,
.standings-table thead th.has-link .problem-link { color: var(--problem-link-color); }
.result-standings-table thead th.has-attempts .problem-link,
.standings-table thead th.has-attempts .problem-link { color: var(--attempt-color-link); }
.result-standings-table thead th.has-ac .problem-link,
.standings-table thead th.has-ac .problem-link { color: var(--attempt-color-accepted); }

/* When a header has neither an external link nor any submissions/attempts,
   render the problem-link anchor as non-interactive (no pointer, no events).
   This matches results.html where empty headers are plain text. */
.result-standings-table thead th[data-has-subs="0"][data-has-link="0"] .problem-link,
.standings-table thead th[data-has-subs="0"][data-has-link="0"] .problem-link {
    cursor: default;
    pointer-events: none;
    color: inherit;
    text-decoration: none;
}

/* Attempts modal: center as a fixed overlay */
#attemptsModal.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2200;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(6,8,12,0.6);
    backdrop-filter: blur(6px);
}
#attemptsModal .modal-content { background: var(--surface, #071025); padding: 18px; border-radius:8px; color: var(--text, #e6eef8); max-height: calc(100vh - 48px); overflow-y: auto; }

/* Shared standings table styles used by index/results */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
    min-width: 560px;
}

.standings-table th {
    background: #151d2b;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    padding: 10px;
    text-align: center;
}

.standings-table td {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: #121925;
}

.standings-table .problem-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    min-width: 62px;
    background: transparent;
}

.standings-cf-rank {
    margin-top: 4px;
    font-size: 0.72rem;
    opacity: 0.88;
}

.standings-standing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    border-radius: 999px;
    padding: 2px 8px;
    background: #1b2434;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.8rem;
}

.standings-table .problem-cell-main {
    font-weight: 700;
    line-height: 1;
}

.standings-table .problem-cell-sub {
    margin-top: 3px;
    font-size: 0.72rem;
    color: #d6deeb;
}

.standings-table .status-ac { color: #00c853; background: transparent; }
.standings-table .status-wa { color: #8ea8ff; background: transparent; }
.standings-table .status-pending { color: #ffd98b; background: transparent; }
.standings-table .status-none { color: var(--muted); background: transparent; }

.standings-table .pending-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.standings-table .pending-loader {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 2px solid rgba(74, 52, 4, 0.25);
    border-top-color: #7d5a07;
    animation: pendingSpin 0.85s linear infinite;
}

@keyframes pendingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes resultPendingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

