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

body {
  overflow: hidden;
  background: #0a0a0f;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
  user-select: none;
  -webkit-user-select: none;
}

#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* ---- Join Screen ---- */

#join-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a12 100%);
}

#join-panel {
  background: rgba(18, 18, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
}

#join-panel h1 {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #6ec6ff 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 24px;
}

#name-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 20px;
}

#name-input:focus {
  border-color: rgba(110, 198, 255, 0.5);
}

#name-input::placeholder {
  color: #555;
}

/* Face Editor */

#face-editor {
  margin-bottom: 24px;
}

#face-canvas {
  width: 192px;
  height: 192px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  image-rendering: pixelated;
  cursor: crosshair;
  background: #2a2a3a;
  display: block;
  margin: 0 auto 12px;
}

#face-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#face-tools input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 1px;
}

#face-tools button,
#brush-sizes button {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.15s;
}

#face-tools button:hover,
#brush-sizes button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

#brush-sizes {
  display: flex;
  gap: 4px;
}

#brush-sizes button.active {
  background: rgba(110, 198, 255, 0.25);
  border-color: rgba(110, 198, 255, 0.5);
  color: #6ec6ff;
}

#join-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.1em;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

#join-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

#join-btn:active {
  transform: translateY(0);
}

/* ---- Game UI ---- */

#game-ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#game-ui > * {
  pointer-events: auto;
}

/* Crosshair */

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  font-weight: 300;
  line-height: 1;
}

#crosshair.aiming {
  color: #ffee66;
  font-size: 30px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 180, 40, 0.9), 0 0 2px #000;
}

/* Screen clock vs game clock — compositor animation vs the game loop. */

#pace-compare {
  position: absolute;
  top: 96px;
  left: 12px;
  z-index: 30;
  width: 360px;
  padding: 8px 10px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 10, 16, 0.78);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

#game-ui > #pace-compare {
  pointer-events: none;
}

#pace-compare[hidden] {
  display: none !important;
}

.pace-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pace-tag {
  width: 58px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.pace-tag.screen { color: #5cff8a; }
.pace-tag.game { color: #ff7ad9; }

.pace-track {
  position: relative;
  width: 260px;
  height: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.pace-dot {
  position: absolute;
  top: 2px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  will-change: transform;
}

.pace-dot-screen {
  background: #5cff8a;
  box-shadow: 0 0 8px #5cff8a;
  animation: pace-slide 1s linear infinite;
}

.pace-dot-game {
  background: #ff7ad9;
  box-shadow: 0 0 8px #ff7ad9;
}

@keyframes pace-slide {
  from { transform: translateX(0); }
  to { transform: translateX(248px); }
}

#pace-readout {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* Player Info */

#player-info {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#player-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

#super-token-hud {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 180, 40, 0.7), 0 1px 3px rgba(0, 0, 0, 0.9);
}

#super-token-hud.flash {
  animation: super-token-flash 0.9s ease-out;
}

@keyframes super-token-flash {
  0% { transform: scale(1.35); color: #fff6a0; }
  100% { transform: scale(1); color: #ffd700; }
}

/* [V] reminder — clear, and off the crosshair / fuel bar */
#game-ui > #vehicle-hint {
  position: absolute;
  left: 50%;
  bottom: 124px;
  transform: translateX(-50%);
  z-index: 24;
  pointer-events: none;
  padding: 5px 12px;
  background: rgba(6, 14, 28, 0.88);
  border: 1px solid rgba(255, 220, 120, 0.7);
  border-radius: 8px;
  color: #ffe9a0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

/* Fly / jet fuel — always visible, big when changing */
#fuel-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  max-width: min(420px, 34vw);
  width: 280px;
  padding: 8px 12px 10px;
  background: rgba(6, 14, 28, 0.82);
  border: 2px solid rgba(80, 160, 255, 0.55);
  border-radius: 10px;
  pointer-events: none;
  z-index: 25;
  box-shadow: 0 0 18px rgba(40, 120, 255, 0.25);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

#fuel-hud .fuel-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #7ec8ff;
  margin-bottom: 4px;
}

#fuel-hud .fuel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fuel-hud .fuel-bar-track {
  flex: 1;
  height: 14px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(120, 180, 255, 0.35);
}

#fuel-hud .fuel-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a5cff, #44ddff);
  border-radius: 6px;
  transition: width 0.12s linear;
  box-shadow: 0 0 10px rgba(68, 200, 255, 0.65);
}

#fuel-hud .fuel-seconds {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #e8f6ff;
  min-width: 3.2em;
  text-align: right;
  text-shadow: 0 0 8px rgba(80, 180, 255, 0.5);
}

