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

:root {
  --bg: #0f1115;
  --bg-card: #1a1d24;
  --bg-sidebar: #13161b;
  --border: #2a2f38;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #10b981;
  --primary-hover: #059669;
  --accent: #22d3ee;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.header-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
}

.online-players {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #22c55e;
  border-radius: 50%;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0; }
}

.player-count {
  font-weight: 500;
  color: var(--text);
}

.search-form {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 16px 0 40px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  padding: 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.lang-link {
  padding: 4px 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
}

.lang-link.active {
  color: var(--text);
  font-weight: 500;
}

.login-btn {
  margin-left: 8px;
  padding: 6px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.login-btn:hover {
  background: var(--primary-hover);
}

/* Main Layout */
.main-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 48px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 32px 8px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.nav-main, .nav-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.1);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Carousel */
.carousel {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.carousel-slide {
  padding: 24px;
}

.carousel-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.carousel-content p {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  max-width: 400px;
  margin-bottom: 16px;
}

.carousel-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.carousel-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Feed Cards */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.feed-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-title h2 {
  font-size: 16px;
  font-weight: 600;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--primary);
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
}

.live-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.live-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 50%;
}

.view-all {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

.view-all:hover {
  color: var(--text);
}

.feed-list {
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.feed-item:hover {
  background: rgba(255,255,255,0.03);
}

.feed-item:last-child {
  border-bottom: none;
}

.item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-icon img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-qty {
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.item-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  width: 100px;
  text-align: right;
}

.item-player {
  text-align: right;
  width: 110px;
  flex-shrink: 0;
}

.player-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-clan {
  font-size: 12px;
  color: var(--accent);
}

.item-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stats Panel */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.footer-alt {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-disclaimer {
  font-size: 12px;
  color: rgba(156, 163, 175, 0.6);
}

/* Click Interceptor */
.click-interceptor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  cursor: pointer;
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-modal {
  position: relative;
  background: #1e2128;
  border: 1px solid #2a2f38;
  border-radius: 16px;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}

.popup-close:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.popup-content {
  text-align: center;
}

.popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-icon svg {
  width: 32px;
  height: 32px;
  color: #34d399;
}

.popup-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.popup-text {
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 16px;
}

.popup-text .highlight {
  color: #34d399;
  font-weight: 600;
}

.popup-info {
  background: #15171c;
  border: 1px solid #2a2f38;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.popup-info p {
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.6;
}

.popup-info .info-title {
  color: #fbbf24;
  font-weight: 500;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25);
}

.download-btn:hover {
  background: var(--primary-hover);
}

.download-btn svg {
  width: 20px;
  height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .logo-text, .online-players, .lang-link {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .header-content {
    gap: 8px;
  }

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

  .stats-panel {
    flex-direction: row;
    overflow-x: auto;
  }

  .stat-card {
    min-width: 150px;
  }
}
