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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #1da1f2, #ff0000, #9146ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

header .last-updated {
  color: #888;
  font-size: 0.9rem;
}

.status-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #1da1f2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.platform-icon {
  font-size: 1.8rem;
}

.stat-card h2 {
  font-size: 1rem;
  color: #888;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-delta {
  font-size: 0.9rem;
  color: #4ade80;
}

.stat-delta.negative {
  color: #f87171;
}

.stat-delta.zero {
  color: #666;
}

.chart-section {
  margin-bottom: 30px;
}

.chart-section h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #fff;
}

.chart-container {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 20px;
  overflow-x: auto;
}

#stats-chart {
  max-width: 900px;
  min-height: 300px;
}

.content-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.content-section h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #fff;
}

.content-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.tab-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.1);
}

.tab-btn.active {
  background: linear-gradient(90deg, #1da1f2, #ff0000, #9146ff);
  border-color: transparent;
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.posts-list {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.post-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.post-item a {
  color: #1da1f2;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

.post-item a:hover {
  text-decoration: underline;
}

.post-date {
  font-size: 0.75rem;
  color: #666;
}

.post-excerpt {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 4px;
  line-height: 1.4;
}

.post-thumbnail {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
}

.loading-posts {
  color: #666;
  padding: 20px;
  text-align: center;
}

.twitch-info {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
}

.twitch-streamer {
  font-size: 1.3rem;
  font-weight: 600;
  color: #9146ff;
  margin-bottom: 8px;
}

.twitch-stream-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.twitch-stream-status.online {
  color: #4ade80;
}

.twitch-stream-status.offline {
  color: #f87171;
}

.twitch-viewers {
  font-size: 1.1rem;
  color: #fff;
}

.twitch-followers {
  color: #888;
  font-size: 0.9rem;
}

footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: #666;
  font-size: 0.85rem;
}

.error-message {
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid #f87171;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  color: #f87171;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    padding: 10px;
  }
  
  #stats-chart {
    min-height: 250px;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
}