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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#canvas:active {
  cursor: grabbing;
}

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

.hud-section {
  position: absolute;
  pointer-events: auto;
  background: rgba(4, 7, 11, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.hud-top-left {
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-bottom-left {
  bottom: 60px;
  left: 20px;
  min-width: 320px;
  max-width: 400px;
}

.hud-top-right {
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seed-display,
.fps-display,
.hash-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.label {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  min-width: 50px;
}

.value {
  color: #00d9ff;
  font-weight: 600;
}

.monospace {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
}

.phase-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00d9ff, #7b2cbf);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.progress-details {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.separator {
  color: rgba(255, 255, 255, 0.3);
}

.hud-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.hud-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.hud-button:active {
  transform: translateY(0);
}

.hud-button:focus {
  outline: 2px solid #00d9ff;
  outline-offset: 2px;
}

.button-icon {
  font-size: 16px;
}

.button-text {
  flex: 1;
  text-align: left;
}

.webgl-error {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #04070b;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-content {
  text-align: center;
  padding: 40px;
  max-width: 500px;
}

.error-content h2 {
  font-size: 32px;
  margin-bottom: 16px;
  color: #00d9ff;
}

.error-content p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
}

.footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

.footer p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: auto;
}

.footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #00d9ff;
}

@media (max-width: 768px) {
  .hud-section {
    padding: 12px;
  }

  .hud-top-left,
  .hud-bottom-left,
  .hud-top-right {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .hud-bottom-left {
    bottom: 50px;
    min-width: auto;
  }

  .hud-top-right {
    top: auto;
    bottom: 140px;
    right: 10px;
    left: 10px;
  }

  .hud-button {
    min-width: auto;
    justify-content: center;
  }

  .button-text {
    display: none;
  }
}