:root {
  --bg: #050403;
  --fg: #d8cfc4;
  --muted: #8a8176;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.magnet-root {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.magnet-stage {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  max-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
}

.magnet-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}

.magnet-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(216, 207, 196, 0.72);
}

.magnet-fill {
  position: absolute;
  top: max(0.42rem, env(safe-area-inset-top));
  left: 16%;
  right: 16%;
  height: 2px;
  background: rgba(216, 207, 196, 0.12);
  overflow: hidden;
}

.magnet-fill-inner {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: rgba(216, 207, 196, 0.42);
  transition: transform 160ms linear;
}

.magnet-line {
  position: absolute;
  top: max(0.85rem, calc(env(safe-area-inset-top) + 0.42rem));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  font-weight: 500;
  color: rgba(216, 207, 196, 0.58);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.magnet-line.visible { opacity: 1; }

.magnet-hint {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  font-weight: 500;
  text-transform: lowercase;
  color: rgba(216, 207, 196, 0.55);
  opacity: 0;
  transition: opacity 1.1s ease;
}

.magnet-hint.visible { opacity: 1; }

.magnet-weight {
  position: absolute;
  right: 1.1rem;
  top: max(1.35rem, calc(env(safe-area-inset-top) + 0.85rem));
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: rgba(138, 129, 118, 0.8);
  opacity: 0.55;
}
