:root {
  color-scheme: light;
  --ink: #fbf9f9;
  --slate: #e7e4e4;
  --muted: #cfcaca;
  --surface: rgba(0, 3, 29, 0.85);
  --surface-strong: rgba(0, 3, 29, 0.92);
  --accent: #ffce00;
  --accent-2: #ffce00;
  --accent-3: #f2b84b;
  --cool: #2f80ed;
  --warm: #f2b84b;
  --hot: #e65c4f;
  --shadow: rgba(0, 0, 0, 0.4);
  --radius: 24px;
  --gap: 24px;
}

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

body {
  font-family: "Georgia", "Times New Roman", serif;
  background: radial-gradient(circle at top left, #111b45 0%, #070912 45%, #05050a 100%);
  color: var(--ink);
  min-height: 100vh;
}

h1,
h2,
h3 {
  color: #ffce00;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.home { color: yellow; }
.btn {
  border: none;
  background: var(--accent);
  color: #151515;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 30px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px var(--shadow);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.main-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.insight-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 18px 40px var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  pointer-events: none;
}

.chart-card {
  min-height: 280px;
}

.sentiment-card {
  display: flex;
  flex-direction: column;
}

.sentiment-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.sentiment-card canvas {
  width: 100%;
  height: auto;
}

.sentiment-legend {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--slate);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-label {
  color: #fbf9f9;
}

.card-header p {
  color: #f7f5f5;
  margin-top: 6px;
}

.metric {
  font-size: 2.6rem;
  margin-top: 18px;
}

.metric-sub {
  color: #f7f5f5;
  margin-top: 8px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

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

.bar-label {
  min-width: 110px;
  font-size: 0.9rem;
  color: var(--slate);
}

.bar-track {
  flex: 1;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--cool);
}

.bar-value {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 54px;
  text-align: right;
}

.tag-headers {
  display: grid;
  grid-template-columns: 1.4fr 2fr 0.8fr 0.8fr;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.tag-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.tag-row {
  display: grid;
  grid-template-columns: 1.4fr 2fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.tag-name {
  font-size: 0.95rem;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-name a {
  color: #ffce00;
  text-decoration: none;
}

.tag-name a:hover {
  text-decoration: underline;
}

.tag-heat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(12, 16, 22, 0.12);
  overflow: hidden;
}

.tag-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.tag-metric {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.tag-votes {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.85rem;
}

.tag-up {
  color: #1f8a5b;
  font-weight: 600;
}

.tag-down {
  color: #d24b43;
  font-weight: 600;
}

.tag-neutral {
  color: var(--accent-3);
  font-weight: 600;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  color: var(--slate);
}

.list li {
  line-height: 1.4;
}

.list a {
  color: #ffce00;
  text-decoration: none;
}

.list a:hover {
  text-decoration: underline;
}

.summary {
  margin-top: 16px;
  color: #ffffff;
}

.sentiment-pill {
  margin-top: 16px;
  display: inline-flex;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #16138f;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.85rem;
  color: #ffffff;
  border: 1px solid rgba(22, 19, 143, 0.8);
}

.card.wide {
  grid-column: span 2;
}

.top-articles-section {
  padding: 28px;
}

.ratings-section {
  padding: 28px;
}

.ratings-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.ratings-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.ratings-card {
  padding: 18px;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(34, 61, 164, 0.45), rgba(4, 9, 35, 0.95));
  border: 1px solid rgba(255, 206, 0, 0.08);
  box-shadow: inset 0 0 30px rgba(53, 92, 255, 0.18);
}

.ratings-card.hot {
  background: radial-gradient(circle at top left, rgba(53, 92, 255, 0.4), rgba(4, 9, 35, 0.95));
}

.ratings-card.cool {
  background: radial-gradient(circle at top left, rgba(29, 55, 141, 0.45), rgba(4, 9, 35, 0.95));
}

.ratings-grid h4 {
  color: #ffce00;
  font-size: 1rem;
  margin-top: 4px;
}

.ratings-list {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.rating-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.rating-rank {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 206, 0, 0.22);
  color: #ffce00;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.rating-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-title {
  color: #fbf9f9;
  text-decoration: none;
  font-weight: 600;
}

.rating-title:hover {
  text-decoration: underline;
}

.rating-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.rating-fill {
  height: 100%;
  border-radius: 999px;
}

.rating-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: #fbf9f9;
  white-space: nowrap;
}

.ratings-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #f7f5f5;
}

.ratings-analysis {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(18, 28, 92, 0.7), rgba(6, 10, 38, 0.95));
  border: 1px solid rgba(255, 206, 0, 0.12);
  color: #fbf9f9;
  display: grid;
  gap: 10px;
  box-shadow: inset 0 0 22px rgba(58, 88, 255, 0.16);
}

.ratings-analysis h5 {
  font-size: 0.95rem;
  color: #ffce00;
}

.ratings-analysis ul {
  margin-left: 16px;
  display: grid;
  gap: 6px;
}

.raw-section {
  padding: 28px;
}

.raw-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.raw-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 24, 88, 0.8), rgba(3, 7, 28, 0.95));
  border: 1px solid rgba(255, 206, 0, 0.1);
  box-shadow: inset 0 0 18px rgba(53, 92, 255, 0.18);
}

.raw-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.raw-metric {
  margin-top: 8px;
  font-size: 1.4rem;
  color: #fbf9f9;
}

.timespan-switch {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.timespan-switch .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ffce00;
  border: 1px solid rgba(255, 206, 0, 0.4);
}

.timespan-switch .btn.ghost.active {
  background: #ffce00;
  color: #151515;
  border-color: #ffce00;
}

.articles-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.article-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 206, 0, 0.12), rgba(46, 80, 150, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px var(--shadow);
}

.article-rank {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
}

.article-title {
  font-size: 1.05rem;
  color: #ffce00;
  text-decoration: none;
  font-weight: 600;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.score-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.score-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--cool);
}

.score-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-pill {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--slate);
}

@media (max-width: 900px) {
  .card.wide {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .bar-label {
    min-width: 80px;
  }

  .tag-headers,
  .tag-row {
    grid-template-columns: 1fr 1.4fr;
  }

  .tag-headers span:nth-child(3),
  .tag-headers span:nth-child(4),
  .tag-row .tag-metric {
    display: none;
  }

  .sentiment-layout {
    grid-template-columns: 1fr;
  }

  .rating-row {
    grid-template-columns: auto 1fr;
  }

  .rating-chip {
    grid-column: 1 / -1;
    justify-self: start;
    white-space: normal;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.panel {
  animation: fadeUp 0.6s ease both;
}
