/* style.css */

:root {
  --bg: #0b0f14;
  --panel: rgba(255, 255, 255, 0.04);
  --panel2: rgba(255, 255, 255, 0.055);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: rgba(231, 237, 246, 0.92);
  --muted: rgba(231, 237, 246, 0.65);
  --muted2: rgba(231, 237, 246, 0.52);

  /* brighter accents */
  --green: #1bd37b;
  --green2: #11c56e;
  --red: #ff5c5c;
  --blue: #4aa3ff;
  --amber: #f5c04f;

  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);

  /* FIX: fluid gradient with no seam/cut */
  background:
    radial-gradient(900px 700px at 18% 18%, rgba(27, 211, 123, 0.22), transparent 60%),
    radial-gradient(900px 700px at 82% 20%, rgba(255, 92, 92, 0.20), transparent 60%),
    radial-gradient(1000px 700px at 50% 55%, rgba(74, 163, 255, 0.10), transparent 65%),
    radial-gradient(1200px 900px at 50% 50%, rgba(255, 255, 255, 0.03), transparent 70%),
    linear-gradient(180deg, #070a0f 0%, #0b0f14 50%, #070a0f 100%);
  background-attachment: fixed;
}

.container {
  max-width: 1180px;
  margin: 34px auto 44px;
  padding: 0 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

h1 {
  font-size: 26px;
  margin: 0 0 6px 0;
  letter-spacing: 0.2px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
}

.meta {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.section { margin-top: 18px; }

h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: rgba(231, 237, 246, 0.90);
  letter-spacing: 0.2px;
}

.card,
.chart-card,
.stat,
.macro-item {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card { padding: 16px; }
.card h3 {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.value {
  font-size: 18px;
  font-weight: 650;
  margin: 2px 0 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;

  /* BRIGHTER: less washed out */
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(231, 237, 246, 0.95);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.badge.risk-on {
  background: rgba(27, 211, 123, 0.16);
  border-color: rgba(27, 211, 123, 0.40);
  color: rgba(228, 255, 242, 0.96);
}

.badge.risk-off {
  background: rgba(255, 92, 92, 0.16);
  border-color: rgba(255, 92, 92, 0.40);
  color: rgba(255, 235, 235, 0.96);
}

.badge.neutral {
  background: rgba(74, 163, 255, 0.12);
  border-color: rgba(74, 163, 255, 0.34);
  color: rgba(232, 244, 255, 0.96);
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 12px;
}

.legend-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(231, 237, 246, 0.78);
  font-size: 13px;
}

.legend-row:first-of-type { border-top: none; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(231, 237, 246, 0.92);
}

.pill.low {
  background: rgba(245, 192, 79, 0.18);
  border-color: rgba(245, 192, 79, 0.38);
  color: rgba(255, 242, 214, 0.96);
}
.pill.med {
  background: rgba(74, 163, 255, 0.16);
  border-color: rgba(74, 163, 255, 0.38);
  color: rgba(232, 244, 255, 0.96);
}
.pill.high {
  background: rgba(27, 211, 123, 0.18);
  border-color: rgba(27, 211, 123, 0.40);
  color: rgba(228, 255, 242, 0.96);
}
.pill.extreme {
  background: rgba(255, 92, 92, 0.18);
  border-color: rgba(255, 92, 92, 0.40);
  color: rgba(255, 235, 235, 0.96);
}

.chart-wrap {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}

.chart-card { padding: 16px; }

.chart-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.chart-meta {
  text-align: right;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.5;
}

.chart-placeholder {
  height: 280px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(231, 237, 246, 0.72);
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.curve-stats {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.stat { padding: 16px; }

.stat .k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat .v {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.stat .hint {
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.5;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.macro-item { padding: 14px; }

.macro-item .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.macro-item strong {
  font-size: 14px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

thead th {
  text-align: left;
  font-size: 12px;
  color: rgba(231, 237, 246, 0.62);
  font-weight: 650;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.18);
}

tbody td {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: rgba(231, 237, 246, 0.86);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.bias-long { color: rgba(27, 211, 123, 0.95); font-weight: 750; }
.bias-short { color: rgba(255, 92, 92, 0.95); font-weight: 750; }
.bias-neutral { color: rgba(74, 163, 255, 0.92); font-weight: 750; }

.conviction { font-weight: 750; color: rgba(231, 237, 246, 0.92); }

.gate-yes { color: rgba(27, 211, 123, 0.92); font-weight: 750; }
.gate-no { color: rgba(231, 237, 246, 0.55); font-weight: 650; }

.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: rgba(231, 237, 246, 0.52);
}

/* Tooltips */
.has-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(231, 237, 246, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.tip {
  position: absolute;
  z-index: 30;
  left: 0;
  top: 24px;
  width: min(360px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(231, 237, 246, 0.86);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: none;
}

.has-tip:hover .tip,
.has-tip:focus .tip {
  display: block;
}

/* Responsive */
@media (max-width: 980px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .macro-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
  .meta { text-align: left; }
}