#fuel-hud .fuel-delta {
  position: absolute;
  right: 12px;
  top: -6px;
  font-size: 18px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

#fuel-hud.empty {
  border-color: rgba(90, 90, 100, 0.45);
  box-shadow: none;
}
#fuel-hud.empty .fuel-label { color: #8899aa; }
#fuel-hud.empty .fuel-seconds { color: #8899aa; text-shadow: none; }
#fuel-hud.empty .fuel-bar-fill { background: #445566; box-shadow: none; }

#fuel-hud.draining {
  border-color: #ff8844;
  box-shadow: 0 0 22px rgba(255, 120, 40, 0.45);
  animation: fuel-drain-pulse 0.55s ease-in-out infinite;
}
#fuel-hud.draining .fuel-bar-fill {
  background: linear-gradient(90deg, #ff6622, #ffcc44);
}
#fuel-hud.draining .fuel-seconds { color: #ffcc88; }

#fuel-hud.gaining {
  border-color: #44ff99;
  box-shadow: 0 0 28px rgba(60, 255, 140, 0.55);
  transform: translateX(-50%) scale(1.06);
}
#fuel-hud.gaining .fuel-bar-fill {
  background: linear-gradient(90deg, #22ee66, #88ffee);
}
#fuel-hud.gaining .fuel-seconds { color: #b8ffd0; }

#fuel-hud.low:not(.empty):not(.gaining) {
  border-color: #ff4466;
  animation: fuel-low-blink 0.7s steps(2) infinite;
}

#fuel-delta.pop-gain {
  color: #66ffaa;
  animation: fuel-delta-up 1.1s ease-out forwards;
}
#fuel-delta.pop-drain {
  color: #ff9955;
  animation: fuel-delta-down 0.9s ease-out forwards;
}

@keyframes fuel-drain-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 120, 40, 0.35); }
  50% { box-shadow: 0 0 28px rgba(255, 140, 50, 0.7); }
}
@keyframes fuel-low-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes fuel-delta-up {
  0% { opacity: 1; transform: translateY(0) scale(1.2); }
  100% { opacity: 0; transform: translateY(-28px) scale(1); }
}
@keyframes fuel-delta-down {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(16px); }
}

/* Toolbar */

#toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(12, 12, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(16px);
}

#tool-buttons {
  display: flex;
  gap: 4px;
}

.tool-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  font-size: 1.2em;
  transition: all 0.15s;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
}

#color-palette {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 200px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

#custom-color {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 1px;
}

/* Chat */

#chat-box {
  position: absolute;
  bottom: 80px;
  left: 16px;
  width: 320px;
  display: flex;
  flex-direction: column;
}

#chat-messages {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(12, 12, 20, 0.5);
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#chat-messages:empty {
  display: none;
}

#chat-messages:empty + #chat-input {
  border-radius: 10px;
}

.chat-msg {
  font-size: 0.82em;
  line-height: 1.4;
  padding: 2px 0;
  word-wrap: break-word;
}

.chat-msg .chat-name {
  font-weight: 600;
  color: #a5b4fc;
}

.chat-msg .chat-text {
  color: rgba(255, 255, 255, 0.85);
}

.chat-msg.system-msg {
  color: rgba(255, 255, 150, 0.7);
  font-style: italic;
}

#chat-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85em;
  background: rgba(12, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 10px 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: rgba(110, 198, 255, 0.4);
  background: rgba(12, 12, 20, 0.85);
}

#chat-input::placeholder {
  color: #555;
}

#chat-stay-label {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  user-select: none;
}

#chat-box.chatting #chat-stay-label {
  display: flex;
}

/* Static controls, with the legacy teleport code tucked under them */

#game-ui > #corner-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 196px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
}

