:root {
  --bg: #12140f;
  --panel: #1b1e16;
  --stage: #070806;
  --line: #313628;
  --text: #f4f1e8;
  --muted: #9c978a;
  --accent: #d6f25c;
  --accent-ink: #1a2206;
  --mono: ui-monospace, "SF Mono", "Source Code Pro", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 3px solid var(--accent);
}

.mark {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0.1rem 0 0;
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.clip-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: min(100%, 22rem);
  max-width: 32rem;
}

.clip-pick label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.clip-pick select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  background: #0c0d0a;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.clip-pick select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.clip-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

video.is-loading {
  opacity: 0;
}

main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(24rem, 1.05fr);
  grid-template-rows: minmax(70vh, 1fr);
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 1.25rem 1.5rem;
  min-height: 0;
}

.stage {
  background: var(--stage);
  min-width: 0;
  align-self: start;
}

video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.clip-state {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.clip-state[hidden] {
  display: none;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.seek {
  flex: none;
}

.bib-columns {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(11.5rem, 0.9fr) minmax(14rem, 1.15fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.column {
  background: var(--panel);
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.85rem 0.75rem 0.75rem;
}

.column.now {
  border-left: 4px solid var(--accent);
}

.column.roster {
  border-left: 4px solid var(--line);
}

.now-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.15rem 0.75rem;
  flex: none;
}

h2 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.now-head h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.clock {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
}

.scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.now-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.now-list button {
  width: 100%;
  padding: 0.12rem 0;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-align: left;
}

.now-list button:hover,
.now-list button.is-active {
  border-color: var(--accent);
}

.empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.empty[hidden] {
  display: none;
}

.seek label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.seek-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.seek input {
  width: 7.2ch;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  background: #0c0d0a;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.seek input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.seek input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button:disabled,
button:disabled:hover {
  border-color: var(--line);
  color: var(--muted);
  background: transparent;
  cursor: not-allowed;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.status {
  min-height: 2.8em;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.bib-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bib-list button {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.08rem;
  width: 100%;
  padding: 0.32rem 0 0.4rem;
  text-align: left;
}

.bib-list button.is-active {
  border-color: var(--accent);
}

.bib-list button.is-on .num {
  color: var(--accent);
}

.num {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: left;
}

.range {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

@media (max-width: 860px) {
  main {
    flex: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-content: start;
  }

  .panel {
    height: auto;
    min-height: 0;
  }

  .bib-columns {
    flex: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .column {
    height: auto;
    min-height: 11rem;
    max-height: 46vh;
  }

  .now-list button {
    font-size: 1.7rem;
  }
}
