@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/site/fredoka-700.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/site/source-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/site/source-sans-600.woff2") format("woff2");
}

:root {
  --grass: #102616;
  --grass-2: #14301c;
  --sheet: #f3efe2;
  --ink: #1a2414;
  --ink-soft: #24301c;
  --line: #e0d5ba;
  --yellow: #ffd400;
  --cream: #fffaf0;
  --danger: #8c1c1c;
  --log: #0c1c12;
  --log-text: #e7f0dc;
  --log-dim: #d7e4cc;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px 48px;
  background-color: var(--grass);
  background-image: repeating-linear-gradient(90deg, var(--grass) 0 22px, var(--grass-2) 22px 44px);
  color: var(--sheet);
  font-family: "Source Sans 3", sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

::selection { background: var(--yellow); color: var(--ink); }

:focus-visible {
  outline: 2px solid #e6b000;
  outline-offset: 3px;
}

[hidden] { display: none !important; }

a { color: inherit; text-underline-offset: 3px; }

.sheet {
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: 28px 22px 32px;
  background: var(--sheet);
  color: var(--ink);
  color-scheme: light;
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(6, 16, 8, 0.35);
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet.wide { width: min(100%, 48rem); }

.sheet ::selection { background: var(--yellow); color: var(--ink); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark { width: 56px; height: 56px; flex: none; }

h1, h2, h3, button, .score, .when {
  font-family: Fredoka, "Source Sans 3", sans-serif;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

h2 { margin: 0 0 12px; font-size: 1.55rem; letter-spacing: -0.02em; }

h3 { margin: 0 0 8px; font-size: 1.15rem; }

p { margin: 0; }

.status { margin-top: 6px; color: var(--ink-soft); max-width: 62ch; }

.fine { margin-top: 8px; color: var(--ink-soft); font-size: 0.95rem; }

section { margin-top: 36px; }

.switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

button {
  font-size: 1rem;
  background: var(--yellow);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

button:hover { background: #ffe566; }

button:focus-visible { outline-color: var(--ink); }

button:disabled {
  background: #e4d7a4;
  color: #3a3424;
  cursor: default;
}

.switch button {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.switch button:hover { background: #fff6cc; }

.switch button[aria-pressed="true"] {
  background: var(--yellow);
  box-shadow: none;
}

.switch button[aria-pressed="true"]:hover { background: #ffe566; }

label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
}

input, select {
  font: inherit;
  width: 100%;
  max-width: 24rem;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid #c9c0a4;
  border-radius: 12px;
  padding: 10px 12px;
  caret-color: var(--ink);
}

input:focus, select:focus {
  outline: 2px solid #e6b000;
  border-color: #e6b000;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 8px;
}

.filters label { margin: 0; flex: 1 1 12rem; }

.board { margin-top: 18px; }

.row {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.row.win {
  background: var(--yellow);
  margin: 8px -12px 4px;
  padding: 12px;
  border-radius: 16px;
  border-bottom: 0;
}

.rank, .score {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
}

.who { min-width: 0; }

.name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.when-small { display: block; color: var(--ink-soft); font-size: 0.92rem; }

.row.win .when-small { color: var(--ink); }

.empty, .error { margin-top: 16px; }

.error { color: var(--danger); font-weight: 600; }

.foot {
  width: min(100%, 40rem);
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  text-align: center;
}

.foot a { color: #d7e4cc; }

.prose h2 { margin-top: 26px; }

.prose p + p { margin-top: 10px; }

.prose ul { margin: 10px 0 0; padding-left: 1.15rem; }

.prose li { margin: 6px 0; }

.prose a { font-weight: 600; }

.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.legal a[aria-current="page"] { text-decoration: underline; }

.bar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.account { font-weight: 600; }

.nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  margin: 0;
}

.nums div { margin: 0; }

.nums dt { margin: 0; color: var(--ink-soft); }

.nums dd {
  margin: 2px 0 0;
  font-family: Fredoka, "Source Sans 3", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.modes { margin-top: 16px; }

.days {
  display: grid;
  grid-template-columns: repeat(14, minmax(2.2rem, 1fr));
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: #3d5a28 transparent;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 9rem;
  gap: 4px;
}

.bar {
  display: block;
  width: 100%;
  background: #1f6b32;
  border-radius: 6px 6px 0 0;
  min-height: 2px;
}

.day.today .bar { background: var(--yellow); }

.day .n { font-family: Fredoka, sans-serif; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.day .l { font-size: 0.75rem; color: var(--ink-soft); text-align: center; }

.match { padding: 16px 0; border-top: 1px solid var(--line); }

.match p { max-width: 68ch; }

details { margin-top: 8px; }

summary { cursor: pointer; font-weight: 600; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

th { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }

td.num, th.num { text-align: right; }

ul.plain { margin: 12px 0 0; padding: 0; list-style: none; }

ul.plain li { padding: 8px 0; border-top: 1px solid var(--line); }

.log {
  background: var(--log);
  color: var(--log-text);
  color-scheme: dark;
  border-radius: 16px;
  padding: 12px;
  max-height: 28rem;
  overflow: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  scrollbar-color: var(--log-dim) var(--log);
}

.logline {
  display: grid;
  grid-template-columns: 4.8rem 3.4rem minmax(0, 1fr);
  gap: 8px;
  padding: 2px 0;
}

.logline time { color: var(--log-dim); }

.logline.warn { color: var(--yellow); }

.logline.error { color: #ffb4b4; }

.logline .msg { white-space: pre-wrap; overflow-wrap: anywhere; }

.more { margin-top: 12px; }

@media (max-width: 520px) {
  body { padding: 16px 12px 36px; }
  .sheet { padding: 22px 16px 26px; border-radius: 22px; }
  .nums { grid-template-columns: 1fr; }
  .logline { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .logline .lv { display: none; }
}
