:root {
  --lime: #ccff00;
  --ink: #241f11;
  --deep: #1c180d;
  --cream: #f7e4cd;
  --green: #3daf82;
  --muted-green: #719193;
  --red: #ef6666;
  --panel: rgba(36, 31, 17, .76);
  --line: rgba(204, 255, 0, .34);
  --dim: rgba(247, 228, 205, .58);
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(204,255,0,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204,255,0,.027) 1px, transparent 1px),
    var(--deep);
  background-size: 18px 18px;
  color: var(--lime);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

button, input { font: inherit; }
button { touch-action: manipulation; }

a { color: inherit; }

.site-header {
  position: relative;
  z-index: 10;
  width: min(1120px, calc(100% - 28px));
  height: 52px;
  margin: 0 auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hover-menu {
  position: relative;
  display: flex;
  align-items: center;
  width: 48px;
  height: 44px;
  overflow: visible;
}

.logo-switch {
  position: relative;
  z-index: 2;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  image-rendering: pixelated;
}

.logo-switch img {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.logo-hover { opacity: 0; }

.hover-menu:hover .logo-static,
.hover-menu:focus-within .logo-static { opacity: 0; }

.hover-menu:hover .logo-hover,
.hover-menu:focus-within .logo-hover { opacity: 1; }

.pixel-nav {
  position: absolute;
  top: 5px;
  left: 51px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: min(720px, calc(100vw - 88px));
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--lime);
  border-radius: 5px;
  background: rgba(0,0,0,.88);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 12px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.pixel-nav::-webkit-scrollbar { display: none; }

.hover-menu:hover .pixel-nav,
.hover-menu:focus-within .pixel-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.pixel-nav a { text-decoration: none; }

.pixel-nav a:hover,
.pixel-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pixel-nav span { opacity: .55; }

.site-mark {
  padding-top: 9px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  white-space: nowrap;
}

.page-shell {
  width: min(880px, calc(100% - 28px));
  margin: 0 auto;
  padding: 10px 0 28px;
}

.terminal {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36,31,17,.72), rgba(28,24,13,.82));
  box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 24px 70px rgba(0,0,0,.28);
}

.terminal-bar {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.24);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.prompt { color: var(--green); }

.blink {
  animation: blink 1s steps(1,end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lookup-zone {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.find-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.find-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.24);
}

.find-row > span {
  text-align: center;
  color: var(--green);
  font-weight: 900;
}

.find-row input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  border-left: 1px solid rgba(204,255,0,.15);
  padding: 0 11px;
  outline: 0;
  background: transparent;
  color: var(--lime);
  font-weight: 900;
}

.find-row button {
  align-self: stretch;
  min-width: 64px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 1000;
}

.find-row .go-button {
  background: var(--lime);
  color: var(--deep);
}

.find-row .inline-random {
  background: rgba(0,0,0,.26);
  color: var(--lime);
}

.fren-stage {
  width: min(700px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 34px) 30px;
}

.fren-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

.fren-title-link[href] {
  cursor: pointer;
}

.fren-title-link[href]:hover,
.fren-title-link[href]:focus-visible {
  color: #ccff00;
}

.identity {
  margin: 0 auto 10px;
  text-align: center;
}

.identity-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.identity h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(23px, 6vw, 40px);
  line-height: 1;
  letter-spacing: -.055em;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--lime);
  background: rgba(204,255,0,.08);
  color: var(--lime);
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: .1em;
}

.badge.custom {
  border-color: var(--green);
  color: var(--green);
}

.owner-line {
  min-height: 24px;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .04em;
}

