/* ============================================================
   P4kong - Steal An Egg (SAE) Realtime Quiet Server Finder CSS
   Theme: Luxury Black & Gold
   ============================================================ */

:root {
  --bg-main: #050505;
  --bg-surface: #0a0907;
  --bg-card: rgba(18, 16, 11, 0.78);
  --bg-card-hover: rgba(28, 24, 15, 0.9);
  --bg-input: rgba(12, 11, 8, 0.9);

  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-bright: #f59e0b;
  --gold-deep: #b8860b;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-glow-soft: rgba(212, 175, 55, 0.12);

  --border-subtle: rgba(212, 175, 55, 0.18);
  --border-bright: rgba(212, 175, 55, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  --text-gold: #fde047;

  --color-green: #22c55e;
  --color-green-glow: rgba(34, 197, 94, 0.3);
  --color-amber: #f59e0b;
  --color-red: #ef4444;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background Ambient Gold Aurora */
.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  will-change: transform;
  animation: auroraFloat 18s ease-in-out infinite alternate;
}

.aurora-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #d4af37, #f59e0b);
  top: -120px;
  left: 15%;
}

.aurora-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #b8860b, #eab308);
  bottom: 8%;
  right: 10%;
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.aurora-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #f59e0b, #d97706);
  top: 45%;
  left: 50%;
  opacity: 0.12;
}

@keyframes auroraFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.06); }
  100% { transform: translate(-25px, 20px) scale(0.96); }
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 1;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.logo-text {
  background: linear-gradient(135deg, #fff 40%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-sae {
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid var(--border-bright);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

nav a:hover {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.08);
}

nav a.nav-highlight {
  color: #050505;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  font-weight: 600;
  box-shadow: 0 0 15px var(--gold-glow);
}

nav a.nav-highlight:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--gold-glow);
}

/* Main Container */
.main-wrapper {
  position: relative;
  z-index: 2;
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 36px;
}

.hero-pill-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 16, 11, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 10px var(--color-green);
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pill-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
}

.refresh-countdown {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hero-title .gold-gradient {
  background: linear-gradient(135deg, #fff 20%, var(--gold-light) 50%, var(--gold-primary) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

.hero-subtitle {
  max-width: 680px;
  margin: 0 auto 24px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-subtitle strong {
  color: var(--gold-light);
  font-weight: 600;
}

/* Controls Bar */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-refresh {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-bright);
  color: var(--gold-light);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-bright);
  box-shadow: 0 0 15px var(--gold-glow);
}

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

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

.last-sync-tag {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* Auto Progress Bar */
.progress-container {
  max-width: 320px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin: 0 auto 36px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-bright));
  transition: width 1s linear;
}

/* Notice Box */
.notice-box {
  background: rgba(18, 16, 11, 0.6);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.notice-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Server Stats Bar */
.server-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(18, 16, 11, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
}

.stats-count {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #050505;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.count-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.sort-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Server Cards Grid */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Server Card Styling */
.server-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.server-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.6;
}

.server-card.primary-server {
  border-color: rgba(212, 175, 55, 0.45);
  background: linear-gradient(180deg, rgba(28, 24, 15, 0.85) 0%, rgba(14, 12, 8, 0.8) 100%);
  box-shadow: 0 20px 45px -12px rgba(212, 175, 55, 0.2);
}

.server-card.primary-server::before {
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-bright), var(--gold-primary));
  opacity: 1;
}

.server-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -15px rgba(212, 175, 55, 0.25);
}

/* Card Header */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.primary-badge {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--border-bright);
  color: var(--gold-light);
}

.secondary-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.status-very-quiet {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.status-quiet {
  background: rgba(234, 179, 8, 0.14);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fde047;
}

.status-moderate {
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
}

/* Player Hero Counter inside Card */
.player-hero-box {
  background: rgba(10, 9, 6, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.player-count-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  margin-bottom: 6px;
  font-weight: 600;
}

.player-numbers {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.current-players {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-light);
}

.primary-server .current-players {
  color: #fff;
  text-shadow: 0 0 20px var(--gold-glow);
}

.max-players-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-sub);
}

.capacity-meter {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.capacity-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.fill-very-quiet {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.fill-quiet {
  background: linear-gradient(90deg, #eab308, #fde047);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.fill-moderate {
  background: linear-gradient(90deg, #f97316, #fb923c);
}

.recommend-text {
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 500;
}

/* Metrics Grid */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.metric-item {
  background: rgba(12, 11, 8, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon {
  font-size: 1.1rem;
  opacity: 0.85;
}

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

.metric-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Server ID Box */
.server-id-box {
  background: rgba(10, 9, 6, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.id-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.id-label {
  font-size: 0.7rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.id-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-inline-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-inline-copy:hover {
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
}

/* Actions */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.btn-join {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d4af37 50%, #b8860b 100%);
  color: #080806;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.btn-join:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.45);
  filter: brightness(1.05);
}

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

.btn-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-secondary {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold-primary);
  color: #fff;
}

/* Tips Section */
.tips-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 40px;
}

.tips-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tip-card {
  background: rgba(10, 9, 6, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
}

.tip-num {
  width: 26px;
  height: 26px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--border-bright);
  color: var(--gold-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.tip-heading {
  font-size: 0.96rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.tip-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-size: 0.86rem;
}

footer a {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #14120c;
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px var(--gold-glow);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .header-container {
    padding: 12px 16px;
  }
  
  nav a:not(.nav-highlight) {
    display: none;
  }

  .main-wrapper {
    padding: 24px 16px 60px;
  }

  .servers-grid {
    grid-template-columns: 1fr;
  }

  .btn-action-row {
    grid-template-columns: 1fr;
  }
}
