:root {
  --bg-dark: #0b0e14;
  --bg-card: #151b26;
  --bg-card-hover: #1c2433;
  --bg-card-subtle: #0f141d;
  --border-color: #242e42;
  --border-active: #3b4968;
  
  --primary: #e01e37;       /* AMD Ruby Red */
  --primary-hover: #c71f37;
  --accent-blue: #3a86ff;
  --accent-green: #06d6a0;
  --accent-purple: #8338ec;
  --accent-orange: #fb5607;
  --accent-cyan: #00f5d4;

  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(224, 30, 55, 0.25);

  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* Header */
.site-header {
  background: rgba(15, 20, 29, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #800f2f);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 0 15px rgba(224, 30, 55, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Live Indicator Pill */
.live-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.live-indicator-pill:hover {
  background: rgba(0, 245, 212, 0.18);
  border-color: var(--accent-cyan);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #ff3366;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff3366;
  animation: live-pulse 1.4s infinite;
}

@keyframes live-pulse {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.7); }
  70% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 8px rgba(255, 51, 102, 0); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

/* Live Ticker Bar */
.live-ticker-bar {
  background: #0f1523;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  overflow: hidden;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff3366;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ticker-content {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.ticker-item-link {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  margin-right: 20px;
  transition: color 0.2s ease;
}

.ticker-item-link:hover {
  color: var(--accent-cyan);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pill.online {
  background: rgba(6, 214, 160, 0.12);
  border: 1px solid rgba(6, 214, 160, 0.3);
  color: var(--accent-green);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

/* Main Content */
.main-content {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

/* Stats Overview */
.stats-overview-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.red { background: rgba(224, 30, 55, 0.15); color: var(--primary); }
.stat-icon.blue { background: rgba(58, 134, 255, 0.15); color: var(--accent-blue); }
.stat-icon.green { background: rgba(6, 214, 160, 0.15); color: var(--accent-green); }
.stat-icon.purple { background: rgba(131, 56, 236, 0.15); color: var(--accent-purple); }

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

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Tabs */
.tab-pane {
  display: none;
}

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

/* Stream Controls & View Toggle */
.live-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stream-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-btn:hover {
  color: #fff;
}

.view-btn.active {
  background: var(--border-color);
  color: #fff;
}

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 450px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 38px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: #fff;
  border-color: var(--border-active);
}

.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

/* Live Cards Grid */
.live-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Submission Card */
.submission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.submission-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 30px rgba(0, 245, 212, 0.12);
}

.sub-card-banner {
  height: 120px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.sub-card-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 14, 20, 0.2) 0%, rgba(11, 14, 20, 0.92) 100%);
}

.sub-banner-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sub-game-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.sub-fps-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.sub-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-hw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hw-badge-core {
  background: rgba(35, 134, 54, 0.2);
  border: 1px solid #238636;
  color: #7ee787;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.hw-badge-cu {
  background: rgba(31, 111, 235, 0.2);
  border: 1px solid #1f6feb;
  color: #79c0ff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.hw-badge-mode {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e6edf3;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
}

.hw-badge-mode.oc {
  background: rgba(242, 204, 96, 0.15);
  border-color: #f2cc60;
  color: #f2cc60;
  font-weight: 600;
}

.sub-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.sub-metric-col {
  display: flex;
  flex-direction: column;
}

.sub-metric-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sub-metric-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sub-card-footer {
  padding: 10px 16px;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.sub-node-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.fps-badge {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

.fps-badge span {
  font-size: 11px;
  font-weight: 600;
}

.fps-green { background: rgba(6, 214, 160, 0.15); color: var(--accent-green); border: 1px solid rgba(6, 214, 160, 0.3); }
.fps-blue { background: rgba(58, 134, 255, 0.15); color: var(--accent-blue); border: 1px solid rgba(58, 134, 255, 0.3); }
.fps-yellow { background: rgba(255, 190, 11, 0.15); color: #ffbe0b; border: 1px solid rgba(255, 190, 11, 0.3); }
.fps-red { background: rgba(224, 30, 55, 0.15); color: #ff758f; border: 1px solid rgba(224, 30, 55, 0.3); }

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.game-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

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

.metric-label {
  font-size: 11px;
  color: var(--text-dim);
}

.metric-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

/* Data Table */
.table-responsive {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-card-subtle);
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.mac-badge {
  font-family: var(--font-mono);
  background: rgba(58, 134, 255, 0.1);
  border: 1px solid rgba(58, 134, 255, 0.25);
  color: #79c0ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Devices Grid */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-mac-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.device-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.device-detail-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.device-detail-row span:last-child {
  color: var(--text-main);
  font-weight: 500;
}

/* Guide */
.guide-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.guide-card h2 {
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-box {
  display: flex;
  gap: 16px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

pre {
  background: #090c10;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  margin-top: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #79c0ff;
}

.api-endpoint-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.http-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  width: fit-content;
}

.http-badge.post { background: var(--accent-blue); color: #fff; }
.http-badge.get { background: var(--accent-green); color: #000; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group h2 {
  font-size: 22px;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Footer */
.site-footer {
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .guide-container {
    grid-template-columns: 1fr;
  }
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
  }
}
