:root {
  --paper: #ece7dc;
  --paper-strong: #f8f5ed;
  --ink: #17201e;
  --muted: #69716c;
  --line: #d5d0c4;
  --teal: #0d655e;
  --teal-dark: #064941;
  --lime: #cde96c;
  --coral: #ec7357;
  --yellow: #f5c94b;
  --blue: #5da8d4;
  --shadow: 0 18px 45px rgba(24, 32, 30, 0.08);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Manrope, sans-serif;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 27px 18px 16px;
  background: #e2ddd1;
  border-right: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 35px;
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 3px;
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: var(--lime);
  border-radius: 7px;
}
.brand-mark svg {
  width: 18px;
}
.primary-nav {
  display: grid;
  gap: 4px;
}
.nav-item,
.system-link {
  display: flex;
  align-items: center;
  color: #4e5852;
  text-decoration: none;
  border: 0;
  background: none;
  text-align: left;
}
.nav-item {
  gap: 13px;
  padding: 10px 11px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}
.nav-item svg {
  width: 18px;
  stroke-width: 2;
}
.nav-item.active {
  color: var(--teal-dark);
  background: #d3e7b1;
}
.sidebar-section {
  margin-top: 38px;
}
.sidebar-label,
.eyebrow {
  margin: 0;
  color: #777a68;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
}
.sidebar-label {
  margin: 0 10px 12px;
}
.system-link {
  position: relative;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 12px;
}
.system-link:hover,
.system-link.is-selected {
  color: var(--teal-dark);
  background: #f0ede5;
}
.system-count {
  margin-left: auto;
  color: #858a82;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.system-symbol {
  width: 24px;
  height: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}
.all {
  color: #7b7d73;
  background: #c8c6bd;
  font-size: 15px;
}
.three-ds {
  background: var(--coral);
}
.ds {
  background: #778ba3;
}
.gba {
  background: #947bc4;
}
.gb {
  background: #7da460;
}
.snes {
  background: #c4758f;
}
.account-block {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 14px 8px 2px;
  border-top: 1px solid #cbc5b8;
}
.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  border-radius: 50%;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.account-name {
  display: grid;
  gap: 1px;
  font-size: 10px;
}
.account-name strong {
  font-size: 11px;
}
.account-name span {
  color: var(--muted);
}
.account-block .icon-button {
  margin-left: auto;
}

main {
  min-width: 0;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}
