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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e9eef5;
  font-family: 'Inter', system-ui, sans-serif;
  color: #1d2433;
  user-select: none;
}

#game { display: block; width: 100vw; height: 100vh; }

.hidden { display: none !important; }

#hud {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.hud-item {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
  box-shadow: 0 4px 20px rgba(30, 40, 60, 0.08);
}
.hud-item .label { font-size: 10px; letter-spacing: 0.14em; opacity: 0.55; font-weight: 600; }
.hud-item span:last-child { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

#toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1d2433;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(233, 238, 245, 0.55);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 40px;
  width: min(420px, 100%);
  text-align: center;
  box-shadow: 0 20px 60px rgba(30, 40, 60, 0.15);
}

#face-preview {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 24px rgba(30, 40, 60, 0.2);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }

h1 { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
h1 span { color: #ff6b4a; }
.sub { margin-top: 10px; opacity: 0.6; font-size: 14px; }
.big { font-size: 48px; font-weight: 800; margin-top: 12px; font-variant-numeric: tabular-nums; }

button {
  margin-top: 22px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: #1d2433;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
button:hover { background: #ff6b4a; }
button:active { transform: scale(0.98); }

.upload {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.6;
  cursor: pointer;
  text-decoration: underline;
}
.upload:hover { opacity: 1; }
.upload input { display: none; }

.controls {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  text-align: left;
  opacity: 0.7;
}
kbd {
  display: inline-block;
  background: #eef1f6;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: inherit;
  font-weight: 600;
  margin-right: 4px;
}

/* mouse locked to the centre while playing */
body.playing, body.playing #game { cursor: none; }

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}
body.playing #crosshair { display: block; }
#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(29, 36, 51, 0.35);
  border-radius: 1px;
}
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after { top: 8px; left: 0; width: 18px; height: 2px; }

#lock-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(29, 36, 51, 0.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}
