/* =============================================================================
   Canvas Performance Tech Demo — Styles
   ============================================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080812;
  font-family: 'Courier New', Courier, monospace;
  color: #e0e0ff;

  /* Prevent all touch gestures */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* --- Canvas --- */
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
}

/* --- Overlays --- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 16, 0.88);
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  text-align: center;
  padding: 40px 48px;
  border: 2px solid rgba(70, 215, 255, 0.3);
  background: rgba(8, 8, 24, 0.9);
  box-shadow:
    0 0 40px rgba(70, 215, 255, 0.1),
    inset 0 0 40px rgba(70, 215, 255, 0.05);
}

.pixel-text {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.overlay-title {
  font-size: 32px;
  color: #46d7ff;
  text-shadow:
    0 0 10px rgba(70, 215, 255, 0.6),
    0 0 40px rgba(70, 215, 255, 0.3);
  margin-bottom: 8px;
}

.overlay-sub {
  font-size: 12px;
  color: rgba(224, 224, 255, 0.5);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

.overlay-hint {
  font-size: 11px;
  color: rgba(224, 224, 255, 0.35);
  margin-top: 20px;
  line-height: 1.6;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 40px;
  font-size: 18px;
  color: #080812;
  background: #46d7ff;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: #68e0ff;
  box-shadow: 0 0 20px rgba(70, 215, 255, 0.5);
}

.btn:active {
  transform: scale(0.96);
  background: #ffd24a;
  box-shadow: 0 0 30px rgba(255, 210, 74, 0.6);
}

/* --- Game Over Stats --- */
.go-stats {
  margin: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.go-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
}

.go-label {
  color: rgba(224, 224, 255, 0.5);
}

.go-val {
  color: #ffd24a;
  font-weight: bold;
}

/* --- Profiler Panel --- */
.profiler {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(70, 215, 255, 0.2);
  padding: 8px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.6;
  min-width: 220px;
  pointer-events: none;

  /* Safe area for notched phones */
  padding-top: max(8px, env(safe-area-inset-top, 8px));
  padding-left: max(12px, env(safe-area-inset-left, 12px));
}

.profiler.hidden {
  display: none;
}

.prof-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.prof-label {
  color: rgba(224, 224, 255, 0.4);
}

.prof-val {
  color: #44ff44;
  font-weight: bold;
  text-align: right;
  white-space: nowrap;
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
  .overlay-box {
    padding: 28px 24px;
    margin: 0 16px;
  }

  .overlay-title {
    font-size: 24px;
  }

  .btn {
    padding: 14px 48px;
    font-size: 18px;
  }

  .profiler {
    top: 4px;
    left: 4px;
    font-size: 10px;
    padding: 6px 8px;
    min-width: 180px;
  }
}

/* --- CRT Vignette effect --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
}