@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Press+Start+2P&display=swap");
:root {
  --bg: #080a0f;
  --panel: #0d1017;
  --ink: #f0f1e8;
  --muted: #73798b;
  --line: rgba(255, 255, 255, 0.12);
  --cyan: #30f4d0;
  --pink: #ff3b81;
  --yellow: #f6dc55;
  --ui: "Chakra Petch", system-ui, sans-serif;
  --pixel: "Press Start 2P", monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 70% 15%,
      rgba(48, 244, 208, 0.08),
      transparent 27%
    ),
    radial-gradient(
      circle at 12% 72%,
      rgba(255, 59, 129, 0.07),
      transparent 30%
    ),
    var(--bg);
  font-family: var(--ui);
  overflow-x: hidden;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(#000, transparent 96%);
}
button,
input {
  font: inherit;
}
.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.library-shell {
  position: relative;
  width: min(1260px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 0 36px;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.16em;
  font-size: 11px;
}
.brand-mark {
  border: 1px solid var(--ink);
  padding: 7px 6px 6px;
  font-weight: 700;
  letter-spacing: 0;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: #4c5261;
  font-size: 7px;
}
.system-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #778095;
  font-size: 10px;
  letter-spacing: 0.19em;
}
.system-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 11px var(--cyan);
}
.kicker {
  color: #667083;
  font-size: 8px;
  letter-spacing: 0.25em;
}
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 54px 0 32px;
}
.hero h1 {
  margin: 8px 0 11px;
  font-size: clamp(37px, 5vw, 66px);
  line-height: 1;
  letter-spacing: 0.04em;
}
.hero p {
  max-width: 590px;
  margin: 0;
  color: #82899a;
  font-size: 14px;
  line-height: 1.75;
}
.hero-stat {
  display: flex;
  align-items: flex-end;
  gap: 13px;
}
.hero-stat strong {
  color: var(--pink);
  font: clamp(34px, 5vw, 62px) / 1 var(--pixel);
  text-shadow: 0 0 25px rgba(255, 59, 129, 0.25);
}
.hero-stat span {
  padding-bottom: 5px;
  color: #555d6e;
  font-size: 8px;
  letter-spacing: 0.21em;
}
.console-panel {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(
    145deg,
    rgba(19, 23, 33, 0.92),
    rgba(7, 9, 14, 0.92)
  );
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.36),
    inset 0 1px rgba(255, 255, 255, 0.025);
}
.console-panel:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 5px solid rgba(0, 0, 0, 0.16);
}
.console-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--line);
}
.console-head h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: 0.05em;
}
.search-wrap {
  width: min(360px, 45%);
  height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #323846;
  background: rgba(0, 0, 0, 0.26);
}
.search-wrap span {
  color: var(--cyan);
  font-size: 19px;
  transform: rotate(-20deg);
}
.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: none;
  font-size: 12px;
}
.search-wrap input::placeholder {
  color: #4f5665;
}
.rom-grid {
  position: relative;
  min-height: 255px;
  max-height: 440px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #323846 transparent;
}
.rom-card {
  position: relative;
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: 31px 76px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a8aebb;
  background: rgba(4, 6, 10, 0.48);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.rom-card:hover {
  border-color: rgba(48, 244, 208, 0.4);
  transform: translateY(-1px);
}
.rom-card.selected {
  border-color: var(--cyan);
  background: linear-gradient(
    110deg,
    rgba(48, 244, 208, 0.085),
    rgba(4, 6, 10, 0.56)
  );
  box-shadow:
    inset 3px 0 var(--cyan),
    0 0 22px rgba(48, 244, 208, 0.06);
}
.card-number {
  align-self: start;
  color: #434a58;
  font: 7px var(--pixel);
}
.card-art {
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #2c323d;
  background:
    radial-gradient(
      circle at 70% 25%,
      rgba(255, 59, 129, 0.36),
      transparent 36%
    ),
    linear-gradient(145deg, #1a1e2a, #080a0f);
}
.card-art:before,
.card-art:after {
  content: "";
  position: absolute;
  width: 150%;
  height: 1px;
  background: rgba(48, 244, 208, 0.18);
  transform: rotate(-27deg);
}
.card-art:after {
  transform: rotate(27deg);
}
.card-art i {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.card-art b {
  z-index: 1;
  color: #fff;
  font: 15px var(--pixel);
  text-shadow: 3px 3px var(--pink);
}
.card-copy {
  min-width: 0;
}
.card-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e5e6df;
  font-size: 15px;
}
.card-file {
  display: block;
  margin: 6px 0 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555d6d;
  font-size: 9px;
  letter-spacing: 0.07em;
}
.card-meta {
  display: flex;
  gap: 6px;
}
.card-meta i {
  padding: 4px 6px;
  border: 1px solid #2b303b;
  color: #747c8d;
  font: normal 7px var(--pixel);
}
.card-meta i:first-child {
  color: var(--cyan);
}
.card-arrow {
  color: #444b59;
  font-size: 18px;
}
.rom-card.selected .card-arrow {
  color: var(--cyan);
}
.library-empty {
  grid-column: 1/-1;
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #626979;
  text-align: center;
}
.library-empty p {
  margin: 12px 0 6px;
  font-size: 13px;
}
.library-empty small {
  color: #474e5c;
}
.loader-ring {
  width: 28px;
  height: 28px;
  border: 2px solid #252a34;
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.launch-dock {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 14, 0.96);
}
.selection-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.selection-copy > span {
  color: #555d6e;
  font-size: 8px;
  letter-spacing: 0.18em;
}
.selection-copy strong {
  margin: 5px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}
.selection-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #636b7b;
  font-size: 9px;
}
.launch-button {
  min-width: 220px;
  padding: 13px 22px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: rgba(48, 244, 208, 0.04);
  cursor: pointer;
}
.launch-button span,
.launch-button small {
  display: block;
}
.launch-button span {
  font: 9px var(--pixel);
}
.launch-button small {
  margin-top: 7px;
  color: #6a958e;
  font-size: 9px;
}
.launch-button:hover:not(:disabled) {
  color: #03110e;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(48, 244, 208, 0.2);
}
.launch-button:hover:not(:disabled) small {
  color: #164139;
}
.launch-button:disabled {
  border-color: #2d333e;
  color: #4b5260;
  cursor: not-allowed;
}
.library-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 3px;
  color: #626a7a;
  font-size: 10px;
}
.library-note i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(246, 220, 85, 0.5);
}
.library-note p {
  margin: 0;
}
.library-note b,
.library-note code {
  color: #9ca3b1;
}
footer {
  height: 46px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #414754;
  font-size: 7px;
  letter-spacing: 0.2em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 760px) {
  .library-shell {
    padding: 0 16px;
  }
  .topbar {
    height: 64px;
  }
  .system-status span {
    display: none;
  }
  .hero {
    align-items: flex-start;
    padding: 35px 0 24px;
  }
  .hero p {
    font-size: 12px;
  }
  .hero-stat {
    display: none;
  }
  .console-head {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }
  .search-wrap {
    width: 100%;
  }
  .rom-grid {
    grid-template-columns: 1fr;
    max-height: none;
    padding: 12px;
  }
  .launch-dock {
    padding: 15px 18px;
  }
  .launch-button {
    min-width: 175px;
  }
  .card-copy strong {
    font-size: 14px;
  }
}
@media (max-width: 500px) {
  .brand > span:last-child {
    display: none;
  }
  .hero h1 {
    font-size: 37px;
  }
  .hero p {
    font-size: 11px;
  }
  .rom-card {
    grid-template-columns: 24px 62px minmax(0, 1fr) 15px;
    gap: 9px;
    min-height: 91px;
    padding: 9px;
  }
  .card-art {
    width: 62px;
  }
  .card-art b {
    font-size: 12px;
  }
  .card-meta i:last-child {
    display: none;
  }
  .launch-dock {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .launch-button {
    width: 100%;
    min-width: 0;
  }
  .library-note {
    align-items: flex-start;
    line-height: 1.6;
  }
  footer span:nth-child(2) {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