.breadcrumb,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb strong {
  color: var(--ink);
}
.breadcrumb svg {
  width: 14px;
}
.topbar-actions {
  gap: 8px;
}
.icon-button {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #45504a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
}
.icon-button:hover,
.icon-button.active {
  color: var(--teal-dark);
  background: var(--paper-strong);
  border-color: var(--line);
}
.icon-button svg {
  width: 17px;
}
.subtle {
  width: 27px;
  height: 27px;
}
.subtle svg {
  width: 15px;
}
.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  background: var(--coral);
  border-radius: 50%;
}
.mobile-menu {
  display: none;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 53px clamp(24px, 4vw, 64px) 30px;
}
.page-heading h1 {
  margin: 7px 0;
  font-family: Fraunces, serif;
  font-size: clamp(34px, 4vw, 49px);
  line-height: 1;
  letter-spacing: 0;
}
.lede {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.library-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #3e4a44;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.library-status small {
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.status-light {
  width: 8px;
  height: 8px;
  background: #74a447;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(116, 164, 71, 0.16);
}
.control-panel {
  padding: 0 clamp(24px, 4vw, 64px) 23px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(600px, 100%);
  height: 45px;
  padding: 0 12px;
  background: var(--paper-strong);
  border: 1px solid #ccc6b9;
  border-radius: 6px;
  box-shadow: 0 2px 3px rgba(20, 30, 25, 0.03);
}
.search-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 101, 94, 0.12);
}
.search-field svg {
  width: 18px;
  color: #66726c;
}
.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}
.search-field input::placeholder {
  color: #8c9189;
}
.search-field kbd {
  padding: 2px 6px;
  color: #747970;
  background: #e5e1d8;
  border: 1px solid #d5d0c5;
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}
.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 9px;
  color: #526059;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.filter-button:hover {
  color: var(--teal-dark);
  border-color: var(--teal);
}
.filter-button svg {
  width: 13px;
}
.filter-button svg:last-child {
  width: 12px;
}
.select-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 8px;
  color: #526059;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.select-filter:focus-within {
  color: var(--teal-dark);
  border-color: var(--teal);
}
.select-filter svg {
  width: 13px;
  pointer-events: none;
}
.select-filter select {
  min-width: 92px;
  padding: 0 17px 0 0;
  appearance: auto;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.result-count {
  margin-left: auto;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.feature-strip {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 20px;
  margin: 0 clamp(24px, 4vw, 64px) 38px;
  padding: 15px 20px 15px 15px;
  background: #c9dfe0;
  border: 1px solid #aac9c9;
  border-radius: 7px;
}
.feature-strip[hidden] {
  display: none;
}
.feature-illustration {
  position: relative;
  width: 75px;
  height: 65px;
  overflow: hidden;
  background: #e89066;
  border-radius: 4px;
}
.feature-illustration svg {
  position: absolute;
  z-index: 1;
  right: 12px;
  top: 15px;
  width: 27px;
  color: #fff4bb;
}
.pixel {
  position: absolute;
  display: block;
  width: 13px;
  height: 13px;
}
.p1 {
  background: #73435a;
  left: 8px;
  top: 11px;
}
.p2 {
  background: #f7df69;
  left: 22px;
  top: 25px;
}
.p3 {
  background: #dc5f57;
  left: 8px;
  top: 39px;
}
.p4 {
  background: #7c9e70;
  right: 4px;
  bottom: 9px;
}
.p5 {
  width: 7px;
  height: 7px;
  background: #fff4bb;
  left: 43px;
  top: 9px;
}
.feature-strip h2 {
  margin: 4px 0 3px;
  font-family: Fraunces, serif;
  font-size: 21px;
}
.feature-strip p:not(.eyebrow) {
  margin: 0;
  color: #40625f;
  font-size: 12px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.text-button svg {
  width: 15px;
}
.catalog-section {
  padding: 0 clamp(24px, 4vw, 64px) 70px;
}
.admin-guide-section {
  padding: 0 clamp(24px, 4vw, 64px) 70px;
}
.admin-guide-section[hidden] {
  display: none;
}
.admin-guide-content {
  max-width: 780px;
  padding: 24px 28px;
  background: var(--paper-strong);
  border: 1px solid #d1cbbe;
  border-radius: 8px;
}
.admin-guide-content h3 {
  margin: 28px 0 8px;
  font-family: Fraunces, serif;
  font-size: 18px;
}
.admin-guide-content h3:first-child {
  margin-top: 0;
}
.admin-guide-content h4 {
  margin: 18px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.admin-guide-content p,
.admin-guide-content li {
  font-size: 13px;
  line-height: 1.6;
}
.admin-guide-content ol,
.admin-guide-content ul {
  margin: 0 0 10px;
  padding-left: 20px;
}
.admin-guide-content code {
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
}
.admin-guide-content pre {
  margin: 8px 0 14px;
  padding: 12px 14px;
  overflow-x: auto;
  background: #17201e;
  color: #f4f1e8;
  border-radius: 6px;
}
.admin-guide-content pre code {
  padding: 0;
  background: none;
  color: inherit;
}
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-bar h2 {
  margin: 0;
  font-family: Fraunces, serif;
  font-size: 24px;
}
.section-bar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.view-switcher {
  display: flex;
  gap: 3px;
}
.view-switcher .icon-button {
  width: 30px;
  height: 30px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(13px, 1.8vw, 22px);
}
.game-grid.view-compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.view-compact .cover-title {
  font-size: 10px;
}
.view-compact .cover-label {
  display: none;
}
.view-compact .card-info {
  padding-top: 7px;
}
.view-compact .card-meta {
  display: none;
}
.game-grid.view-list {
  grid-template-columns: 1fr;
  gap: 9px;
}
.view-list .game-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 8px;
  background: var(--paper-strong);
  border: 2px solid var(--line);
}
.view-list .cover {
  min-height: 112px;
  box-shadow: none;
}
.view-list .cover-title {
  font-size: 10px;
}
.view-list .card-info {
  padding-top: 0;
}
.view-list .card-title {
  font-size: 14px;
}
.view-list .card-meta {
  margin-top: 7px;
  font-size: 10px;
}
.game-card {
  min-width: 0;
  animation: card-in 430ms both;
}
.game-card:nth-child(2) {
  animation-delay: 45ms;
}
.game-card:nth-child(3) {
  animation-delay: 90ms;
}
.game-card:nth-child(4) {
  animation-delay: 135ms;
}
.game-card:nth-child(5) {
  animation-delay: 180ms;
}
.game-card:nth-child(6) {
  animation-delay: 225ms;
}
.game-card:nth-child(7) {
  animation-delay: 270ms;
}
.game-card:nth-child(8) {
  animation-delay: 315ms;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: flex;
  align-items: end;
  padding: 11px;
  isolation: isolate;
  border-radius: 5px;
  box-shadow: 0 7px 12px rgba(23, 32, 30, 0.12);
}
.card-open {
  width: 100%;
  border: 0;
  text-align: left;
}
.card-open:hover {
  transform: translateY(-2px);
}
.cover::before,
.cover::after {
  position: absolute;
  content: "";
  pointer-events: none;
}
.cover::before {
  inset: 8px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.cover::after {
  z-index: -2;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 8px,
    rgba(255, 255, 255, 0.08) 8px 9px
  );
}
.cover-art {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.cover .cover-art.has-cover {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.cover-title {
  max-width: 100%;
  color: white;
  font-family: Fraunces, serif;
  font-size: clamp(19px, 2.3vw, 30px);
  font-weight: 700;
  line-height: 0.92;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  overflow-wrap: anywhere;
}
.cover-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 5px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.5px;
}
.card-info {
  padding-top: 10px;
}
.card-title-line {
  display: flex;
  align-items: start;
  gap: 5px;
}
.card-title {
  flex: 1;
  margin: 0;
  overflow: hidden;
  color: #24302c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-details {
  width: 21px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #6a756e;
  opacity: 0;
  background: transparent;
  border: 0;
}
.game-card:hover .card-details {
  opacity: 1;
}
.card-details svg {
  width: 15px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 0;
}
.system-tag {
  padding: 2px 6px;
  color: #fff;
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}
.system-tag.gbc {
  background: #4f8f7a;
}
.system-tag.other {
  color: #4a4f49;
  background: #d8d5c9;
}
.title-tag {
  padding: 2px 6px;
  color: #fff;
  background: #8a5cb8;
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}
.empty-state {
  padding: 34px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.collection-wave {
  background: linear-gradient(145deg, #116d67, #123d45);
}
.collection-wave::before {
  border-radius: 45% 55% 20% 35%;
  border: 12px solid #d9ed70;
  transform: rotate(-15deg) translate(35px, -18px);
}
.collection-wave::after {
  background:
    radial-gradient(circle at 70% 20%, #e97859 0 4%, transparent 5%),
    radial-gradient(circle at 33% 64%, #75b7d6 0 11%, transparent 12%);
}
.cover-amber {
  background: #dd673f;
}
.cover-amber .cover-art {
  background:
    linear-gradient(
      145deg,
      transparent 48%,
      rgba(83, 31, 39, 0.68) 49% 52%,
      transparent 53%
    ),
    radial-gradient(ellipse at 65% 35%, #f6cd61 0 17%, transparent 18%);
}
.cover-lime {
  background: #789f64;
}
.cover-lime .cover-art {
  background:
    linear-gradient(110deg, transparent 42%, #3d6e59 43% 55%, transparent 56%),
    radial-gradient(circle at 77% 27%, #f2e799 0 11%, transparent 12%);
}
.cover-blue {
  background: #4b88a5;
}
.cover-blue .cover-art {
  background:
    repeating-linear-gradient(
      150deg,
      transparent 0 13px,
      rgba(228, 245, 238, 0.48) 14px 16px
    ),
    radial-gradient(circle at 30% 74%, #f0d65d 0 11%, transparent 12%);
}
.cover-coral {
  background: #cc666a;
}
.cover-coral .cover-art {
  background: radial-gradient(
    circle at 50% 49%,
    #f4c656 0 20%,
    #a24a5a 21% 36%,
    transparent 37%
  );
}
.cover-purple {
  background: #77669e;
}
.cover-purple .cover-art {
  background:
    linear-gradient(45deg, transparent 40%, #baa9df 41% 46%, transparent 47%),
    radial-gradient(circle at 67% 25%, #f6d66b 0 9%, transparent 10%);
}
.cover-night {
  background: #2d5963;
}
.cover-night .cover-art {
  background:
    radial-gradient(circle at 68% 25%, #d8e76b 0 8%, transparent 9%),
    linear-gradient(160deg, transparent 55%, #101f3a 56%);
}
.selection-bar {
  position: fixed;
  z-index: 10;
  bottom: 24px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 9px 8px 13px;
  color: #edf5ed;
  background: #173c38;
  border: 1px solid #305a54;
  border-radius: 7px;
  box-shadow: 0 18px 42px rgba(15, 39, 35, 0.28);
  transform: translateX(-50%);
  font-size: 12px;
}
.selection-bar[hidden] {
  display: none;
}
.selection-bar strong {
  color: var(--lime);
}
.selection-size {
  padding-left: 10px;
  color: #b6c5bd;
  border-left: 1px solid #466963;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.selection-clear {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #dce9df;
  background: transparent;
  border: 0;
  border-radius: 3px;
}
.selection-clear:hover {
  background: #315b54;
}
.selection-clear svg {
  width: 15px;
}
.batch-download,
.copy-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: #173c38;
  background: var(--lime);
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}
.batch-download svg,
.copy-link svg {
  width: 15px;
}
dialog {
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid #d1cbbe;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(14, 28, 27, 0.58);
  backdrop-filter: blur(3px);
}
.details-modal {
  width: min(670px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
}
.details-modal > div {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 26px;
  padding: 30px;
}
.modal-cover {
  min-height: 265px;
}
.details-copy {
  padding: 3px 0;
}
.details-copy h2,
.qr-modal h2 {
  margin: 8px 0 7px;
  font-family: Fraunces, serif;
  font-size: 30px;
  line-height: 1;
}
.details-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 0;
}
.based-on-link {
  margin: 10px 0 0;
  white-space: normal;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 23px 0;
}
.meta-grid span {
  display: block;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}
.meta-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.release-list {
  display: grid;
  gap: 7px;
}
.release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 8px 9px 10px;
  background: #eeebe3;
  border: 1px solid #d8d2c6;
  border-radius: 4px;
}
.release-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.release-info strong {
  font-size: 11px;
}
.release-info span {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}
.release-actions {
  display: flex;
  gap: 3px;
}
.release-button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--teal-dark);
  background: #f9f7f1;
  border: 1px solid #d3cec2;
  border-radius: 3px;
}
.release-button:hover,
.release-button.selected {
  background: var(--lime);
  border-color: #b4ce59;
}
.release-button.download {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}
.release-button svg {
  width: 14px;
}
.download-row {
  display: flex;
  gap: 7px;
}
.download-main {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: white;
  background: var(--teal);
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}
.download-main svg {
  width: 15px;
}
.qr-button {
  width: 37px;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: #d7e9ba;
  border: 0;
  border-radius: 4px;
}
.qr-button svg {
  width: 18px;
}
.modal-close {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  background: rgba(255, 255, 255, 0.6);
}
.qr-modal {
  width: min(345px, calc(100% - 32px));
  padding: 34px;
  text-align: center;
}
.qr-modal p:last-of-type {
  max-width: 220px;
  margin: 15px auto 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.qr-code {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 24px auto 0;
  background-color: white;
  background-image:
    linear-gradient(
      90deg,
      #1d302c 12%,
      transparent 12% 24%,
      #1d302c 24% 34%,
      transparent 34% 44%,
      #1d302c 44% 52%,
      transparent 52% 60%,
      #1d302c 60% 72%,
      transparent 72% 84%,
      #1d302c 84%
    ),
    linear-gradient(
      #1d302c 11%,
      transparent 11% 20%,
      #1d302c 20% 33%,
      transparent 33% 44%,
      #1d302c 44% 55%,
      transparent 55% 64%,
      #1d302c 64% 75%,
      transparent 75% 85%,
      #1d302c 85%
    );
  background-size: 17px 17px;
  border: 11px solid white;
  box-shadow: 0 0 0 1px #d5d0c4;
}
.qr-code span {
  position: absolute;
  width: 39px;
  height: 39px;
  background: white;
  border: 7px solid #1d302c;
  outline: 5px solid white;
}
.qr-code span::after {
  position: absolute;
  content: "";
  inset: 7px;
  background: #1d302c;
}
.qr-code span:nth-child(1) {
  top: 0;
  left: 0;
}
.qr-code span:nth-child(2) {
  top: 0;
  right: 0;
}
.qr-code span:nth-child(3) {
  bottom: 0;
  left: 0;
}
.copy-link {
  margin: auto;
  color: white;
  background: var(--teal);
}
.login-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 28, 22, 0.88);
  backdrop-filter: blur(4px);
}
.login-screen[hidden] {
  display: none;
}
.login-panel {
  width: min(390px, 100%);
  display: grid;
  gap: 15px;
  padding: 30px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}
.login-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--lime);
  background: var(--teal);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--coral);
}
.login-mark svg {
  width: 23px;
}
.login-panel h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 20px;
  line-height: 1.4;
}
.login-panel label {
  display: grid;
  gap: 6px;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}
.login-panel input {
  height: 40px;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 0;
  outline: 0;
}
.login-panel input:focus {
  border-color: var(--coral);
  box-shadow: 3px 3px 0 var(--coral);
}
.login-error {
  min-height: 16px;
  margin: -5px 0 0;
  color: #b53c2a;
  font-size: 10px;
}
.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  color: #17251e;
  background: var(--lime);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}
.login-submit svg {
  width: 15px;
}
.edit-title-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 6px 8px;
  color: var(--teal-dark);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}
.edit-title-button:hover {
  color: var(--ink);
  background: var(--lime);
}
.edit-title-button svg {
  width: 13px;
}
.editor-modal {
  width: min(590px, calc(100% - 32px));
  padding: 0;
}
.title-editor {
  display: grid;
  gap: 15px;
  padding: 31px;
}
.title-editor h2 {
  max-width: calc(100% - 42px);
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  line-height: 1.5;
}
.title-editor label {
  display: grid;
  gap: 6px;
}
.title-editor label > span {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  font-weight: 700;
}
.title-editor input,
.title-editor textarea,
.title-editor select {
  width: 100%;
  min-height: 38px;
  padding: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  outline: 0;
  font-family: "Space Mono", monospace;
  font-size: 11px;
}
.title-editor textarea {
  min-height: 95px;
  resize: vertical;
}
.title-editor input:focus,
.title-editor textarea:focus,
.title-editor select:focus {
  border-color: var(--coral);
  box-shadow: 3px 3px 0 var(--coral);
}
.editor-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.editor-error {
  min-height: 15px;
  margin: -6px 0 0;
  color: #b53c2a;
  font-size: 10px;
}
.release-file {
  margin: -6px 0 0;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
}
.editor-subheading {
  margin: 4px 0 -6px;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.editor-releases {
  display: grid;
  gap: 10px;
  max-height: 260px;
  padding-right: 2px;
  overflow-y: auto;
}
.editor-release-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: var(--paper-strong);
  border: 2px solid var(--line);
}
.editor-release-row .release-file {
  margin: 0;
}
.editor-release-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.editor-release-fields label {
  display: grid;
  gap: 4px;
}
.editor-release-fields label > span {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 8px;
  font-weight: 700;
}
.editor-release-fields input {
  width: 100%;
  min-height: 32px;
  padding: 6px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  outline: 0;
  font-family: "Space Mono", monospace;
  font-size: 10px;
}
.editor-release-fields input:focus {
  border-color: var(--coral);
  box-shadow: 3px 3px 0 var(--coral);
}
.editor-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  color: #17251e;
  background: var(--lime);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}
.editor-save svg {
  width: 14px;
}
.editor-merge-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.editor-merge-row select {
  width: 100%;
  min-height: 38px;
  padding: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  outline: 0;
  font-family: "Space Mono", monospace;
  font-size: 11px;
}
.editor-merge-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--coral);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.editor-merge-button svg {
  width: 13px;
}
.toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  max-width: min(350px, calc(100vw - 44px));
  padding: 11px 14px;
  color: #fff;
  background: #173c38;
  border-radius: 5px;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 12px;
  }
  .feature-strip {
    grid-template-columns: 75px 1fr;
  }
  .feature-strip .text-button {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }
}
@media (max-width: 720px) {
  .site-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 30;
    width: 264px;
    max-width: calc(100vw - 42px);
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu {
    display: inline-grid;
  }
  .topbar {
    height: 57px;
    padding: 0 16px;
  }
  .breadcrumb {
    display: none;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .page-heading {
    align-items: start;
    padding: 37px 20px 22px;
  }
  .library-status {
    display: none;
  }
  .control-panel {
    padding: 0 20px 19px;
  }
  .result-count {
    width: 100%;
    margin: 4px 0 0;
  }
  .feature-strip {
    grid-template-columns: 64px 1fr;
    gap: 13px;
    margin: 0 20px 31px;
    padding: 12px;
  }
  .feature-illustration {
    width: 64px;
    height: 59px;
  }
  .feature-strip h2 {
    font-size: 18px;
  }
  .feature-strip p:not(.eyebrow) {
    font-size: 10px;
  }
  .catalog-section {
    padding: 0 20px 60px;
  }
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 13px;
  }
  .game-grid.view-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .view-list .game-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 6px;
  }
  .view-list .cover {
    min-height: 96px;
  }
  .card-details {
    opacity: 1;
  }
  .details-modal > div {
    grid-template-columns: 125px 1fr;
    gap: 16px;
    padding: 22px;
  }
  .modal-cover {
    min-height: 174px;
  }
  .details-copy h2 {
    font-size: 23px;
  }
  .meta-grid {
    gap: 10px;
    margin: 15px 0;
  }
  .release-row {
    align-items: flex-start;
  }
  .selection-bar {
    bottom: 14px;
    width: calc(100% - 28px);
    gap: 8px;
  }
  .selection-size {
    display: none;
  }
  .batch-download {
    margin-left: auto;
  }
  .cover-title {
    font-size: 22px;
  }
}
@media (max-width: 390px) {
  .feature-strip {
    grid-template-columns: 1fr;
  }
  .feature-illustration {
    display: none;
  }
  .feature-strip .text-button {
    grid-column: 1;
  }
  .filter-row {
    gap: 5px;
  }
  .filter-button {
    padding: 0 6px;
  }
  .filter-button span {
    font-size: 10px;
  }
  .details-modal > div {
    grid-template-columns: 1fr;
  }
  .game-grid.view-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-cover {
    display: flex;
    min-height: 210px;
    max-height: 260px;
  }
}

