* { box-sizing: border-box; }
:root {
  --ink: #060d18;
  --blue-dark: #2a4f8a;
  --blue: #4b7fcc;
  --blue-light: #6ea4e0;
  --teal: #3abfbf;
  --steel: #8faabf;
  --gold: #e8b84b;
  --orange: #cc7722;
  --red: #cc6655;
  --archive-width: 1040px;
}
html, body { min-height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--blue-light);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
button, input { font: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.shell {
  min-height: 100vh;
  padding: 18px;
  position: relative;
}
.starfield {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.38)), url("./nebula.jpg") center/cover no-repeat;
  opacity: .62;
}
.archive-panel {
  width: min(100%, var(--archive-width));
  margin: 0 auto;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(110,164,224,.3);
  border-radius: 28px 28px 0 0;
  background: rgba(6,13,24,.72);
  box-shadow: inset 0 0 36px rgba(42,79,138,.22), 0 0 30px rgba(0,0,0,.45);
  overflow: hidden;
  user-select: none;
}
.archive-top {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--blue-dark), var(--steel) 22%, var(--steel) 78%, var(--teal));
  color: var(--ink);
}
.archive-top p {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: .18em;
  white-space: nowrap;
}
.archive-top span {
  font-size: 12px;
  letter-spacing: .16em;
}
.archive-top span:last-child { justify-self: end; }
.randomizer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid rgba(110,164,224,.22);
}
.panel {
  border: 1px solid rgba(75,127,204,.33);
  background: rgba(6,13,24,.58);
  padding: 16px;
}
.selector-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.command-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.command-panel h2,
.filter-heading h2 {
  margin: 0;
  color: var(--blue);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .32em;
  text-transform: uppercase;
}
.selector {
  min-height: 308px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: color .4s ease;
}
.micro-lines { width: 96px; display: grid; gap: 3px; }
.micro-lines span { height: 1px; background: var(--blue-light); opacity: .6; }
.micro-lines span + span { opacity: .25; }
.micro-lines.reverse span { opacity: .25; }
.micro-lines.reverse span + span { opacity: .6; }
.eyebrow {
  margin: 0;
  font-size: 18px;
  letter-spacing: .35em;
  text-align: center;
}
.subcopy {
  margin: 0;
  font-size: 10px;
  letter-spacing: .4em;
  opacity: .5;
}
.result { display: none; width: 100%; text-align: center; }
.selector.has-episode .micro-lines,
.selector.has-episode .eyebrow,
.selector.has-episode .subcopy { display: none; }
.selector.has-episode .result { display: block; }
.designation, .numbers p {
  margin: 0;
  color: var(--blue-light);
  font-size: 16px;
  letter-spacing: .44em;
}
#seriesName {
  margin: 8px 0;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: .08em;
}
.divider {
  width: min(100%, 344px);
  max-width: 384px;
  margin: 14px auto 16px;
  display: grid;
  gap: 3px;
  color: currentColor;
}
.divider div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.divider span { height: 1px; flex: 1; background: currentColor; }
.divider div:first-child span { opacity: .5; }
.divider div:last-child span { opacity: .2; }
.divider i,
.divider b {
  width: 6px;
  flex: 0 0 6px;
}
.divider i {
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.divider b { height: 1px; }
.numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 6vw, 46px);
}
.numbers > div:not(.beads) {
  width: clamp(108px, 21vw, 136px);
  text-align: center;
}
.numbers strong {
  display: block;
  font-size: clamp(50px, 8vw, 68px);
  line-height: 1;
  letter-spacing: .05em;
}
.beads {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 8px;
  opacity: .35;
}
.beads span {
  width: 1px;
  height: 16px;
  background: currentColor;
}
.beads i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.locked {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--teal);
  font-size: 10px;
  letter-spacing: .4em;
}
.locked span { width: 32px; height: 1px; background: currentColor; opacity: .5; }
.locked i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
.selector.landed .locked { display: flex; }
.search {
  width: min(100%, 512px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.selector.has-episode .search { display: none; }
.search input {
  width: 100%;
  background: transparent;
  border: 1px solid #1a3050;
  color: var(--blue-light);
  caret-color: var(--blue);
  outline: none;
  padding: 10px 12px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.search input:focus { border-color: var(--blue); }
.search-results {
  display: grid;
  gap: 1px;
  max-height: 392px;
  overflow: auto;
}
.search-count {
  margin: 0;
  padding: 6px 10px;
  background: rgba(42,79,138,.2);
  color: var(--blue-light);
  font-size: 10px;
  letter-spacing: .18em;
  text-align: center;
}
.search-hit {
  display: grid;
  grid-template-columns: 56px 76px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #030812;
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
}
.search-hit:hover { opacity: .72; }
.search-hit .abbr { font-size: 20px; font-weight: 700; }
.search-hit .code { color: var(--blue-dark); }
.search-empty {
  margin: 0;
  color: var(--blue-dark);
  text-align: center;
  font-size: 10px;
  letter-spacing: .16em;
}
.title-row {
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0 8px;
}
.title-row a {
  color: var(--gold);
  text-decoration: none;
  font-size: clamp(15px, 2.4vw, 19px);
  line-height: 1.25;
  letter-spacing: .08em;
  text-align: center;
  max-width: min(100%, 560px);
}
.title-row a:hover { opacity: .75; }
.primary-button {
  position: relative;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  outline: none;
}
.primary-button:before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  filter: blur(6px);
  opacity: .4;
}
.primary-button span {
  position: relative;
  display: block;
  min-width: 248px;
  padding: 12px 42px;
  border-radius: inherit;
  background: var(--blue);
  color: var(--ink);
  box-shadow: 0 0 24px rgba(75,127,204,.25), inset 0 1px 0 rgba(110,164,224,.38);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4em;
}
.primary-button.scanning span { background: var(--gold); }
.primary-button:disabled span {
  background: #0d1a28;
  color: #2a4060;
  box-shadow: none;
}
.reset-button {
  padding: 8px 24px;
  border: 1px solid #1a3050;
  background: transparent;
  color: #2a4f7a;
  font-size: 12px;
  letter-spacing: .3em;
}
.reset-button:hover { color: var(--blue-light); border-color: var(--blue); }
.pool-count {
  margin: 0;
  color: var(--blue-light);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: .12em;
  text-align: center;
}
.filters {
  margin: 0 14px 14px;
}
.filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.filter-heading span { flex: 1; height: 1px; background: #1a3050; }
.filter-heading button {
  border: 1px solid rgba(75,127,204,.27);
  background: rgba(75,127,204,.07);
  color: var(--blue-light);
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 9px;
}
.series-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.series-button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #1a3050;
  border-radius: 2px;
  background: #030812;
  color: #2a4060;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: .08em;
}
.series-button i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a3050;
}
.series-button strong { font-weight: 700; }
.series-button small { font-size: 9px; opacity: .7; }
.series-button.active {
  border-color: var(--series);
  color: var(--series);
  background: color-mix(in srgb, var(--series) 13%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--series) 19%, transparent);
}
.series-button.active i {
  background: var(--series);
  box-shadow: 0 0 6px var(--series);
}
.archive-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 14px 18px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .16em;
  text-align: center;
}
.archive-footer p { margin: 2px 0; }
@keyframes pulse { 50% { opacity: .45; } }
@media (max-width: 760px) {
  .shell { padding: 10px; }
  .archive-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .archive-top span:last-child { justify-self: center; }
  .archive-top p { font-size: clamp(20px, 6vw, 28px); white-space: normal; text-align: center; }
  .randomizer-grid { grid-template-columns: 1fr; }
  .selector { min-height: 360px; }
  .filter-heading { flex-wrap: wrap; justify-content: center; }
  .filter-heading h2 { font-size: 16px; letter-spacing: .22em; order: -1; width: 100%; text-align: center; }
  .series-button small { display: none; }
  .primary-button span { min-width: 216px; padding-inline: 28px; }
  .search-hit { grid-template-columns: 48px 64px 1fr; font-size: 13px; }
  .archive-footer { font-size: 12px; }
}
