/* Page styles: compete area. Owned by its views; tokens and shared components live in ../app.css.
   Challenges + ChallengeNew (page 10), Tournaments + Bracket (page 11), and the tournament
   create sheet (not drawn; same style as ChallengeNew). Values transcribed from the artboards. */

/* ---------- Shared page head (Challenges, Tournaments) ---------- */
.cp-head { padding: 14px var(--gutter) 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 46px; }
.cp-new {
  flex: none; height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 6px; border-radius: 12px;
  background: var(--red); color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 14px;
}
.cp-new:hover { color: #FFFFFF; filter: brightness(1.06); }
.cp-add { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--red); color: #FFFFFF; text-decoration: none; }
.cp-add:hover { color: #FFFFFF; filter: brightness(1.06); }
.cp-h { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cp-state { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 14px; }

/* Shared tag (kind / status) */
.cp-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.cp-tag.gold { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* Shared action buttons (cards) */
.cp-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-btn {
  height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 12px;
  font: 700 15px var(--font-body); text-decoration: none; text-align: center;
}
.cp-btn.light { border: 0; background: var(--ink); color: var(--bg); }
.cp-btn.line { background: transparent; border: 1.5px solid var(--border-strong); color: var(--ink); font-weight: 600; }
.cp-btn.red { border: 0; background: var(--red); color: #FFFFFF; }
.cp-btn.red:hover { color: #FFFFFF; filter: brightness(1.06); }
.cp-btn.line:hover { color: var(--ink); border-color: var(--muted); }
.cp-btn.sm { height: 46px; font-size: 14px; }
.cp-btn:disabled { background: var(--surface-2); color: var(--disabled-ink); border-color: var(--surface-2); filter: none; }
.cp-btn.wide { grid-column: 1 / -1; }
.cp-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--error-ink); }
.cp-note svg { flex: none; margin-top: 1px; }
.cp-note.info { color: var(--soft-ink); }

/* ---------- Challenges (page 10) ---------- */
.ch-list { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 26px; }
.ch-section { display: flex; flex-direction: column; gap: 10px; }
.ch-section.flat { gap: 0; }
.ch-section.flat > .cp-h { margin-bottom: 6px; }
.cp-h.ink { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.ch-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #FFFFFF; font-size: 11px; letter-spacing: 0; display: flex; align-items: center; justify-content: center; }

.ch-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-strong); scroll-margin-top: 16px; }
.ch-card.quiet { background: transparent; border-color: var(--border); }
.ch-card.focus, .ch-sent.focus, .ch-hist.focus { box-shadow: 0 0 0 2px var(--gold); }
.ch-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ch-exp { font-size: 12px; color: var(--subtle); text-align: right; }
.ch-who { display: flex; flex-direction: column; gap: 4px; }
.ch-from { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.ch-to { font-size: 14px; color: var(--muted); }
.ch-to strong { color: var(--ink); }
.ch-msg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.ch-msg .by { color: var(--subtle); }
.ch-when { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft-ink); }
.ch-when svg { flex: none; }
.ch-vs { font-size: 16px; overflow-wrap: anywhere; }
.ch-vs .v { color: var(--subtle); }
.ch-more { display: flex; justify-content: center; margin: -4px 0 -8px; }
.ch-sent-btn { flex: none; display: flex; }

.ch-sent { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 12px 16px; border-radius: 14px; border: 1px solid var(--border); scroll-margin-top: 16px; }
.ch-sent-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-sent-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ch-sent-sub { font-size: 12px; color: var(--subtle); }
.ch-cancel { flex: none; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--gold); font: 600 14px var(--font-body); }
.ch-cancel:hover { color: var(--gold-hover); }
.ch-cancel:disabled { color: var(--subtle); }
.ch-sent-wrap { display: flex; flex-direction: column; gap: 8px; }

.ch-hist { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.ch-hist-text { display: flex; flex-direction: column; min-width: 0; }
.ch-hist-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ch-hist-when { font-size: 12px; color: var(--subtle); }
.ch-hist.focus { padding: 6px 12px; border-radius: 10px; border-top-color: transparent; }
.ch-hist-when a { font-weight: 600; }
.ch-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); border: 1px dashed var(--subtle); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.ch-badge.solid { color: var(--ink); border: 1px solid var(--ink); }
.ch-badge.gold { color: var(--gold); border: 1px solid var(--gold-line-3); }

/* ---------- New challenge / new tournament sheets ---------- */
.sheet-body.cn-body { padding-top: 8px; gap: 18px; }
.sheet-foot.cn-foot { gap: 6px; }
.cn-sec { display: flex; flex-direction: column; gap: 8px; }
.cn-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cn-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cn-label .opt, .cn-label-row .opt { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--subtle); }
.cn-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cn-chip {
  min-height: 44px; padding: 0 14px; border-radius: 22px; background: transparent; color: var(--ink);
  border: 1.5px solid var(--border); font: 600 14px var(--font-body);
}
.cn-chip[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.cn-chip:disabled { color: var(--disabled-ink); border-color: var(--line); }
.cn-chip[aria-checked="true"]:disabled { background: var(--surface-2); color: var(--disabled-ink); border-color: var(--surface-2); }

.cn-options { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.cn-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 0 14px;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 15px var(--font-body); text-align: left;
}
.cn-opt:first-child { border-top: 0; }
.cn-opt .rk { color: var(--subtle); font-weight: 500; }
.cn-opt .rt { flex: none; font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.cn-opt .nm { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.cn-opt[aria-checked="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.cn-opt[aria-checked="true"] .rk { color: #6A4A48; }
.cn-opt:disabled { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 60px; color: var(--disabled-ink); }
.cn-opt:disabled .rk { color: inherit; }
.cn-opt .why { font-size: 12px; font-weight: 500; }
.cn-opt .seed { flex: none; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--bg); color: var(--ink); font: 700 12px var(--font-body); display: inline-flex; align-items: center; justify-content: center; }
.cn-opt .tick { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; }
.cn-opt[aria-checked="true"] .tick { background: var(--bg); border-color: var(--bg); color: var(--ink); }
.cn-opt:focus-visible { outline-offset: -3px; }

.cn-field { display: flex; flex-direction: column; gap: 6px; }
.cn-textarea {
  resize: none; padding: 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border);
  color: var(--ink); font: 400 16px/1.4 var(--font-body);
}
.cn-input {
  height: 48px; width: 100%; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border);
  color: var(--ink); color-scheme: dark; font: 500 16px var(--font-body);
}
.cn-textarea:focus, .cn-input:focus { border-color: var(--ink); outline: none; }
.cn-textarea:disabled, .cn-input:disabled { color: var(--disabled-ink); }
.cn-input.invalid { border-color: var(--error-line); }
.cn-help { font-size: 13px; color: var(--subtle); line-height: 1.4; }
.cn-foot-note { font-size: 12px; color: var(--subtle); text-align: center; }
.cn-empty { padding: 14px; border-radius: 14px; border: 1px dashed var(--border-strong); font-size: 14px; line-height: 1.45; color: var(--muted); }
.cn-empty a { font-weight: 600; }

/* ---------- Tournaments list (page 11) ---------- */
.tn-list { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 24px; }
.tn-section { display: flex; flex-direction: column; gap: 10px; }
.tn-section.flat { gap: 0; }
.tn-section.flat > .cp-h { margin-bottom: 6px; }
.tn-live { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); text-decoration: none; color: var(--ink); }
.tn-live:hover { color: var(--ink); border-color: var(--muted); }
.tn-live-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tn-round { font-size: 12px; font-weight: 700; color: var(--gold); }
.tn-name { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 0.95; text-transform: uppercase; overflow-wrap: anywhere; }
.tn-progress { display: flex; flex-direction: column; gap: 6px; }
.tn-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.tn-bar > span { height: 4px; border-radius: 2px; background: var(--border-strong); }
.tn-bar > span.on { background: var(--ink); }
.tn-meta { font-size: 13px; color: var(--muted); }
.tn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); }
.tn-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tn-row-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.tn-row-meta { font-size: 12px; color: var(--subtle); }
.tn-view { flex: none; min-height: 44px; padding: 0 14px; border-radius: 10px; background: transparent; border: 1.5px solid var(--border-strong); color: var(--ink); font: 600 14px var(--font-body); display: flex; align-items: center; text-decoration: none; }
.tn-view:hover { color: var(--ink); border-color: var(--muted); }
.tn-done { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 6px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tn-done:hover { color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.tn-done-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.tn-champ { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--gold); text-align: right; }
.tn-champ svg { flex: none; }

/* ---------- Bracket (page 11) ---------- */
.bk-head { padding: 10px var(--gutter) 18px; display: flex; flex-direction: column; gap: 6px; }
.bk-meta { font-size: 13px; color: var(--muted); line-height: 1.4; }
.bk-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 0 var(--gutter); padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.bk-tab { height: 42px; min-width: 0; padding: 0 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 14px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.bk-panel { padding: 18px var(--gutter) 0; display: flex; flex-direction: column; gap: 12px; }
.bk-panel:focus-visible { outline-offset: -2px; }
.bk-match { border-radius: 16px; border: 1px solid var(--line); background: transparent; overflow: hidden; }
.bk-match.ready { border-color: var(--border-strong); background: var(--surface); }
.bk-match.waiting { border-color: var(--border); }
.bk-match.mine { box-shadow: 0 0 0 1px var(--gold-line-3); }
.bk-mhead { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 12px; color: var(--subtle); border-bottom: 1px solid var(--line); }
.bk-mlabel { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.bk-mstatus { text-align: right; }
.bk-mstatus.live { color: var(--ink); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.bk-side { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-bottom: 1px solid #2E1013; color: var(--ink); }
.bk-side.lose { color: var(--subtle); }
.bk-seed { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.bk-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.bk-side.win .bk-name { font-weight: 700; }
.bk-side.lose .bk-name { font-weight: 500; }
.bk-side.tbd .bk-name { color: var(--muted); font-weight: 500; }
.bk-adv { margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.bk-score { font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px; }
.bk-mfoot { display: flex; justify-content: flex-end; padding: 0 6px; }

.bk-cards { padding: 0 var(--gutter) 18px; display: flex; flex-direction: column; gap: 12px; }
.bk-next { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--gold-line-2); }
.bk-next-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bk-next-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.bk-next-round { font-size: 12px; color: var(--subtle); }
.bk-next-vs { font-size: 14px; color: var(--muted); }
.bk-next-name { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.bk-next-name .sd { color: var(--gold); margin-right: 8px; }
.bk-next-sub { font-size: 13px; color: var(--soft-ink); }
.bk-champ { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--gold-tint-2); border: 1px solid var(--gold-line-2); }
.bk-champ svg { flex: none; }
.bk-champ-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-champ-name { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.bk-cancelled { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--border-alert); font-size: 14px; line-height: 1.45; color: var(--muted); }
.bk-cancelled strong { color: var(--ink); font-size: 15px; }
.bk-tools { padding: 18px var(--gutter) 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.bk-entrants { padding: 18px var(--gutter) 0; display: flex; flex-direction: column; }
.bk-entrants > .cp-h { margin-bottom: 6px; }
.bk-entrant { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.bk-entrant.you { color: var(--gold); }
.bk-sheet-text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
