:root {
  --green: #1f4d2b;
  --green-soft: #e7efe8;
  --ink: #16181a;
  --muted: #5b6168;
  --line: #d5d9dd;
  --bg: #f4f5f3;
  --card: #ffffff;
  --gold: #f2c14e;
  --red: #b3261e;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.plain { padding-bottom: 32px; }
main, .account { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* the venue picture across the top, with the club's name over it; a plain green band until a club has a picture */
.hero { position: relative; max-width: 560px; margin: 0 auto; background: var(--green); color: #fff; min-height: 96px;
  padding-top: env(safe-area-inset-top); overflow: hidden; }
.hero.pic { min-height: 0; aspect-ratio: 16 / 9; max-height: 300px; width: 100%; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0) 62%); }
.hero-text { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; }
.hero-text { display: flex; align-items: flex-end; gap: 12px; }
/* the roll-up's logo beside the name: a small white tile, not the full-width venue picture */
.hero img.logo { position: static; width: 56px; height: 56px; flex: none; border-radius: 12px; background: #fff; object-fit: contain; }
.logo-now { display: block; width: 96px; height: 96px; border-radius: 20px; border: 1px solid var(--line); background: #fff; margin: 8px 0; }
.hero-text h1 { margin: 0; font-size: 26px; line-height: 1.15; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.hero-text p { margin: 2px 0 0; font-size: 16px; font-weight: 600; opacity: .95; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.credit { max-width: 560px; margin: 2px auto 0; padding: 0 16px; font-size: 11px; color: var(--muted); text-align: right; }
@media (min-width: 560px) { .hero { border-radius: 0 0 16px 16px; } }

h2 { font-size: 22px; margin: 0; }
h3 { font-size: 14px; margin: 16px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hint { color: var(--muted); font-size: 16px; margin: 8px 0; }
.result { font-weight: 600; min-height: 1.4em; margin: 8px 0 0; color: var(--red); }
.result:empty { display: none; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }

button { font: inherit; border-radius: 10px; cursor: pointer; }
.primary { background: var(--green); color: #fff; border: 0; padding: 12px 18px; font-weight: 600; }
.secondary { background: #fff; color: var(--green); border: 2px solid var(--green); padding: 10px 16px; font-weight: 600; }
.secondary.danger { color: var(--red); border-color: var(--red); }
/* text buttons still get a full-size tap area */
.link { background: none; border: 0; color: var(--green); text-decoration: underline; padding: 4px; min-height: 44px; min-width: 44px; }
.link.danger { color: var(--red); }
.wide { width: 100%; padding: 16px; font-size: 20px; }
button:disabled { opacity: .5; }
/* two actions side by side: the negative one on the left */
.pair { display: flex; gap: 10px; margin-top: 16px; }
.pair > * { flex: 1; min-width: 0; padding-top: 14px; padding-bottom: 14px; }

input, select, textarea { font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; width: 100%; background: #fff;
  color: var(--ink); }
input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; min-height: 48px; text-align: left; }
input[type="time"]::-webkit-date-and-time-value { text-align: left; }
input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
.row .hint { margin: 4px 0 0; font-size: 15px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > input, .inline > select { flex: 1; min-width: 0; }
.inline > button { flex: none; }
.tick { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 12px 0; }
.pin { font-size: 28px; letter-spacing: .4em; text-align: center; }

#notices:empty { display: none; }
#notices { background: #fff6dc; border: 2px solid var(--gold); border-radius: 12px; padding: 4px 14px 10px; margin: 16px 0 0; }
.banner { background: #fff6dc; border: 2px solid var(--gold); border-radius: 12px; padding: 10px 14px; margin: 16px 0 0; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0; }
.tag { display: inline-block; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; border-radius: 999px;
  padding: 2px 10px; margin-bottom: 6px; }
.ev-sub { margin: 2px 0 12px; color: var(--muted); font-size: 16px; }
.state { font-weight: 700; font-size: 20px; margin: 0 0 8px; }
.state.in { color: var(--green); }
.state.in::before { content: '✓ '; }
.state.reserve { color: #9a5b00; }
.state.soon, .state.off { color: var(--muted); font-size: 18px; }
.state.off { color: var(--red); }
.note { background: #fff6dc; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; font-weight: 600; }

ol.names { list-style: none; margin: 0; padding: 0; counter-reset: n; }
ol.names li { counter-increment: n; display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
ol.names li:first-child { border-top: 0; }
ol.names li::before { content: counter(n); width: 1.6em; flex: none; text-align: center; color: var(--muted); font-weight: 700;
  font-variant-numeric: tabular-nums; }
ol.names li.me { font-weight: 700; color: var(--green); }
ol.names li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ol.names li button { flex: none; }
.tees { margin: 14px 0 0; color: var(--muted); font-size: 16px; }

.choice { display: flex; gap: 8px; margin: 16px 0 0; }
.choice button { flex: 1; min-width: 0; padding: 10px 6px; border: 2px solid var(--green); background: #fff; color: var(--green); font-weight: 700;
  font-size: 16px; }
.choice button.on { background: var(--green); color: #fff; }

.post { border-top: 1px solid var(--line); padding: 12px 0; }
.post:first-of-type { border-top: 0; }
.post .when { color: var(--muted); font-size: 14px; margin: 0; }

/* the admin tab: one section per job, opened by tapping its title */
details.sec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 12px 0; padding: 0 16px; }
details.sec[open] { padding-bottom: 16px; }
details.sec > summary { font-weight: 700; font-size: 20px; padding: 16px 0; cursor: pointer; }
.line { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; width: 100%; text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; color: var(--ink); }
.line .who { font-weight: 700; }
.line .what { font-size: 15px; color: var(--muted); grid-column: 1; }
.line .go { grid-row: 1 / 3; grid-column: 2; font-size: 26px; color: var(--muted); }
.line.wait { border: 2px solid var(--gold); }
.box { background: var(--green-soft); border-radius: 12px; padding: 4px 12px 12px; margin: 8px 0; }
.box input[readonly] { font-size: 14px; }
/* a play day: a closed row that opens into its form when tapped */
details.day { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 0 12px; background: #fff; }
details.day[open] { padding-bottom: 12px; border-color: var(--green); }
details.day > summary { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; padding: 12px 0; cursor: pointer;
  list-style: none; }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::after { content: '›'; grid-row: 1 / 3; grid-column: 2; font-size: 26px; color: var(--muted); }
details.day[open] > summary::after { transform: rotate(90deg); }
details.day .who { font-weight: 700; }
details.day .what { font-size: 15px; color: var(--muted); grid-column: 1; }
details.day .saved { margin-left: 6px; }
/* said where something has just been saved */
.saved { display: inline-block; background: #d8f0dc; color: var(--green); font-weight: 700; font-size: 15px; border-radius: 999px; padding: 2px 12px; }
.saved::before { content: '✓ '; }
.late-tag { flex: none; font-style: normal; font-size: 13px; font-weight: 700; color: #9a5b00; background: #fff6dc; border-radius: 999px; padding: 2px 10px; }
.secondary.late { color: #9a5b00; border-color: #9a5b00; margin-left: 8px; }
.card > .secondary.late:first-of-type { margin-left: 0; }
.record { list-style: none; margin: 4px 0; padding: 0; font-size: 15px; color: var(--muted); }
.record li { padding: 3px 0; }
.record .late { color: var(--red); font-weight: 600; }
table.numbers { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.numbers th, table.numbers td { padding: 8px 2px; border-bottom: 1px solid var(--line); text-align: center; font-size: 16px;
  font-variant-numeric: tabular-nums; }
/* the headings are kept small so that the names keep their room: a name wraps between its words, never inside one */
table.numbers th { font-size: 11px; color: var(--muted); vertical-align: bottom; line-height: 1.2; }
table.numbers th:first-child, table.numbers td:first-child { text-align: left; padding-left: 0; }
.numbers-wrap { overflow-x: auto; }
table.numbers td.bad { color: var(--red); font-weight: 700; }

.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; }
.sheet .ask { font-size: 20px; font-weight: 700; margin: 4px 0 8px; }
.sheet .inline + input { margin-top: 8px; }
[hidden] { display: none !important; }
.sheet .close { display: block; margin: 12px auto 0; }

.account { color: var(--muted); font-size: 15px; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0;
  border-radius: 0; padding: 16px 2px; font-weight: 600; font-size: 15px; color: var(--muted); }
.tabs button.on { color: var(--green); box-shadow: inset 0 3px 0 var(--green); }

/* the names to choose from on the join page: one above the other */
.name-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.name-list .secondary { min-height: 52px; text-align: left; overflow-wrap: anywhere; }
input[type="search"] { -webkit-appearance: none; appearance: none; margin-top: 12px; }
.welcome { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; margin: 16px 0; }
