* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #070b12;
  color: white;
  font-family: Arial, sans-serif;
}

.app {
  max-width: 1100px;
  margin: auto;
  padding: 28px;
}

.topbar {
  background: #111827;
  border: 1px solid #263244;
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 36px;
}

.topbar p {
  color: #9ca3af;
  margin-bottom: 0;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tab {
  border: 1px solid #263244;
  background: #111827;
  color: #d1d5db;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
}

.tab.active,
.tab:hover {
  background: #22c55e;
  color: #04130a;
}

.overall-tab.active,
.overall-tab:hover {
  background: #facc15;
  color: #1f1300;
}

.card {
  background: #111827;
  border: 1px solid #263244;
  border-radius: 18px;
  padding: 22px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.card-header h2 {
  margin: 0;
}

input {
  background: #070b12;
  color: white;
  border: 1px solid #263244;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 240px;
}

.status {
  color: #9ca3af;
  margin-bottom: 14px;
}

.status.error {
  color: #f87171;
}

.players {
  display: grid;
  gap: 12px;
}

.player {
  display: grid;
  grid-template-columns: 60px 1fr 100px 90px;
  align-items: center;
  gap: 14px;
  background: #0b1220;
  border: 1px solid #263244;
  border-radius: 14px;
  padding: 14px;
}

.rank {
  color: #9ca3af;
  font-weight: bold;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.name {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode {
  color: #9ca3af;
}

.tier {
  text-align: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: bold;
  color: white;
}

.lt5 { background: #6b7280; }
.ht5 { background: #4b5563; }
.lt4 { background: #22c55e; }
.ht4 { background: #15803d; }
.lt3 { background: #38bdf8; }
.ht3 { background: #2563eb; }
.lt2 { background: #a855f7; }
.ht2 { background: #7e22ce; }
.lt1 { background: #d97706; }

@media (max-width: 700px) {
  .app {
    padding: 14px;
  }

  .card-header {
    display: block;
  }

  input {
    width: 100%;
    margin-top: 12px;
  }

  .player {
    grid-template-columns: 40px 1fr;
  }

  .mode,
  .tier {
    grid-column: 2;
  }
}

.player {
  width: 100%;
  color: white;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.player:hover {
  border-color: #facc15;
  transform: translateY(-1px);
}

.unranked { background: #374151; }

.profile-card {
  background: #0b1220;
  border: 1px solid #263244;
  border-radius: 18px;
  padding: 22px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.profile-top h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.profile-top p {
  margin: 0;
  color: #9ca3af;
}

.overall-row,
.tier-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #111827;
  border: 1px solid #263244;
  border-radius: 14px;
  padding: 14px;
}

.overall-row {
  margin-bottom: 14px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.back-button {
  margin-top: 18px;
  border: 0;
  background: #facc15;
  color: #1f1300;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
}
