:root {
  --ink: #0c0c0c;
  --panel: #161616;
  --line: #2a2a2a;
  --mint: #5dcaa5;
  --white: #ffffff;
  --muted: #a3a3a3;
  --bad: #ff6b6b;
  --warn: #f2c14e;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--white);
  font: 400 17px/1.45 Roboto, system-ui, sans-serif;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }

h1, h2, .wordmark, .pot-total, .code, .brand h1 { font-family: Anton, Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: 34px; line-height: 1.1; margin: 4px 0 14px; }
h2 { font-size: 21px; margin: 26px 0 10px; }
h2 small { font-family: Roboto, sans-serif; font-size: 15px; text-transform: none; color: var(--muted); letter-spacing: 0; }
.card h2 { margin-top: 0; }
.card .list + h2 { margin-top: 22px; }
em { font-style: normal; color: var(--mint); }
p { margin: 0 0 10px; }
small { font-size: 15px; color: var(--muted); }
.muted { color: var(--muted); font-size: 16px; }
.empty { padding: 18px 0; text-align: center; }
.grow { flex: 1; min-width: 0; }

/* layout */
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
#app.out { padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; justify-content: center; }
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px; background: var(--ink); border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 24px; }
header .club { flex: 1; min-width: 0; color: var(--muted); font: 400 15px Roboto, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; padding: 8px 0; text-align: left; cursor: pointer; }
.bell { position: relative; background: none; border: 0; font-size: 22px; padding: 6px; cursor: pointer; }
.bell i { position: absolute; top: 0; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--mint); color: var(--ink); font: 700 13px/20px Roboto, sans-serif; }
main { padding: 16px 18px calc(110px + env(safe-area-inset-bottom)); }

nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--ink); border-top: 1px solid var(--line);
}
nav button { flex: 1; max-width: 110px; min-height: 52px; background: none; border: 0; color: var(--muted); font: 500 16px Roboto, sans-serif; border-radius: 12px; cursor: pointer; }
nav button.on { color: var(--mint); }
nav button.plus { flex: 0 0 60px; background: var(--mint); color: var(--ink); font: 500 44px/1 Roboto, sans-serif; border-radius: 50%; height: 60px; margin-top: -18px; }

/* brand screen */
.brand { text-align: center; margin-bottom: 14px; }
.brand span { color: var(--muted); letter-spacing: .2em; text-transform: uppercase; font-size: 14px; }
.brand h1 { font-size: 84px; line-height: 1; margin: 6px 0 12px; }
.brand p { color: var(--muted); }

/* building blocks */
.card { background: var(--panel); border: 1px solid var(--mint); border-radius: 16px; padding: 16px; margin: 0 0 12px; }
.pot { text-align: center; }
.pot-total { font-size: 68px; line-height: 1.05; color: var(--mint); }
.pot p { margin: 0; color: var(--muted); }
.deadline { border-color: var(--warn); }
.deadline b { color: var(--warn); }
.deadline p { margin: 4px 0 0; color: var(--muted); }
.owe { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
a.btn { text-decoration: none; }
.owe small { display: block; }
.owe b { display: block; font: 400 34px/1.1 Anton, sans-serif; }
.owe .btn { width: auto; margin: 0; padding: 0 26px; }
.code { font-size: 46px; letter-spacing: .14em; color: var(--mint); margin-bottom: 8px; }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 10px; padding: 0 18px;
  border-radius: 14px; border: 1.5px solid var(--mint); background: none; color: var(--white);
  font: 700 17px Roboto, sans-serif; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--mint); color: var(--ink); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 60px; font-size: 19px; }
/* Stays in view above the bottom bar while the list scrolls behind it. */
.sticky-go { position: sticky; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 4; box-shadow: 0 0 0 10px var(--ink), 0 -18px 24px 8px var(--ink); }
.btn.small { min-height: 44px; margin-top: 0; }
.btn:disabled { opacity: .5; }
/* Busy: the button's text fades and a small spinner turns over it while the server works. */
.busy { position: relative; pointer-events: none; color: transparent !important; }
.busy::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 3px solid currentColor; border-color: var(--mint) var(--mint) transparent transparent;
  animation: spin .7s linear infinite;
}
.btn.primary.busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.pair { display: flex; gap: 8px; margin-top: 12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--white); font: inherit; cursor: pointer;
}
.row b { display: block; font-weight: 700; }
.row .plain { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.row .btn.small { flex: none; width: auto; padding: 0 14px; }
.row small { display: block; }
.row.pick.on { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.rank { width: 28px; font: 400 22px Anton, sans-serif; color: var(--muted); text-align: center; }
.row:first-child .rank { color: var(--mint); }
.amt { font: 400 22px Anton, sans-serif; white-space: nowrap; }

.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 10px; scroll-margin-top: 70px; }
.acc.open { border-color: var(--mint); }
.acc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 0 16px; background: none; border: 0; color: var(--white); cursor: pointer; text-align: left; }
.acc-head span { font: 400 21px Anton, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.acc-head b { color: var(--mint); font: 700 16px Roboto, sans-serif; text-align: right; }
.acc-body { display: none; padding: 0 14px 14px; }
.acc.open .acc-body { display: block; }
.acc .row, .acc .chip { background: var(--ink); }
.acc .chip.on { background: var(--mint); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--white); font: 500 24px/1 Roboto, sans-serif; cursor: pointer; }
.qty .n { min-width: 30px; color: var(--mint); font: 400 22px Anton, sans-serif; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid var(--line); background: var(--panel); color: var(--white); font: 500 16px Roboto, sans-serif; cursor: pointer; }
.chip.on { background: var(--mint); border-color: var(--mint); color: var(--ink); }

