:root {
  color-scheme: dark;
  --background: #0f1214;
  --panel: #181d20;
  --panel-soft: #20272a;
  --text: #fbf7ed;
  --muted: #b9c2bf;
  --accent: #e4b76b;
  --accent-2: #8fd0b5;
  --line: #344047;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.status {
  margin: 0;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

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

.caption {
  position: absolute;
  left: 50%;
  bottom: clamp(54px, 8vw, 92px);
  transform: translateX(-50%);
  width: min(90%, 980px);
  color: white;
  font-size: clamp(18px, 2.7vw, 34px);
  font-weight: 650;
  line-height: 1.28;
  text-align: center;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(0, 0, 0, 0.88);
  white-space: pre-line;
  pointer-events: none;
}

.caption:empty {
  display: none;
}

.toolbar {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.toolbar-label {
  color: var(--muted);
  font-weight: 650;
}

.caption-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caption-option {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.caption-option:hover {
  border-color: var(--accent);
}

.caption-option.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  color: #fff4d8;
}

.caption-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .page {
    width: min(100vw - 20px, 1180px);
    padding-top: 14px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    text-align: left;
  }

  .toolbar {
    align-items: stretch;
  }

  .caption-options {
    width: 100%;
  }

  .caption-option {
    flex: 1 1 92px;
  }
}
