@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Silkscreen&display=swap');

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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Share Tech Mono', monospace;
  cursor: crosshair;
}

canvas { display: block; }

#overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}

#hud-top {
  position: fixed;
  top: 20px; left: 24px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 11;
  pointer-events: none;
}

#hud-top .title {
  font-family: 'Silkscreen', monospace;
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 5px;
  margin-bottom: 4px;
}

#hud-bottom {
  position: fixed;
  bottom: 20px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,1);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  z-index: 11;
  pointer-events: none;
}

#hud-controls {
  position: fixed;
  bottom: 20px; right: 24px;
  color: rgba(255,255,255,1);
  font-size: 14px;
  letter-spacing: 2px;
  text-align: right;
  z-index: 11;
  pointer-events: none;
  line-height: 1.8;
}

#sound-toggle {
  position: fixed;
  top: 20px; right: 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 2px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 10px;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.3s;
  pointer-events: all;
  white-space: nowrap;
}

#sound-toggle:hover,
#fx-toggle:hover {
  border-color: rgba(255,255,255,0.4);
}

#sound-toggle .snd-active,
#fx-toggle .snd-active {
  color: #fff;
}

#sound-toggle .snd-inactive,
#fx-toggle .snd-inactive {
  color: rgba(255,255,255,0.2);
}

#fx-toggle {
  position: fixed;
  top: 52px; right: 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 2px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 10px;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.3s;
  pointer-events: all;
  white-space: nowrap;
}


#hud-lives {
  position: fixed;
  bottom: 100px;
  left: 24px;
  color: rgba(255,255,255,0.9);
  font-family: 'Silkscreen', monospace;
  font-size: 36px;
  letter-spacing: 8px;
  z-index: 11;
  pointer-events: none;
}

#game-over {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#game-over.visible {
  opacity: 1;
  pointer-events: all;
}

.go-title {
  font-family: 'Silkscreen', monospace;
  font-size: 52px;
  color: #fff;
  letter-spacing: 14px;
  margin-bottom: 24px;
  animation: flicker 3s infinite;
}

.go-score {
  font-family: 'Silkscreen', monospace;
  font-size: 32px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 8px;
  margin-bottom: 52px;
}

.go-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: #fff;
  letter-spacing: 4px;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 12px 40px;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

.go-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.05);
}

.go-btn.secondary {
  animation: none;
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
}

.go-btn.secondary:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

#scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 12;
}

#vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 11;
}

#intro-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 1.5s ease;
  overflow-y: auto;
  padding: 40px 0;
}

#intro-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#intro-screen .intro-name {
  font-family: 'Silkscreen', monospace;
  font-size: 48px;
  color: #fff;
  letter-spacing: 16px;
  margin-bottom: 14px;
  animation: flicker 3s infinite;
}

#intro-screen .intro-alias {
  font-family: 'Share Tech Mono', monospace;
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 10px;
  margin-bottom: 12px;
}

#intro-screen .intro-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 7px;
  margin-bottom: 56px;
}

.intro-buttons {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-bottom: 24px;
}

#intro-screen .start-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  color: #fff;
  letter-spacing: 5px;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 16px 52px;
  cursor: pointer;
  pointer-events: all;
  background: transparent;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

#intro-screen .start-btn.secondary {
  animation: none;
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.55);
}

#intro-screen .start-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.intro-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #fff;
  letter-spacing: 4px;
}

/* ─── TEXT VIEW ──────────────────────────────────────── */
#text-view {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  overflow-y: auto;
  z-index: 50;
}

#text-view.visible {
  display: block;
}

#text-view::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.tv-header {
  position: relative;
  text-align: center;
  padding: 60px 24px 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0;
}

