/* FamiDex — racer replaces DEX on CRT when arcade is active */

.crt-screen--racing .console {
  display: none;
}

.crt-racer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 680px;
  outline: none;
}

.crt-racer.hidden {
  display: none;
}

.crt-racer:focus-visible {
  outline: 3px solid var(--highlight, #01cdfe);
  outline-offset: 4px;
}

.race-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  color: var(--warning, #ffcd75);
}

.race-hud-mid {
  color: #01cdfe;
  text-align: center;
}

.race-hud strong {
  color: #01cdfe;
}

.race-viewport {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  border: 4px solid #000;
  background: #12081f;
}

#raceCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #12081f;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.race-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 24, 0.78);
  gap: 16px;
  pointer-events: auto;
  cursor: pointer;
  text-align: center;
  padding: 16px;
  z-index: 2;
}

.race-start.hidden {
  display: none;
}

.race-start-title {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.65rem, 2vw, 1rem);
  color: #ff71ce;
  line-height: 1.5;
}

.race-start p:last-child {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.45rem, 1.2vw, 0.6rem);
  color: #c4a8e8;
  line-height: 1.5;
}

.race-hint {
  margin: 0;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  color: #c4a8e8;
}

.race-close {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  padding: 10px 14px;
  background: #1e1035;
  color: #ff71ce;
  border: 3px solid #ff71ce;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}

.race-close:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

@media (max-width: 768px) {
  .crt-racer {
    min-height: 480px;
  }

  .race-viewport,
  #raceCanvas {
    min-height: 240px;
  }

  .race-hud {
    font-size: 0.45rem;
  }
}