/* Retro terminal skin */
:root {
  --paper: #ded3b3;
  --paper-strong: #f6efcf;
  --ink: #17251e;
  --muted: #596559;
  --line: #1d3027;
  --teal: #136d63;
  --teal-dark: #123e35;
  --lime: #c8ee62;
  --coral: #ed6b43;
  --yellow: #f5bf3a;
  --blue: #3a91b7;
  --shadow: 5px 5px 0 #1a2c24;
}

body {
  font-family: "Space Mono", monospace;
  background-color: var(--paper);
  background-image: radial-gradient(
    rgba(33, 53, 42, 0.16) 0.75px,
    transparent 0.9px
  );
  background-size: 5px 5px;
}

.sidebar {
  background: #20342c;
  border-right: 4px solid #101d18;
  box-shadow: inset -1px 0 #7fa078;
}

.brand {
  color: #f5e8bc;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  letter-spacing: 0;
}

.brand-mark {
  border: 2px solid #f5e8bc;
  border-radius: 0;
  box-shadow: 3px 3px 0 #0b1813;
}

.nav-item,
.system-link {
  color: #bdc9ac;
  border-radius: 0;
  font-family: "Space Mono", monospace;
}

.nav-item.active,
.nav-item:hover,
.system-link:hover,
.system-link.is-selected {
  color: #17251e;
  background: var(--lime);
  box-shadow: inset 4px 0 #ed6b43;
}

