/* Games. Phone-first, one file, no build step. */
@font-face { font-family: "Inter"; src: url("InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --felt: #1f4e79; --felt-deep: #163a5a; --gold: #e9b44c; --paper: #f7f6f2;
  --ink: #1c2230; --card: #ffffff; --line: #dcdfe4; --muted: #5f6672;
  --ok-bg: #e3f0ea; --ok: #1e5a4e; --bad-bg: #fbe4e2; --bad: #9b2424;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", system-ui, sans-serif; font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--paper); }
a { color: var(--felt); }
h1 { font-size: 1.5rem; margin: 0.4rem 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
h3 { font-size: 0.8rem; margin: 0.9rem 0 0.2rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
p { margin: 0.4rem 0; }

.devbar { background: #ffe14d; color: #1c1c1c; font-weight: 700; font-size: 0.8rem; text-align: center; padding: 0.35rem 0.6rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 1rem; background: var(--felt); color: #fff; }
.brand { color: #fff; text-decoration: none; }
.brand .mark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }

main { max-width: 40rem; margin: 0 auto; padding: 0.9rem 1rem 2rem; }
footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1rem 1rem 2rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; margin: 0.8rem 0; }
.card.narrow { max-width: 24rem; margin-left: auto; margin-right: auto; }
.card.empty { color: var(--muted); text-align: center; }
.hint { color: var(--muted); font-size: 0.88rem; }

.flash { border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0.6rem 0; font-weight: 600; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }

.changed { position: sticky; top: 0; z-index: 5; background: var(--gold); color: var(--ink); font-weight: 700; text-align: center; padding: 0.5rem; }
.who { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.who .quiet { color: #fff; border-color: rgba(255, 255, 255, 0.45); background: transparent; }
.tabs { display: flex; background: var(--felt-deep); }
.tabs a { flex: 1; text-align: center; padding: 0.65rem 0.4rem; color: #d3dfeb; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a.on { color: #fff; border-bottom-color: var(--gold); }

.row-link { display: block; text-decoration: none; color: var(--ink); }
.row-link strong { display: block; }
.row-link.quiet { opacity: 0.75; }
.card.alert { border-color: var(--gold); background: #fff8e6; }
.optional { color: var(--muted); font-weight: 400; font-size: 0.88rem; }
.undo-link { text-align: right; font-size: 0.9rem; }

.player { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.player:first-of-type { border-top: 0; }
.player-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; }
.cell { color: var(--muted); font-size: 0.9rem; }
.copy { display: flex; gap: 0.4rem; margin: 0.4rem 0; }
.copy input { flex: 1; font-size: 0.85rem; }
details summary { cursor: pointer; color: var(--felt); font-size: 0.9rem; padding: 0.3rem 0; }
form.inline { display: flex; gap: 0.4rem; align-items: center; margin: 0.4rem 0; }
.buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stack > * + * { margin-top: 0.7rem; }
.card form + form { margin-top: 0.6rem; }

label { display: block; font-weight: 600; font-size: 0.92rem; }
label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
input, select, button, .button { font: inherit; }
input:not([type=checkbox]):not([type=hidden]), select { display: block; width: 100%; margin-top: 0.25rem; padding: 0.6rem 0.65rem; border: 1px solid #c3c8d0; border-radius: 9px; background: #fff; color: var(--ink); min-height: 2.75rem; }
input[type=checkbox] { width: 1.3rem; height: 1.3rem; }
input.pin { letter-spacing: 0.4em; font-size: 1.2rem; max-width: 9rem; }
input.pin::placeholder { letter-spacing: normal; font-size: 0.95rem; }
form.inline input.pin { margin-top: 0; }
button, .button { display: inline-block; cursor: pointer; border: 1px solid var(--felt); background: var(--felt); color: #fff; font-weight: 700; border-radius: 9px; padding: 0.6rem 1rem; min-height: 2.75rem; text-decoration: none; }
button.quiet { background: #fff; color: var(--felt); border-color: #c3c8d0; font-weight: 600; padding: 0.4rem 0.7rem; min-height: 2.4rem; font-size: 0.9rem; }
button.danger { color: var(--bad); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Cashflow */
.summary .label { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.summary .cash { font-size: 2.4rem; font-weight: 800; margin: 0 0 0.3rem; letter-spacing: -0.02em; }
.summary .big { font-size: 1.3rem; font-weight: 700; margin: 0; }
.summary .big.bad { color: var(--bad); }
.summary .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.summary .note { background: #fff8e6; border-radius: 8px; padding: 0.4rem 0.6rem; margin-top: 0.6rem; font-weight: 600; }
.bar { height: 0.8rem; background: #e7eaee; border-radius: 99px; overflow: hidden; margin: 0.3rem 0; }
.bar span { display: block; height: 100%; background: var(--ok); width: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0.8rem 0; }
.tile { display: flex; align-items: center; justify-content: center; min-height: 4.2rem; background: var(--felt); color: #fff; border-radius: 12px; font-weight: 700; font-size: 1.05rem; text-decoration: none; text-align: center; padding: 0.4rem; }
.small-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.6rem 0; }
.small-grid a { display: flex; align-items: center; justify-content: center; min-height: 3rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--felt); font-weight: 600; font-size: 0.88rem; text-decoration: none; text-align: center; padding: 0.3rem; }
.pick-card { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.pick-card span { display: block; font-weight: 400; font-size: 0.88rem; color: var(--muted); }
table.ba, table.lines { width: 100%; border-collapse: collapse; }
table.ba th, table.ba td, table.lines th, table.lines td { padding: 0.35rem 0.2rem; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.ba th:first-child, table.lines th { text-align: left; font-weight: 500; }
table.lines tr.total th, table.lines tr.total td { font-weight: 800; }
table.lines tr.undone { color: var(--muted); }
.search { display: flex; gap: 0.4rem; }
.search input { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips a { padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; font-size: 0.85rem; background: #fff; }
.chips a.on { background: var(--felt); color: #fff; border-color: var(--felt); }
.bar .w0 { width: 0%; }
.bar .w5 { width: 5%; }
.bar .w10 { width: 10%; }
.bar .w15 { width: 15%; }
.bar .w20 { width: 20%; }
.bar .w25 { width: 25%; }
.bar .w30 { width: 30%; }
.bar .w35 { width: 35%; }
.bar .w40 { width: 40%; }
.bar .w45 { width: 45%; }
.bar .w50 { width: 50%; }
.bar .w55 { width: 55%; }
.bar .w60 { width: 60%; }
.bar .w65 { width: 65%; }
.bar .w70 { width: 70%; }
.bar .w75 { width: 75%; }
.bar .w80 { width: 80%; }
.bar .w85 { width: 85%; }
.bar .w90 { width: 90%; }
.bar .w95 { width: 95%; }
.bar .w100 { width: 100%; }
