@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0b0714;
  --deep: #1a1033;
  --pink: #ff3ea5;
  --cyan: #22e1ff;
  --white: #fff;
  --lilac: #d9cdf0;
  /* 1990s dialog grey, tinted toward the night */
  --face: #c9c3d6;
  --hi: #f4f0fb;
  --lo: #6f6786;
  --ink: #160d2b;
}

* { box-sizing: border-box; margin: 0; }
::selection { background: var(--pink); color: var(--white); }
html { background: var(--bg); scrollbar-color: var(--pink) var(--deep); }

body {
  min-height: 100vh;
  color: var(--white);
  font: 400 20px/1.45 "Pixelify Sans", ui-monospace, monospace;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.4vh, 28px) 16px;
  text-align: center;
  background:
    radial-gradient(70% 45% at 50% 100%, #3a1160 0%, transparent 70%),
    var(--bg);
}

main { width: min(760px, 100%); display: grid; gap: clamp(10px, 1.8vh, 18px); justify-items: center; }

h1 {
  font-weight: 700;
  font-size: clamp(40px, 9.6vw, 92px);
  line-height: .95;
  letter-spacing: .02em;
  color: var(--white);
  text-shadow: .06em .06em 0 var(--pink);
  text-wrap: balance;
}
h1 span { color: var(--cyan); text-shadow: .06em .06em 0 #0a5a86; }

/* the monitor the scene plays on */
.screen {
  position: relative;
  width: 100%;
  padding: 6px;
  background: var(--face);
  border: 3px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .9);
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border: 3px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  cursor: crosshair;
}

.pitch { max-width: 58ch; color: var(--lilac); text-wrap: pretty; }

/* a 1990s game dialog box */
.win {
  width: min(560px, 100%);
  background: var(--face);
  color: var(--ink);
  border: 3px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  text-align: left;
}
.bar {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 4px 10px;
  background: #b8146f;
  color: var(--white);
  border-bottom: 3px solid var(--lo);
}
form { padding: 12px 12px 10px; display: grid; gap: 8px; }
label { font-weight: 600; }
.row { display: flex; gap: 8px; }
input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--white);
  border: 3px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  border-radius: 0;
  caret-color: var(--pink);
}
input::placeholder { color: #5d5573; }
button {
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
  color: var(--ink);
  background: var(--face);
  border: 3px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  border-radius: 0;
  cursor: pointer;
}
button:hover { background: var(--hi); }
button:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); padding: 2px 17px 0 19px; }
button[disabled] { color: var(--lo); cursor: wait; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.win :focus-visible { outline-color: var(--ink); }
.msg { font-size: 17px; color: #3b3154; min-height: 1.45em; }
.msg.err { color: #a3004f; font-weight: 600; }
.msg.ok { color: #0a5a3a; font-weight: 600; }

@media (max-width: 520px) {
  body { font-size: 18px; }
  .row { flex-direction: column; }
  button { padding: 10px; }
  button:active { padding: 12px 8px 8px 12px; }
}

.cap { position: absolute; left: 22px; bottom: 16px; text-align: left; font-size: clamp(13px, 2vw, 18px); line-height: 1.2; font-weight: 600; color: var(--white); text-shadow: 2px 2px 0 #000; pointer-events: none; }