#controls-ref {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  padding: 6px 8px;
  background: rgba(6, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

#controls-ref kbd {
  font-family: inherit;
  font-weight: 800;
  color: #ffe9a0;
}

#ctrl-speed {
  color: #9ad4ff;
  font-variant-numeric: tabular-nums;
}

#teleport-panel {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  width: 100%;
  padding: 6px;
  background: rgba(12, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  pointer-events: auto;
}

#teleport-panel button {
  padding: 6px 10px;
  font-size: 0.78em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

#teleport-panel button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

#photo-mode-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px;
  background: rgba(8, 16, 32, 0.82);
  border: 1px solid rgba(120, 180, 255, 0.45);
  border-radius: 10px;
  pointer-events: none;
  z-index: 30;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
#photo-mode-banner.active { display: flex; }
#photo-mode-banner span {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #9ad4ff;
}
#photo-mode-banner small {
  font-size: 11px;
  color: rgba(220, 235, 255, 0.75);
}

#tp-code-input {
  width: 72px;
  padding: 5px 8px;
  font-size: 0.78em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #fff;
  outline: none;
}

#tp-code-input::placeholder {
  color: #555;
}

#tp-code-display {
  font-size: 0.78em;
  color: #6ec6ff;
  font-family: monospace;
  min-width: 0;
}

/* Paint Overlay */

#paint-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#paint-editor {
  background: rgba(18, 18, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

#paint-editor h3 {
  margin-bottom: 14px;
  font-weight: 600;
  color: #ddd;
}

#paint-canvas {
  width: 256px;
  height: 256px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  image-rendering: pixelated;
  cursor: crosshair;
  background: repeating-conic-gradient(#333 0% 25%, #2a2a2a 0% 50%) 0 0 / 32px 32px;
  display: block;
  margin: 0 auto 12px;
}

#paint-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

#paint-tools input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 1px;
}

#paint-tools button,
#paint-brush-sizes button {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.15s;
}

#paint-tools button:hover,
#paint-brush-sizes button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

#paint-brush-sizes {
  display: flex;
  gap: 4px;
}

#paint-brush-sizes button.active {
  background: rgba(110, 198, 255, 0.25);
  border-color: rgba(110, 198, 255, 0.5);
  color: #6ec6ff;
}

#paint-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

#paint-actions button {
  padding: 8px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.15s;
}

#paint-save {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-color: transparent !important;
}

#paint-save:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#paint-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
}

#paint-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ---- Creature / Horror ---- */

#proximity-vignette {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(80, 0, 0, 0.8) 100%);
  transition: opacity 0.3s;
}

#creature-compass {
  position: absolute;
  bottom: 72px;
  right: 16px;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.45s, transform 0.45s;
  pointer-events: none;
}

#creature-compass.active {
  opacity: 1;
  transform: scale(1);
}

.compass-ring {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(30, 0, 0, 0.35) 0%, rgba(8, 0, 0, 0.88) 70%),
    repeating-conic-gradient(from 0deg, rgba(255, 60, 40, 0.18) 0deg 2deg, transparent 2deg 90deg);
  border: 2px solid rgba(255, 70, 40, 0.55);
  box-shadow: 0 0 14px rgba(255, 20, 0, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.55);
}

.compass-tick {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  font-family: "Courier New", Courier, monospace;
  color: rgba(255, 180, 160, 0.75);
  letter-spacing: 0.04em;
}

.compass-tick-n { top: 4px; left: 50%; transform: translateX(-50%); color: #ff6655; font-size: 8px; }
.compass-tick-e { right: 5px; top: 50%; transform: translateY(-50%); font-size: 8px; }
.compass-tick-s { bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 7px; }
.compass-tick-w { left: 5px; top: 50%; transform: translateY(-50%); font-size: 8px; }

#compass-needle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s linear;
  transform-origin: 50% 50%;
}

.compass-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #ffccaa;
  box-shadow: 0 0 6px rgba(255, 80, 40, 0.8);
  z-index: 2;
}

#compass-label {
  font-size: 0.65em;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #ff5533;
  font-family: "Courier New", Courier, monospace;
  text-shadow: 0 0 6px rgba(255, 0, 0, 0.55);
}

