:root {
  --desktop: #397f82;
  --navy: #00006b;
  --navy-dark: #000044;
  --cyan: #00d9df;
  --red: #e60012;
  --window: #c6c6c6;
  --window-light: #ededed;
  --window-shadow: #7e7e7e;
  --ink: #090909;
  --muted: #404040;
  --row-a: #ffffff;
  --row-b: #dcebec;
  --row-hover: #fff4c3;
  --focus: #ffef00;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--desktop);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 4px),
    var(--desktop);
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.window {
  width: min(calc(100% - 28px), 1560px);
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  background: var(--window);
  border: 2px solid;
  border-color: #fff #292929 #292929 #fff;
  box-shadow: 2px 2px 0 #111;
}

.titlebar {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 4px 3px 5px;
  color: #fff;
  background: linear-gradient(90deg, var(--navy-dark), var(--navy) 64%, #1b74a5);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  border-bottom: 3px solid var(--red);
}

.titlebar-logo {
  width: 18px;
  height: 18px;
  margin-right: 7px;
  object-fit: cover;
  background: #000;
  border: 1px solid #fff;
  image-rendering: pixelated;
}

.titlebar-controls {
  display: flex;
  gap: 3px;
  margin-left: auto;
}

.titlebar-control {
  display: grid;
  place-items: center;
  width: 20px;
  height: 19px;
  color: #000;
  background: var(--window);
  border: 2px solid;
  border-color: #fff #454545 #454545 #fff;
  font: 700 12px/12px Arial, sans-serif;
  text-shadow: none;
}

.masthead {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 100px;
  padding: 11px 18px;
  color: #fff;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(0, 217, 223, .055) 10px 12px),
    var(--navy-dark);
  border-top: 1px solid #101010;
  border-bottom: 5px solid var(--cyan);
}

.archive-icon-frame {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.archive-icon {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  image-rendering: pixelated;
}

.masthead-copy { min-width: 0; }

.masthead h1 {
  margin: 0 0 4px;
  color: #fff;
  font: 700 clamp(27px, 3vw, 44px)/1 Tahoma, Verdana, Arial, sans-serif;
  letter-spacing: -.035em;
  text-shadow: 2px 2px 0 #000;
}

.subtitle {
  margin: 0;
  color: var(--cyan);
  font: 700 clamp(13px, 1.5vw, 18px)/1.25 Verdana, Tahoma, sans-serif;
  letter-spacing: .01em;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 9px;
  background: var(--window);
  border-bottom: 1px solid #727272;
}

.toolbar-label { font-weight: 700; }

.search-input {
  width: min(620px, 70vw);
  height: 27px;
  padding: 3px 7px;
  color: #000;
  background: #fff;
  border: 2px solid;
  border-color: #404040 #fff #fff #404040;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 #000;
}

.search-input::placeholder {
  color: #606060;
  opacity: 1;
}

.toolbar-status {
  margin-left: auto;
  color: #282828;
  font-size: 11px;
  white-space: nowrap;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  min-height: 730px;
}

.sidebar {
  min-width: 0;
  padding: 10px;
  background: #b9b9b9;
  border-right: 1px solid #686868;
}

.sidebar-inner {
  position: sticky;
  top: 8px;
}

.group-box {
  position: relative;
  margin: 8px 0 16px;
  padding: 15px 8px 9px;
  border: 2px groove #fff;
}

.group-title {
  position: absolute;
  top: -9px;
  left: 8px;
  margin: 0;
  padding: 0 5px;
  color: #000;
  background: #b9b9b9;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.category-list,
.related-links,
.extension-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-list {
  display: grid;
  gap: 3px;
}

.category-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  color: #000;
  background: #d5d5d5;
  border: 1px solid transparent;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.category-button:hover {
  background: #fff;
  border-color: #777;
}

.category-button[aria-pressed="true"] {
  color: #fff;
  background: var(--navy);
  border-color: #000;
}

.category-count {
  min-width: 26px;
  padding: 1px 4px;
  color: inherit;
  background: rgba(255, 255, 255, .2);
  font: 700 10px/1.35 "Courier New", monospace;
  text-align: right;
}

.about-copy {
  margin: 0;
  color: #171717;
  font-size: 11px;
  line-height: 1.45;
}

.about-copy a,
.contribution-copy a {
  color: #00006f;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-copy a:hover,
.contribution-copy a:hover { color: var(--red); }

.contribution-copy {
  margin: 8px 0 0;
  padding-top: 8px;
  color: #303030;
  border-top: 1px dotted #777;
  font-size: 11px;
  line-height: 1.45;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.discord-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.path {
  font-family: "Courier New", monospace;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.related-links {
  display: grid;
  gap: 8px;
}

.related-links a {
  color: #00006f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.related-links a:hover { color: var(--red); }

.related-link-with-icon {
  display: flex;
  align-items: center;
  gap: 7px;
}

.related-logo {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.catalog-main {
  min-width: 0;
  padding: 9px;
  background: #a8a8a8;
}

.install-notice {
  margin-bottom: 6px;
  padding: 6px 8px;
  color: #181818;
  background: #dcebec;
  border: 1px solid #626f70;
  border-left: 4px solid var(--red);
  font-size: 11px;
  line-height: 1.4;
}

.install-notice strong { color: var(--navy-dark); }

.complete-archive-notice {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  color: #252525;
  background: #c6c6c6;
  border: 1px solid #696969;
  font-size: 11px;
  line-height: 1.4;
}

.complete-archive-notice strong { color: var(--navy-dark); }

.complete-archive-link {
  color: #00006f;
  font: 700 13px/1.3 "Courier New", monospace;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.complete-archive-link:hover { color: #b00000; }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 46px;
  padding: 6px 8px;
  background: var(--window);
  border: 1px solid;
  border-color: #d6d6d6 #626262 #626262 #d6d6d6;
}

.list-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.list-heading h2 {
  margin: 0;
  color: var(--navy-dark);
  font: 700 16px/1.2 Tahoma, Verdana, sans-serif;
}

.result-count {
  color: #4a4a4a;
  font-size: 10px;
  text-transform: none;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.sort-select {
  min-width: 148px;
  height: 27px;
  padding: 2px 4px;
  color: #000;
  background: #fff;
  border: 2px solid;
  border-color: #555 #fff #fff #555;
  border-radius: 0;
}

.extension-list {
  border: 2px solid;
  border-color: #4a4a4a #cecece #cecece #4a4a4a;
}

.extension-row {
  display: grid;
  grid-template-columns: 38px minmax(270px, 1fr) minmax(110px, 150px) minmax(130px, 170px) 126px;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 9px 10px;
  border-top: 1px solid #728082;
}

.extension-row:first-child { border-top: 0; }
.extension-row:nth-child(odd) { background: var(--row-a); }
.extension-row:nth-child(even) { background: var(--row-b); }
.extension-row:hover { background: var(--row-hover); }

.extension-icon-image,
.extension-icon-placeholder {
  display: block;
  width: 32px;
  height: 32px;
}

.extension-icon-image {
  object-fit: contain;
  image-rendering: pixelated;
}

.extension-icon-placeholder {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--navy);
  border: 2px solid;
  border-color: #fff #202020 #202020 #fff;
  font: 700 8px/1 "Courier New", monospace;
}

.extension-copy { min-width: 0; }

.extension-name {
  margin: 0 0 4px;
  color: #00004c;
  font: 700 14px/1.2 Verdana, Tahoma, sans-serif;
}

.extension-version {
  color: #3a3a3a;
  font-size: 11px;
  font-weight: 400;
}

.extension-description {
  margin: 0;
  color: #202020;
  font-size: 11px;
  line-height: 1.38;
}

.meta-cell {
  min-width: 0;
  color: #111;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.meta-label {
  display: block;
  margin-bottom: 3px;
  color: #505050;
  font: 700 9px/1 "Courier New", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.author-link {
  color: #00006f;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.author-link:hover { color: var(--red); }

.category-tag {
  display: block;
  max-width: 100%;
  padding: 0;
  color: #202020;
  background: transparent;
  border: 0;
  font: 400 11px/1.3 Tahoma, Verdana, sans-serif;
  text-transform: none;
}

.file-link {
  justify-self: start;
  max-width: 100%;
  color: #00006f;
  font: 700 13px/1.3 "Courier New", monospace;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-link:hover { color: #b00000; }

.unavailable-file {
  display: grid;
  gap: 3px;
  justify-self: start;
  max-width: 145px;
}

.unavailable-label {
  color: #b00000;
  font: 700 13px/1.2 Tahoma, Verdana, sans-serif;
}

.unavailable-help {
  color: #444;
  font-size: 9px;
  line-height: 1.35;
}

.unavailable-help a {
  color: #00006f;
  font-weight: 700;
  text-decoration: underline;
}

.unavailable-help a:hover { color: #b00000; }

.empty-state {
  padding: 70px 20px;
  color: #303030;
  background: #fff;
  border: 2px solid;
  border-color: #4a4a4a #fff #fff #4a4a4a;
  text-align: center;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 7px;
  padding: 5px 7px;
  color: #242424;
  background: var(--window);
  border: 2px solid;
  border-color: #777 #cecece #cecece #777;
  font-size: 9px;
  line-height: 1.3;
}

@media (max-width: 1120px) {
  .catalog-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .extension-row { grid-template-columns: 38px minmax(250px, 1fr) 125px 120px; }
  .meta-category { display: none; }
}

@media (max-width: 820px) {
  .window {
    width: min(calc(100% - 12px), 1560px);
    min-height: calc(100vh - 12px);
    margin: 6px auto;
  }

  .toolbar-status { display: none; }
  .search-input { width: 100%; }
  .catalog-layout { display: block; }

  .sidebar {
    border-right: 0;
    border-bottom: 2px solid #555;
  }

  .sidebar-inner { position: static; }

  .category-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .category-button {
    display: flex;
    width: auto;
    min-width: max-content;
  }

  .sidebar .group-box:not(:first-child) { display: none; }
  .extension-row { grid-template-columns: 38px minmax(0, 1fr) 118px; }
  .meta-author,
  .meta-category { display: none; }
}

@media (max-width: 560px) {
  .titlebar-control { width: 18px; }

  .masthead {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    min-height: 76px;
    padding: 9px 11px;
  }

  .archive-icon-frame,
  .archive-icon {
    width: 52px;
    height: 52px;
  }

  .masthead h1 { font-size: 23px; }
  .subtitle { font-size: 11px; }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 3px;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .sort-control { justify-content: space-between; }
  .sort-select { width: min(230px, 72vw); }

  .extension-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 10px 8px;
  }

  .file-link {
    grid-column: 2;
    margin-top: -4px;
  }

  .unavailable-file {
    grid-column: 2;
    max-width: none;
    margin-top: -4px;
  }

  .statusbar {
    flex-direction: column;
    gap: 3px;
  }
}
