* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0d0d1a;
  color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('bg.jpg') center center / cover no-repeat;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 13, 26, 0.75);
  z-index: -1;
}

/* ===== PAGE WRAPPER ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 920px;
  max-width: 100%;
  margin-top: -30px;
}

/* ===== IP BANNER ===== */
.ip-banner {
  width: 100%;
  background: #1a1a32;
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 18px 28px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}
.ip-banner:hover {
  background: #222244;
  border-color: #7c5cfc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 252, 0.2);
}
.ip-banner-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.ip-banner-address {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}
.ip-banner-copied {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #00e676;
  color: #000;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* ===== MAIN ROW ===== */
.main-row {
  display: flex;
  gap: 14px;
  width: 100%;
  align-items: center;
}

/* ===== CARD ===== */
.card {
  background: #151528;
  border: 1px solid #2a2a4a;
  border-radius: 24px;
  padding: 40px 36px;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.logo { font-size: 44px; font-weight: 700; margin-bottom: 6px; }
.logo span { color: #7c5cfc; }
.subtitle { font-size: 16px; color: #666; margin-bottom: 32px; }

/* ===== STATUS ===== */
.status-box {
  background: #1a1a32;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
}
.dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.online { background: #00e676; box-shadow: 0 0 16px #00e676; animation: pulse 1.5s infinite; }
.dot.offline { background: #ff4444; box-shadow: 0 0 16px #ff4444; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ===== PLAYERS ===== */
.players-box {
  background: #1a1a32;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}
.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 16px;
  color: #aaa;
}
.players-count { font-size: 22px; font-weight: 600; color: #fff; }
.bar-bg {
  background: #0d0d1a;
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c5cfc, #00e676);
  border-radius: 8px;
  transition: width 0.6s ease;
}
.player-list { max-height: 200px; overflow-y: auto; text-align: left; }
.player-list::-webkit-scrollbar { width: 4px; }
.player-list::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.player-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
  transition: background 0.2s;
}
.player-item:hover { background: #222244; }
.player-avatar { width: 36px; height: 36px; border-radius: 6px; image-rendering: pixelated; }
.no-players { color: #555; font-size: 15px; padding: 10px 0; }

/* ===== NAV GRID ===== */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.nav-card {
  background: #1a1a32;
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 20px 12px;
  text-decoration: none;
  color: #ccc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  cursor: pointer;
}
.nav-card:hover {
  background: #222244;
  color: #fff;
  border-color: #7c5cfc;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(124, 92, 252, 0.25);
}
.nav-card:active { transform: translateY(0); }
.nav-emoji { font-size: 32px; line-height: 1; display: block; }
.nav-text { font-size: 14px; font-weight: 600; letter-spacing: 0.5px; display: block; }

/* ===== REFRESH TIMER ===== */
.refresh-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.08), rgba(0, 230, 118, 0.06));
  border: 1px solid rgba(124, 92, 252, 0.12);
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.3px;
}
.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

/* ===== MISC ===== */
.updated { font-size: 12px; color: #444; margin-top: 6px; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: linear-gradient(165deg, #1a1a36 0%, #13132a 50%, #151530 100%);
  border: 1px solid rgba(124, 92, 252, 0.18);
  border-radius: 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.35),
    0 12px 42px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(124, 92, 252, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  min-height: 480px;
  overflow: hidden;
  position: relative;
}
/* Subtle top glow */
.sidebar::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7c5cfc, transparent);
  border-radius: 0 0 50% 50%;
  opacity: 0.6;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 16px;
  background: linear-gradient(180deg, rgba(124, 92, 252, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(124, 92, 252, 0.1);
}
.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #e0e0ef;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.sidebar-title-icon { font-size: 18px; }
.sidebar-badge {
  background: linear-gradient(135deg, #7c5cfc, #6347e0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 32px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(124, 92, 252, 0.35);
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  max-height: 560px;
  padding: 8px 12px;
  margin-bottom: 0;
  scroll-behavior: smooth;
}
.sidebar-list::-webkit-scrollbar { width: 5px; }
.sidebar-list::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.sidebar-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c5cfc44, #7c5cfc22);
  border-radius: 10px;
}
.sidebar-list::-webkit-scrollbar-thumb:hover { background: #7c5cfc66; }

/* Loading dots */
.sidebar-loading {
  display: flex;
  gap: 7px;
  justify-content: center;
  padding: 30px 0;
}
.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c5cfc;
  animation: loadingBounce 1.2s infinite ease-in-out;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadingBounce {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1); }
}

/* Player rows in sidebar */
.sidebar-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: all 0.25s ease;
  animation: slideInPlayer 0.4s ease both;
  position: relative;
}
.sidebar-player:hover {
  background: rgba(124, 92, 252, 0.1);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.12);
}
.sidebar-player + .sidebar-player {
  margin-top: 2px;
}
@keyframes slideInPlayer {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sidebar-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  image-rendering: pixelated;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(124, 92, 252, 0.15);
}
.sidebar-player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-player-name {
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f8;
}
.sidebar-player-tag {
  font-size: 11px;
  color: #00e676;
  font-weight: 500;
  opacity: 0.85;
}

/* Empty state */
.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 16px;
  text-align: center;
}
.sidebar-empty-icon { font-size: 36px; opacity: 0.8; }
.sidebar-empty-text { font-size: 13px; color: #555; line-height: 1.6; }

/* Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555;
  padding: 14px 20px;
  border-top: 1px solid rgba(124, 92, 252, 0.1);
  background: rgba(0, 0, 0, 0.12);
}
.sidebar-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

/* ===== BACK / RULES ===== */
.back-btn {
  display: inline-block;
  color: #7c5cfc;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 12px;
  transition: background 0.2s;
}
.back-btn:hover { background: #1a1a32; }

.rules-card { width: 700px; text-align: left; }
.rules-content {
  background: #1a1a32;
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
  max-height: 60vh;
  overflow-y: auto;
}
.rules-content::-webkit-scrollbar { width: 4px; }
.rules-content::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.rule-title {
  font-size: 22px;
  font-weight: 700;
  color: #7c5cfc;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a4a;
}
.rule-subtitle { font-size: 18px; font-weight: 600; color: #a78bfa; margin-top: 18px; margin-bottom: 10px; }
.rule-item {
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.2s;
}
.rule-item:hover { background: #222244; }
.rule-number { color: #7c5cfc; font-weight: 700; margin-right: 4px; }
.rule-bullet { padding: 4px 14px 4px 28px; font-size: 14px; color: #bbb; line-height: 1.5; }
.rule-text { padding: 4px 14px; font-size: 15px; color: #ccc; line-height: 1.6; }
.rule-spacer { height: 10px; }

/* ===== MOBILE ===== */
@media (max-width: 720px) {
  .main-row { flex-direction: column; }
  .sidebar { width: 100%; }
  .card { padding: 28px 20px; }
  .logo { font-size: 34px; }
  .ip-banner-address { font-size: 16px; }
  .rules-card { width: 100%; }
}
