:root {
  --bg: #070a13;
  --panel: #0b0f19;
  --panel2: #141d33;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --a: #00d2ff;
  --b: #ff6b35;
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism & Glow */
.glass-panel {
  background: radial-gradient(130% 100% at 50% 0%, rgba(20, 29, 51, 0.75) 0%, rgba(11, 15, 25, 0.88) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
}

.glow-cyan-subtle {
  box-shadow: 0 0 30px -5px rgba(0, 210, 255, 0.22);
}

/* Segmented Buttons */
.seg {
  display: flex;
  background: rgba(7, 10, 19, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.seg button:hover:not(.on) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.seg button.on {
  background: #00d2ff !important;
  color: #070a13 !important;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.45);
}

/* Link version of the segmented control (format switcher on value charts) */
.seg a {
  color: #94a3b8;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.seg a:hover:not(.on) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.seg a.on {
  background: #00d2ff !important;
  color: #070a13 !important;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.45);
}

.fmt-switch {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}

.seg-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 10, 19, 0.7);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.seg-label {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-left: 8px;
  padding-right: 4px;
}

/* Navigation */
nav.sitenav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 14px 0;
  font-size: 14.5px;
}

nav.sitenav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

nav.sitenav a:hover, nav.sitenav a.on {
  color: var(--a);
}

/* Pick tiles & Headshots */
.pick-tile {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  color: var(--a);
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.3);
  flex-shrink: 0;
}

/* Search Results Dropdown */
.results {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(11, 15, 25, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.search-filter-pill {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.search-filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cat-pill, .fmt-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover, .fmt-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cat-pill.active, .fmt-pill.active {
  background: rgba(0, 210, 255, 0.2);
  color: #38bdf8;
  border-color: rgba(0, 210, 255, 0.4);
}

.search-section-header {
  padding: 8px 14px 4px 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(11, 15, 25, 0.8);
}

.result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.result:hover, .result.focused {
  background: rgba(255, 255, 255, 0.08);
}

.result .r-add-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  margin-left: 10px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.result:hover .r-add-icon, .result.focused .r-add-icon {
  background: #00d2ff;
  color: #070a13;
  border-color: #00d2ff;
}

.result img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #070a13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.result .r-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.result .r-sub {
  color: #94a3b8;
  font-size: 12px;
}

.result .r-val {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
}

/* Chips in Trade Columns */
.chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.chip:hover {
  background: rgba(20, 29, 51, 0.95);
  border-color: rgba(0, 210, 255, 0.25);
}

.chip-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chip-avatar-wrap img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #070a13;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chip-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: #070a13;
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #38bdf8;
}

.chip-info {
  min-width: 0;
  flex: 1;
}

.chip-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-team-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.chip-sub {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-val-col {
  text-align: right;
  flex-shrink: 0;
}

.chip-val {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  display: block;
}

.chip-tier {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  display: block;
}

.chip-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
  flex-shrink: 0;
}

.chip-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Trends */
.trend-up { color: #10b981; font-weight: 700; }
.trend-dn { color: #f87171; font-weight: 700; }
.trend-flat { color: #64748b; }

/* Suggestions Grid Cards */
.suggest-card {
  padding: 12px;
  background: rgba(11, 15, 25, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.suggest-card:hover {
  background: rgba(20, 29, 51, 0.95);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.suggest-card img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: #070a13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.suggest-card .s-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggest-card .s-sub {
  font-size: 11px;
  color: #94a3b8;
}

.suggest-card .s-val {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 13.5px;
  color: #10b981;
}

.suggest-card .s-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.suggest-card:hover .s-add-btn {
  background: #10b981;
  color: #070a13;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(15, 22, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.ok {
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

/* Tables & Scrollable containers for sub-pages */
.tscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
  border-radius: 16px;
}

.tscroll > table.vt {
  margin-top: 0;
}

table.vt {
  width: 100%;
  border-collapse: collapse;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

table.vt th, table.vt td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 14px;
}

table.vt th:first-child, table.vt td:first-child,
table.vt th.l, table.vt td.l {
  text-align: left;
}

table.vt th {
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(7, 10, 19, 0.6);
}

table.vt td {
  color: #cbd5e1;
}

table.vt td b {
  font-family: "JetBrains Mono", monospace;
  color: #fff;
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #070a13;
}
::-webkit-scrollbar-thumb {
  background: #1c2847;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #283861;
}

@media (max-width: 640px) {
  .hm { display: none; }
}
