:root {
  color-scheme: dark;
  --bg: #08070a;
  --panel: #121016;
  --panel-2: #18151f;
  --line: rgba(255, 255, 255, 0.11);
  --text: #fff7f0;
  --muted: rgba(255, 247, 240, 0.6);
  --dim: rgba(255, 247, 240, 0.38);
  --hot: #ff3f8f;
  --gold: #ffd15c;
  --green: #53e68b;
  --red: #ff5b77;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glow-pink: rgba(255, 63, 143, 0.34);
  --glow-gold: rgba(255, 209, 92, 0.26);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(255, 63, 143, 0.2), transparent 31%),
    linear-gradient(290deg, rgba(255, 209, 92, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

.board {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(1.25);
}

.brand img {
  display: block;
  width: clamp(148px, 18vw, 210px);
  height: auto;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.view-btn,
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 15px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  border: 0;
}

.view-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.view-btn[aria-pressed="true"] {
  color: #11080d;
  background: linear-gradient(135deg, var(--gold), #ff7ab8);
  border-color: transparent;
  box-shadow: 0 0 24px var(--glow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.refresh-btn {
  color: #11080d;
  background: linear-gradient(135deg, var(--gold), #ff7ab8);
  border-radius: 8px;
  box-shadow: 0 0 24px var(--glow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.refresh-btn span {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-btn.is-loading span {
  animation: spin 0.7s linear infinite;
}

.refresh-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(320px, 1.06fr) minmax(420px, 1.4fr);
  gap: 14px;
  margin: 18px 0 14px;
}

.score-main,
.score-grid article,
.platform-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035)),
    rgba(18, 16, 22, 0.72);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px) saturate(1.25);
}

.score-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: clamp(22px, 4vw, 40px);
  background:
    linear-gradient(135deg, rgba(255, 63, 143, 0.32), transparent 58%),
    linear-gradient(315deg, rgba(255, 209, 92, 0.15), transparent 50%),
    rgba(18, 16, 22, 0.68);
  box-shadow:
    0 0 72px rgba(255, 63, 143, 0.18),
    0 24px 80px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.label {
  display: block;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.score-main strong {
  margin-top: 10px;
  font-size: clamp(4.2rem, 10vw, 9.4rem);
  line-height: 0.83;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(255, 209, 92, 0.24), 0 0 66px rgba(255, 63, 143, 0.18);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.score-grid article {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: 22px;
}

.score-grid strong {
  margin: 12px 0 8px;
  font-size: clamp(2.2rem, 4vw, 4.6rem);
  line-height: 0.9;
}

small {
  color: var(--muted);
  line-height: 1.35;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.platform-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 18px;
}

.platform-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow, rgba(255, 255, 255, 0.28));
}

.platform-card::after {
  position: absolute;
  inset: 1px 1px auto;
  height: 54px;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent);
}

.instagram { --accent: linear-gradient(135deg, #f9ce34, #ee2a7b 48%, #6228d7); --accent-glow: rgba(238, 42, 123, 0.44); }
.tiktok { --accent: linear-gradient(90deg, #25f4ee, #ffffff 48%, #fe2c55); --accent-glow: rgba(37, 244, 238, 0.36); }
.youtube { --accent: #ff0033; --accent-glow: rgba(255, 0, 51, 0.42); }
.threads { --accent: #ffffff; --accent-glow: rgba(255, 255, 255, 0.32); }
.facebook { --accent: #1877f2; --accent-glow: rgba(24, 119, 242, 0.42); }

.platform-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 24px var(--accent-glow, rgba(255, 255, 255, 0.2)), 0 10px 24px rgba(0, 0, 0, 0.25);
}

.icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.platform-head b,
.platform-head small {
  display: block;
}

.platform-head b {
  margin-bottom: 3px;
  font-size: 1.02rem;
}

.platform-head small {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics {
  display: grid;
  gap: 22px;
  margin-bottom: 24px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2.5rem, 4.8vw, 4.1rem);
  line-height: 0.9;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.1);
}

.metrics div + div strong {
  color: var(--gold);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.latest-link {
  display: block;
  min-height: 20px;
  margin: -8px 0 14px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-link[hidden] {
  display: none;
}

.meter {
  height: 9px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow, rgba(255, 255, 255, 0.24));
  transition: width 0.35s ease;
}

.platform-card p {
  min-height: 40px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.is-live {
  background:
    linear-gradient(180deg, rgba(83, 230, 139, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(18, 16, 22, 0.72);
}

.is-waiting {
  background:
    linear-gradient(180deg, rgba(255, 209, 92, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(18, 16, 22, 0.72);
}

body.is-compact .board {
  width: min(1480px, calc(100% - 24px));
  padding: 12px 0 18px;
}

body.is-compact .topbar {
  min-height: 48px;
}

body.is-compact .brand img {
  width: clamp(132px, 14vw, 172px);
}

body.is-compact .topbar-meta {
  font-size: 0.82rem;
}

body.is-compact .view-btn,
body.is-compact .refresh-btn {
  min-height: 36px;
  padding: 0 12px;
}

body.is-compact .scoreboard {
  grid-template-columns: minmax(260px, 0.75fr) minmax(520px, 1.5fr);
  gap: 10px;
  margin: 10px 0;
}

body.is-compact .score-main,
body.is-compact .score-grid article {
  min-height: 128px;
  padding: 16px;
}

body.is-compact .score-main strong {
  font-size: clamp(3rem, 6vw, 5.8rem);
}

body.is-compact .score-grid {
  gap: 10px;
}

body.is-compact .score-grid strong {
  margin: 8px 0 5px;
  font-size: clamp(1.9rem, 3vw, 3.4rem);
}

body.is-compact small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.is-compact .platforms {
  gap: 10px;
}

body.is-compact .platform-card {
  min-height: 188px;
  padding: 14px;
}

body.is-compact .platform-head {
  gap: 10px;
  margin-bottom: 14px;
}

body.is-compact .icon {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
}

body.is-compact .platform-head b {
  font-size: 0.92rem;
}

body.is-compact .platform-head small {
  max-width: 132px;
  font-size: 0.78rem;
}

body.is-compact .metrics {
  gap: 12px;
  margin-bottom: 14px;
}

body.is-compact .label {
  font-size: 0.64rem;
}

body.is-compact .metrics strong {
  margin-top: 5px;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
}

body.is-compact .metrics div + div strong {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

body.is-compact .latest-link {
  margin: -4px 0 10px;
  font-size: 0.72rem;
}

body.is-compact .meter {
  height: 6px;
}

body.is-compact .platform-card p {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 1180px) {
  .scoreboard,
  .platforms {
    grid-template-columns: 1fr;
  }

  .platform-card {
    min-height: 260px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-compact .scoreboard {
    grid-template-columns: 1fr;
  }

  body.is-compact .platforms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .board {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .score-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .score-main,
  .score-grid article,
  .platform-card {
    min-height: auto;
    padding: 18px;
  }

  .score-main strong {
    font-size: clamp(4rem, 20vw, 6.4rem);
  }

  .metrics strong {
    font-size: 3.2rem;
  }

  body.is-compact .board {
    width: min(100% - 16px, 1440px);
    padding: 8px 0 12px;
  }

  body.is-compact .topbar {
    flex-direction: row;
    align-items: center;
    min-height: 44px;
    padding: 7px;
  }

  body.is-compact .brand img {
    width: 112px;
  }

  body.is-compact .topbar-meta {
    width: auto;
    gap: 7px;
    justify-content: flex-end;
  }

  body.is-compact #updatedAt {
    display: none;
  }

  body.is-compact .view-btn,
  body.is-compact .refresh-btn {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.78rem;
  }

  body.is-compact .scoreboard {
    gap: 8px;
    margin: 8px 0;
  }

  body.is-compact .score-main {
    min-height: 84px;
    padding: 12px;
  }

  body.is-compact .score-main strong {
    font-size: 3.2rem;
  }

  body.is-compact .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.is-compact .score-grid article {
    min-height: 72px;
    padding: 9px;
  }

  body.is-compact .score-grid strong {
    margin: 5px 0 0;
    font-size: 1.45rem;
  }

  body.is-compact .score-grid small {
    display: none;
  }

  body.is-compact .platforms {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  body.is-compact .platform-card {
    display: grid;
    grid-template-columns: minmax(128px, 0.9fr) minmax(0, 1.1fr);
    gap: 8px;
    align-items: center;
    min-height: auto;
    padding: 9px;
  }

  body.is-compact .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
  }

  body.is-compact .platform-head {
    gap: 8px;
    margin: 0;
  }

  body.is-compact .icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  body.is-compact .platform-head b {
    font-size: 0.86rem;
  }

  body.is-compact .platform-head small {
    max-width: 92px;
    font-size: 0.68rem;
  }

  body.is-compact .metrics .label {
    font-size: 0.54rem;
    letter-spacing: 0.06em;
  }

  body.is-compact .metrics strong {
    font-size: 1.55rem;
  }

  body.is-compact .metrics div + div strong {
    font-size: 1.28rem;
  }

  body.is-compact .latest-link {
    display: none;
  }

  body.is-compact .meter {
    display: none;
  }
}
