/* Banner look: a dark window with a grey title bar, IBM Plex Mono, one green accent.
   The tiled background (carpet.svg) is kept. IBM Plex Mono is SIL OFL 1.1, see fonts/OFL.txt. */
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
}

:root {
  --ground: #16103a;
  --screen: #0d1117;
  --bar: #161b22;
  --line: #30363d;
  --fg: #e6edf3;
  --dim: #8b949e;
  --accent: #7ee787;
  --hover: #1c2128;
  --error: #ff7b72;
  --warn: #d29922;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--ground); color-scheme: dark; }
body {
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  background: var(--ground) url("carpet.svg") repeat;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

.skip { position: absolute; left: -999px; top: 0; padding: 8px 12px; background: var(--accent); color: var(--screen); z-index: 10; }
.skip:focus { left: 16px; top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.term {
  position: relative;
  max-width: 1100px;
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--screen);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}
.term > * { min-width: 0; }
.term > :not(.titlebar) { margin-left: 16px; margin-right: 16px; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
}
.dots { display: flex; gap: 8px; flex: none; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.titlebar h1 { flex: 1; margin: 0 38px 0 0; text-align: center; font-size: 13px; font-weight: 400; color: var(--dim); overflow-wrap: anywhere; }

.notice { margin-top: 14px; }
.notice p { margin: 0 0 8px; overflow-wrap: anywhere; }
.badge { border: 1px solid var(--warn); border-left-width: 4px; border-radius: 6px; padding: 6px 10px; }
.badge strong { color: var(--warn); font-weight: 600; }
.disclaimer { border-left: 2px solid var(--line); padding-left: 10px; color: var(--dim); }
.status { margin: 0 0 4px; color: var(--dim); }
.status summary, .options summary { cursor: pointer; color: var(--dim); width: max-content; max-width: 100%; overflow-wrap: anywhere; }
.status summary:hover, .options summary:hover { color: var(--fg); }
.statusline { color: var(--dim); }
.status .statusline { margin: 4px 0 0; }

.bar { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.group { display: flex; flex-wrap: wrap; gap: 6px; }

button, input { font: inherit; color: inherit; }
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 2px 10px;
  cursor: pointer;
  border-radius: 6px;
}
.chip:hover { background: var(--hover); color: var(--fg); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--screen); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:focus-visible, .row:focus-visible { outline-color: #ffffff; }

.activeline { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 6px; font-size: 0.85em; color: var(--dim); }
.activeline p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.activeline .chip { padding: 0 8px; }
.options { margin-top: 6px; }
.options[open] { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px 8px; }
.options .group { margin-top: 6px; }
.count { margin-left: 6px; padding: 0 6px; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); font-size: 0.85em; }
.view {
  flex: 1 1 320px;
  min-height: 240px;
  max-height: 65vh;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 0 4px;
}
.feed { list-style: none; margin: 0; padding: 0; }
.feed li.head { color: var(--dim); padding: 6px 8px 2px; }
.row {
  display: grid;
  grid-template-columns: 12ch 10ch 16ch 30ch 8ch 1fr;
  gap: 0 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 1px 8px;
  text-align: left;
  cursor: pointer;
}
.row:hover { background: var(--hover); }
/* Column headings stay at the top of the scrolling list. */
.colhead { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 12ch 10ch 16ch 30ch 8ch 1fr; gap: 0 10px; padding: 4px 8px; background: var(--bar); border-bottom: 1px solid var(--line); color: var(--dim); }
.row span { overflow-wrap: anywhere; min-width: 0; }
.row .label { font-weight: 600; color: var(--accent); }
.row .sum { color: var(--dim); }
.row .stars, .colhead .stars { text-align: right; }

table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 2px 8px; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; background: var(--bar); color: var(--dim); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); font-weight: 400; }
.sorthead { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.sorthead:hover { color: var(--fg); }
.sorthead:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
td .row { display: inline; padding: 0; width: auto; text-decoration: underline; color: var(--fg); }
caption { text-align: left; padding: 4px 8px; color: var(--dim); }
.tablenote { margin: 0; padding: 6px 8px 0; color: var(--dim); overflow-wrap: anywhere; }
.recent table { min-width: 0; }
.recent .firstseen { white-space: nowrap; }
.recent td a { color: var(--accent); }
.recent td a:visited { color: var(--accent); }
.recent td { overflow-wrap: anywhere; }

.about { padding: 4px 12px; max-width: 80ch; }
.about h2 { font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
.about p, .about li { overflow-wrap: anywhere; }
.empty { padding: 8px; color: var(--dim); overflow-wrap: anywhere; }
.ghsearch { padding-top: 0; }
.ghsearch p { margin: 0 0 6px; }

.outhead { display: flex; justify-content: space-between; margin-top: 8px; padding: 3px 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--dim); font-size: 0.85em; }
.out { max-height: 22vh; min-height: 3.2em; overflow: auto; border: 1px solid var(--line); border-radius: 0 0 6px 6px; padding: 4px 10px; }
/* Line numbers come from CSS content, so selecting and copying skips them. */
.out div { white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 5ch; text-indent: -5ch; }
.out div::before { content: attr(data-n); display: inline-block; width: 4ch; margin-right: 1ch; text-indent: 0; text-align: right; color: var(--dim); opacity: 0.7; user-select: none; -webkit-user-select: none; }
.out .dim { color: var(--dim); }
.out .error { color: var(--error); }
.out .ok { color: var(--accent); }
.out a, .ghsearch a { color: var(--accent); }

.prompt { display: flex; align-items: center; gap: 8px; margin-top: 8px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.prompt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.prompt label { white-space: nowrap; }
.prompt .sign { color: var(--accent); }
.prompt input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; caret-color: var(--accent); caret-shape: block; }
.prompt input::placeholder { color: var(--dim); opacity: 1; }

@media (max-width: 760px) {
  .row { grid-template-columns: auto 1fr; gap: 0 10px; }
  .row .sum { grid-column: 1 / -1; padding-left: 2ch; }
  .row .stars { grid-column: 1 / -1; padding-left: 2ch; text-align: left; color: var(--dim); }
  .row .stars::before { content: "stars "; }
  .row .game, .row .repo { grid-column: 1 / -1; }
  .colhead { display: none; }
  /* Recent view on a phone: each repository is a small grid. The first seen time breaks between
     date and clock, game and description go on their own lines, and the headings stick together. */
  .recent thead { position: sticky; top: 0; z-index: 2; background: var(--bar); border-bottom: 1px solid var(--line); }
  .recent tr { display: grid; grid-template-columns: 11ch minmax(0, 1fr) auto; gap: 0 8px; padding: 2px 8px; }
  .recent tbody tr { border-bottom: 1px solid var(--line); }
  .recent th { position: static; border: 0; box-shadow: none; padding: 0; }
  .recent td { padding: 0; min-width: 0; }
  .recent tr > :nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .recent .firstseen { white-space: normal; }
  .recent tr > :nth-child(2) { grid-column: 2 / -1; grid-row: 2; }
  .recent tr > :nth-child(3) { grid-column: 2; grid-row: 1; }
  .recent tr > :nth-child(4) { grid-column: 3; grid-row: 1; text-align: right; }
  .recent tr > :nth-child(5) { grid-column: 1 / -1; grid-row: 3; color: var(--dim); }
  .recent th:nth-child(5), .recent td.desc:empty { display: none; }
  /* The static list has six cells a row (repository, game, kind, first seen, last commit, stars), not the
     interactive table's five, so it is stacked as plain lines and each cell names itself. */
  .recent.static thead { display: none; }
  .recent.static tr { display: block; padding: 2px 8px; }
  .recent.static td { display: inline; padding: 0; margin-right: 1.5ch; color: var(--fg); }
  .recent.static td:nth-child(-n+2) { display: block; margin-right: 0; }
  .recent.static td[data-label]::before { content: attr(data-label) " "; color: var(--dim); }
  .view { max-height: 60vh; }
  .prompt input { font-size: 16px; }
  .term > :not(.titlebar) { margin-left: 12px; margin-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.lede { margin: 12px 0 0; color: var(--dim); overflow-wrap: anywhere; }
.links { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.links a { color: var(--accent); }
.links a:hover, .links a:focus-visible { background: var(--hover); }