.sidebar-label,
.eyebrow {
  color: #a8be8a;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0;
}

.system-count {
  color: #90a995;
}

.system-symbol,
.avatar {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
}

.account-block {
  color: #dce8ca;
  border-top-color: #55705d;
}

.account-name span {
  color: #9fb69d;
}

.topbar {
  height: 64px;
  background: #f6efcf;
  border-bottom: 3px solid #1d3027;
}

.breadcrumb {
  font-family: "Space Mono", monospace;
  font-size: 11px;
}

.icon-button,
.filter-button {
  border-color: #75806e;
  border-radius: 0;
}

.icon-button:hover,
.icon-button.active,
.filter-button:hover {
  color: #17251e;
  background: var(--lime);
  border-color: #17251e;
  box-shadow: 2px 2px 0 #17251e;
}

.page-heading {
  position: relative;
  padding-top: 46px;
}

.page-heading::after {
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: 16px;
  width: 34%;
  max-width: 330px;
  height: 7px;
  content: "";
  background: repeating-linear-gradient(
    90deg,
    #ed6b43 0 12px,
    #f5bf3a 12px 24px,
    #136d63 24px 36px
  );
}

.page-heading h1,
.feature-strip h2,
.section-bar h2,
.details-copy h2,
.qr-modal h2 {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: 34px;
  line-height: 1.28;
}