#compass-dist {
  font-size: 0.72em;
  color: #ff8866;
  font-family: monospace;
  text-shadow: 0 0 4px rgba(255, 0, 0, 0.45);
}

#splash-version,
#game-version {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

#splash-version {
  margin-top: 14px;
  text-align: center;
}

#game-version {
  position: absolute;
  bottom: 10px;
  left: 14px;
  z-index: 12;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

/* Fuel stays in the top-center gap. Controls stay in the right column. */
@media (max-width: 1366px), (max-height: 768px) {
  #fuel-hud {
    top: 8px;
    width: 220px;
    padding: 6px 10px 8px;
  }
  #fuel-hud .fuel-seconds { font-size: 18px; }
  #game-ui > #vehicle-hint { font-size: 14px; bottom: 124px; }
}

@media (max-width: 1280px), (max-height: 720px) {
  #fuel-hud { width: 180px; }
  #fuel-hud .fuel-label { font-size: 10px; letter-spacing: 0.14em; }
  #fuel-hud .fuel-bar-track { height: 12px; }
  #game-ui > #corner-stack { width: 180px; }
  #controls-ref { font-size: 10px; }
}

@media (max-width: 1024px) {
  #fuel-hud {
    top: 6px;
    width: 150px;
    padding: 4px 8px 6px;
  }
  #fuel-hud .fuel-seconds { font-size: 15px; min-width: 2.4em; }
  #fuel-hud .fuel-bar-track { height: 10px; }
  #game-ui > #vehicle-hint { bottom: 140px; font-size: 13px; padding: 3px 8px; }
  #chat-box { width: 260px; }
}

@media (max-width: 820px), (max-height: 620px) {
  #fuel-hud {
    top: 4px;
    width: 118px;
    padding: 3px 6px 4px;
  }
  #fuel-hud .fuel-label { margin-bottom: 2px; }
  #fuel-hud .fuel-seconds { font-size: 13px; min-width: 2.2em; }
  #fuel-hud .fuel-row { gap: 6px; }
  #game-ui > #corner-stack { top: 4px; right: 4px; width: 156px; }
  #controls-ref { font-size: 10px; padding: 4px 6px; gap: 1px 6px; }
  #game-ui > #vehicle-hint { bottom: 160px; font-size: 12px; }
  #chat-box { width: 220px; bottom: 64px; }
  #player-info { font-size: 0.72em; max-width: 42vw; }
}

#jumpscare-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s;
}

#jumpscare-overlay.active {
  opacity: 1;
  pointer-events: auto;
  animation: scare-flash 0.15s ease-out 3;
}

@keyframes scare-flash {
  0% { background: rgba(200, 0, 0, 1); }
  50% { background: rgba(30, 0, 0, 0.95); }
  100% { background: rgba(80, 0, 0, 0.95); }
}

#jumpscare-eyes {
  display: flex;
  gap: 50px;
  animation: eyes-zoom 0.2s ease-out forwards;
}

#jumpscare-overlay.active #jumpscare-eyes {
  animation: eyes-zoom 0.2s ease-out forwards;
}

@keyframes eyes-zoom {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.js-eye {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0000 30%, #880000 60%, #220000 100%);
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.9), 0 0 80px rgba(255, 0, 0, 0.5), inset 0 0 15px rgba(255, 100, 0, 0.5);
  animation: eye-glow 0.3s ease-in-out infinite alternate;
}

@keyframes eye-glow {
  from { box-shadow: 0 0 40px rgba(255, 0, 0, 0.9), 0 0 80px rgba(255, 0, 0, 0.5); transform: scale(1); }
  to { box-shadow: 0 0 60px rgba(255, 0, 0, 1), 0 0 120px rgba(255, 0, 0, 0.7); transform: scale(1.1); }
}

#killcam-banner {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

#killcam-banner.active {
  opacity: 1;
}

#killcam-label {
  font-size: 1.6em;
  font-weight: bold;
  color: #ff3322;
  border: 2px solid rgba(255, 50, 30, 0.85);
  padding: 0.35em 1em;
  background: rgba(10, 0, 0, 0.7);
}

#killcam-name {
  margin-top: 0.45em;
  font-size: 0.95em;
  color: rgba(255, 220, 200, 0.95);
  letter-spacing: 0.12em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
