@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;1,9..144,300&display=swap');

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

body {
  background: #1a1a2e;
  color: #e0d8c8;
  font-family: 'DM Mono', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

#ui-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}

#title {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 300;
  color: #a09880;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 20;
  pointer-events: none;
  margin: 0;
}

#tech-tray {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
  pointer-events: all;
}

.tech-token {
  border: 0;
  font-family: inherit;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 24px;
  position: relative;
}

.tech-token:hover {
  transform: translateY(-4px);
}

.tech-token:active {
  cursor: grabbing;
}

.tech-token .label {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
}

.tech-token.nuclear {
  background: linear-gradient(135deg, #2d2a1a, #3a3520);
  border: 1px solid #6b6030;
  color: #e8d44d;
  box-shadow: 0 2px 12px rgba(232,212,77,0.15);
}
.tech-token.nuclear .label { color: #c8b840; }

.tech-token.crypto {
  background: linear-gradient(135deg, #1a2a2d, #1a2d28);
  border: 1px solid #2a6b5a;
  color: #4de8a0;
  box-shadow: 0 2px 12px rgba(77,232,160,0.15);
}
.tech-token.crypto .label { color: #40c888; }

.tech-token.firearms {
  background: linear-gradient(135deg, #2d1a1a, #352020);
  border: 1px solid #6b3030;
  color: #e87050;
  box-shadow: 0 2px 12px rgba(232,112,80,0.15);
}
.tech-token.firearms .label { color: #c86040; }

.tech-token.p2p {
  background: linear-gradient(135deg, #1a1a2d, #201a35);
  border: 1px solid #4040a0;
  color: #8080e8;
  box-shadow: 0 2px 12px rgba(128,128,232,0.15);
}
.tech-token.p2p .label { color: #7070c8; }

.tech-token.ai {
  background: linear-gradient(135deg, #2d1a2a, #351a30);
  border: 1px solid #8040a0;
  color: #d070e8;
  box-shadow: 0 2px 12px rgba(208,112,232,0.15);
}
.tech-token.ai .label { color: #b060c8; }

#narration-bar {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  width: 90%;
  max-width: 800px;
  justify-content: center;
}

#narration-bar.visible {
  opacity: 1;
  pointer-events: all;
}

#narration {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: #d0c8b0;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
  background: rgba(26, 26, 46, 0.85);
  padding: 4px 12px;
  border-radius: 4px;
}

#prev-btn,
#next-btn {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid #505040;
  color: #b0a880;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

#prev-btn:hover,
#next-btn:hover {
  border-color: #908860;
  color: #e0d8b0;
  background: rgba(200, 190, 140, 0.08);
}

.tech-token:focus-visible,
#prev-btn:focus-visible,
#next-btn:focus-visible,
#reset-btn:focus-visible {
  outline: 2px solid #f0e8c8;
  outline-offset: 3px;
}

#prev-btn.hidden,
#next-btn.hidden {
  display: none;
}

#instructions {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #605848;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 20;
  pointer-events: none;
}

#reset-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #404040;
  color: #808080;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 20;
  pointer-events: all;
  transition: border-color 0.2s, color 0.2s;
}
#reset-btn:hover { border-color: #808080; color: #c0c0c0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
  }
}
