@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=ZCOOL+KuaiLe&display=swap');

:root {
  --bg-color: #1a1a1a;
  --neon-cyan: #00e1ff;
  --neon-red: #ff4141;
  --nintendo-red: #e60012;
  --nintendo-red-shadow: #80000a;
  --text-color: #ffffff;
  --pixel-border: 4px solid #000000;
  --pixel-border-white: 4px dashed #ffffff;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'ZCOOL KuaiLe', 'Press Start 2P', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* CRT Scanline Effect Overlay */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  z-index: 9999;
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

/* Header styled with Chromatic Aberration */
header {
  margin-top: 20px;
  margin-bottom: 10px;
  text-align: left;
  width: 100%;
  max-width: 480px;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-container {
  position: relative;
  display: inline-block;
}

.main-title {
  font-size: 2.2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 
    -3px -3px 0 var(--neon-cyan),  
     3px  3px 0 var(--neon-red);
  letter-spacing: 2px;
  animation: glitch 1.5s infinite;
}

@keyframes glitch {
  0% {
    text-shadow: -3px -3px 0 var(--neon-cyan), 3px 3px 0 var(--neon-red);
  }
  50% {
    text-shadow: -2px 3px 0 var(--neon-cyan), 3px -2px 0 var(--neon-red);
  }
  100% {
    text-shadow: -3px -3px 0 var(--neon-cyan), 3px 3px 0 var(--neon-red);
  }
}

/* Sub-header */
.subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--neon-cyan);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Main Container Grid */
main {
  width: 100%;
  max-width: 480px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
}

/* Arcade retro cabinets/panels */
.cabinet-panel {
  background-color: #222;
  border: 4px solid #000;
  box-shadow: 
    0 0 0 4px #444,
    0 8px 0 #111;
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.panel-header {
  border-bottom: 4px solid #000;
  margin-bottom: 12px;
  padding-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  color: var(--neon-cyan);
  font-size: 1.1rem;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
}

/* User Profile Stats Card */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.username-tag {
  color: #ffff00;
  font-weight: bold;
}

.city-input-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.city-input {
  background-color: #000;
  border: 2px solid #555;
  color: var(--neon-cyan);
  font-family: 'ZCOOL KuaiLe', monospace;
  font-size: 0.9rem;
  padding: 3px 6px;
  width: 100px;
  text-align: center;
}

.city-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 5px;
}

.stat-box {
  background-color: #000;
  border: 2px solid #333;
  padding: 8px;
  text-align: center;
}

.stat-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  color: #ffcc00;
  font-weight: bold;
  margin-top: 4px;
}

/* Achievement badges */
.achievements-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.badge {
  background-color: #333;
  border: 2px solid #000;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: #aaa;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.unlocked {
  background-color: #004400;
  border-color: #00ff00;
  color: #00ff00;
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.4);
}

/* Chromatic Aberration Input component */
antigravity-input {
  display: block;
  margin-bottom: 12px;
}

.chroma-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #1a1a1a;
  border: 4px solid #000000;
  box-shadow: 
    -3px -3px 0 var(--neon-cyan),
     3px  3px 0 var(--neon-red);
  padding: 10px;
  gap: 15px;
}

.chroma-btn {
  background-color: #000;
  border: 2px solid #fff;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.chroma-btn:active {
  background-color: #333;
  transform: scale(0.95);
}

.chroma-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.6rem;
  width: 60px;
  text-align: center;
  color: #fff;
}

/* Pixel Hit Button component */
pixel-hit-button {
  display: block;
}

.retro-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0;
}

.arcade-btn {
  background-color: var(--nintendo-red);
  border: 4px solid #000;
  box-shadow: 
    0 0 0 4px #fff,
    0 8px 0 var(--nintendo-red-shadow),
    0 8px 0 4px #000;
  width: 100%;
  padding: 15px 0;
  color: #fff;
  font-family: 'ZCOOL KuaiLe', 'Press Start 2P', monospace;
  font-size: 1.3rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  user-select: none;
}

.arcade-btn:active {
  transform: translateY(4px);
  box-shadow: 
    0 0 0 4px #fff,
    0 4px 0 var(--nintendo-red-shadow),
    0 4px 0 4px #000;
}

.btn-caption {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #666;
  margin-top: 15px;
  text-transform: uppercase;
}

/* Leaderboard component rendering */
arcade-leaderboard {
  display: block;
}

.leaderboard-container {
  background-color: #000;
  border: var(--pixel-border-white);
  padding: 10px;
  font-family: 'ZCOOL KuaiLe', 'Press Start 2P', monospace;
}

