:root {
  color-scheme: light;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  --background: #f4f6fa;
  --surface: #fff;
  --text: #202735;
  --muted: #555f72;
  --border: #dce1ea;
  --accent: #4834b1;
  --accent-dark: #36268d;
  --header: #171628;
  --danger: #a32137;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

a {
  color: var(--accent);
  text-underline-offset: .18em;
}

header {
  background: var(--header);
  color: #fff;
}

nav,
main {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
}

.brand {
  font-size: 1.25rem;
  font-weight: 750;
}

main {
  padding: 2rem 0 4rem;
}

h1 {
  margin: .35rem 0 1.5rem;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

h2 {
  line-height: 1.25;
}

hr {
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.search,
.panel,
.notice,
.card,
.records {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

label {
  display: grid;
  min-width: 0;
  gap: .25rem;
  font-weight: 600;
}

input,
select,
textarea,
button,
.button {
  padding: .6rem .75rem;
  border-radius: 8px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #abb4c4;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

button,
.button {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

button.secondary {
  justify-self: start;
  background: #fff;
  color: var(--accent);
}

button.secondary:hover {
  border-color: var(--accent);
  background: #f2efff;
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

button.danger:hover {
  border-color: #81182a;
  background: #81182a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 1rem;
}

.card {
  overflow: hidden;
}

.thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e5defb;
  color: var(--accent);
  text-decoration: none;
}

.thumb > * {
  grid-area: 1 / 1;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.thumb .cover {
  z-index: 1;
}

.placeholder {
  font-size: 2.3rem;
}

.info,
.panel,
.notice {
  padding: 1rem;
}

.info h2 {
  margin: .25rem 0 .5rem;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.info h2 a {
  color: inherit;
  text-decoration: none;
}

.info h2 a:hover {
  text-decoration: underline;
}

.info p {
  margin: .4rem 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.info small {
  color: var(--accent);
  font-weight: 700;
}

.video-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.player {
  max-width: 900px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--header);
}

.player iframe,
.player video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player video {
  object-fit: contain;
}

.video-details {
  max-width: 900px;
  padding: 1rem;
  border-radius: 12px;
  background: #303030;
  color: #fff;
}

.video-details section + section {
  margin-top: 1rem;
}

.video-details h2 {
  margin: 0 0 .5rem;
  font-size: 1rem;
}

.video-labels {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.info .video-labels {
  margin: .5rem 0;
}

.video-labels a {
  max-width: 100%;
  padding: .2rem .55rem;
  border-radius: 5px;
  background: #eee9fb;
  color: #302575;
  font-size: .85rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.video-details .video-labels a {
  background: #202020;
  color: #fff;
}

.video-details .video-labels.tags a {
  background: #474747;
}

.video-labels a:hover,
.video-labels a:focus-visible {
  text-decoration: underline;
}

.video-description {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.panel {
  max-width: 760px;
}

.panel h2 {
  margin-top: 0;
}

.panel + .panel {
  margin-top: 1rem;
}

.editor {
  display: grid;
  gap: .85rem;
}

.editor small {
  color: var(--muted);
}

.records {
  padding: 0;
  list-style: none;
}

.records li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  overflow-wrap: anywhere;
}

.records li + li {
  border-top: 1px solid var(--border);
}

.records small {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}

:focus-visible {
  outline: 3px solid #7867e3;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  main {
    padding-top: 1.25rem;
  }

  .search {
    grid-template-columns: minmax(0, 1fr);
  }

  .records li {
    flex-wrap: wrap;
  }
}