@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- PALWORLD STATUS DESIGN SYSTEM --- */
:root {
  --bg-primary: #f0f6fa;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-hover: rgba(255, 255, 255, 0.88);
  --border-color: rgba(0, 157, 209, 0.15);
  --border-color-hover: rgba(0, 157, 209, 0.35);
  
  /* Palette inspired by Palworld */
  --pal-cyan: #008eb7;
  --pal-cyan-glow: rgba(0, 142, 183, 0.15);
  --pal-gold: #d97706;
  --pal-gold-glow: rgba(217, 119, 6, 0.15);
  --pal-silver: #64748b;
  --pal-bronze: #b45309;
  --pal-green: #10b981;
  --pal-red: #ef4444;
  --pal-purple: #8b5cf6;
  
  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  /* Fonts */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Shadows */
  --shadow-cyan: 0 10px 30px rgba(0, 142, 183, 0.08);
  --shadow-glow: 0 15px 40px rgba(0, 142, 183, 0.15);
  --shadow-gold: 0 10px 25px rgba(217, 119, 6, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--pal-cyan) var(--bg-secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pal-cyan);
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 142, 183, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
    linear-gradient(to bottom, #f0f6fa, #e8f5e9);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  padding: 0;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

/* --- HEADER AREA --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pal-sphere-logo {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, var(--pal-cyan) 0%, #005f73 70%);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--pal-cyan);
  position: relative;
  animation: float 4s ease-in-out infinite;
}

.pal-sphere-logo::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 15%;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  filter: blur(1px);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pal-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  display: block;
  margin-top: -3px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 142, 183, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(0, 142, 183, 0.15);
  font-size: 0.85rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--pal-green);
  box-shadow: 0 0 10px var(--pal-green);
}

.status-dot.offline {
  background-color: var(--pal-red);
  box-shadow: 0 0 10px var(--pal-red);
}

.status-dot.loading {
  background-color: var(--pal-gold);
  box-shadow: 0 0 10px var(--pal-gold);
  animation: pulse 1.5s infinite;
}

.btn-refresh {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: all 0.2s;
  border-radius: 50%;
}

.btn-refresh:hover {
  color: var(--pal-cyan);
  transform: rotate(30deg);
}

.btn-refresh.spinning svg {
  animation: spin 1s linear infinite;
}

/* --- WARNING BANNER FOR DEMO DATA --- */
.demo-banner {
  display: none;
  background: linear-gradient(90deg, rgba(255,170,0,0.1) 0%, rgba(255,170,0,0.2) 50%, rgba(255,170,0,0.1) 100%);
  border: 1px solid rgba(255, 170, 0, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 2rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--pal-gold);
}

.demo-banner svg {
  flex-shrink: 0;
}

/* --- SERVER INFORMATION SECTION --- */
.server-hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-cyan);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--border-color-hover);
}

.server-info-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.server-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.card-title-group {
  margin-bottom: 1.5rem;
}

.card-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pal-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.server-connection-box {
  background: rgba(0, 142, 183, 0.05);
  border: 1px solid rgba(0, 142, 183, 0.12);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.connection-details {
  display: flex;
  flex-direction: column;
}

.connection-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.connection-value {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.btn-copy {
  background: linear-gradient(135deg, #00a4e4 0%, #007fa5 100%);
  border: none;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 164, 228, 0.2);
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 240, 255, 0.5);
}

.btn-copy:active {
  transform: translateY(0);
}

.btn-toggle-hero {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-cyan);
}

.btn-toggle-hero:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-toggle-hero.active {
  background: rgba(0, 142, 183, 0.08);
  border-color: var(--pal-cyan);
  color: var(--pal-cyan);
}

.discord-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.08) 0%, var(--bg-glass) 100%);
  border: 1px solid rgba(88, 101, 242, 0.2);
}

.discord-card:hover {
  border-color: rgba(88, 101, 242, 0.4);
  box-shadow: 0 10px 30px rgba(88, 101, 242, 0.06);
}

.discord-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.discord-icon {
  color: #5865F2;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.discord-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-discord {
  background: #5865F2;
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-discord:hover {
  background: #4752c4;
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
  transform: translateY(-2px);
}

/* --- STATS GRID --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-cyan);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 142, 183, 0.08);
  border: 1px solid rgba(0, 142, 183, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pal-cyan);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Colors customized per stat type */
.stat-box.stat-players .stat-icon {
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.15);
  color: var(--pal-green);
}
.stat-box.stat-players:hover {
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.stat-box.stat-days .stat-icon {
  background: rgba(255, 170, 0, 0.08);
  border-color: rgba(255, 170, 0, 0.15);
  color: var(--pal-gold);
}
.stat-box.stat-days:hover {
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.1);
}

.stat-box.stat-camps .stat-icon {
  background: rgba(157, 78, 221, 0.08);
  border-color: rgba(157, 78, 221, 0.15);
  color: var(--pal-purple);
}
.stat-box.stat-camps:hover {
  box-shadow: 0 0 20px rgba(157, 78, 221, 0.1);
}

/* --- LEADERBOARD & PLAYER ROSTER --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--pal-cyan);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--pal-cyan);
}

.podium-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Podium Cards */
.podium-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

.podium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
}

.podium-1st::before {
  background: var(--pal-gold);
}
.podium-2nd::before {
  background: var(--pal-silver);
}
.podium-3rd::before {
  background: var(--pal-bronze);
}

.podium-1st {
  box-shadow: var(--shadow-gold);
  border-color: rgba(255, 170, 0, 0.25);
}
.podium-1st:hover {
  border-color: rgba(255, 170, 0, 0.5);
  box-shadow: 0 0 30px rgba(255, 170, 0, 0.4);
  transform: translateY(-5px);
}

