/* Arthur scoreboard. Greyscale only: the avatar is the one thing with colour on the page. */

:root {
  color-scheme: light dark;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --ink: #161616;
  --ink-2: #474747;
  --ink-3: #676767;
  --rule: #dadada;
  --rule-2: #b9b9b9;
  --logo-filter: brightness(0);
  --logo-opacity: 0.5;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1b1b1b;
    --ink: #ececec;
    --ink-2: #b4b4b4;
    --ink-3: #8f8f8f;
    --rule: #2b2b2b;
    --rule-2: #484848;
    --logo-filter: brightness(0) invert(1);
    --logo-opacity: 0.55;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ------------------------------------------------------------------ intro */

.intro {
  padding-top: 40px;
  text-align: center;
}

.avatar img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.intro h1 {
  margin: 14px 0 10px;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.tag {
  display: inline-block;
  margin: 0;
  padding: 4px 9px 3px;
  border: 1px solid var(--ink-2);
  border-radius: 3px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
}

.tag.is-live {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.sub {
  max-width: 31ch;
  margin: 18px auto 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: balance;
}

.switch { margin: 10px 0 0; }

.switch button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ stats */

.stats { margin-top: 36px; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}

.stat {
  display: flex;
  flex-direction: column-reverse;   /* number above its label, label first in the DOM */
  align-items: center;
  gap: 2px;
  padding: 20px 8px 18px;
  text-align: center;
}

.stat:nth-child(odd) { border-right: 1px solid var(--rule); }
.stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }

.stat dt {
  color: var(--ink-3);
  font-size: 13px;
}

.stat dd {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.stat-note {
  max-width: 44ch;
  min-height: 1.45em;
  margin: 12px auto 0;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------ bets */

.bets { margin-top: 44px; }

.bets h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
}

.quiet { color: var(--ink-3); font-size: 14px; }

.empty {
  margin-top: 12px;
  padding: 28px 20px;
  border: 1px dashed var(--rule-2);
  border-radius: 10px;
  text-align: center;
}

.empty p { margin: 0 auto; max-width: 36ch; color: var(--ink-2); }
.empty .empty-title { margin-bottom: 6px; color: var(--ink); font-weight: 600; }

.bet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.bet-table th {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.bet-table td {
  padding: 14px 8px 14px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.bet-table th:last-child,
.bet-table td:last-child { padding-right: 0; }

.bet-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.c-date { color: var(--ink-2); white-space: nowrap; }

.legs {
  margin: 0;
  padding: 0 0 0 10px;
  border-left: 2px solid var(--rule-2);   /* groups the legs of one parlay */
  list-style: none;
  overflow-wrap: anywhere;
}

.legs li + li { margin-top: 3px; }

.c-payout .if-won {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}

.is-won .c-payout { font-weight: 600; }
.is-lost .c-payout,
.is-open .c-payout { color: var(--ink-3); }

.badge {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.badge-won { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.badge-open { border-style: dashed; }
.badge-void { border-style: dotted; }

.more {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 20px auto 0;
  padding: 0 28px;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.more:hover { background: var(--surface); }
.more[disabled] { color: var(--ink-3); cursor: progress; }
.more-error { margin: 10px 0 0; text-align: center; }
.more-error:empty { display: none; }

/* Phone: each bet becomes a stacked card. */
@media (max-width: 639px) {
  .bet-table, .bet-table tbody { display: block; }
  .bet-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .bet-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "date date status"
      "legs legs legs"
      "stake odds payout";
    gap: 10px 12px;
    padding: 16px 0 18px;
    border-bottom: 1px solid var(--rule);
  }
  .bet-table td { display: block; padding: 0; border: 0; }
  .bet-table td:last-child { padding-right: 0; }
  .c-date { grid-area: date; align-self: center; font-size: 13px; }
  .c-status { grid-area: status; justify-self: end; }
  .c-legs { grid-area: legs; font-size: 16px; }
  .c-stake { grid-area: stake; }
  .c-odds { grid-area: odds; }
  .c-payout { grid-area: payout; }
  .bet-table .c-stake, .bet-table .c-odds { text-align: left; }
  .c-stake::before, .c-odds::before, .c-payout::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 400;
  }
}

/* ------------------------------------------------------------------ built with */

.stack {
  margin-top: 64px;
  text-align: center;
}

.stack h2 {
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo {
  display: block;
  width: auto;
  filter: var(--logo-filter);
  opacity: var(--logo-opacity);
}

.logo-kalshi { height: 18px; }
.logo-odds { height: 30px; }
.logo-anthropic { height: 12px; }

.disclaimer {
  margin: 18px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

/* ------------------------------------------------------------------ footer */

.foot {
  padding: 48px var(--gutter) 40px;
  text-align: center;
}

.foot p {
  max-width: 30ch;
  margin: 0 auto;
  text-wrap: balance;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* ------------------------------------------------------------------ wider screens */

@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat:nth-child(n) { border-bottom: 0; border-right: 1px solid var(--rule); }
  .stat:last-child { border-right: 0; }
}

@media (min-width: 640px) {
  .intro { padding-top: 64px; }
  .avatar img { width: 144px; height: 144px; }
  .intro h1 { font-size: 3.5rem; }
  .stat dd { font-size: 2.75rem; }
  .bets { margin-top: 56px; }
  .c-date { width: 4.5rem; }
  .bet-table .c-status, .bet-table th:nth-child(5) { width: 6.5rem; padding-left: 20px; }
  .more { width: auto; }
}
