* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", cursive;
  overflow: hidden;
  background: #030305;
}

.arcade-cabinet {
  position: relative;
  max-width: 95vw;
  background: 
    repeating-linear-gradient(
      85deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.08) 3px,
      rgba(0,0,0,0.08) 6px
    ),
    repeating-linear-gradient(
      95deg,
      transparent,
      transparent 12px,
      rgba(255,255,255,0.015) 12px,
      rgba(255,255,255,0.015) 24px
    ),
    linear-gradient(180deg, #2d1a0f 0%, #1f130a 15%, #1a0c06 30%, #1f130a 50%, #1a0c06 70%, #1f130a 85%, #2d1a0f 100%);
  padding: 15px 40px;
  border-radius: 20px;
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,0.08),
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 10px 40px rgba(0,0,0,0.8),
    0 0 0 8px #1a0f05,
    0 0 0 12px #0d0702,
    0 20px 60px rgba(0,0,0,0.9);
  position: relative;
}

.arcade-cabinet::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 2px solid rgba(255,200,100,0.05);
  border-radius: 12px;
  pointer-events: none;
}

.arcade-cabinet::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.03) 30%, 
    rgba(255,255,255,0.05) 50%, 
    rgba(255,255,255,0.03) 70%, 
    transparent 100%
  );
  pointer-events: none;
  border-radius: 20px;
}

.marquee {
  background: linear-gradient(180deg, #111 0%, #222 50%, #111 100%);
  color: #00ff88;
  font-size: 20px;
  padding: 10px 30px;
  margin-bottom: 15px;
  border-radius: 10px;
  text-align: center;
  text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff8866;
  box-shadow: 
    inset 0 -4px 10px rgba(0,0,0,0.8),
    0 2px 4px rgba(0,0,0,0.5),
    0 0 30px #00ff8833;
  border: 3px solid #0a0a0a;
  letter-spacing: 3px;
}

.arcade-cabinet .screen-bezel {
  background: #0a0a0a;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 
    inset 0 4px 20px rgba(0,0,0,0.8),
    0 2px 4px rgba(0,0,0,0.5);
  position: relative;
}

.arcade-cabinet #gameCanvas {
  display: block;
  border: 3px solid #00ff88;
  box-shadow: 
    0 0 40px #00ff8822,
    inset 0 0 60px #00000088;
  max-width: 100%;
  height: auto;
  touch-action: none;
}

.arcade-cabinet .controls {
  margin-top: 12px;
  text-align: center;
  font-size: 10px;
}

.arcade-cabinet .legend {
  margin-top: 8px;
  text-align: center;
  font-size: 9px;
}

.arcade-cabinet .legend-info {
  color: #a08060;
  font-size: 8px;
  margin-top: 10px;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .arcade-cabinet {
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 98vw;
  }
  
  .marquee {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .arcade-cabinet .screen-bezel {
    padding: 6px;
  }
  
  .arcade-cabinet .controls, button.donate-btn {
    display: none;
  }

  .arcade-cabinet .legend,
  .arcade-cabinet .legend-info {
    font-size: 7px;
    margin-top: 8px;
    line-height: 1.6;
  }
  
  .arcade-cabinet .legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .arcade-cabinet .legend-item {
    margin: 0 2px;
  }
  
  .donate-btn {
    position: static;
    display: block;
    font-size: 6px;
    padding: 3px 5px;
  }
}

#qrOverlay .donate-btn,
#continueOverlay .donate-btn,
.qr-box .donate-btn {
  position: static;
  display: block;
  background: linear-gradient(180deg, #2d1f10 0%, #1a1008 100%);
  color: #00ff00;
  border: 2px solid #00aa00;
  padding: 6px 12px;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.1),
    inset -1px -1px 2px rgba(0,0,0,0.3),
    0 0 10px rgba(0, 255, 0, 0.3);
  transition: all 0.2s;
}

#qrOverlay .donate-btn:hover,
#continueOverlay .donate-btn:hover,
.qr-box .donate-btn:hover {
  color: #88ff88;
  border-color: #00ff00;
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.1),
    inset -1px -1px 2px rgba(0,0,0,0.3),
    0 0 20px rgba(0, 255, 0, 0.5);
}

