/* The dashboard: the top bar, tournament list, new-tournament wizard, settings and
   account. Tokens, buttons, forms, cards and notices come from /shared/ui.css; this
   file adds the layout around them. */

/* ui.css sets display on .button and .card, which would otherwise override hidden. */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Top bar. On phones the links drop to a second row so nothing is squeezed. */
.topbar .who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.nav { display: flex; align-items: center; gap: 18px; font-weight: 700; }
.nav a { color: var(--text); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--blue); }
.nav button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.nav a:hover, .nav button:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .topbar .who { max-width: 55vw; }
  .nav { order: 3; width: 100%; gap: 22px; }
}

h3 { margin: 22px 0 8px; font-size: 15px; }
code { background: var(--panel-2); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hint.error { color: var(--red); }
.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.grow { flex: 1 1 200px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
/* A row of fields and a button, lined up on their bottom edges. Each label stacks
   its caption above its control. */
.inline-form { align-items: flex-end; }
.inline-form label { display: grid; gap: 4px; margin: 0; }
.inline-form select { width: auto; }
.button.small, label.button { margin: 0; }
.button.small { padding: 5px 9px; font-size: 13px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.crumbs { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.path { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Tournament cards */
.tcard { display: flex; flex-direction: column; gap: 10px; }
.tcard h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.tcard .meta { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.tcard .actions { margin-top: auto; }
.empty p { margin: 0 0 14px; }
.plain-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Choices: template cards, scenes and art modes */
.options { display: grid; gap: 8px; }
.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}
.option input { width: auto; flex: none; margin: 3px 0 0; accent-color: var(--blue); }
.option:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.option-text { display: grid; gap: 2px; min-width: 0; }
.option-text strong { font-weight: 700; }
.option-text .muted { font-size: 13px; }

.template-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.template { position: relative; flex-direction: column; }
.template input { position: absolute; top: 16px; right: 16px; }
.template-body { display: grid; gap: 6px; min-width: 0; }
.template-body strong { padding-right: 26px; }
.template-body img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--panel); }

/* OBS browser-source URLs */
.obs-list { list-style: none; margin: 0; padding: 0; }
.obs-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.obs-row:last-child { border-bottom: 0; }
.obs-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.obs-text code { font-size: 12px; }

/* Logos and sponsors */
.logo-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-thumb { width: 96px; height: 64px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.logo-empty { display: grid; place-items: center; width: 96px; height: 64px; border-radius: 8px; border: 1px dashed var(--line); }
.sponsor { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.sponsor-fields { display: grid; gap: 12px; }
.sponsor-fields label { margin: 0; }
@media (min-width: 640px) {
  .sponsor-fields { grid-template-columns: 1fr 1fr; }
  .sponsor-fields .wide { grid-column: 1 / -1; }
}

/* Per-event character art */
.event-art { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 400; }
.event-art:last-child { border-bottom: 0; }
.event-art select { width: auto; flex: 0 1 240px; }

/* Assets */
.asset-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.asset { display: flex; flex-direction: column; margin: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.asset-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--line) 45%, transparent) 10px 20px); }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.asset figcaption { display: grid; gap: 6px; padding: 10px; min-width: 0; }
.asset-name { overflow-wrap: anywhere; font-size: 14px; }
.asset .row { gap: 6px; }

/* Members */
.member { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Stream Deck */
.key { padding: 7px 10px; font-size: 14px; letter-spacing: 0.04em; }
.urls { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.urls li { display: grid; gap: 4px; min-width: 0; }
.urls span { font-size: 14px; font-weight: 700; }
.urls code { font-size: 12px; }

.danger-zone { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
