:root {
  --bg: #050407;
  --fg: #e8e2dc;
  --dim: #6b6560;
  --red: #ff1c0b;
  --blue: #3caee3;
  --turq: #6ddbd7;
  --gutter: clamp(16px, 3vw, 36px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  font: 400 12px/1.6 "IBM Plex Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

canvas#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
}

.fallback {
  display: none;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(80vw, 760px);
}

.no-gl .fallback { display: block; }

.hud {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom));
  pointer-events: none;
  mix-blend-mode: difference;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.row.top { align-items: flex-start; }

.cell { display: flex; flex-direction: column; gap: 2px; }
.cell.right { align-items: flex-end; text-align: right; }
.top .cell { flex-direction: row; gap: 10px; flex-wrap: wrap; }
.top .cell.right { justify-content: flex-end; }

.label { font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; }
.dim { color: var(--dim); }

.whisper {
  min-height: 1.6em;
  max-width: 34ch;
  font-size: 13px;
  text-transform: none;
}

button, input {
  pointer-events: auto;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  text-transform: inherit;
}

button {
  cursor: pointer;
  padding: 4px 0;
}

button:hover, button:focus-visible { color: var(--turq); outline: none; }
button[aria-pressed="true"] { color: var(--red); }

#key {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

#key input {
  width: 10ch;
  font-size: 16px;
  border-bottom: 1px solid var(--dim);
  padding: 2px 0;
  caret-color: var(--red);
  outline: none;
  text-align: left;
}

#key input:focus { border-color: var(--fg); }

.artist { color: var(--dim); }

.answer { min-height: 1.6em; color: var(--turq); }

.shake { animation: shake 0.28s steps(4) 1; }

@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 1px); }
  50% { transform: translate(3px, -1px); }
  75% { transform: translate(-2px, 0); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 560px) {
  html, body { font-size: 11px; }
  .row.bottom { flex-direction: column; align-items: stretch; gap: 14px; }
  .row.bottom .cell.right { align-items: flex-start; text-align: left; }
}