.fine { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 8px; cursor: pointer; }
.fine-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fine-top b { display: block; font-size: 18px; }
.fine-title { color: var(--mint); }
.fine-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.note { margin: 8px 0 0; font-style: italic; color: #d6d6d6; }
.evidence { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-top: 10px; }
.evidence.full { max-height: none; }

.tag { flex: none; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tag.ok { border-color: var(--mint); color: var(--mint); }
.tag.bad { border-color: var(--bad); color: var(--bad); }
.tag.warn { border-color: var(--warn); color: var(--warn); }

label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 16px; }
input:not([type=checkbox]), textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink); color: var(--white); font: 400 17px Roboto, sans-serif;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--mint); }
textarea { resize: vertical; margin-bottom: 4px; }
.big-input { font: 400 30px Anton, sans-serif !important; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
label.check { display: flex; align-items: center; gap: 12px; color: var(--white); }
label.check a { color: var(--mint); }
label.check input { flex: none; }
label.check input { width: 24px; height: 24px; accent-color: var(--mint); }
label.btn { color: var(--white); font-size: 17px; margin-bottom: 0; }

.promo { position: relative; margin-top: 26px; border-color: var(--line); }
.promo small { display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; }
.promo b { display: block; font: 400 24px/1.15 Anton, sans-serif; text-transform: uppercase; letter-spacing: .02em; padding-right: 30px; }
.promo p { margin: 6px 0 0; color: var(--muted); }
.promo img { display: block; width: 100%; border-radius: 10px; margin-bottom: 12px; }
.promo .btn { margin-top: 14px; }
.promo-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.promo-full { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.promo-frame { position: relative; height: 100dvh; max-width: 100vw; aspect-ratio: 9 / 16; }
.promo-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.promo-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--white); background: rgba(0, 0, 0, .65); color: var(--white); font-size: 30px; line-height: 1; cursor: pointer; }
.promo-close, .promo-frame .btn { opacity: 0; pointer-events: none; transition: opacity .4s; }
.promo-full.ready .promo-close, .promo-full.ready .btn { opacity: 1; pointer-events: auto; }
.promo-frame .btn { position: absolute; left: 18px; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: auto; margin: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.season-tabs { margin: 0 0 14px; }
.award small { display: block; color: var(--mint); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; font-weight: 700; }
.award b { display: block; font-size: 20px; margin: 2px 0; }
.award p { margin: 0; }
.btn.clear { min-height: 44px; margin: 0 0 12px; }
.steps { margin: 10px 0 0; padding-left: 22px; color: var(--white); }
.steps li { margin-bottom: 6px; }
.foot { text-align: center; margin: 18px 0 0; }
.card .muted a { color: var(--mint); }
.foot { color: var(--muted); }
.foot a { color: var(--muted); font-size: 15px; }

/* pop-up sheet + toast */
#sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); }
.sheet-body {
  position: relative; width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--panel); border-top: 1.5px solid var(--mint); border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet-body h2 { margin-top: 0; font-size: 26px; }
.sheet-body h2 ~ h2 { margin-top: 26px; }
/* Close button that stays in the top-right corner while the sheet scrolls. */
.sheet-x { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; margin: -10px -6px 0 10px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink); color: var(--white); font-size: 28px; line-height: 1; cursor: pointer; }
.sheet-body .fine { background: var(--ink); }
#toast {
  position: fixed; left: 18px; right: 18px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; max-width: 524px; margin: 0 auto;
  padding: 14px 16px; border-radius: 14px; background: var(--mint); color: var(--ink); font-weight: 700; text-align: center;
}
#toast.bad { background: var(--bad); }

/* welcome tour: full screen so it can't be missed */
.tour-full { position: fixed; inset: 0; z-index: 25; background: var(--ink); display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.tour-dots { display: flex; gap: 8px; justify-content: center; }
.tour-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { background: var(--mint); width: 26px; border-radius: 5px; }
.tour-main { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; max-width: 480px; width: 100%; margin: 0 auto; }
.tour-icon { font-size: 84px; line-height: 1; margin-bottom: 22px; }
.tour-main h1 { font-size: 46px; color: var(--mint); margin: 0 0 16px; }
.tour-main p { font-size: 21px; line-height: 1.45; color: var(--white); margin: 0; }
.tour-foot { max-width: 480px; width: 100%; margin: 0 auto; }
.tour-skip { display: block; width: 100%; margin-top: 14px; padding: 10px; background: none; border: 0; color: var(--muted); font: 400 15px Roboto, sans-serif; cursor: pointer; }

/* Table of Sin: owes now + season total */
.sin-head { display: flex; gap: 12px; padding: 0 15px 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.sin-head span:not(.grow) { width: 64px; text-align: right; white-space: nowrap; }
.owes-now { width: 64px; text-align: right; color: var(--warn); font-weight: 700; }
.owes-now.clear { color: var(--mint); font-weight: 400; font-size: 14px; }
.sin-list .amt { min-width: 64px; text-align: right; }
.row.current { border-color: var(--mint); }
