* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: #000; color: #cfcfcf;
  font-family: Georgia, 'Times New Roman', serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
canvas.game { position: fixed; inset: 0; display: block; }

.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,0,0,.88), rgba(0,0,0,.97));
  text-align: center; padding: 24px;
}
.overlay h1 {
  font-size: clamp(28px, 6vw, 54px); letter-spacing: .35em;
  color: #a00; text-shadow: 0 0 24px rgba(180,0,0,.6);
  margin-bottom: 12px; font-weight: normal;
}
.overlay p { max-width: 520px; line-height: 1.6; color: #999; margin-bottom: 10px; }
.overlay .keys { color: #666; font-size: 14px; margin-bottom: 22px; }
button.big {
  font-family: inherit; font-size: 20px; letter-spacing: .2em;
  background: transparent; color: #c33;
  border: 1px solid #722; padding: 14px 42px; cursor: pointer;
  transition: all .25s;
}
button.big:hover, button.big:active { background: #300; color: #f66; border-color: #a33; box-shadow: 0 0 24px rgba(200,0,0,.35); }

.hud {
  position: fixed; z-index: 10; pointer-events: none;
  color: #888; font-size: 13px; letter-spacing: .12em;
}
.hud.topleft { top: 12px; left: 14px; }
.hud.bottomleft { bottom: 12px; left: 14px; }
.hud .ver { color: #444; }

.pair-panel {
  position: fixed; z-index: 10; right: 14px; top: 12px;
  background: rgba(8,8,8,.85); border: 1px solid #333;
  padding: 12px; text-align: center; width: 172px;
}
.pair-panel .label { font-size: 11px; letter-spacing: .18em; color: #999; margin-bottom: 8px; }
.pair-panel .code { font-size: 26px; letter-spacing: .4em; color: #c33; margin: 8px 0 4px; text-indent: .4em; }
.pair-panel .status { font-size: 12px; color: #666; margin-top: 6px; }
.pair-panel .status.linked { color: #3c6; }
#qr { width: 148px; height: 148px; margin: 0 auto; background: #fff; padding: 6px; }
#qr img, #qr canvas { width: 100% !important; height: 100% !important; }

.objective {
  position: fixed; z-index: 10; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: 14px; letter-spacing: .22em; color: #a99; pointer-events: none;
  text-shadow: 0 0 12px #000; white-space: nowrap;
}

.flash {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(160,0,0,.55), rgba(80,0,0,.85));
  opacity: 0; transition: opacity .12s;
}
.flash.on { opacity: 1; }

#win h1 { color: #cfc; text-shadow: 0 0 24px rgba(120,200,120,.4); }

/* ---- phone ---- */
#phone-root { position: fixed; inset: 0; background: #000; overflow: hidden; }
#radar-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#phone-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 120px 40px rgba(160,0,0,0);
  transition: box-shadow .4s;
}
#phone-state {
  position: absolute; bottom: 12%; width: 100%; text-align: center;
  font-size: 20px; letter-spacing: .3em; color: #a33;
  text-shadow: 0 0 16px rgba(200,0,0,.5);
}
#phone-runes {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #000;
}
#phone-runes.show { display: flex; }
#phone-runes .rl { font-size: 15px; letter-spacing: .3em; color: #888; }
#phone-runes .seq { display: flex; gap: 26px; }
#phone-runes .rune {
  font-size: 84px; color: #e8d9a0; text-shadow: 0 0 30px rgba(230,200,120,.55);
}
#link-ui { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; background: #000; z-index: 5; }
#link-ui h2 { font-weight: normal; letter-spacing: .3em; color: #a00; font-size: 22px; }
#link-ui .manual { display: flex; gap: 8px; margin-top: 8px; }
#link-ui input {
  background: #111; border: 1px solid #444; color: #ddd; font-size: 20px;
  letter-spacing: .3em; text-transform: uppercase; padding: 10px; width: 130px; text-align: center;
  font-family: inherit;
}
#link-ui .go { font-size: 16px; padding: 10px 18px; }
#link-status { color: #666; font-size: 14px; min-height: 20px; }
