* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0b0b0b;
  font-family: "Impact", "Arial Black", sans-serif;
  overflow: hidden;
  cursor: crosshair;
}

.wall {
  position: fixed;
  inset: 0;
  display: grid;
  gap: 1px;
  padding: 1px;
  background: #0b0b0b;
  z-index: 0;
}

.tile {
  overflow: hidden;
  position: relative;
  background: #1a1a1a;
  transition: transform 0.2s ease;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.3) contrast(1.1);
  transition: transform 0.4s ease, filter 0.2s ease;
}

.tile:hover img {
  transform: scale(1.15) rotate(3deg);
  filter: saturate(2) contrast(1.2) hue-rotate(15deg);
  z-index: 2;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  text-align: center;
}

.title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 9rem);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 10px #ff0055,
    0 0 25px #ff0055,
    0 0 50px #ff00aa,
    4px 4px 0 #000;
  animation: throb 2s ease-in-out infinite;
}

.subtitle {
  margin: 0.5rem 0 1.5rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  color: #ffcc00;
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
  animation: flash 1.2s step-end infinite;
}

.go-btn {
  pointer-events: auto;
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 1rem 2.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
  background: #ffcc00;
  border: 4px solid #fff;
  box-shadow: 0 0 15px #ffcc00, 6px 6px 0 #ff0055;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.go-btn:hover {
  transform: translate(-50%, -50%) scale(1.08) rotate(-2deg);
  background: #fff;
}

.go-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.faller,
.particle {
  position: fixed;
  z-index: 5;
  pointer-events: none;
}

.faller {
  animation: fall linear forwards;
}

.particle {
  animation: explode 1.2s ease-out forwards;
}

@keyframes throb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fall {
  0% { transform: translateY(-120vh) rotate(0deg); }
  100% { transform: translateY(120vh) rotate(360deg); }
}

@keyframes explode {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.3) rotate(var(--rot)); opacity: 0; }
}

.bang {
  position: fixed;
  z-index: 6;
  font-size: clamp(2rem, 6vw, 5rem);
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0 10px #ff0055, 0 0 20px #ff00aa;
  pointer-events: none;
  animation: bangPop 0.8s ease-out forwards;
}

@keyframes bangPop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  25% { transform: scale(1.3) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg) translateY(-60px); opacity: 0; }
}

.leaderboard {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 20;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ffcc00;
  border-radius: 8px;
  padding: 1rem;
  color: #fff;
  text-align: left;
  pointer-events: auto;
  box-shadow: 0 0 15px #ff0055;
}

.leaderboard h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: #ffcc00;
  text-shadow: 2px 2px 0 #000;
}

.leaderboard ol {
  margin: 0;
  padding-left: 1.2rem;
  list-style: decimal;
  font-size: 0.95rem;
}

.leaderboard li {
  margin-bottom: 0.4rem;
}

.leaderboard li b {
  float: right;
  color: #ffcc00;
}

.lb-me {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ff0055;
  color: #ffcc00;
  font-weight: bold;
  font-size: 0.95rem;
}

.lb-note {
  margin: -0.5rem 0 0.25rem;
  font-size: 0.8rem;
  color: #ff0055;
}

.countdown {
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 0 0 10px #ffcc00, 2px 2px 0 #000;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.winner {
  font-size: 0.95rem;
  color: #ff0055;
  text-shadow: 0 0 8px #ff0055, 1px 1px 0 #000;
  margin-bottom: 0.75rem;
  font-weight: bold;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  pointer-events: auto;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 90%;
  max-width: 360px;
  background: #111;
  border: 2px solid #ffcc00;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 0 25px #ff0055;
  color: #fff;
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  color: #ffcc00;
  text-transform: uppercase;
}

.modal-content input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-family: inherit;
}

.modal-content input::placeholder {
  color: #666;
}

.modal-error {
  color: #ff0055;
  min-height: 1.2em;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-buttons button {
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid #fff;
  background: #ffcc00;
  color: #000;
}

.modal-buttons button:last-child {
  background: #000;
  color: #fff;
}

.modal-buttons button:hover {
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .go-btn { font-size: 1rem; padding: 0.8rem 1.5rem; }
  .leaderboard { width: 180px; padding: 0.75rem; }
}
