/* The weekly contest (contest.html). Builds on the arena styles in style.css: board-top, big-clock,
   board-status, arena-bar, arena-workspace, lc-table. Monochrome; color carries state only. */
.contest-top .contest-clock { text-align: right; }
.contest-top .contest-clock .label { margin-bottom: .4rem; }
.contest-top h1:focus { outline: none; }
.contest-entry, .contest-rules, .contest-board, .contest-ranking, .contest-editorial { padding: 1.8rem var(--gutter); border-bottom: 1px solid var(--rule); }
.contest-entry p { max-width: 62ch; }
.contest-rules ul { list-style: none; margin: .6rem 0 0; padding: 0; max-width: 92ch; font-family: var(--mono); font-size: .8rem; line-height: 1.75; color: var(--fg-muted); }
.contest-rules li { padding: .45rem 0; border-top: 1px solid var(--rule); }
.contest-rules li b { color: var(--fg); font-weight: 500; }
.contest-go { font-size: 1.05rem; }
.contest-start .preload span { margin-right: .9rem; color: var(--fg-faint); }
.contest-start .preload span.on { color: var(--grown); }

/* the run: one tile per problem */
.contest-tiles { list-style: none; margin: .8rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.contest-tiles li { display: flex; }
.contest-tile { all: unset; box-sizing: border-box; flex: 1; cursor: pointer; display: grid; grid-template-columns: 2.6rem 1fr; gap: .35rem 1rem; padding: 1.2rem 1.2rem 1.1rem; background: var(--bg); color: var(--fg); min-height: 8.5rem; align-content: start; transition: background .15s; }
.contest-tile:hover { background: var(--bg-elev); }
.contest-tile:focus-visible { outline: 2px solid var(--grown); outline-offset: -2px; }
.contest-tile[disabled] { cursor: default; opacity: .6; }
.contest-tile .ct-num { grid-row: 1 / span 3; font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--fg-faint); line-height: 1; }
.contest-tile.done .ct-num { color: var(--grown); }
.contest-tile .ct-title { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.ct-meta { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.contest-tile .ct-state { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; }
.contest-tile .ct-state.ok { color: var(--grown); }
.contest-workspace .problem-nav { display: none; }   /* the arena bar above has "← Contest" */

/* results */
.contest-big { font-size: 1.25rem; margin: .4rem 0 .8rem; }
.contest-big b { font-family: var(--mono); font-size: 1.6rem; }
.contest-plist { list-style: none; padding: 0; margin: 0 0 1rem; font-family: var(--mono); font-size: .8rem; color: var(--fg-muted); }
.contest-plist li { padding: .3rem 0; border-top: 1px solid var(--rule); }
.contest-plist li.done { color: var(--fg); }
.contest-ranking .lc-scroll { position: relative; }   /* keeps the headers' screen-reader text inside the scroller */
.contest-table tr.me td { background: var(--grown-soft); }
.contest-table td small { color: var(--fg-muted); }
.contest-editorial .editorial-item { padding: 1.4rem 0; border-top: 1px solid var(--rule); max-width: 92ch; }
.contest-editorial h3 { font-size: 1.4rem; text-transform: uppercase; letter-spacing: -0.03em; }
.contest-editorial h4 { font-family: var(--mono); font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); margin: 1.2rem 0 .4rem; }
.contest-editorial details { margin-top: .9rem; }
.contest-editorial summary { cursor: pointer; font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.contest-editorial details .prose { padding: .6rem 0 0 1rem; border-left: 2px solid var(--rule); }
.contest-past { padding-top: 1.6rem; }

@media (max-width: 760px) {
  .contest-tiles { grid-template-columns: 1fr; }
  .contest-tile { min-height: 0; }
  .contest-top { grid-template-columns: 1fr; gap: 1rem; }
  .contest-top .contest-clock { text-align: left; }
  .contest-top .big-clock { text-align: left; }
}
