/* Tap Discs Game Styling - BitPlay Theme */

* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  margin: 0; 
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #16213e 100%);
  color: var(--fg); 
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

/* Game Header */
header { 
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  height: 60px; 
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(122, 255, 189, 0.2);
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Header Buttons */
#btn-exit, #btn-restart {
  width: 50px;
  height: 50px;
  background: linear-gradient(145deg, var(--card), #0f1f2f);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  color: var(--neon-cyan);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 15px rgba(122, 255, 189, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#btn-exit:hover, #btn-restart:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--neon-cyan);
  color: var(--bg-primary);
  box-shadow: 
    0 6px 25px rgba(122, 255, 189, 0.6),
    0 0 30px rgba(122, 255, 189, 0.4);
}

/* Score Display */
#hi {
  font-size: 24px;
  font-weight: bold;
  color: var(--neon-cyan);
  text-shadow: 0 0 15px var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
}

#hi-val {
  background: linear-gradient(145deg, var(--card), #0f1f2f);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--neon-cyan);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Game Canvas Container */
#game {
  width: 90vw;
  height: 70vh;
  max-width: 1000px;
  max-height: 600px;
  border: 3px solid var(--neon-cyan);
  border-radius: 15px;
  box-shadow: 
    0 0 30px var(--neon-cyan),
    inset 0 0 20px rgba(122, 255, 189, 0.1);
  background: radial-gradient(ellipse at center, #001122 0%, #000a1a 100%);
  margin: 80px 20px 20px;
  display: block;
}

/* Center Message Area */
#center-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
}

#center-msg div {
  font-size: 28px;
  font-weight: bold;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px var(--neon-cyan);
  margin-bottom: 10px;
}

#hits {
  font-size: 36px;
  color: var(--neon-pink);
  text-shadow: 0 0 25px var(--neon-pink);
}

#hi-badge {
  display: block;
  background: linear-gradient(135deg, var(--neon-pink), #ff4757);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulse-glow 2s infinite;
  margin-top: 10px;
}

@keyframes pulse-glow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 20px var(--neon-pink);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 35px var(--neon-pink);
  }
}

/* Call to Action Buttons */
.cta {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 50;
}

#share, .cta a {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: var(--bg-primary);
  text-decoration: none;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 15px rgba(58, 199, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#share:hover, .cta a:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 25px rgba(58, 199, 255, 0.5),
    0 0 30px rgba(58, 199, 255, 0.3);
}

/* Leaderboard Container */
.leaderboard-container {
  position: fixed;
  right: 20px;
  top: 80px;
  width: 300px;
  max-height: calc(100vh - 200px);
  background: rgba(20, 24, 39, 0.9);
  border: 2px solid rgba(122, 255, 189, 0.3);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  z-index: 90;
}

.leaderboard h3 {
  color: var(--neon-cyan);
  text-align: center;
  margin: 0 0 15px;
  font-size: 18px;
  text-shadow: 0 0 10px var(--neon-cyan);
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.leaderboard-entry:hover {
  background: rgba(122, 255, 189, 0.1);
  border-left-color: var(--neon-cyan);
}

.leaderboard-entry.first {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
  border-left-color: #ffd700;
}

.leaderboard-entry.second {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
  border-left-color: #c0c0c0;
}

.leaderboard-entry.third {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.1));
  border-left-color: #cd7f32;
}

.leaderboard-rank {
  font-weight: bold;
  min-width: 30px;
}

.leaderboard-score {
  color: var(--neon-cyan);
  font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
  .leaderboard-container {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  header {
    height: 50px;
    padding: 0 10px;
  }
  
  #btn-exit, #btn-restart {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  #hi {
    font-size: 18px;
  }
  
  #game {
    width: 95vw;
    height: 60vh;
    margin: 60px 10px 20px;
  }
  
  #center-msg div {
    font-size: 20px;
  }
  
  #hits {
    font-size: 28px;
  }
  
  .cta {
    bottom: 10px;
    gap: 10px;
  }
  
  #share, .cta a {
    padding: 10px 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #game {
    width: 98vw;
    height: 55vh;
    margin: 60px 5px 20px;
  }
  
  .cta {
    flex-direction: column;
    align-items: center;
  }
}

/* Loading and Error States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 18px;
  color: var(--muted);
}

.error {
  background: rgba(255, 107, 107, 0.1);
  border: 2px solid var(--neon-pink);
  color: var(--neon-pink);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin: 20px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}