/* Infinity Click - Main Styles */
/* Reset and base styles */

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

body {
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #1a0033 0%, #0a0015 100%);
  background-attachment: fixed;
  /* Prevent pull-to-refresh on mobile */
  overscroll-behavior: none;
}

/* Mobile touch optimization */
button,
a,
[role="button"],
[onclick] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Disable right-click context menu */
#root {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Button styles */
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px currentColor, 0 7px 0 #990099 !important;
}

/* Support Development Button Hover Animation */
a[href*="ko-fi"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 0 #cc5500, 0 0 20px rgba(255, 170, 0, 0.8), 0 0 40px rgba(255, 170, 0, 0.4) !important;
  filter: brightness(1.1);
}

a[href*="ko-fi"]:active {
  transform: translateY(2px) !important;
  box-shadow: 0 2px 0 #cc5500, 0 0 10px rgba(255, 170, 0, 0.5) !important;
}

/* Don't apply hover transform to pulsing button */
button.pulse-button:hover {
  transform: translateY(-2px) !important;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 0 10px currentColor, 0 2px 0 #990099 !important;
}

/* Pulsing START GAME button */
.pulse-button {
  animation: buttonPulse 1.5s ease-in-out infinite !important;
}

button.pulse-button {
  animation: buttonPulse 1.5s ease-in-out infinite !important;
}

.power-up:hover {
  transform: scale(1.2) !important;
}

/* Custom scrollbar for debug menu */
*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 255, 255, 0.1);
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.5);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.8);
}

/* Loading Screen Styles */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a0033 0%, #0a0015 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: 'Press Start 2P', cursive;
}

.loading-container {
  text-align: center;
  padding: 40px;
}

.loading-cabinet {
  background: rgba(0, 0, 0, 0.8);
  border: 8px solid #ff00ff;
  box-shadow: 0 0 30px #ff00ff, inset 0 0 30px rgba(255, 0, 255, 0.2);
  padding: 40px;
  border-radius: 8px;
  max-width: 600px;
}

.loading-title {
  width: 565px;
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto 30px;
  filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 25px rgba(0, 255, 255, 0.6));
  image-rendering: crisp-edges;
  animation: pulse 2s ease-in-out infinite;
}

.loading-text {
  font-size: 18px;
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
  margin-bottom: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-bar-container {
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.5);
  border: 3px solid #0ff;
  box-shadow: 0 0 10px #0ff, inset 0 0 10px rgba(0, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ff 0%, #00cccc 50%, #0ff 100%);
  box-shadow: 0 0 20px #0ff;
  transition: width 0.3s ease-out;
  position: relative;
}

.loading-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.loading-status {
  font-size: 12px;
  color: #ff00ff;
  text-shadow: 0 0 5px #ff00ff;
  min-height: 20px;
}

.tap-to-start-btn {
  margin-top: 20px;
  padding: 12px 24px;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  border: 2px solid #fff;
  border-radius: 8px;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.5), 0 0 20px rgba(0, 255, 255, 0.5);
  transition: all 0.3s ease;
  animation: pulse 1.5s ease-in-out infinite;
}

.tap-to-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.8), 0 0 30px rgba(0, 255, 255, 0.8);
}

.tap-to-start-btn:active {
  transform: scale(0.95);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Global Leaderboard - Second Arcade Monitor */
.global-leaderboard-container {
  width: min(95vw, 1200px);
  max-width: 1200px;
  margin: 20px auto 0;
  background: rgba(0, 0, 0, 0.8);
  border: 6px solid #00ff00;
  box-shadow: 0 0 25px #00ff00, inset 0 0 20px rgba(0, 255, 0, 0.2);
  border-radius: 8px;
  padding: 20px;
  font-family: 'Press Start 2P', cursive;
  position: relative;
  overflow: hidden;
}

/* CRT Filter Effect */
.global-leaderboard-container::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;
  z-index: 1;
}

/* CRT Scanline Animation */
.global-leaderboard-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 2;
  animation: crt-scanline 8s linear infinite;
}

@keyframes crt-scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(1000%); }
}

/* CRT Scanline Effect - Static Scanlines */
.game-screen-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 255, 0.03) 0px,
    rgba(0, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1000;
}

/* CRT Rolling Scanline Animation */
.game-screen-rolling-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    rgba(0, 255, 255, 0) 0%,
    rgba(0, 255, 255, 0.08) 50%,
    rgba(0, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 1001;
  animation: crt-scanline 8s linear infinite;
}

.leaderboard-header {
  font-size: 18px;
  color: #00ff00;
  text-shadow: 0 0 15px #00ff00, 0 0 25px #00ff00;
  text-align: center;
  margin-bottom: 15px;
  z-index: 3;
  position: relative;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  z-index: 3;
  position: relative;
}

