.game-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(280px, 720px) minmax(220px, 280px);
  gap: 1rem;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  align-items: start;
}

.leaderboard-toggles {
  display: none;
  grid-column: 1 / -1;
  justify-content: center;
  gap: 0.75rem;
}

.lb-toggle {
  background: transparent;
  border: 1px solid #00f3ff;
  color: #00f3ff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

.lb-toggle:hover,
.lb-toggle[aria-expanded="true"] {
  background: #00f3ff;
  color: #050508;
}

.leaderboard-panel {
  background: #121420;
  border: 2px solid #232738;
  border-radius: 12px;
  min-height: 420px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.leaderboard-panel.today {
  border-color: #00f3ff;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.18);
}

.leaderboard-panel.yesterday {
  border-color: #9d00ff;
  box-shadow: 0 0 16px rgba(157, 0, 255, 0.18);
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #232738;
}

.leaderboard-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.leaderboard-panel.today .leaderboard-header h2 {
  color: #00f3ff;
}

.leaderboard-panel.yesterday .leaderboard-header h2 {
  color: #d9a6ff;
}

.lb-close {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
}

.leaderboard-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0.4rem 0;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 1.6rem 40px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leaderboard-list .rank {
  color: #c9a227;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
}

.leaderboard-list .rank::after {
  content: '.';
}

.leaderboard-list .lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #3a415c;
  background: #181b2e;
}

.leaderboard-list .lb-player {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.08rem;
}

.leaderboard-list .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 600;
}

.leaderboard-list .pts {
  color: #c9c3a8;
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.leaderboard-empty {
  color: #8c93b0;
  padding: 1.25rem 1rem;
  font-size: 0.9rem;
}

.leaderboard-backdrop {
  display: none;
}

.game-shell .slot-container,
.game-shell .game-board {
  margin: 0;
  width: 100%;
  max-width: 720px;
  justify-self: center;
}

@media (max-width: 1100px) {
  .game-shell {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .leaderboard-toggles {
    display: flex;
  }

  .leaderboard-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 180;
  }

  .leaderboard-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .leaderboard-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(340px, 88vw);
    max-height: none;
    min-height: 0;
    z-index: 190;
    border-radius: 0;
    transition: transform 0.32s ease;
  }

  .leaderboard-panel.today {
    left: 0;
    transform: translateX(-105%);
  }

  .leaderboard-panel.yesterday {
    right: 0;
    left: auto;
    transform: translateX(105%);
  }

  .leaderboard-panel.open {
    transform: translateX(0);
  }

  .lb-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
