:root {
  color-scheme: dark;
  --ink: #f4f0df;
  --panel: rgba(13, 18, 22, .78);
  --edge: rgba(244, 240, 223, .28);
  --red: #e84f3d;
  --gold: #f1b94a;
  --teal: #4cc6b8;
  --violet: #8a75e8;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(232, 79, 61, .22), transparent 26%),
    radial-gradient(circle at 82% 68%, rgba(76, 198, 184, .18), transparent 28%),
    linear-gradient(145deg, #141414, #22251f 48%, #171b21);
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.game-shell {
  position: relative;
  width: min(100vw, 1280px);
  height: min(100vh, 720px);
  background: #07090b;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .55);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  background: #07090b;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(rgba(7, 9, 11, .44), rgba(7, 9, 11, .88)),
    url("resources/cover_background.jpeg") center / cover;
}

.overlay.hidden,
.dialogue.hidden {
  display: none;
}

.sigil {
  width: min(33vh, 210px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--edge);
  border-radius: 8px;
  background: #161616;
}

.sigil img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5rem);
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 5px 0 #080808;
}

.overlay p {
  margin: 0;
  color: #d7dcc9;
}

button {
  min-width: 170px;
  min-height: 44px;
  border: 2px solid #fff2c7;
  border-radius: 8px;
  background: linear-gradient(#f2c34d, #bd6a2c);
  color: #15110b;
  font: 700 1rem/1 "Trebuchet MS", Arial, sans-serif;
  cursor: pointer;
}

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.hud-row,
.keys,
.music-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--panel);
  font-size: clamp(.9rem, 1.6vw, 1.08rem);
  text-rendering: geometricPrecision;
}

.music-row {
  pointer-events: auto;
  width: min(560px, 100%);
}

.music-row button {
  min-width: 104px;
  min-height: 34px;
  font-size: .82rem;
}

.music-row audio {
  width: min(390px, 58vw);
  height: 34px;
  accent-color: var(--teal);
}

.keys {
  align-self: start;
  width: fit-content;
  max-width: 100%;
  color: #dfe4dc;
}

.bars {
  display: flex;
  gap: 8px;
  width: min(320px, 70vw);
}

meter {
  width: 50%;
  height: 12px;
}

.dialogue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  width: min(820px, calc(100% - 28px));
  min-height: 112px;
  padding: 16px;
  border: 2px solid #f4f0df;
  border-radius: 8px;
  background: rgba(16, 21, 27, .92);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .38);
  transform: translateX(-50%);
}

.dialogue strong {
  color: var(--gold);
}

.dialogue p {
  margin: 8px 0 0;
  line-height: 1.35;
}

.dialogue span {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: #111;
  background: var(--teal);
  font-weight: 700;
}

.pip-boy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100% - 36px));
  max-height: min(56vh, 380px);
  overflow: auto;
  padding: 14px;
  border: 2px solid rgba(125, 255, 158, .72);
  border-radius: 8px;
  background:
    linear-gradient(rgba(4, 20, 10, .94), rgba(9, 28, 16, .9)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(125, 255, 158, .06) 5px 6px);
  color: #9cffb0;
  font-family: "Courier New", monospace;
  font-size: .94rem;
  text-shadow: 0 0 8px rgba(125, 255, 158, .5);
}

.pip-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(125, 255, 158, .35);
}

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

.pip-boy h2 {
  margin: 12px 0 6px;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pip-boy ul {
  margin: 0;
  padding-left: 18px;
  font-size: .74rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .pip-grid {
    grid-template-columns: 1fr;
  }

  .music-row {
    align-items: stretch;
    flex-direction: column;
  }

  .music-row audio {
    width: 100%;
  }
}
