:root {
  color-scheme: dark;
  --page: #131215;
  --text: #f6eee3;
  --muted: #c4b6b4;
  --rule: #40373a;
  --accent: #f1c3a3;
  font: 16px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 42% 0, #251f24, var(--page) 32rem) fixed;
  color: var(--text);
}

.library {
  width: min(100% - 32px, 48rem);
  margin-inline: auto;
  padding-block: 32px 56px;
}

.library-header, .player-top, .player-actions {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.library-header { border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.library-header span, #sample-size, #status, .settings p, .welcome p { color: var(--muted); }
h1, h2, p { margin: 0; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
button, input, select { font: inherit; }

button, select {
  padding: 7px 12px;
  min-height: 42px;
  border: 1px solid var(--rule);
  background: #201c20;
  color: var(--text);
  border-radius: .55rem;
}

button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button.primary, button[aria-pressed="true"] {
  color: #251a18;
  background: var(--accent);
  border-color: var(--accent);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.welcome, .player { padding-top: 22px; }
.welcome { display: grid; justify-items: start; gap: 14px; }
.player { display: grid; gap: 12px; }
.player-top { font-size: .85rem; }
#sample-size { flex: none; font-variant-numeric: tabular-nums; }
video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0b090d;
  border-radius: .7rem;
}
.player-actions, .drive-actions, .mode-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.player-actions { align-items: center; }
#status:not(:empty) { margin-top: 16px; }
.settings { border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 20px; }
summary { cursor: pointer; min-height: 40px; }
form { display: grid; gap: 12px; max-width: 35rem; }
form p { font-size: .9rem; }
form label { display: grid; gap: 5px; }
form input {
  width: 100%;
  min-height: 42px;
  padding: 6px 9px;
  color: var(--text);
  background: #171419;
  border: 1px solid var(--rule);
  border-radius: .45rem;
}
form button { justify-self: start; }
.drive-actions { margin-top: 12px; }
.drive-preview { display: grid; gap: 8px; margin-top: 12px; }
.drive-preview iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: .7rem; background: #0b090d; }
.drive-preview a { color: var(--accent); justify-self: start; }
#preview-error:not(:empty) { margin-top: 8px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .library { width: calc(100% - 24px); padding-top: 20px; }
}
