/* Shared retro shell for the portal and game viewer. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/static/assets/fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0b0718;
  --bg-2: #140d28;
  --panel: #1b1236;
  --panel-2: #241847;
  --line: #3b2b63;
  --ink: #f6f0e4;
  --muted: #a99fc7;
  --cyan: #5ff2d0;
  --magenta: #ff5fb2;
  --gold: #ffd166;
  --red: #ff6b6b;
  --green: #8bff9e;
  --shadow: #05030c;
  --pixel: 4px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  line-height: 1.55;
  -webkit-font-smoothing: none;
}

h1,
h2,
h3,
.pixel {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.02em;
  margin: 0;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.pixel-btn {
  --btn-face: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.1em;
  border: 3px solid var(--shadow);
  background: var(--btn-face);
  color: var(--ink);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.62rem;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.45),
    inset 4px 4px 0 rgba(255, 255, 255, 0.12), 0 4px 0 var(--shadow);
  transition: transform 80ms steps(2), filter 80ms linear;
}

.pixel-btn:hover {
  filter: brightness(1.15);
}

.pixel-btn:active {
  transform: translateY(3px);
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.45),
    inset 4px 4px 0 rgba(255, 255, 255, 0.12), 0 1px 0 var(--shadow);
}

.pixel-btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.btn-change {
  --btn-face: #3d2a63;
  border-color: #1b1030;
  color: var(--cyan);
}

.btn-bug {
  --btn-face: #5a2140;
  border-color: #2a0d1e;
  color: #ffc6dd;
}

.btn-gold {
  --btn-face: #6b4a12;
  border-color: #2b1c04;
  color: var(--gold);
}

.btn-danger {
  --btn-face: #5c1f1f;
  border-color: #260909;
  color: #ffd1d1;
}

.btn-quiet {
  --btn-face: var(--panel);
}

.chip {
  display: inline-block;
  padding: 0.35em 0.6em;
  border: 2px solid var(--line);
  background: #0f0a1f;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
}

.chip-current {
  color: var(--green);
  border-color: #245a33;
}

.chip-warn {
  color: var(--gold);
  border-color: #664c17;
}

.chip-tag {
  color: var(--cyan);
  border-color: #236b5d;
}

/* Pixel dialog ------------------------------------------------------------ */

.pixel-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 4px solid #0a0614;
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: 0 0 0 4px #4a3578, 0 24px 60px rgba(0, 0, 0, 0.7);
}

.pixel-dialog::backdrop {
  background: rgba(5, 3, 12, 0.82);
  backdrop-filter: blur(2px);
}

.dialog-inner {
  padding: 22px;
  max-height: calc(100vh - 56px);
  overflow: auto;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-head h2 {
  font-size: 0.95rem;
  color: var(--gold);
}

.dialog-close {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 0.8rem;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.55rem;
  color: var(--muted);
  text-transform: uppercase;
}

.field textarea,
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 3px solid #0a0614;
  background: #0e0920;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog-actions .status {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.dialog-actions .status.error {
  color: var(--red);
}

.dialog-actions .status.ok {
  color: var(--green);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding: 26px 20px 34px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