.podium-card:not(.podium-1st):hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
}

.crown-rank {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  opacity: 0.5;
}

.podium-1st .crown-rank {
  color: var(--pal-gold);
  opacity: 1;
}
.podium-2nd .crown-rank {
  color: var(--pal-silver);
  opacity: 0.8;
}
.podium-3rd .crown-rank {
  color: var(--pal-bronze);
  opacity: 0.8;
}

.pal-avatar-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.03);
  border: 2px dashed rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-1st .pal-avatar-container {
  border-color: var(--pal-gold);
  background: radial-gradient(circle, rgba(255, 170, 0, 0.1) 0%, transparent 80%);
}

.podium-2nd .pal-avatar-container {
  border-color: var(--pal-silver);
}

.podium-3rd .pal-avatar-container {
  border-color: var(--pal-bronze);
}

.pal-sphere-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pal-cyan) 0%, #005f73 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.podium-1st .pal-sphere-avatar {
  background: radial-gradient(circle, var(--pal-gold) 0%, #cc7a00 70%);
}

.podium-online-indicator {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--pal-green);
  border: 2px solid var(--bg-secondary);
}

.podium-online-indicator.offline {
  background-color: var(--pal-red);
}

.podium-info-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  min-width: 0;
}

.podium-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.2s;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.podium-name:hover {
  color: var(--pal-cyan);
}

.podium-1st .podium-name:hover {
  color: var(--pal-gold);
}

.podium-account {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.podium-level-badge {
  background: rgba(0, 142, 183, 0.05);
  border: 1px solid rgba(0, 142, 183, 0.15);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.podium-1st .podium-level-badge {
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.3);
  color: var(--pal-gold);
}

/* Filtering & Controls */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.search-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--pal-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.btn-filter {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-filter:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.btn-filter.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--pal-cyan);
  color: var(--pal-cyan);
}

/* Leaderboard Table Card */
.leaderboard-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid rgba(0, 142, 183, 0.1);
  background: rgba(0, 142, 183, 0.03);
}

.leaderboard-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tr {
  transition: background-color 0.2s;
}

.leaderboard-table tr:hover {
  background-color: rgba(0, 142, 183, 0.04);
}

.rank-cell {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.rank-cell.top-rank-1 {
  color: var(--pal-gold);
}
.rank-cell.top-rank-2 {
  color: var(--pal-silver);
}
.rank-cell.top-rank-3 {
  color: var(--pal-bronze);
}

.player-info-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-sphere {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pal-cyan) 0%, #005f73 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
}

.player-details {
  display: flex;
  flex-direction: column;
}

.player-link {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.player-link:hover {
  color: var(--pal-cyan);
}

.player-steam {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.level-cell {
  font-family: var(--font-heading);
  font-weight: 700;
}

.level-badge {
  background: rgba(0, 142, 183, 0.05);
  border: 1px solid rgba(0, 142, 183, 0.15);
  padding: 0.3rem 0.75rem;
  border-radius: 30px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.level-badge span {
  color: var(--pal-cyan);
}

.status-cell {
  width: 120px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background: rgba(255, 3b, 48, 0.1);
  border: 1px solid rgba(255, 3b, 48, 0.2);
  color: #ff453a;
}

.status-badge.online {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--pal-green);
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online .status-pulse {
  animation: pulse 1.5s infinite;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 0.95rem;
}

/* --- FOOTER --- */
footer {
  margin-top: 5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 2rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--pal-cyan);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* --- ANIMATIONS --- */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem 3rem 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .server-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .action-bar {
    justify-content: center !important;
    margin-bottom: 1rem !important;
  }

  .btn-toggle-hero {
    width: 100%;
    justify-content: center;
  }
  
  .podium-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .podium-card {
    flex-direction: row;
    text-align: left;
    padding: 1.25rem 4.5rem 1.25rem 1.25rem; /* Designates empty space on the right for absolute rank badge */
    gap: 1.25rem;
    align-items: center;
    justify-content: flex-start;
    order: initial !important;
    position: relative;
  }
  
  .pal-avatar-container {
    margin: 0;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }
  
  .pal-sphere-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .podium-info-wrapper {
    align-items: flex-start;
    text-align: left;
  }

  .podium-name {
    font-size: 1.1rem;
    max-width: 100%;
    word-break: break-all;
  }
  
  .podium-account {
    margin-bottom: 0.25rem;
  }
  
  .crown-rank {
    top: 50%;
    transform: translateY(-50%);
    right: 1.5rem;
  }
  
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .search-wrapper {
    max-width: 100%;
  }
  
  .filter-group {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none; /* Hide default scrollbar on Firefox */
  }
  
  .filter-group::-webkit-scrollbar {
    display: none; /* Hide scrollbar on Chrome/Safari */
  }

  .btn-filter {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem 0.75rem 2rem 0.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-box {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }
  
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .logo-container {
    flex-direction: column;
    text-align: center;
  }

  .logo-text span {
    margin-top: 0;
  }

  .sync-status {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .card-title {
    font-size: 1.35rem;
    text-align: center;
  }

  .card-title-group {
    text-align: center;
  }
  
  .server-connection-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem 0.75rem !important;
  }

  .connection-details {
    text-align: center;
  }

  .server-connection-box > div {
    display: flex;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .btn-copy {
    justify-content: center;
    width: 100%;
    padding: 0.6rem 1rem;
  }
  
  .leaderboard-table th, .leaderboard-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .player-info-cell {
    gap: 0.5rem;
  }

  .player-sphere {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0.75rem;
  }

  .player-link {
    font-size: 0.9rem;
  }

  .player-steam {
    font-size: 0.75rem;
  }

  .level-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
  }
}