.lede {
  max-width: 540px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
}

.library-status {
  position: relative;
  z-index: 1;
  padding: 7px 9px;
  color: #d9f5b8;
  background: #20342c;
  border: 2px solid #17251e;
  box-shadow: 3px 3px 0 #ed6b43;
}

.library-status small {
  color: #aac19e;
  border-left-color: #55705d;
}

.status-light {
  border-radius: 0;
  box-shadow: 2px 2px 0 #0b1813;
}

.search-field {
  height: 48px;
  background: #f6efcf;
  border: 2px solid #1d3027;
  border-radius: 0;
  box-shadow: 4px 4px 0 #1d3027;
}

.search-field:focus-within {
  border-color: #ed6b43;
  box-shadow: 4px 4px 0 #ed6b43;
}

.search-field input,
.filter-button,
.result-count {
  font-family: "Space Mono", monospace;
}

.search-field kbd {
  color: #f5e8bc;
  background: #20342c;
  border-color: #20342c;
  border-radius: 0;
}

.filter-button {
  background: #f6efcf;
  border-color: #1d3027;
  box-shadow: 2px 2px 0 #1d3027;
}

.feature-strip {
  position: relative;
  overflow: hidden;
  background: #f5bf3a;
  border: 3px solid #1d3027;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.feature-strip::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image: repeating-linear-gradient(
    45deg,
    #fff 0 1px,
    transparent 1px 7px
  );
}

