:root {
  --primary-color: #6c5ce7;
  --secondary-color: #fd79a8;
  --accent-color: #00cec9;
  --bg-color: #2d3436;
  --panel-color: #353b48;
  --text-color: #f5f6fa;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
}

.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent-color);
}

h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.5);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

#player-name {
  font-size: 1.2rem;
  font-weight: bold;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: var(--panel-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.stat i {
  color: var(--secondary-color);
}

.kz-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.kz {
  width: 200px;
  height: 200px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.1s, filter 0.3s;
  margin-bottom: 20px;
}

.kz:hover {
  transform: scale(1.05);
}

.kz:active {
  transform: scale(0.95);
}

.basic-kz {
  background-image: url('../images/basic-kz.png');
}

.silver-kz {
  background-image: url('../images/silver-kz.png');
}

.gold-kz {
  background-image: url('../images/gold-kz.png');
}

.diamond-kz {
  background-image: url('../images/diamond-kz.png');
}

.rainbow-kz {
  background-image: url('../images/rainbow-kz.png');
}

.kz-selector {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.kz-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.kz-option {
  width: 60px;
  height: 60px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  border: 2px solid transparent;
}

.kz-option:hover {
  transform: scale(1.1);
}

.kz-option.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-color);
}

.locked {
  filter: grayscale(100%) brightness(30%);
  cursor: not-allowed;
}

.game-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background-color: var(--panel-color);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: 100%; /* Make panel use full height */
  display: flex;
  flex-direction: column;
}

.panel h2 {
  color: var(--secondary-color);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--accent-color);
  padding-bottom: 10px;
}

.update-timer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
}

.powerup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background-color 0.2s;
}

.powerup:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Max level powerup styling */
.max-level-powerup {
  border: 1px solid var(--accent-color);
  background-color: rgba(74, 157, 248, 0.1);
}

.max-level-powerup:hover {
  background-color: rgba(74, 157, 248, 0.15);
}

.powerup-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-right: 10px;
}

.powerup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.powerup-name {
  font-weight: bold;
  color: var(--accent-color);
}

.powerup-level-progress {
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
}

.powerup-description {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 5px;
}

.powerup-next-level {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-style: italic;
  margin-bottom: 5px;
  opacity: 0.9;
}

.powerup-level-pips {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.level-pip {
  width: 12px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.level-pip.active {
  background-color: var(--accent-color);
}

.buy-btn {
  background-color: var(--primary-color);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 120px;
  text-align: center;
}

.buy-btn:hover {
  background-color: #5f52d0;
}

.buy-btn:disabled {
  background-color: #444;
  cursor: not-allowed;
}

.buy-btn.max-level {
  background-color: var(--accent-color);
  opacity: 0.6;
}

.use-btn {
  background-color: var(--secondary-color);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 5px;
  transition: background-color 0.2s;
}

.use-btn:hover {
  background-color: #4a8dd8;
}

.use-btn:disabled {
  background-color: #444;
  cursor: not-allowed;
  opacity: 0.6;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.rank {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin-right: 15px;
  font-weight: bold;
}

.top-rank {
  background-color: gold;
  color: #333;
}

.player-stats {
  flex-grow: 1;
}

.player-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.player-clicks {
  font-size: 0.9rem;
  opacity: 0.8;
}

.challenge-btn {
  background-color: var(--secondary-color);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.challenge-btn:hover {
  background-color: #e84393;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.online-indicator {
  width: 10px;
  height: 10px;
  background-color: #2ecc71;
  border-radius: 50%;
  margin-right: 10px;
}

.challenge-item {
  display: flex;
  flex-direction: column;
  padding: 10px;
  margin-bottom: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.challenge-players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
}

.challenge-vs {
  font-size: 0.9rem;
  opacity: 0.7;
  margin: 0 10px;
}

.challenge-status {
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--primary-color);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

#login-btn {
  background-color: var(--primary-color);
  color: white;
}

#login-btn:hover {
  background-color: #5f52d0;
}

.btn-secondary {
  background-color: #7f8c8d;
  color: white;
}

.btn-secondary:hover {
  background-color: #95a5a6;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--panel-color);
  border-radius: var(--border-radius);
  padding: 30px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 1;
}

.modal h2 {
  color: var(--secondary-color);
  margin-bottom: 20px;
}

#username-input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #555;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 4px;
  font-size: 1rem;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.competition-content {
  max-width: 800px;
  text-align: center;
}

.competition-timer {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.competition-scores {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 30px;
}

.score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#player1-name, #player2-name {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

#player1-score, #player2-score {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.vs {
  font-size: 1.5rem;
  opacity: 0.7;
}

.competition-kz-container {
  display: flex;
  justify-content: center;
}

.competition-kz {
  width: 150px;
  height: 150px;
}

#notifications-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.notification {
  background-color: var(--panel-color);
  color: white;
  padding: 15px 20px;
  margin-top: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 300px;
  animation: slideIn 0.3s forwards;
  opacity: 0;
  transform: translateX(50px);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-success {
  border-left: 4px solid #2ecc71;
}

.notification-info {
  border-left: 4px solid var(--primary-color);
}

.notification-warning {
  border-left: 4px solid #f39c12;
}

@media (max-width: 768px) {
  .game-panels {
    grid-template-columns: 1fr;
  }
  
  .kz {
    width: 180px;
    height: 180px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .competition-scores {
    flex-direction: column;
    gap: 15px;
  }
  
  .vs {
    margin: 10px 0;
  }
  
  .modal-content {
    padding: 20px;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5f52d0;
}