:root { --g: #1f7a3f; --gd: #145a2d; --gl: #e6f4ea; --r: #c0392b; --rl: #fdecea; --ink: #1d2a22; --mut: #66756b; --line: #d8e4dc; }
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: #f2f6f3; font-size: 16px; -webkit-tap-highlight-color: transparent; }
.mock { background: #fff4d6; color: #8a5a00; font-size: 12px; text-align: center; padding: 5px; }
header { background: var(--g); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
header h1 { margin: 0; font-size: 20px; }
header a { color: #fff; font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.card h2 { margin: 0 0 8px; font-size: 17px; color: var(--gd); display: flex; justify-content: space-between; align-items: center; }
.mut { color: var(--mut); font-size: 13px; }
input, select { font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; background: #fff; width: 100%; }
label { font-size: 13px; font-weight: 600; color: var(--mut); display: block; margin: 8px 0 4px; }
.btn { border: 0; border-radius: 10px; min-height: 44px; padding: 0 14px; font-size: 15px; font-weight: 700; background: var(--g); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.lite { background: var(--gl); color: var(--gd); }
.btn.red { background: var(--rl); color: var(--r); }
.btn.plus { min-width: 44px; padding: 0; font-size: 22px; }
.btn.x { min-width: 44px; padding: 0; background: var(--rl); color: var(--r); }
.btn.small { min-height: 34px; font-size: 13px; padding: 0 10px; }

/* status board */
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { border-radius: 14px; padding: 12px; color: #fff; text-align: center; }
.tile b { display: block; font-size: 30px; line-height: 1.1; }
.tile.filled { background: var(--g); }
.tile.open { background: var(--r); }

/* course & times */
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.row > input, .row > select { flex: 1; min-width: 0; }
.row > input[type=time] { flex: 0 0 160px; }

/* players table */
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--mut); font-weight: 600; padding: 4px; }
td { padding: 8px 4px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th.n, td.n { width: 44px; }
th.st, td.st { width: 44px; text-align: center; }
td.n { touch-action: none; cursor: grab; color: var(--g); font-weight: 700; user-select: none; }
td.n::before { content: "≡ "; color: var(--mut); font-weight: 400; }
td.nm { font-weight: 600; cursor: pointer; text-decoration: underline dotted var(--mut); }
td.ct { color: var(--mut); font-size: 13px; }
tr.dragging { background: var(--gl); }
.pill { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: #e3e7e4; color: var(--mut); }
.pill.in { background: var(--g); color: #fff; }
.pill.out { background: var(--r); color: #fff; }
.form { background: var(--gl); border-radius: 12px; padding: 10px; margin-top: 10px; }
.seg { display: flex; gap: 0; margin-top: 4px; }
.seg button { flex: 1; min-height: 40px; border: 1px solid var(--g); background: #fff; color: var(--g); font-weight: 700; font-size: 14px; }
.seg button:first-child { border-radius: 10px 0 0 10px; }
.seg button:last-child { border-radius: 0 10px 10px 0; }
.seg button.on { background: var(--g); color: #fff; }
.form .actions { display: flex; gap: 8px; margin-top: 10px; }
.form .actions .btn { flex: 1; }

/* player page */
.hi { font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.event { font-size: 18px; line-height: 1.5; }
.event .big { font-size: 22px; font-weight: 800; color: var(--gd); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.choices button { min-height: 110px; border: 0; border-radius: 18px; font-size: 32px; font-weight: 900; color: #fff; cursor: pointer; }
.choices .in { background: var(--g); }
.choices .out { background: var(--r); }
.status { margin-top: 16px; padding: 22px 16px; border-radius: 18px; text-align: center; font-size: 22px; font-weight: 800; }
.status.in { background: var(--gl); color: var(--gd); }
.status.out { background: var(--rl); color: var(--r); }
.status.wait { background: #fff4d6; color: #8a5a00; }
.change { display: block; text-align: center; margin-top: 12px; color: var(--mut); font-size: 14px; background: none; border: 0; text-decoration: underline; cursor: pointer; width: 100%; padding: 8px; }
.group { text-align: center; margin-top: 14px; font-size: 14px; color: var(--mut); }

#toasts { position: fixed; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--gd); color: #fff; padding: 12px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: opacity .4s; }
.links .btn { width: 100%; margin-bottom: 8px; }

/* deadline + text buttons */
.dates { display: grid; grid-template-columns: 1fr; gap: 0; }
.remind-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn:disabled { background: #e3e7e4; color: #8c9a91; cursor: default; }
.btn.hot { background: #d98a00; }
.card h2 span { display: flex; gap: 6px; align-items: center; }
th.n, td.n { width: 38px; }
th.st, td.st { width: 42px; }
th.tx, td.tx { width: 54px; text-align: right; }
td.st a { text-decoration: none; }
.btn.tiny { min-height: 30px; padding: 0 8px; font-size: 12px; background: var(--gl); color: var(--gd); }

.held-note { margin: -4px 0 12px; text-align: center; font-size: 13px; font-weight: 700; color: #8a5a00; background: #fff4d6; border-radius: 10px; padding: 6px; }

.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.send-grid .btn { min-height: 52px; font-size: 14px; line-height: 1.2; padding: 6px 8px; }
.outbox { margin-top: 10px; }
.ob-head { display: flex; justify-content: space-between; align-items: center; }
.outbox pre { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 11px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.ob-url { font-size: 11px; word-break: break-all; margin-top: 4px; }

header .sub { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
/* real build additions */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.btn.disabled { background: #e3e7e4; color: #8c9a91; cursor: default; pointer-events: auto; }
.toast.bad { background: #c0392b; }
.linkbtn { background: none; border: 0; color: #fff; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px 0; }
.err { color: #c0392b; font-weight: 600; }
.pill.wait { background: #d98a00; color: #fff; }
[hidden] { display: none !important; }