.leaderboard-tab {
  background: rgba(0, 255, 0, 0.1);
  border: 2px solid #00ff00;
  color: #00ff00;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  padding: 8px 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 0 5px #00ff00;
}

.leaderboard-tab:hover {
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 15px #00ff00;
}

.leaderboard-tab.active {
  background: rgba(0, 255, 0, 0.3);
  box-shadow: 0 0 20px #00ff00;
  border-color: #0ff;
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

.leaderboard-scroll {
  z-index: 3;
  position: relative;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.3);
  font-size: 10px;
  transition: all 0.2s;
}

.leaderboard-entry:hover {
  background: rgba(0, 255, 0, 0.1);
  border-color: #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.leaderboard-entry.rank-1 {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.leaderboard-entry.rank-2 {
  background: rgba(192, 192, 192, 0.2);
  border-color: #c0c0c0;
}

.leaderboard-entry.rank-3 {
  background: rgba(205, 127, 50, 0.2);
  border-color: #cd7f32;
}

.leaderboard-rank {
  min-width: 40px;
  color: #ffff00;
  text-shadow: 0 0 5px #ffff00;
  font-weight: bold;
}

.leaderboard-entry.rank-1 .leaderboard-rank {
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
}

.leaderboard-entry.rank-2 .leaderboard-rank {
  color: #c0c0c0;
  text-shadow: 0 0 10px #c0c0c0;
}

.leaderboard-entry.rank-3 .leaderboard-rank {
  color: #cd7f32;
  text-shadow: 0 0 10px #cd7f32;
}

.leaderboard-player {
  flex: 1;
  color: #0ff;
  text-shadow: 0 0 5px #0ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-flag {
  font-size: 14px;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
  display: inline-block;
  min-width: 24px;
  text-align: center;
}

/* Style for country codes when flag emojis aren't supported (Windows) */
.leaderboard-flag.country-code {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 4px;
  background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
  color: #000;
  border-radius: 3px;
  border: 1px solid #00ffff;
  box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  letter-spacing: 0.5px;
  filter: none;
}

.leaderboard-score {
  min-width: 80px;
  text-align: right;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
  font-weight: bold;
}

.leaderboard-stats {
  display: flex;
  gap: 15px;
  color: #888;
  font-size: 8px;
  margin-left: 10px;
}

.leaderboard-loading {
  text-align: center;
  color: #00ff00;
  padding: 40px;
  font-size: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

.leaderboard-error {
  text-align: center;
  color: #ff0000;
  padding: 20px;
  font-size: 10px;
  text-shadow: 0 0 10px #ff0000;
}

/* Score Submission Modal */
.submission-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.submission-modal {
  background: linear-gradient(180deg, #1a0033 0%, #0a0015 100%);
  border: 6px solid #0ff;
  box-shadow: 0 0 40px #0ff, inset 0 0 30px rgba(0, 255, 255, 0.2);
  border-radius: 12px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  font-family: 'Press Start 2P', cursive;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.submission-modal h2 {
  font-size: 20px;
  color: #0ff;
  text-shadow: 0 0 20px #0ff;
  text-align: center;
  margin-bottom: 20px;
}

.submission-modal p {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.6;
}

.submission-modal input {
  width: 100%;
  padding: 15px;
  background: rgba(0, 0, 0, 0.8);
  border: 3px solid #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  color: #0ff;
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
  text-align: center;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.submission-modal input:focus {
  outline: none;
  box-shadow: 0 0 20px #0ff;
}

.submission-modal .error-message {
  color: #ff0000;
  text-shadow: 0 0 10px #ff0000;
  font-size: 10px;
  text-align: center;
  margin-bottom: 15px;
  min-height: 20px;
}

.submission-modal .button-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.submission-modal button {
  flex: 1;
  padding: 15px;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.submission-modal .submit-button {
  background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
  border: 3px solid #0ff;
  color: #000;
  box-shadow: 0 4px 0 #006600, 0 0 10px rgba(0, 255, 0, 0.5);
}

.submission-modal .submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #006600, 0 0 20px rgba(0, 255, 0, 0.8);
}

.submission-modal .submit-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #006600, 0 0 10px rgba(0, 255, 0, 0.5);
}

.submission-modal .submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submission-modal .cancel-button {
  background: rgba(255, 0, 0, 0.2);
  border: 3px solid #ff0000;
  color: #ff0000;
  box-shadow: 0 4px 0 #990000, 0 0 10px rgba(255, 0, 0, 0.3);
}

.submission-modal .cancel-button:hover {
  background: rgba(255, 0, 0, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #990000, 0 0 20px rgba(255, 0, 0, 0.5);
}

.submission-modal .cancel-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #990000, 0 0 10px rgba(255, 0, 0, 0.3);
}