.feature-strip > * {
  position: relative;
  z-index: 1;
}

.feature-illustration {
  border: 3px solid #1d3027;
  border-radius: 0;
  box-shadow: 3px 3px 0 #1d3027;
}

.feature-strip h2 {
  font-size: 15px;
  line-height: 1.4;
}

.feature-strip p:not(.eyebrow) {
  color: #394535;
  font-family: "Space Mono", monospace;
  font-size: 10px;
}

.text-button {
  padding: 8px 9px;
  color: #f6efcf;
  background: #20342c;
  border: 2px solid #1d3027;
  border-radius: 0;
  box-shadow: 3px 3px 0 #ed6b43;
}

.text-button:hover {
  color: #17251e;
  background: var(--lime);
}

.section-bar h2 {
  font-size: 17px;
  line-height: 1.45;
}

.section-bar p,
.card-meta {
  font-family: "Space Mono", monospace;
}

.cover {
  border: 3px solid #1d3027;
  border-radius: 0;
  box-shadow: 4px 4px 0 #1d3027;
}

.card-open:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #ed6b43;
}

.cover::before {
  border-width: 2px;
  border-radius: 0;
}

.cover-title {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  line-height: 1.2;
}

.cover-label {
  border-radius: 0;
  font-family: "Space Mono", monospace;
}

