/* Injected into nginx autoindex pages on replays.goobstation.com via sub_filter. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5f5a;
  --line: #e2e2dd;
  --row-hover: #f0f0ec;
  --link: #1d5fa8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1e1e1c;
    --text: #e8e8e3;
    --muted: #a3a39c;
    --line: #34342f;
    --row-hover: #262623;
    --link: #8ab8ec;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 32px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}

body > * { max-width: 760px; margin-left: auto; margin-right: auto; }

h1 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

h1 a { color: var(--text); text-decoration: none; }
h1 a:hover { text-decoration: underline; }
h1 .sep { color: var(--muted); padding: 0 6px; font-weight: 400; }

hr { display: none; }

a { color: var(--link); }
a:focus-visible, input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* No-JS fallback: the original preformatted listing, scrolling inside its own box. */
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
}

.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.tools input {
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tools input[type="search"] { flex: 1 1 200px; max-width: 280px; }
.tools input::placeholder { color: var(--muted); }

.status { color: var(--muted); margin: 16px 0; }

.day { margin-top: 20px; scroll-margin-top: 16px; }

.day h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.round, .folder {
  display: grid;
  align-items: baseline;
  column-gap: 16px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
}

.round { grid-template-columns: 4.5em 1fr auto 5.5em; }
.round:hover, .folder:hover { background: var(--row-hover); }

.rn { font-weight: 600; color: var(--link); }
.d, .s, .latest { color: var(--muted); }
.d, .s { text-align: right; }

.round.restart .rn, .round.restart .t { color: var(--muted); font-weight: 400; }

.round.other { grid-template-columns: 1fr auto; }
.round.other .name { overflow-wrap: anywhere; }

.folder { grid-template-columns: 1fr auto; }
.folder .name { font-weight: 600; color: var(--link); overflow-wrap: anywhere; }
.folder.file .name { font-weight: 400; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.tile:hover { border-color: var(--muted); background: var(--row-hover); }
.tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile-name { font-size: 18px; font-weight: 600; color: var(--link); }

@media (max-width: 560px) {
  body { padding-top: 20px; }
  .round { grid-template-columns: auto 1fr auto; grid-template-areas: "rn d s" "t t t"; }
  .round .rn { grid-area: rn; }
  .round .t { grid-area: t; color: var(--muted); font-size: 14px; }
  .round .d { grid-area: d; }
  .round .s { grid-area: s; }
  .round.other { grid-template-areas: none; grid-template-columns: 1fr auto; }
  .folder { grid-template-columns: 1fr; }
  .tile { height: 130px; padding: 16px; }
}
