* {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Press Start 2P", cursive;
  background: #000;
  color: #fff;
  height: 100vh;
}

#game {
  width: 100vw;
  height: 100vh;
  position: relative;
  text-align: center;
  background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.crt-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 600;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  background-size: 100% 4px;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.7) 150%);
}

h1 {
  color: #00c8ff;
  text-shadow: 3px 3px #ff00ff;
  font-size: clamp(14px, 4vw, 24px);
  margin: 15px 0;
  z-index: 20;
}

#demo-text,
#demo-subtext,
#desktop-note {
  font-size: 10px;
  color: #fff;
  line-height: 1.5;
  padding: 0 10px;
}

.thumb {
  width: 40px;
  height: 40px;
  background: #ff00ff;
  border: 3px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: 50px;
  box-shadow: 0 0 15px #ff00ff;
}

#demo-anim {
  position: relative;
  width: 100%;
  height: 120px;
}

.spot {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  position: absolute;
  bottom: 120px;
  background: rgba(255, 255, 255, 0.05);
  display: none;
  transition: all 0.2s;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='white' opacity='0.25' d='M256 16c-132.5 0-240 107.5-240 240v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-114.9 93.1-208 208-208s208 93.1 208 208v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64C496 123.5 388.5 16 256 16zm0 64c-88.4 0-160 71.6-160 160v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-70.7 57.3-128 128-128s128 57.3 128 128v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-88.4-71.6-160-160-160zm0 64c-53 0-96 43-96 96v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-35.3 28.7-64 64-64s64 28.7 64 64v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-53-43-96-96-96zm0 64c-17.7 0-32 14.3-32 32v64c0 8.8 7.2 16 16 16s16-7.2 16-16v-64c0-17.7-14.3-32-32-32z'/%3E%3C/svg%3E");

  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.spot.lit {
  border: 5px solid #00c8ff;
  background: rgba(0, 200, 255, 0.2);
  box-shadow:
    0 0 30px #00c8ff,
    inset 0 0 15px #00c8ff;
  opacity: 1;
}

.left-spot {
  left: 10%;
}

.right-spot {
  right: 10%;
}

button {
  font-family: "Press Start 2P", cursive;
  background: #000;
  color: #fff;
  border: 3px solid #fff;
  padding: 15px 20px;
  font-size: 12px;
  cursor: pointer;
  margin: 10px;
  box-shadow: 5px 5px 0px #ff00ff;
  position: relative;
  z-index: 110;
}

button:active {
  transform: translate(3px, 3px);
  box-shadow: 0px 0px 0px;
}

#progress-container {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 25px;
  background: #000;
  border: 3px solid #fff;
  display: none;
  z-index: 50;
}

#progress-fill {
  height: 100%;
  background: #ff00ff;
  box-shadow: 0 0 15px #ff00ff;
  width: 0%;
}

#instructions,
#result,
#gameover,
#mode-buttons {
  background: #000;
  border: 4px solid #fff;
  box-shadow: 8px 8px 0px #00c8ff;
  padding: 25px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 120;
  width: 85%;
  max-width: 400px;
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  display: none;
}

#mode-buttons {
  flex-direction: column;
}

#countdown {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  color: #ff00ff;
  text-shadow: 4px 4px #00c8ff;
  z-index: 130;
  display: none;
}

#lives-display,
#swaps-display,
#touches-display {
  position: absolute;
  font-size: 10px;
  color: #00c8ff;
  z-index: 20;
}

#lives-display {
  top: 20px;
  left: 20px;
}

#touches-display {
  top: 20px;
  right: 20px;
}

#swaps-display {
  top: 50px;
  right: 20px;
}

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 105;
  display: none;
}

.overlay-screen {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.arcade-title {
  font-size: clamp(24px, 7vw, 50px) !important;
  color: #00c8ff;
  text-shadow: 5px 5px #ff00ff;
  margin-bottom: 10px;
  text-align: center;
}

.arcade-subtitle {
  font-size: 10px;
  color: #ff00ff;
  letter-spacing: 2px;
  margin-bottom: 50px;
}

.blink-text {
  font-size: 14px;
  color: #fff;
  animation: blink-animation 0.8s infinite;
}

@keyframes blink-animation {
  50% {
    opacity: 0;
  }
}

#swap-prompt {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #00c8ff;
  z-index: 10;
  background: #000;
  border: 2px solid #fff;
  padding: 10px;
  display: none;
  text-align: center;
}

#keyboard-instructions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 10px;
  z-index: 10;
  display: none;
}

#horse-counter {
  position: fixed;
  top: 90px;
  left: 10px;
  font-size: 14px;
  color: white;
}

#main-title {
  display: none;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  color: #00c8ff;
  text-shadow: 3px 3px #ff00ff;
  z-index: 2100;
  text-align: center;
}

#header_logo {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 60px;
  height: auto;
  z-index: 2100;
  max-width: 150px;
  display: block;
  margin: 0 auto;
  z-index: 20;
}

#partner_logo {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: auto;
  z-index: 1500;
  display: none;
}

#game-ui-container {
  position: fixed;
  top: 60px;
  left: 10px;
  display: none !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  z-index: 2000;
}

.arcade-lives {
  display: flex;
  gap: 5px;
  font-size: 16px;
}

.heart {
  color: #ff4757;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.heart.empty {
  color: #444;
  opacity: 0.5;
}

.horse-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 5px;
}

.horse-icon {
  font-size: 16px;
  filter: grayscale(1) opacity(0.3);
  transition: all 0.3s ease;
}

.horse-icon.active {
  filter: grayscale(0) opacity(1);
  transform: scale(1.2);
}

#lives-display,
#swaps-display {
  display: none !important;
}
