:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101216;
  color: #f1f3f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid #343a40;
  background: rgb(16 18 22 / 94%);
  backdrop-filter: blur(10px);
}
.index-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
}
h1 { margin: 0; font-size: 20px; }
.index-header p, .source-name { margin: 4px 0 0; color: #adb5bd; font-size: 13px; }
input {
  width: min(440px, 42vw);
  margin-left: auto;
  padding: 9px 11px;
  border: 1px solid #495057;
  border-radius: 6px;
  background: #212529;
  color: inherit;
}
main { padding: 14px; }
.animation-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.animation-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  min-height: 68px;
  padding: 11px;
  border: 1px solid #343a40;
  border-radius: 7px;
  background: #181b20;
  text-decoration: none;
}
.animation-list a:hover { border-color: #74c0fc; background: #20252b; }
.animation-id {
  grid-row: 1 / 3;
  align-self: center;
  color: #74c0fc;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.frame-count { color: #868e96; font-size: 12px; }
.animation-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}
.animation-header nav { display: flex; gap: 8px; }
.animation-header nav:last-child { justify-self: end; }
.button {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid #495057;
  border-radius: 5px;
  background: #212529;
  text-decoration: none;
}
.button:hover { border-color: #74c0fc; }
.button[aria-disabled="true"] { visibility: hidden; }
.title-block { text-align: center; }
.title-block h1 { font-size: 18px; }
.load-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #343a40;
  color: #ced4da;
  font-variant-numeric: tabular-nums;
}
.view-links { display: flex; gap: 10px; }
.view-links a { color: #74c0fc; }
progress { width: min(520px, 55vw); height: 14px; }
.preview-section { margin-bottom: 28px; scroll-margin-top: 110px; }
.preview-section h2 { margin: 0 0 10px; font-size: 18px; }
.playback-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #343a40;
  border-radius: 6px;
}
.playback-controls legend { padding: 0 5px; color: #adb5bd; font-size: 13px; }
.playback-controls label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.playback-controls input { width: auto; margin: 0; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.preview { width: 100%; }
.preview-stage {
  display: flex;
  justify-content: center;
  background: #08090b;
}
.preview canvas {
  display: block;
  width: min(100%, 512px);
  height: auto;
}
.view-section { scroll-margin-top: 110px; }
.view-section + .view-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid #495057;
}
.view-section h2 { margin: 0 0 10px; font-size: 18px; }
.frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 8px;
}
.atlas-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.atlas { width: 100%; }
.atlas a { display: block; background: #08090b; }
.atlas img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  image-rendering: auto;
}
.atlas figcaption { gap: 16px; }
.atlas figcaption span { text-align: right; }
figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #343a40;
  border-radius: 6px;
  background: #0b0d10;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; }
.checker {
  min-width: 0;
  background:
    linear-gradient(45deg, #24282e 25%, transparent 25%),
    linear-gradient(-45deg, #24282e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #24282e 75%),
    linear-gradient(-45deg, transparent 75%, #24282e 75%),
    #171a1f;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}
img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
figcaption {
  display: flex;
  justify-content: space-between;
  padding: 5px 7px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #adb5bd;
}
.error { outline: 2px solid #fa5252; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .index-header { align-items: stretch; flex-direction: column; gap: 10px; }
  input { width: 100%; margin-left: 0; }
  .animation-header { grid-template-columns: auto 1fr auto; gap: 8px; }
  .button .wide { display: none; }
  .source-name { display: none; }
  .load-status { flex-wrap: wrap; }
}
