/* Contenders page. Builds on styles.css (colors, logo, toolbar, sign-in bar, year buttons) and
   rankings.css (the table, posters). Flat marks only: no gradients, glows or motion. */
.ct .reviewer-bar { margin: 4px 0 14px; }
.ct .years { margin: 0 0 14px; }
.ct .years[hidden] { display: none; } /* .years sets display: flex, which beats [hidden] */
.ct-empty { text-align: center; color: var(--text-dim); margin: 30px 0; }

/* Suggest a movie */
.ct-add { position: relative; max-width: 520px; margin: 0 auto 18px; }
.ct-add input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
}
.ct-add input:focus { outline: none; border-color: var(--accent); }
.ct-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.ct-results button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--text-dim);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.ct-results button:hover, .ct-results button:focus-visible { background: var(--bg); color: var(--text); outline: none; }
.ct-results strong { color: var(--text); font-weight: 600; }
.ct-results img, .ct-noposter { width: 30px; height: 45px; flex: 0 0 auto; border-radius: 3px; object-fit: cover; background: var(--bg); }
.ct-results .ct-typed { justify-content: center; padding: 10px 8px; color: var(--accent); font-weight: 600; }
.ct-results .rk-poster { width: 30px; height: 45px; border-radius: 3px; }
.ct-results-head { padding: 8px 8px 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.ct-rewatch-line { font-size: 12px; color: var(--text-dim); }

/* Rewatch: the movie is on an earlier year's list (hover for the years). Brighter than the main page's
   grey tags so it stands out in the list. */
.ct-rewatch { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; color: var(--text); border-color: var(--text-dim); }
.ct-rewatch svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ct-results .ct-rewatch { margin: 2px 4px 0 0; }

/* Toast for results of an action */
.ct-status {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  visibility: hidden;
}
.ct-status.show { visibility: visible; }
.ct-status.error { border-color: var(--accent); color: #ffb4a8; }

/* Status pills */
.ct-pill {
  display: inline-block;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.ct-pill.listed { color: #fff; background: var(--accent); border-color: var(--accent); }
.ct-pill.asked { color: var(--text); border-style: dashed; border-color: var(--text-dim); }
.ct-by { display: block; margin-top: 2px; font-size: 11px; color: var(--text-dim); }

/* Row actions */
.ct-actions { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.ct-act {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.ct-act:hover { color: var(--text); border-color: var(--text-dim); }
.ct-act.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.ct-act.danger:hover { color: #ff8a80; border-color: #ff8a80; }
.ct-act:disabled { opacity: .5; cursor: wait; }

/* Edit / move form, opened under a row. contain: inline-size keeps its long note from re-balancing the
   table's column widths, which re-wrapped the rows above and made the list jump. */
.ct-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 10px 4px 12px; contain: inline-size; }
.ct-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.ct-panel input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color-scheme: dark;
}
.ct-panel input[name="year"] { width: 5.5em; }
.ct-panel-buttons { display: flex; gap: 6px; }
.ct-panel-note { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--text-dim); }

/* The list: the rankings table (rankings.css), with Status as the last column */
.ct-table th.c-status, .ct-table td.c-status { text-align: right; }
.ct-table td.c-status .ct-actions { justify-content: flex-end; }
.ct-table tr.is-listed .rk-movie { color: var(--text-dim); }
.ct-table tr.ct-panel-row td { background: var(--bg-raised); }
.ct-table .rk-sub span + span::before { content: ' · '; }
.ct-table .rk-sub .ct-inline + span::before { content: none; } /* .ct-inline only shows on phones */
.ct-table .ct-inline { display: none; }
.ct-table .ct-inline:empty { display: none !important; }

@media (max-width: 600px) {
  .ct-table .c-num { display: none; }
  .ct-table .ct-inline { display: inline; }
  .ct-table .rk-sub .ct-inline:not(:empty) + span::before { content: ' · '; }
  .ct-table td.c-status { max-width: 40vw; }
}