.legend {
  color: #d4a855;
  font-size: 9px;
  margin-top: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
}
.legend-item {
  display: inline-block;
  margin: 0 8px;
}
.legend-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border: 2px solid #5a4a30;
  vertical-align: middle;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}
.legend-info {
  color: #a08060;
  font-size: 8px;
  margin-top: 10px;
  letter-spacing: 1px;
}
.controls {
  color: #d4a855;
  font-size: 11px;
  margin-top: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
}
.controls span {
  color: #f5e6c8;
  background: #2a1f15;
  padding: 3px 6px;
  margin: 0 4px;
  border: 1px solid #5a4a30;
  border-radius: 3px;
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.1),
    inset -1px -1px 2px rgba(0,0,0,0.3);
}

.donate-btn {
  position: absolute;
  bottom: 15px;
  right: 20px;
  background: linear-gradient(180deg, #2d1f10 0%, #1a1008 100%);
  color: #00ff00;
  border: 2px solid #00aa00;
  padding: 5px;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.1),
    inset -1px -1px 2px rgba(0,0,0,0.3),
    0 0 10px rgba(0, 255, 0, 0.3);
  transition: all 0.2s;
}

.donate-btn:hover {
  color: #88ff88;
  border-color: #00ff00;
  box-shadow: 
    inset 1px 1px 2px rgba(255,255,255,0.1),
    inset -1px -1px 2px rgba(0,0,0,0.3),
    0 0 20px rgba(0, 255, 0, 0.5);
}

.donate-btn:disabled {
  color: #555555;
  border-color: #333333;
  cursor: not-allowed;
  box-shadow: none;
}

.qr-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.qr-overlay.active {
  display: flex;
}

.qr-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.qr-box {
  background: linear-gradient(180deg, #2d1f10 0%, #1a1008 50%, #0d0906 100%);
  padding: 25px 30px;
  border: 3px solid #d4a855;
  border-radius: 8px;
  text-align: center;
  box-shadow: 
    0 0 20px rgba(212, 168, 85, 0.4),
    0 0 40px rgba(212, 168, 85, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.6);
  position: relative;
  min-width: 280px;
}

.qr-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  border-radius: 4px;
}

.qr-box h3 {
  color: #00ff00;
  font-family: "Press Start 2P", cursive;
  font-size: 14px;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#qrContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

#qrContainer svg {
  border: 2px solid #d4a855;
  box-shadow: 0 0 15px rgba(212, 168, 85, 0.4);
}

.qr-box p {
  color: #d4a855;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  margin-top: 15px;
  letter-spacing: 1px;
}

.qr-close {
  position: absolute;
  top: -15px;
  right: -15px;
  color: #d4a855;
  font-size: 28px;
  cursor: pointer;
  font-family: "Press Start 2P", cursive;
  text-shadow: 0 0 5px #d4a855;
  z-index: 10;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #1a1008;
  border: 2px solid #d4a855;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(212, 168, 85, 0.5);
}

.game-over-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.game-over-overlay.active {
  display: flex;
}

.game-over-box {
  text-align: center;
}

.game-over-title {
  font-family: "Press Start 2P", cursive;
  font-size: 24px;
  color: #ff0000;
  margin-bottom: 20px;
  text-shadow: 0 0 5px #ff0000;
}

.game-over-score {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #ffffff;
  margin-bottom: 15px;
  text-shadow: 0 0 8px #ffffff;
}

.game-over-stat {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #00ff00;
  margin-bottom: 8px;
}

.game-over-stat:nth-child(3) {
  color: #ff8800;
  text-shadow: 0 0 3px #ff8800;
}