.card-title {
  font-family: "Space Mono", monospace;
  font-size: 11px;
}

.card-details {
  color: #20342c;
}

.selection-bar {
  border: 3px solid #0b1813;
  border-radius: 0;
  box-shadow: 5px 5px 0 #ed6b43;
}

dialog {
  background: #f6efcf;
  border: 3px solid #17251e;
  border-radius: 0;
  box-shadow: 7px 7px 0 #ed6b43;
}

.details-copy h2,
.qr-modal h2 {
  font-size: 20px;
  line-height: 1.35;
}

.release-row {
  background: #e4dbbd;
  border: 2px solid #1d3027;
  border-radius: 0;
}

.release-button,
.batch-download,
.copy-link,
.qr-button,
.download-main {
  border: 2px solid #1d3027;
  border-radius: 0;
  box-shadow: 2px 2px 0 #1d3027;
}

.release-button.download,
.download-main,
.copy-link {
  background: #136d63;
}

.qr-code {
  border-radius: 0;
}

@media (max-width: 720px) {
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading::after {
    display: none;
  }
  .feature-strip h2 {
    font-size: 12px;
  }
  .cover-title {
    font-size: 12px;
  }
}

:root[data-theme="dark"] {
  --paper: #111b17;
  --paper-strong: #1a2821;
  --ink: #edf6d2;
  --muted: #aab99d;
  --line: #a7c57d;
  --teal: #38a991;
  --teal-dark: #d9f7b7;
  --lime: #c8ee62;
  --coral: #ff845d;
  --yellow: #ffc947;
  --blue: #61bddd;
  --shadow: 5px 5px 0 #030705;
}

