/* Dashboard --------------------------------------------------------------- */

.dashboard {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.dashboard-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("/static/assets/background.png");
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

.dashboard-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(11, 7, 24, 0.45) 0%,
      rgba(11, 7, 24, 0.72) 55%,
      rgba(11, 7, 24, 0.94) 100%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.16) 0,
      rgba(0, 0, 0, 0.16) 2px,
      transparent 2px,
      transparent 5px
    );
}

.site-header {
  padding: clamp(28px, 6vw, 64px) clamp(18px, 5vw, 64px) 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 32px;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: clamp(1.1rem, 3.2vw, 1.9rem);
  text-shadow: 4px 4px 0 #2b1650, 8px 8px 0 rgba(0, 0, 0, 0.35);
}

.brand b {
  color: var(--gold);
  font-weight: 400;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  background: var(--magenta);
  color: #1a0822;
  border: 3px solid #0a0614;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.3);
  font-size: 0.8em;
}

.tagline {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.tagline strong {
  color: var(--cyan);
  font-weight: 400;
}

.dashboard main {
  flex: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 12px clamp(18px, 5vw, 64px) 40px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 22px;
}

.section-head h2 {
  font-size: 0.8rem;
  color: var(--cyan);
  text-transform: uppercase;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0 10px,
    transparent 10px 18px
  );
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(18px, 3vw, 30px);
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 4px solid #0a0614;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 0 4px #2c1e4d, 12px 12px 0 rgba(3, 1, 9, 0.55);
  transition: transform 100ms steps(2), box-shadow 100ms steps(2);
}

.game-card:hover,
.game-card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 0 0 0 4px var(--cyan), 14px 14px 0 rgba(3, 1, 9, 0.6);
}

.game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05030c;
  border-bottom: 4px solid #0a0614;
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.game-cover .badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.badge {
  padding: 0.35em 0.5em;
  background: rgba(8, 4, 18, 0.88);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.48rem;
}

.badge-bezel {
  border-color: var(--magenta);
  color: var(--magenta);
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 18px 20px;
}

.game-body h3 {
  font-size: 0.85rem;
}

.game-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  flex: 1;
}

.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--cyan);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.55rem;
}

.play-cta::before {
  content: "▶";
  color: var(--gold);
}

.game-grid .loading-card {
  min-height: 260px;
  border: 4px dashed var(--line);
  background: rgba(27, 18, 54, 0.4);
  animation: card-pulse 1.2s steps(2) infinite;
}

@keyframes card-pulse {
  50% {
    opacity: 0.55;
  }
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  padding: 36px;
  border: 4px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.error-state {
  border-color: #5c1f1f;
  color: #ffc6c6;
}

/* Viewer ------------------------------------------------------------------ */

.viewer {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #1a1033 0%, #0b0718 55%, #05030c 100%);
  overflow-x: hidden;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.play-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(14px, 3vw, 32px);
  border-bottom: 4px solid #0a0614;
  background: rgba(11, 7, 24, 0.92);
}

.back {
  color: var(--muted);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.55rem;
  text-decoration: none;
  padding: 8px 10px;
  border: 2px solid transparent;
}

.back:hover {
  color: var(--cyan);
  border-color: var(--line);
}

.play-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.play-title h1 {
  font-size: clamp(0.7rem, 2vw, 0.95rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-spacer {
  flex: 1;
}

.stage-shell {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 32px);
}

.stage-area {
  position: relative;
  width: min(1180px, 100%);
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #05030c;
  border: 4px solid #000;
  box-shadow: 0 0 0 4px #33235c, 0 26px 70px rgba(0, 0, 0, 0.7);
}

.stage.no-bezel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 0 6px #241847, inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05030c;
}

.stage .bezel {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
}

.feedback-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-actions .pixel-btn {
  font-size: 0.5rem;
  padding: 0.75em 0.9em;
}

.share-actions {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 28px);
}

.share-actions .share-btn {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.44rem;
  padding: 0.8em 0.85em;
  border: 3px solid #0a0614;
  background: rgba(17, 11, 34, 0.9);
  color: var(--muted);
  text-decoration: none;
  box-shadow: 0 3px 0 #000;
}

.share-actions .share-btn:hover {
  color: var(--ink);
  background: var(--panel-2);
}

.versions-action {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  font-size: 0.46rem;
  padding: 0.75em 0.9em;
}

.stage-caption {
  width: min(1180px, 100%);
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Feedback dialog extras */

.capture-box {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 3px solid #0a0614;
  background: #0e0920;
}

.capture-box img {
  width: 100%;
  border: 2px solid var(--line);
  background: #05030c;
  image-rendering: pixelated;
}

.capture-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.captcha-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
}

.captcha-row img {
  width: 100%;
  border: 3px solid #0a0614;
  background: #110d1e;
  image-rendering: pixelated;
}

.captcha-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.captcha-controls input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.8rem;
}

.link-button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.versions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.versions-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 3px solid #0a0614;
  background: var(--panel);
}

.versions-list .version-label {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--gold);
  min-width: 3.5em;
}

.versions-list .version-notes {
  flex: 1;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .stage-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .feedback-actions {
    position: static;
    justify-content: flex-end;
  }

  .share-actions {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .share-actions .share-btn {
    font-size: 0.38rem;
    padding: 0.7em;
  }

  .versions-action {
    position: static;
    align-self: flex-end;
    font-size: 0.4rem;
  }

  .capture-box,
  .captcha-row {
    grid-template-columns: 1fr;
  }

  .play-title h1 {
    font-size: 0.62rem;
  }
}

@media (max-width: 560px) {
  .stage-shell {
    padding: 10px;
  }

  .share-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .versions-action {
    margin-top: 0;
  }
}
