* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #111214;
}

#cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.lcd-hud {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 6px;
  border: 1px solid #696c72;
  border-radius: 10px;
  background: linear-gradient(#343639, #191a1d 72%);
  box-shadow: 0 6px 18px #0007;
  pointer-events: none;
}

.lcd-hud div { min-width: 78px; padding: 4px 9px; text-align: center; border-right: 1px solid #515358; }
.lcd-hud div:last-child { border: 0; }
.lcd-hud span { display: block; color: #c0c3ca; font: 700 .57rem/1 monospace; letter-spacing: .09em; }
.lcd-hud b { display: block; margin-top: 5px; color: var(--metal-accent); font: 800 1rem/1 monospace; }
.lcd-hud #misses { white-space: nowrap; }

.message {
  position: absolute;
  z-index: 5;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--metal-accent);
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.message.on { opacity: 1; }
.message.pause {
  top: 50%;
  padding: 12px 24px;
  border: 1px solid var(--metal-line);
  border-radius: 10px;
  background: #191a1de8;
  font-size: 1.35rem;
}

.overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0c0d10b8;
  backdrop-filter: blur(5px);
}

.hidden { display: none !important; }
.ov-card { width: min(430px, 100%); padding: 28px; text-align: center; border-radius: 16px; }
.ov-card h2 { margin: 0 0 10px; font-size: 1.65rem; }
.ov-card p { margin: 0 0 19px; font-size: .9rem; line-height: 1.55; }
.ov-card .eyebrow { margin-bottom: 7px; font-size: .67rem; letter-spacing: .17em; }
.ov-card button { padding: 11px 26px; border: 0; border-radius: 9px; font-weight: 800; cursor: pointer; }
.ov-card .hint { margin: 16px 0 0; font: .74rem/1.5 monospace; }

.fs-exit, .pause-btn {
  position: absolute;
  z-index: 7;
  right: max(12px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  color: var(--metal-accent);
  background: var(--metal-panel);
  border: 1px solid var(--metal-line);
  border-radius: 8px;
}

.fs-exit { top: 12px; }
.pause-btn { display: none; bottom: max(12px, env(safe-area-inset-bottom)); touch-action: none; }

@media (max-width: 650px) {
  .lcd-hud { top: 8px; width: calc(100% - 16px); }
  .lcd-hud div { flex: 1; min-width: 0; padding: 3px 2px; }
  .lcd-hud span { font-size: .49rem; }
  .lcd-hud b { font-size: .83rem; }
  .message { top: 64px; }
}

@media (max-width: 900px) and (pointer: coarse) {
  .pause-btn { display: block; }
}