:root[data-theme="dark"] body {
  background-color: var(--paper);
  background-image: radial-gradient(
    rgba(222, 241, 185, 0.13) 0.75px,
    transparent 0.9px
  );
}

:root[data-theme="dark"] .sidebar {
  background: #0b130f;
  border-right-color: #050a07;
  box-shadow: inset -1px 0 #42614b;
}

:root[data-theme="dark"] .brand {
  color: #eaf4ca;
}

:root[data-theme="dark"] .brand-mark {
  background: #174c42;
  border-color: #c8ee62;
  box-shadow: 3px 3px 0 #030705;
}

:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .system-link {
  color: #b9c9ae;
}

:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .system-link:hover,
:root[data-theme="dark"] .system-link.is-selected {
  color: #13231b;
  background: var(--lime);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .search-field,
:root[data-theme="dark"] .filter-button,
:root[data-theme="dark"] dialog {
  background: #17251f;
  border-color: #91ae70;
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: #91ae70;
}

:root[data-theme="dark"] .icon-button {
  color: #c5d8b2;
  border-color: #50684f;
}

:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .icon-button.active,
:root[data-theme="dark"] .filter-button:hover {
  color: #13231b;
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 2px 2px 0 #030705;
}

:root[data-theme="dark"] .breadcrumb strong,
:root[data-theme="dark"] .card-title {
  color: var(--ink);
}

:root[data-theme="dark"] .page-heading::after {
  background: repeating-linear-gradient(
    90deg,
    #ff845d 0 12px,
    #ffc947 12px 24px,
    #38a991 24px 36px
  );
}

:root[data-theme="dark"] .library-status {
  color: #d9f7b7;
  background: #0b130f;
  border-color: #91ae70;
  box-shadow: 3px 3px 0 #ff845d;
}

:root[data-theme="dark"] .feature-strip {
  background: #864e1f;
  border-color: #ffc947;
  box-shadow: 5px 5px 0 #030705;
}

:root[data-theme="dark"] .feature-strip h2 {
  color: #fff0b2;
}

:root[data-theme="dark"] .feature-strip p:not(.eyebrow) {
  color: #f8db9e;
}

:root[data-theme="dark"] .feature-illustration,
:root[data-theme="dark"] .cover,
:root[data-theme="dark"] .release-row {
  border-color: #dcebbb;
  box-shadow: 4px 4px 0 #030705;
}

:root[data-theme="dark"] .release-row {
  background: #21352b;
}

:root[data-theme="dark"] .release-button {
  color: #d9f7b7;
  background: #122017;
  border-color: #73966c;
  box-shadow: none;
}

:root[data-theme="dark"] .release-button.download,
:root[data-theme="dark"] .download-main,
:root[data-theme="dark"] .copy-link {
  color: #ecf8d6;
  background: #246f60;
  border-color: #a4ce89;
}

:root[data-theme="dark"] .release-button:hover,
:root[data-theme="dark"] .release-button.selected {
  color: #13231b;
  background: var(--lime);
  border-color: var(--lime);
}

:root[data-theme="dark"] .login-panel {
  background: #17251f;
  border-color: #91ae70;
}

:root[data-theme="dark"] .login-panel input {
  border-color: #91ae70;
}

:root[data-theme="dark"] .title-editor input,
:root[data-theme="dark"] .title-editor textarea,
:root[data-theme="dark"] .title-editor select {
  background: #122017;
  border-color: #91ae70;
}

@media (max-width: 480px) {
  .title-editor {
    padding: 24px 19px;
  }
  .editor-two-columns {
    grid-template-columns: 1fr;
  }
  .editor-release-fields {
    grid-template-columns: 1fr 1fr;
  }
}