.leaderboard-tabs {
  display: flex;
  margin-bottom: 12px;
  border-bottom: 2px solid #444;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #666;
  font-family: 'ZCOOL KuaiLe', monospace;
  font-size: 1rem;
  padding: 6px;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom: 4px solid var(--neon-cyan);
  font-weight: bold;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for leaderboard list */
.leaderboard-list::-webkit-scrollbar {
  width: 6px;
}
.leaderboard-list::-webkit-scrollbar-track {
  background: #000;
}
.leaderboard-list::-webkit-scrollbar-thumb {
  background: #333;
  border: 1px solid #666;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-size: 0.9rem;
  background-color: #111;
  border: 1px solid #222;
}

.leaderboard-item.highlighted {
  border: 1px solid var(--neon-cyan);
  background-color: #002233;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-weight: bold;
  margin-right: 8px;
}

.rank-badge.rank-1 {
  background-color: var(--gold);
  color: #000;
}
.rank-badge.rank-2 {
  background-color: var(--silver);
  color: #000;
}
.rank-badge.rank-3 {
  background-color: var(--bronze);
  color: #000;
}

.leaderboard-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-city {
  color: #888;
  font-size: 0.8rem;
  margin-right: 12px;
}

.leaderboard-score {
  color: #ffff00;
  font-weight: bold;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
}

/* Share & Audio Panel */
.share-action-row {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  flex: 1;
  background-color: #333;
  border: 3px solid #000;
  box-shadow: 0 4px 0 #111;
  color: #fff;
  font-family: 'ZCOOL KuaiLe', monospace;
  font-size: 0.95rem;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #111;
}

/* Audio control floating / header item */
.sound-toggle {
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
}
.sound-toggle.muted {
  color: var(--neon-red);
}
.sound-toggle.unmuted {
  color: var(--neon-cyan);
}

/* Boom Exploding Particles Effect */
.boom-particle {
  position: absolute;
  color: var(--neon-red);
  font-weight: bold;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  pointer-events: none;
  animation: boom-fly 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  z-index: 1000;
  text-shadow: 0 0 3px #fff;
}

@keyframes boom-fly {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -150%) scale(1.3) rotate(15deg);
    opacity: 0;
  }
}

/* Modal Popup styling for Sharing Poster */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

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

.modal-content {
  background-color: #222;
  border: 4px solid #000;
  box-shadow: 0 0 20px var(--neon-cyan);
  padding: 15px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.poster-canvas-wrapper {
  border: 4px solid #000;
  background-color: #000;
  max-width: 100%;
}

.poster-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.poster-instructions {
  color: #aaa;
  font-size: 0.75rem;
  text-align: center;
}

/* Footer info */
footer {
  margin-top: auto;
  padding: 15px;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #444;
}

/* Anti-Cheat UI Styles */
.cheat-modal-content {
  background-color: #111;
  border: 4px solid var(--neon-red);
  box-shadow: 0 0 25px rgba(255, 65, 65, 0.6);
  padding: 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.cheat-warning-title {
  color: var(--neon-red);
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.cheat-message {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 20px;
  color: #eee;
}

.modal-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.btn-confirm {
  background-color: #004400;
  border: 2px solid #00ff00;
  color: #00ff00;
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'ZCOOL KuaiLe', monospace;
  font-weight: bold;
}

.btn-cancel {
  background-color: #440000;
  border: 2px solid var(--neon-red);
  color: var(--neon-red);
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'ZCOOL KuaiLe', monospace;
  font-weight: bold;
}

.btn-confirm:active, .btn-cancel:active {
  transform: scale(0.95);
}

/* Evidence Upload Styles */
.evidence-upload-container {
  border: 2px dashed #666;
  background-color: #1a1a1a;
  padding: 15px;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
}

.evidence-upload-container input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2rem;
}

.upload-text {
  font-size: 0.8rem;
  color: #aaa;
}

.preview-container {
  display: none;
  width: 100%;
  max-height: 150px;
  overflow: hidden;
  border: 2px solid #000;
  margin-top: 10px;
}

.preview-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ⚡️ Palm glowing dynamic effect */
.glow-palm {
  animation: glow-text-anim 1.5s infinite alternate;
  font-weight: bold;
}

@keyframes glow-text-anim {
  0% {
    color: #ffd700;
    text-shadow: 0 0 5px #ffd700, 0 0 10px #ffcc00, -2px -2px 0 #ff4141;
  }
  100% {
    color: #ff0055;
    text-shadow: 0 0 12px #ff0055, 0 0 20px #ff00ff, 2px 2px 0 #00e1ff;
  }
}

/* 👑 Royal Dark Gold Theme Skin */
.royal-frame {
  border: 4px solid #ffd700 !important;
  box-shadow: 
    0 0 0 4px #000,
    0 0 15px rgba(255, 215, 0, 0.6),
    0 8px 0 #806600 !important;
  background: linear-gradient(135deg, #151515 0%, #2a2200 100%) !important;
}

.royal-username {
  border: 2px solid #ffd700;
  padding: 2px 8px;
  background-color: #000;
  box-shadow: 2px 2px 0 #806600;
  color: #ffd700 !important;
}

/* Bite input custom classes */
.chroma-input-container.bite-mode {
  box-shadow: 
    -3px -3px 0 #ff66a3,
     3px  3px 0 #ff0066;
}

.chroma-input-container.bite-mode .chroma-btn {
  border-color: #ff66a3;
  color: #ff0066;
}

.chroma-input-container.bite-mode .chroma-value {
  color: #ff0066;
}

/* Checkin simulator button styling */
.btn-debug {
  background-color: #4b0082;
  border: 2px solid #9400d3;
  color: #da70d6;
  font-family: 'ZCOOL KuaiLe', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
}

.btn-debug:active {
  transform: scale(0.95);
  box-shadow: 1px 1px 0 #000;
}


