:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #647184;
  --line: #dbe4ec;
  --surface: #f4f7fa;
  --paper: #ffffff;
  --navy: #15324d;
  --teal: #176b7a;
  --green: #168a5b;
  --red: #c84630;
  --amber: #d89a1e;
  --blue: #2c7be5;
  --soft-green: #e7f5ee;
  --soft-red: #fcebe8;
  --soft-amber: #fff4d8;
  --soft-blue: #eaf2ff;
  font-family:
    Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 46%, #fff 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #fff 46% 54%, transparent 54%),
    var(--teal);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button,
.bot-link,
.sheet-link {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  font-size: 19px;
}

.sheet-link {
  padding: 0 14px;
  font-weight: 700;
  font-size: 13px;
}

.bot-link {
  gap: 8px;
  padding: 0 14px 0 10px;
  border-color: rgba(44, 123, 229, 0.92);
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(44, 123, 229, 0.25);
  font-weight: 900;
  font-size: 13px;
}

.bot-link:hover {
  background: #2369c7;
}

.bot-link-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

main {
  width: min(1540px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

section {
  margin-top: 24px;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.kpi {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi.good {
  border-left-color: var(--green);
}

.kpi.warn {
  border-left-color: var(--amber);
}

.kpi.danger {
  border-left-color: var(--red);
}

.kpi.blue {
  border-left-color: var(--blue);
}

.kpi span,
.section-heading span,
.leader-meta,
.bet-meta,
.profile-stat span,
.award small,
.risk-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1;
  white-space: nowrap;
}

.kpi em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.hero-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(520px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.two-column {
  grid-template-columns: minmax(480px, 0.95fr) minmax(430px, 1.05fr);
}

.lower {
  grid-template-columns: minmax(560px, 1.08fr) minmax(420px, 0.92fr);
}

.section-heading {
  min-height: 38px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

.section-heading h2 {
  font-size: 18px;
  line-height: 1.2;
  padding-bottom: 8px;
}

.section-heading span {
  padding-bottom: 8px;
}

.leaderboard,
.awards,
.bets-feed,
.risk-list,
.profiles {
  display: grid;
  gap: 10px;
}

.leader-row,
.award,
.bet-row,
.profile-card,
.risk-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leader-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1.2fr) minmax(100px, 0.7fr) minmax(86px, 0.62fr) minmax(80px, 0.58fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.leader-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--navy);
  font-weight: 900;
}

.leader-name {
  min-width: 0;
}

.leader-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-value,
.leader-profit,
.leader-extra {
  text-align: right;
  white-space: nowrap;
}

.money {
  font-weight: 900;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--muted);
}

canvas {
  width: 100%;
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.award {
  min-height: 112px;
  padding: 14px;
  border-top: 5px solid var(--green);
}

.award:nth-child(2n) {
  border-top-color: var(--amber);
}

.award:nth-child(3n) {
  border-top-color: var(--blue);
}

.award strong {
  display: block;
  margin-top: 9px;
  font-size: 20px;
  line-height: 1.1;
}

.award p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.bets-feed {
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
}

.bet-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 13px;
  align-items: center;
}

.bet-id {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  font-weight: 900;
}

.bet-main {
  min-width: 0;
}

.bet-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-meta {
  display: block;
  margin-top: 5px;
  text-transform: none;
}

.bet-result {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  min-width: 88px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft-amber);
  color: #7c5a00;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.win {
  background: var(--soft-green);
  color: var(--green);
}

.status-pill.loss {
  background: var(--soft-red);
  color: var(--red);
}

.bet-result .money {
  display: block;
  margin-top: 7px;
}

.risk-row {
  padding: 14px;
}

.risk-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.risk-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.risk-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.risk-row.high .risk-meter span {
  background: var(--red);
}

.risk-row.mid .risk-meter span {
  background: var(--amber);
}

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

.profile-card {
  padding: 15px;
}

.profile-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-card h3 {
  margin: 0;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-bank {
  font-weight: 900;
  white-space: nowrap;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat {
  min-height: 64px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.profile-stat strong {
  display: block;
  margin-top: 6px;
}

.empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

@media (max-width: 1180px) {
  .score-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-grid,
  .two-column,
  .lower {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  main {
    width: min(100% - 24px, 1540px);
    padding-top: 14px;
  }

  .score-strip,
  .awards,
  .profiles {
    grid-template-columns: 1fr;
  }

  .leader-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(90px, 0.6fr);
  }

  .leader-profit,
  .leader-extra {
    display: none;
  }

  .bet-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .bet-result {
    grid-column: 2;
    text-align: left;
  }
}
