.ref-card {
  max-width: 960px;
}

.ref-header {
  margin-bottom: 4px;
}

/* === Gender boot modal === */
.gender-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.gender-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.gender-modal-overlay.visible .gender-modal {
  transform: scale(1);
  opacity: 1;
}

.gender-modal {
  background: #070c07;
  border: 1px solid rgba(60, 180, 60, 0.3);
  border-radius: 12px;
  padding: 24px;
  width: 680px;
  max-width: calc(100% - 48px);
  height: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 12px 32px rgba(0, 0, 0, 0.6),
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(60, 180, 60, 0.1);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 350ms cubic-bezier(0.34, 1.15, 0.64, 1), opacity 280ms ease;
  position: relative;
  overflow: hidden;
}

/* CRT scanlines + vignette */
.gender-modal::before,
.gender-modal::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 12px;
  z-index: 10;
}

.gender-modal::before {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.13) 2px,
    rgba(0, 0, 0, 0.13) 4px
  );
}

.gender-modal::after {
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.gender-modal-output {
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1.65;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 180, 60, 0.3) transparent;
}

.gender-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gender-modal-error-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: #ff4444;
  background: rgba(180, 20, 20, 0.18);
  border: 1px solid rgba(255, 60, 60, 0.45);
  border-radius: 5px;
  padding: 5px 12px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(255, 50, 50, 0.7), 0 0 24px rgba(255, 50, 50, 0.3);
  box-shadow: 0 0 12px rgba(255, 40, 40, 0.15);
  opacity: 0;
  pointer-events: none;
}

.gender-modal-error-text.active {
  animation: error-fade 1.8s ease-in-out infinite;
}

@keyframes error-fade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

.gender-modal-ok {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #55cc55;
  background: transparent;
  border: 1px solid rgba(60, 180, 60, 0.4);
  border-radius: 6px;
  padding: 6px 20px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 120ms ease, color 120ms ease;
}

.gender-modal-ok:hover {
  background: rgba(60, 180, 60, 0.15);
  color: #88ee88;
}

/* Boot line colors */
.boot-boot     { color: #888888; }
.boot-kernel   { color: #56d4e8; }
.boot-module   { color: #8888dd; }
.boot-info     { color: #bbbbbb; }
.boot-warn     { color: #e8c84a; }
.boot-trace    { color: #666666; }
.boot-debug    { color: #888888; }
.boot-error    { color: #e05555; }
.boot-bug      { color: #ff3333; font-weight: bold; }
.boot-critical { color: #ff2222; font-weight: bold; }
.boot-panic    { color: #ff4444; font-weight: bold; }
.boot-hint     { color: #56b8c8; }
.boot-status   { color: #aaaaaa; }
.boot-ok       { color: #55cc55; }
.boot-cmd      { color: #66ee66; }
.boot-indent   { color: #666666; }

/* === Error badge === */
.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(180, 20, 20, 0.2);
  border: 1px solid rgba(220, 40, 40, 0.5);
  color: #ff6b6b;
  font-family: monospace;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 120ms ease;
}

.error-badge:hover {
  background: rgba(180, 20, 20, 0.35);
}

.error-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4444;
  flex-shrink: 0;
  animation: error-pulse 1.1s ease-in-out infinite;
}

@keyframes error-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* === Two-column body === */
.ref-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 700px) {
  .ref-body {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }

  .ref-description {
    flex: 0 0 280px;
  }

  .ref-gallery {
    flex: 1;
  }
}

/* === Section titles (8-bit) === */
.ref-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--accent);
  margin: 36px 0 14px;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 6px rgba(255, 109, 0, 0.45);
}

.ref-section-title:first-child {
  margin-top: 0;
}

/* === Info rows === */
.ref-info {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.ref-info li {
  display: table-row;
  font-size: 0.88rem;
}

.detail-label,
.detail-value {
  display: table-cell;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ref-info li:first-child .detail-label,
.ref-info li:first-child .detail-value {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.detail-label {
  color: var(--text-muted);
  font-weight: 700;
  width: 45%;
}

.detail-value {
  color: #ffffff;
  font-weight: 400;
  padding-left: 16px;
}

/* === Bullet lists === */
.ref-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-bullets li {
  font-size: 0.88rem;
  color: #ffffff;
  line-height: 1.6;
  padding-left: 12px;
  position: relative;
}

.ref-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.6rem;
  top: 4px;
}

/* === Color swatches === */
.ref-colors {
  display: flex;
  gap: 12px;
  margin: 0 0 28px;
}

.swatch {
  width: 96px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 100ms ease, opacity 100ms ease;
}

.swatch:hover {
  transform: translateY(-1px);
}

.swatch:active {
  transform: translateY(0);
}

.swatch-hex {
  font-size: 0.75rem;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* === Gallery === */
.ref-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 2px 6px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 4px 10px rgba(0, 0, 0, 0.4),
    0 14px 32px rgba(0, 0, 0, 0.5);
}

/* Full-width reference sheet — no cropping */
.gallery-item--full img {
  width: 100%;
  height: auto;
  display: block;
}

/* Smaller thumbnails below */
.gallery-row .gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* === Lightbox === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  padding: 24px 24px 80px;
}

.lightbox-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.lightbox-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10, 10, 18, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 12px 32px rgba(0, 0, 0, 0.6),
    0 40px 100px rgba(0, 0, 0, 0.7);
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  transform: scale(0.92);
  opacity: 0;
  transition: width 260ms ease-out, height 260ms ease-out,
              transform 350ms cubic-bezier(0.34, 1.15, 0.64, 1), opacity 280ms ease;
}

.lightbox-overlay.visible .lightbox-card {
  transform: scale(1);
  opacity: 1;
}

/* Stage: clips the slide animation without affecting image sizing */
.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  display: block;
  max-width: calc(90vw - 48px);
  max-height: calc(88vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
}

@keyframes lb-swipe-from-right {
  from { transform: translateX(20px); }
  to   { transform: translateX(0); }
}
@keyframes lb-swipe-from-left {
  from { transform: translateX(-20px); }
  to   { transform: translateX(0); }
}
.lightbox-img.swipe-right {
  animation: lb-swipe-from-right 260ms ease-out both;
}
.lightbox-img.swipe-left {
  animation: lb-swipe-from-left 260ms ease-out both;
}


/* Prev / Next arrow buttons — anchored to viewport center, not the card */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 150ms ease, opacity 150ms ease;
  opacity: 0.6;
  z-index: 10;
  flex-shrink: 0;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (hover: none) and (pointer: coarse) {
  .lightbox-prev,
  .lightbox-next { display: none; }
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.82);
  opacity: 1;
}

/* Footer: 3-column grid so dots are truly centered */
.lightbox-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 109, 0, 0.15);
  gap: 8px;
}

/* Dots */
.lightbox-dots {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.lightbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 220ms ease, transform 220ms ease;
}

.lightbox-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

.lightbox-artist {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lightbox-download {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #55cc55;
  background: transparent;
  border: 1px solid rgba(60, 180, 60, 0.4);
  border-radius: 6px;
  padding: 8px 16px;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  justify-self: end;
  transition: background 120ms ease, color 120ms ease;
}

.lightbox-download:hover {
  background: rgba(60, 180, 60, 0.15);
  color: #88ee88;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
  backdrop-filter: blur(4px);
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
}
