:root {
  --bg: #080d18;
  --bg-soft: #0d1526;
  --card: #101a2e;
  --card-border: #1c2940;
  --card-border-hover: #2c3f5e;
  --blue: #4f8ef7;
  --blue-light: #6fa2ff;
  --purple: #7c4fe0;
  --accent-grad: linear-gradient(135deg, #4f8ef7, #7c4fe0);
  --text: #e7ecf5;
  --text-muted: #8a99b3;
  --text-faint: #5a6b88;
  --green: #34d399;
  --gray-dot: #5b6b85;
  --divider: #1c2940;
  --radius: 14px;
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.hidden-view { display: none !important; }

/* ---- Ambient animated background glow ---- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 560px; height: 560px;
  background: var(--blue);
  top: -220px; left: -160px;
  animation: drift-1 18s ease-in-out infinite;
}
.bg-glow-2 {
  width: 520px; height: 520px;
  background: var(--purple);
  bottom: -220px; right: -160px;
  animation: drift-2 22s ease-in-out infinite;
}
@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, -40px); }
}

/* ---- Announcement ticker ---- */
.announcement-bar {
  position: relative;
  z-index: 3;
  background: linear-gradient(90deg, rgba(79,142,247,0.14), rgba(124,79,224,0.14));
  border-bottom: 1px solid rgba(79,142,247,0.2);
  overflow: hidden;
  padding: 8px 0;
}
.announcement-track {
  display: flex;
  gap: 64px;
  white-space: nowrap;
  width: max-content;
  animation: ticker-scroll 25s linear infinite;
}
.announcement-text {
  font-size: 12.5px;
  font-weight: 500;
  color: #cdd9ee;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Sticky topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 13, 24, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  flex: 0 0 auto;
}
.topbar-logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: white;
  overflow: hidden;
  flex: 0 0 auto;
}
.topbar-logo img { width: 100%; height: 100%; object-fit: cover; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-self: end;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.topbar-nav a:hover {
  color: var(--blue-light);
  background: rgba(79,142,247,0.08);
  border-color: rgba(79,142,247,0.2);
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 40px;
  position: relative;
  z-index: 1;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 52px 0 36px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -1px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, #ffffff 10%, #9dc0ff 60%, #b79bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: 15.5px;
  color: #b7c4dc;
  margin: 0 0 16px;
  font-weight: 500;
}

.hero .divider {
  width: 52px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  margin: 0 auto 14px;
}

.hero .subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0;
}

/* ---- Sections ---- */
.section-block {
  margin-bottom: 44px;
  scroll-margin-top: 84px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading .icon-ring {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79,142,247,0.2), rgba(124,79,224,0.2));
  border: 1px solid rgba(79,142,247,0.32);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px -8px rgba(79,142,247,0.4);
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.2px;
}

.section-heading .count-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue-light);
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.25);
  padding: 3px 11px;
  border-radius: 20px;
  flex: 0 0 auto;
}

.section-heading .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--card-border), transparent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 18px;
}

.card {
  --accent: #4f8ef7;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.008)), var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px 16px 20px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--card-border));
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)), #131f38;
  transform: translateY(-5px);
  box-shadow: 0 18px 36px -16px color-mix(in srgb, var(--accent) 45%, transparent);
}

.card:hover::before { opacity: 1; }
.card:hover::after { opacity: 1; }

.card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.card .icon-badge {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #3a4a63;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow:
    0 10px 22px -8px color-mix(in srgb, var(--accent) 55%, transparent),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card:hover .icon-badge {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 14px 28px -8px color-mix(in srgb, var(--accent) 65%, transparent),
    inset 0 0 0 1px rgba(255,255,255,0.12);
}

.card .icon-badge .badge-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.card .card-body {
  width: 100%;
  min-width: 0;
}

.card .card-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.card .card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.status-dot.offline {
  background: var(--gray-dot);
  box-shadow: none;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-size: 12.5px;
  color: #9adbc0;
  font-weight: 500;
  margin-bottom: 16px;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
  animation: live-pulse 1.8s ease-in-out infinite;
}
.live-sep { opacity: 0.4; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.copyright {
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 0;
}

@media (max-width: 820px) {
  .hero h1 { font-size: 34px; }
  .topbar-nav a span.nav-label { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px 36px; }
  .topbar-inner { padding: 10px 16px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 27px; }
  .tagline { font-size: 13.5px; }
  .hero .subtitle { font-size: 12.5px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 20px 10px 16px; border-radius: 16px; }
  .card .icon-badge { width: 50px; height: 50px; border-radius: 15px; font-size: 23px; margin-bottom: 10px; }
  .card .card-title { font-size: 12.5px; }
  .card .card-subtitle { font-size: 11px; }
  .site-footer { margin-top: 36px; padding-top: 24px; }
  .bg-glow { filter: blur(70px); opacity: 0.2; }
}
@media (max-width: 360px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ---- Welcome popup ---- */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: popup-fade-in 0.2s ease;
}
@keyframes popup-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.popup-modal {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 0 0 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6);
  animation: popup-pop-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes popup-pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.popup-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(8,13,24,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
}
.popup-close:hover { background: rgba(8,13,24,0.8); }
.popup-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--card-soft, #0d1526);
  overflow: hidden;
}
.popup-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.popup-icon {
  width: 64px; height: 64px;
  margin: 36px auto 0;
  border-radius: 18px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: white;
  overflow: hidden;
}
.popup-icon img { width: 100%; height: 100%; object-fit: cover; }
.popup-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  margin: 24px 0 12px;
  padding: 0 32px;
}
.popup-message {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 24px;
  padding: 0 32px;
  white-space: pre-line;
}
.popup-btn {
  display: inline-flex;
  padding: 12px 28px;
  font-size: 14.5px;
}