.game-over-stat:nth-child(4) {
  color: #00ffff;
  text-shadow: 0 0 3px #00ffff;
}

.game-over-stat:nth-child(6) {
  color: #ff00ff;
  text-shadow: 0 0 8px #ff00ff;
}

.game-over-blink {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #00ff00;
  margin-top: 20px;
  animation: blink 1s infinite;
  text-shadow: 0 0 8px #00ff00;
}

.game-over-continue {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #ff0000;
  margin-top: 10px;
  text-shadow: 0 0 8px #ff0000;
}

.game-over-nostr {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #ff8800;
  margin-top: 10px;
  text-shadow: 0 0 8px #ff8800;
}

.game-over-nostr.hidden {
  display: none;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@media (max-width: 768px) {
  .game-over-title {
    font-size: 16px;
  }
  
  .game-over-score {
    font-size: 12px;
  }
  
  .game-over-stat {
    font-size: 9px;
  }
  
  .game-over-blink,
  .game-over-continue,
  .game-over-nostr {
    font-size: 7px;
  }
}

.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.loading-overlay.active {
  display: flex;
}

.loading-text {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #00ff00;
  text-shadow: 0 0 10px #00ff00;
}

.block-flash-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  animation: blockFlashFade 2s forwards;
}

.block-flash-overlay.active {
  display: flex;
}

.block-flash-text {
  font-family: "Press Start 2P", cursive;
  font-size: 20px;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00;
}

@keyframes blockFlashFade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.mobile-controls {
  display: none;
}

@media (max-width: 768px) {
  .loading-text {
    font-size: 10px;
  }
  
  .block-flash-text {
    font-size: 12px;
  }

  .mobile-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(180deg, #1a1008 0%, #0d0906 100%);
    border-top: 3px solid #d4a855;
  }

  .mobile-btn {
    font-family: "Press Start 2P", cursive;
    font-size: 12px;
    padding: 15px 25px;
    border: 2px solid #d4a855;
    border-radius: 4px;
    cursor: pointer;
    background: #2d1f10;
    color: #d4a855;
    text-shadow: 0 0 5px #d4a855;
    box-shadow: 0 0 10px rgba(212, 168, 85, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-btn:active {
    background: #d4a855;
    color: #1a1008;
    text-shadow: none;
    box-shadow: 0 0 20px rgba(212, 168, 85, 0.6);
  }

  .mobile-fire {
    font-size: 14px;
    padding: 20px 30px;
  }

  .mobile-controls-restart {
    padding: 10px 20px;
    background: linear-gradient(180deg, #1a1008 0%, #0d0906 100%);
    border-top: none;
    margin-top: 0;
  }

  .mobile-restart {
    font-size: 8px;
    padding: 8px 20px;
  }
}

.mobile-stats {
  display: none;
}

@media (max-width: 768px) {
  .mobile-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 8px;
    background: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
    border: 2px solid #d4a855;
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: "Press Start 2P", cursive;
    font-size: 8px;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    max-width: 98vw;
  }

  .mobile-stats .stat {
    display: inline-block;
  }

  .mobile-stats .stat:nth-child(1) { color: #00ff00; text-shadow: 0 0 5px #00ff00; }
  .mobile-stats .stat:nth-child(2) { color: #00ff00; text-shadow: 0 0 5px #00ff00; }
  .mobile-stats .stat:nth-child(3) { color: #00ff00; text-shadow: 0 0 5px #00ff00; }
  .mobile-stats .stat:nth-child(4) { color: #ff8800; text-shadow: 0 0 5px #ff8800; }
  .mobile-stats .stat:nth-child(5) { color: #ff00ff; text-shadow: 0 0 5px #ff00ff; }
  .mobile-stats .stat:nth-child(6) { color: #00ffff; text-shadow: 0 0 5px #00ffff; }
  .mobile-stats .stat:nth-child(7) { color: #ffff00; text-shadow: 0 0 5px #ffff00; }
}
}