/* MAGNIFY RUSH - SCOPED STYLES */
.magnify-rush-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.magnify-rush-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
}

.magnify-rush-container {
  position: relative;
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  background: var(--panel);
  border: 2px solid rgba(74, 144, 226, 0.4);
  border-radius: var(--radius-m);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 20px rgba(74, 144, 226, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-display);
}

.magnify-rush-close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}

.magnify-rush-close:hover { color: var(--gold); }

.magnify-rush-header {
  padding: 16px 24px;
  background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.magnify-rush-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-shadow: 2px 2px 0px var(--teal);
}

.magnify-rush-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.magnify-rush-game-area {
  flex: 2;
  position: relative;
  background: #050505;
  overflow: hidden;
}

.magnify-rush-game-area canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.rush-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.rush-screen {
  pointer-events: auto;
  background: rgba(21, 24, 28, 0.85);
  border: 1px solid var(--line);
  padding: 40px;
  border-radius: var(--radius-m);
  text-align: center;
  backdrop-filter: blur(4px);
}

.rush-screen h3 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--paper);
}

.rush-btn {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 12px 24px;
  font-weight: 800;
  font-size: 1rem;
  font-family: var(--font-display);
  cursor: pointer;
  border-radius: var(--radius-s);
  transition: transform 0.1s, filter 0.2s;
  box-shadow: 3px 3px 0px var(--teal);
}

.rush-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.rush-btn-outline {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
  box-shadow: none;
  width: 100%;
  margin-bottom: 12px;
}

.rush-btn-outline:hover { border-color: var(--gold); }

.rush-btn-alt {
  background: var(--teal);
  box-shadow: 3px 3px 0px var(--gold);
}

#rushUsernameForm input {
  padding: 12px 16px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: var(--radius-s);
  margin-right: 8px;
  font-family: var(--font-body);
}

.rush-error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; }

/* HUD */
#rushHUD {
  position: absolute;
  top: 20px;
  left: 20px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  pointer-events: none;
}

.rush-score-board {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 2px 2px 0px #000;
}
.rush-score-board .rush-label { font-size: 0.9rem; color: var(--paper); letter-spacing: 2px; }
.rush-distance-board { font-size: 1.2rem; color: var(--teal); font-weight: 700; text-shadow: 1px 1px 0px #000; }

.rush-final-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

/* Social & Leaderboard Area */
.magnify-rush-social-area {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.rush-leaderboard-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.rush-lb-header h3 { margin: 0 0 16px 0; font-size: 1.2rem; }

.rush-lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.rush-tab {
  flex: 1;
  background: rgba(21, 24, 28, 0.5);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px;
  border-radius: var(--radius-s);
  font-weight: 600;
  cursor: pointer;
}

.rush-tab.active {
  background: rgba(74, 144, 226, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

.rush-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--paper);
  margin-bottom: 16px;
}

.rush-lb-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rush-lb-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
}

.rush-lb-row .rank { width: 40px; color: var(--muted); font-weight: 700; }
.rush-lb-row .name { flex: 1; font-weight: 600; }
.rush-lb-row .score { font-family: var(--font-display); font-weight: 700; color: var(--gold); }

.rush-social-controls {
  padding: 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-raised);
}

@media (max-width: 860px) {
  .magnify-rush-body { flex-direction: column; }
  .magnify-rush-game-area { flex: none; height: 50vh; }
  .magnify-rush-social-area { max-width: 100%; border-left: none; border-top: 1px solid var(--line); }
}