.tv-back {
  position: absolute;
  top: 24px; left: 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 3px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.tv-back:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.tv-name {
  font-family: 'Silkscreen', monospace;
  font-size: 24px;
  color: #fff;
  letter-spacing: 10px;
  margin-bottom: 8px;
  animation: flicker 3s infinite;
}

.tv-alias {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 7px;
  margin-bottom: 8px;
}

.tv-role {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 5px;
}

/* ─── TIMELINE ───────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: rgba(255,255,255,0.12);
}

.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: 60px;
}

.timeline-item.left {
  justify-content: flex-end;
  padding-right: calc(50% + 32px);
}

.timeline-item.right {
  justify-content: flex-start;
  padding-left: calc(50% + 32px);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: rgba(255,255,255,0.6);
  z-index: 2;
}

.timeline-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 20px 22px;
  position: relative;
  background: rgba(255,255,255,0.02);
}

/* connector line from card edge to center dot */
.timeline-item.left .timeline-card::after {
  content: '';
  position: absolute;
  top: 23px;
  right: -32px;
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.12);
}

.timeline-item.right .timeline-card::after {
  content: '';
  position: absolute;
  top: 23px;
  left: -32px;
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.12);
}

.card-label {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-title {
  font-family: 'Silkscreen', monospace;
  font-size: 13px;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.card-body {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  line-height: 1.9;
  white-space: pre-line;
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
  98% { opacity: 0.4; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#info-panel {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  color: #fff;
  font-size: 13px;
  letter-spacing: 2px;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  max-width: 360px;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 22px;
}

#info-panel.visible { opacity: 1; }

#info-panel .info-label {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#info-panel .info-title {
  font-family: 'Silkscreen', monospace;
  font-size: 17px;
  margin-bottom: 14px;
}

#info-panel .info-body {
  color: rgba(255,255,255,0.6);
  line-height: 2;
  font-size: 13px;
}

#distance-counter {
  position: fixed;
  bottom: 50px;
  left: 24px;
  color: rgba(255,255,255,1);
  font-size: 36px;
  font-family: 'Silkscreen', monospace;
  letter-spacing: 4px;
  z-index: 11;
  pointer-events: none;
}

/* ─── LEADERBOARD ────────────────────────────────────── */
.lb-title {
  font-family: 'Silkscreen', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-entry {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px;
}

.lb-entry .lb-rank {
  width: 20px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.lb-entry .lb-name {
  flex: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-entry .lb-score {
  color: rgba(255,255,255,0.9);
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.lb-empty {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 2px;
}

/* Homepage leaderboard */
.intro-leaderboard {
  margin-top: 40px;
  width: 460px;
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 24px;
}

.intro-leaderboard .lb-title {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 6px;
  margin-bottom: 16px;
}

.intro-leaderboard .lb-list {
  gap: 10px;
}

.intro-leaderboard .lb-entry {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  gap: 16px;
}

.intro-leaderboard .lb-entry .lb-rank {
  width: 28px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.intro-leaderboard .lb-entry .lb-name {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
}

.intro-leaderboard .lb-entry .lb-score {
  font-size: 15px;
  color: #fff;
}

.intro-leaderboard .lb-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

/* In-game HUD leaderboard */
#hud-leaderboard {
  position: fixed;
  top: 70px;
  left: 24px;
  z-index: 11;
  pointer-events: none;
  width: 260px;
}

#hud-leaderboard .lb-title {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 4px;
  margin-bottom: 10px;
}

#hud-leaderboard .lb-list {
  gap: 7px;
}

#hud-leaderboard .lb-entry {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}

#hud-leaderboard .lb-entry .lb-rank {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  width: 24px;
}

#hud-leaderboard .lb-entry .lb-name {
  color: rgba(255,255,255,0.9);
}

#hud-leaderboard .lb-entry .lb-score {
  font-size: 13px;
  color: #fff;
}

/* Game-over high score prompt */
.go-highscore {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.go-highscore.visible {
  display: flex;
}

.go-hs-label {
  font-family: 'Silkscreen', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 4px;
}

#go-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  color: #fff;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  outline: none;
  width: 220px;
  text-align: center;
  padding: 6px 0;
}

#go-name::placeholder {
  color: rgba(255,255,255,0.2);
  letter-spacing: 4px;
}
