* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f1f5f9;
  min-height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 24px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.logo {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.subtitle {
  color: #94a3b8;
  margin-bottom: 32px;
}

.info-card {
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  margin-bottom: 24px;
  line-height: 1.8;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
  border: none;
  border-radius: 14px;
  padding: 14px 32px;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
}

.countdown-big {
  font-size: 5rem;
  font-weight: 800;
  color: #38bdf8;
  animation: pulse 1s infinite;
}

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

.player-list {
  list-style: none;
  width: 100%;
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.player-list li {
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 6px;
  text-align: left;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 60%, #86efac 60%, #4ade80 100%);
}

.tap-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  pointer-events: none;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.hud-item {
  background: rgba(0,0,0,0.35);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

.ghost-widget {
  position: absolute;
  top: 52px;
  right: 12px;
  background: rgba(0,0,0,0.25);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 10;
  backdrop-filter: blur(4px);
  opacity: 0.7;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-label {
  font-size: 1rem;
}

.leaderboard {
  width: 100%;
  margin: 20px 0;
  max-height: 280px;
  overflow-y: auto;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 6px;
}

.leaderboard-row.me {
  border: 1px solid #38bdf8;
}

.leaderboard-row .rank {
  color: #94a3b8;
  width: 30px;
}

.final-score {
  font-size: 1.4rem;
  margin: 12px 0;
}

.pool-text {
  color: #38bdf8;
  font-weight: 600;
  margin-top: 8px;
}

/* Login Screen Styles */
.login-container {
  width: 100%;
  max-width: 300px;
  background: white;
  color: black;
  border: 2px solid black;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: monospace;
}

.login-container label {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.login-container input {
  width: 100%;
  border: 2px solid black;
  padding: 8px;
  margin-bottom: 16px;
  font-size: 1rem;
  font-family: monospace;
  outline: none;
}

.login-warning {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.login-btn {
  background: white;
  color: black;
  border: 2px solid black;
  border-radius: 0;
  width: auto;
  align-self: center;
  padding: 8px 16px;
  margin-top: 4px;
  margin-bottom: 0;
  font-family: monospace;
}
.login-btn:active {
  background: #eee;
}