.owner-line a {
  margin-left: 5px;
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.owner-line a[href]:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.canvas-frame {
  width: min(460px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: #15120a;
  background-image:
    linear-gradient(45deg, rgba(204,255,0,.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(204,255,0,.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(204,255,0,.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(204,255,0,.045) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  box-shadow: 0 0 30px rgba(204,255,0,.04);
}

#frenCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--dim);
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}

.status.error { color: var(--red); text-align: left; }

.traits-section { margin-top: 24px; }

.section-heading {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 2px 8px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.trait-controls {
  border: 1px solid var(--line);
}

.trait-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  min-height: 58px;
  background: rgba(0,0,0,.18);
}

.trait-row + .trait-row {
  border-top: 1px solid rgba(204,255,0,.16);
}

.trait-arrow {
  border: 0;
  background: transparent;
  color: var(--lime);
  cursor: pointer;
  font-size: 25px;
  font-weight: 900;
}

.trait-arrow:hover,
.trait-arrow:focus-visible {
  background: var(--lime);
  color: var(--deep);
  outline: 0;
}

.trait-arrow:disabled {
  opacity: .18;
  cursor: default;
  background: transparent;
  color: var(--lime);
}

.trait-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 7px 10px;
  border-inline: 1px solid rgba(204,255,0,.12);
  text-align: center;
}

.trait-type {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.trait-name {
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cream);
  font-size: 13px;
  font-weight: 900;
}

.export-zone {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(204,255,0,.22);
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.check-line input {
  width: 17px;
  height: 17px;
  accent-color: var(--lime);
}

.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
}

.terminal-button {
  min-height: 44px;
  border: 1px solid var(--lime);
  padding: 10px 13px;
  cursor: pointer;
  font-weight: 1000;
  letter-spacing: .025em;
}

.terminal-button.primary {
  background: var(--lime);
  color: var(--deep);
}

.terminal-button.secondary {
  background: rgba(0,0,0,.18);
  color: var(--lime);
}

.terminal-button:hover,
.terminal-button:focus-visible {
  box-shadow: inset 0 0 0 1px var(--lime);
  outline: 0;
}

/* Dance Party Easter Egg */
.dance-party-easter-egg {
  margin: 17px 0 -3px;
  text-align: left;
}

.dance-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-decoration: none;
  animation: dance-colors 1.2s steps(1, end) infinite;
}

.dance-link:hover,
.dance-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes dance-colors {
  0%   { color: #33ccff; }
  25%  { color: #ffff66; }
  50%  { color: #ff4dd6; }
  75%  { color: #33ff77; }
  100% { color: #33ccff; }
}

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 26px;
  color: rgba(247,228,205,.4);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
}

footer span:nth-child(2),
footer span:nth-child(4) { color: var(--green); }

@media (max-width: 740px) {
  .site-header {
  position: relative;
  z-index: 10;
  width: min(1120px, calc(100% - 28px));
  height: 52px;
  margin: 0 auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hover-menu {
  position: relative;
  display: flex;
  align-items: center;
  width: 48px;
  height: 44px;
  overflow: visible;
}

.logo-switch {
  position: relative;
  z-index: 2;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  image-rendering: pixelated;
}

.logo-switch img {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.logo-hover { opacity: 0; }

.hover-menu:hover .logo-static,
.hover-menu:focus-within .logo-static { opacity: 0; }

.hover-menu:hover .logo-hover,
.hover-menu:focus-within .logo-hover { opacity: 1; }

.pixel-nav {
  position: absolute;
  top: 5px;
  left: 51px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: min(720px, calc(100vw - 88px));
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--lime);
  border-radius: 5px;
  background: rgba(0,0,0,.88);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 12px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.pixel-nav::-webkit-scrollbar { display: none; }

.hover-menu:hover .pixel-nav,
.hover-menu:focus-within .pixel-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.pixel-nav a { text-decoration: none; }

.pixel-nav a:hover,
.pixel-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pixel-nav span { opacity: .55; }

.site-mark {
  padding-top: 9px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  white-space: nowrap;
}

  .pixel-nav {
    flex: 1;
  }

  .page-shell {
    width: min(100% - 20px, 880px);
    padding-top: 22px;
  }

  .canvas-frame {
    width: min(100%, 495px);
  }
}

@media (max-width: 520px) {
  .logo-switch,
  .logo-switch img {
    width: 42px;
    height: 42px;
  }

  .logo-switch {
    flex-basis: 42px;
  }

  .pixel-nav {
    gap: 8px;
    font-size: 10px;
  }

  .terminal-bar { font-size: 10px; }

  .lookup-zone { padding: 13px; }

  .fren-stage { padding-inline: 12px; }

  .trait-row {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    min-height: 60px;
  }

  .trait-arrow { font-size: 27px; }

  .export-buttons { grid-template-columns: 1fr; }

  .terminal-button { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}

.find-form { width: 100%; }

@media (max-width: 560px) {
  .find-row {
    grid-template-columns: 30px minmax(0, 1fr) 58px;
  }

  .find-row .inline-random {
    grid-column: 1 / -1;
    min-height: 40px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .pixel-nav {
    max-width: calc(100vw - 76px);
    font-size: 10px;
  }
}
