@font-face {
  font-family: Barlow;
  src: url('../../fonts/barlow-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
:root {
  --bg: #06070a;
  --solar: #f59e0b;
  --solar-glow: rgba(245, 158, 11, 0.4);
  --void: #38bdf8;
  --void-glow: rgba(56, 189, 248, 0.4);
  --font-display: Barlow, system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-mono);
  color: #f8fafc;
  touch-action: none;
}
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #06070a;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Minimalist HUD */
.hud {
  position: absolute;
  top: env(safe-area-inset-top, 14px);
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}
.hud-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.score-txt {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
  line-height: 1;
}
.chain-txt {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 1px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.hub-link {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 2px);
  left: 50%;
  translate: -50% 0;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 10px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}
.hub-link:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.graze-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.graze-lbl {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #64748b;
  font-weight: 700;
}
.graze-bar-bg {
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.graze-bar-fill {
  width: 0%;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  transition: width 0.1s linear;
}

/* Discreet Micro-Polarity Indicator */
.polarity-hud {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 10px) + 8px);
  left: 14px;
  pointer-events: none;
  z-index: 10;
}
.polarity-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  opacity: 0.65;
  transition: all 0.2s ease;
}
.polarity-badge.solar {
  color: var(--solar);
  border-color: rgba(245, 158, 11, 0.3);
}
.polarity-badge.void {
  color: var(--void);
  border-color: rgba(56, 189, 248, 0.3);
}
.polarity-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.polarity-badge.solar .polarity-dot { background: var(--solar); }
.polarity-badge.void .polarity-dot { background: var(--void); }

/* Start / Overlays - Clean, Zero Bloat */
.screen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  z-index: 20;
}
.screen-overlay.hidden {
  display: none;
}
.game-logo {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1;
}
.game-byline {
  font-size: 11px;
  letter-spacing: 3px;
  color: #64748b;
  margin-bottom: 36px;
  text-transform: uppercase;
}
.core-mechanic-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  border-radius: 12px;
  margin-bottom: 32px;
  font-size: 11px;
  color: #94a3b8;
}
.core-mechanic-pill span.solar { color: var(--solar); font-weight: 800; }
.core-mechanic-pill span.void { color: var(--void); font-weight: 800; }

.btn-launch {
  width: 220px;
  height: 52px;
  border-radius: 12px;
  background: #ffffff;
  color: #06070a;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
  transition: transform 0.15s, background 0.15s;
}
.btn-launch:active {
  transform: scale(0.96);
  background: #e2e8f0;
}

/* Minimal Game Over */
.gameover-stat {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  color: #ffffff;
  margin: 12px 0 4px 0;
  font-family: var(--font-display);
}
.gameover-label {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.meta-row {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  font-size: 12px;
  color: #94a3b8;
}
.meta-row b {
  color: #ffffff;
}

.controls-hint {
  color: #a9b6cc;
  font: .8rem/1.5 system-ui, sans-serif;
  margin-top: 14px;
}
@media (pointer: coarse) {
  .controls-hint { display: none; }
}
@media (any-pointer: fine) {
  .controls-hint { display: block; }
}
.result-heading { color: #f43f5e; margin-bottom: 0; }
:focus-visible { outline: 2px solid var(--void); outline-offset: 3px; }
canvas:focus-visible { outline-offset: -2px; }
