/* Scoped to the existing TASK modal. Navigation keeps its horizontal overflow. */
#taskModal.contests-active { box-sizing:border-box; padding:44px 0 20px; overflow:hidden; }
#taskModal.contests-active > .task-modal-box {
  box-sizing:border-box; min-height:0; max-height:calc(100vh - 64px); max-height:calc(100dvh - 64px);
  margin-bottom:0; overflow:hidden;
}
#taskModal.contests-active .task-modal-header,
#taskModal.contests-active .task-modal-tabs { flex:0 0 auto; }
#taskModal.contests-active #contestsBody { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
#contestsBody > * { flex-shrink:0; }
#contestsBody { gap:10px; min-width:0; color:var(--text-2, #c9c3d8); font-size:12px; line-height:1.5; }
#contestsBody h3, #contestsBody h4, #contestsBody p { margin:0; }
#contestsBody h3 { color:var(--text-1, #efe9fa); font-size:15px; }
#contestsBody h4 { color:var(--text-1, #efe9fa); font-size:13px; }
#contestsBody .contest-heading, #contestsBody .contest-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#contestsBody .contest-heading > *, #contestsBody .contest-footer > * { min-width:0; }
#contestsBody .contest-note { color:var(--text-3, #a09bb4); font-size:11px; }
#contestsBody .contest-history { display:flex; flex-direction:column; gap:6px; }
#contestsBody select { width:100%; min-width:0; padding:10px; color:var(--text-1, #efe9fa); background:var(--surface-2, #242033); border:1px solid var(--line, #423952); border-radius:6px; font:inherit; }
#contestsBody .contest-card, #contestsBody .contest-rules, #contestsBody .contest-message { padding:12px; border:1px solid var(--line, #423952); border-radius:8px; background:var(--surface-2, #242033); overflow-wrap:anywhere; }
#contestsBody .contest-card { display:flex; flex-direction:column; gap:10px; }
#contestsBody .contest-rules { padding:9px 10px; font-size:11px; line-height:1.4; }
#contestsBody .contest-rules p { margin-top:5px; }
#contestsBody .contest-rules > p:first-child { margin-top:0; }
#contestsBody .contest-terms { margin-top:5px; }
#contestsBody .contest-terms summary { min-height:40px; align-content:center; color:#f5d479; cursor:pointer; }
#contestsBody .contest-terms summary:focus-visible { outline:2px solid #f5c542; outline-offset:2px; }
#contestsBody .contest-stage { padding:9px 10px; border-left:3px solid #8a7338; color:var(--text-1, #efe9fa); overflow-wrap:anywhere; }
#contestsBody .contest-ranking { min-width:0; padding:10px; border:1px solid var(--line, #423952); border-radius:8px; }
#contestsBody .contest-mine { padding:8px 0; color:var(--text-1, #efe9fa); overflow-wrap:anywhere; }
#contestsBody .contest-ranking table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:11px; }
#contestsBody .contest-ranking caption { text-align:left; padding-bottom:6px; color:var(--text-3, #a09bb4); }
#contestsBody .contest-ranking th, #contestsBody .contest-ranking td { padding:6px 4px; text-align:left; vertical-align:top; overflow-wrap:anywhere; border-bottom:1px solid var(--line, #423952); }
#contestsBody .contest-ranking th:first-child { width:44px; }
#contestsBody .contest-ranking th:last-child { width:70px; }
#contestsBody .contest-ranking th:last-child, #contestsBody .contest-ranking td:last-child { text-align:right; }
#contestsBody .contest-ranking .is-me { background:rgba(245,197,66,.08); color:var(--text-1, #efe9fa); }
#contestsBody .contest-card.is-winner { border-color:#8a7338; }
#contestsBody .contest-card.is-claimed { border-color:#45674c; }
#contestsBody .contest-winner { color:var(--success, #80c58b); }
#contestsBody .contest-message { display:flex; flex-direction:column; align-items:flex-start; gap:8px; color:#e3c170; }
#contestsBody button { min-height:40px; padding:7px 12px; border:1px solid #8a7338; border-radius:6px; background:rgba(245,197,66,.08); color:#f5d479; font:inherit; cursor:pointer; flex-shrink:0; }
#contestsBody button:disabled { opacity:.5; cursor:default; }
#contestsBody button:focus-visible, #contestsBody select:focus-visible { outline:2px solid #f5c542; outline-offset:2px; }
@media (max-width:380px) {
  #contestsBody .contest-footer { align-items:flex-start; flex-direction:column; }
}
@media (max-height:600px) {
  #taskModal.contests-active { padding-top:12px; padding-bottom:12px; }
  #taskModal.contests-active > .task-modal-box { max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); }
}
