/* Palette taken from the hall: court green, line white, a cool dark for ink,
   and ochre only where something needs answering. Colour carries status here
   and does nothing else. */
:root {
  --paper:  #F3F5F4;
  --card:   #FFFFFF;
  --ink:    #141A1C;
  --muted:  #5C6B6E;
  --line:   #D7DEDC;
  --court:  #1B6B5A;
  --court-soft: #E4EFEB;
  --wait:   #9A6410;
  --wait-soft:  #FBF0DC;
  --alert:  #93271B;
  --alert-soft: #FAE8E5;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--court); }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem 4rem; }

header.top {
  background: var(--ink);
  color: #fff;
  padding: 0.9rem 0 0;
  border-bottom: 3px solid var(--court);
  padding-top: calc(0.9rem + env(safe-area-inset-top, 0px));
}
header.top .wrap { padding-bottom: 0; }
header.top h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
header.top .who { color: #9FB3AF; font-size: 0.82rem; }
header.top a { color: #BFD6D0; text-decoration: none; }

nav.tabs { display: flex; gap: 1.1rem; margin-top: 0.6rem; overflow-x: auto; }
nav.tabs a {
  color: #9FB3AF;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav.tabs a.on { color: #fff; border-bottom-color: var(--court); }

h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin: 1.5rem 0 0.2rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.3rem 0 0.4rem; }
p.lede { color: var(--muted); margin: 0 0 1rem; max-width: 36rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 0.7rem 0;
}

/* The one piece of emphasis: the answer to "am I playing this week". */
.verdict {
  border-radius: var(--radius);
  padding: 1.1rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
  background: var(--card);
}
.verdict .state { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.verdict .when  { color: var(--muted); font-size: 0.9rem; }
.verdict.in   { background: var(--court-soft); border-color: #B9D6CC; }
.verdict.in .state { color: var(--court); }
.verdict.wait { background: var(--wait-soft); border-color: #E8D3A6; }
.verdict.wait .state { color: var(--wait); }
.verdict.out  { background: var(--alert-soft); border-color: #E7C3BD; }
.verdict.out .state { color: var(--alert); }

.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}
.tag.in   { color: var(--court); background: var(--court-soft); border-color: #B9D6CC; }
.tag.wait { color: var(--wait);  background: var(--wait-soft);  border-color: #E8D3A6; }
.tag.out  { color: var(--alert); background: var(--alert-soft); border-color: #E7C3BD; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .label { font-weight: 600; }
.row .sub { color: var(--muted); font-size: 0.84rem; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 2.4rem;
}
button.primary, .btn.primary { background: var(--court); border-color: var(--court); color: #fff; }
button.danger { color: var(--alert); border-color: #E7C3BD; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--court);
  outline-offset: 2px;
}

input, select {
  font: inherit;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 2.4rem;
  max-width: 100%;
}
label { font-size: 0.86rem; color: var(--muted); display: block; margin-bottom: 0.15rem; }
.field { margin-bottom: 0.7rem; }
.inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 0.8rem; padding: 0.4rem 0.5rem 0.4rem 0; }
td { padding: 0.45rem 0.5rem 0.45rem 0; border-top: 1px solid var(--line); vertical-align: middle; }
.scroll { overflow-x: auto; }

/* A game drawn as a court: two teams either side of the net. */
.court-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.55rem 0.8rem;
  margin: 0.45rem 0;
}
.court-card .team { font-weight: 600; }
.court-card .net { border-top: 2px dashed var(--line); margin: 0.4rem -0.8rem; }
.court-card .court-no { color: var(--muted); font-size: 0.76rem; font-weight: 700; }

pre.paste {
  background: var(--ink);
  color: #E6EDEB;
  padding: 0.9rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre;
}

.note { border-left: 3px solid var(--court); padding-left: 0.7rem; margin: 0.6rem 0; }
.note.alert { border-left-color: var(--alert); }
.empty { color: var(--muted); padding: 1.2rem 0; }
.stat { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0.5rem 0 0.2rem; }
.stat .n { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; display: block; }
.stat .k { font-size: 0.78rem; color: var(--muted); display: block; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
