/* DinkHost app — phone-first */
:root {
  --green: #14532d; --lime: #84cc16; --lime-dark: #4d7c0f;
  --bg: #f6f8f3; --card: #fff; --ink: #1c2420; --muted: #66756c;
  --line: #dde5da; --bad: #b91c1c; --warn: #b45309; --ok: #15803d;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--green); color: #fff; position: sticky; top: 0; z-index: 20; }
.wordmark { color: #fff; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: .3px; }
.wordmark span { color: var(--lime); }
#topnav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
#topnav a, #topnav button { color: #e7f5d8; background: none; border: none; font-size: 14px; cursor: pointer; text-decoration: none; padding: 4px 2px; }
main { max-width: 720px; margin: 0 auto; padding: 16px 14px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
h1 { font-size: 24px; margin: 4px 0 10px; } h2 { font-size: 18px; margin: 0 0 10px; } h3 { font-size: 15px; margin: 14px 0 6px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 16px; background: #fff; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.btn { display: inline-block; background: var(--lime-dark); color: #fff; border: none; border-radius: 9px; padding: 10px 16px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 12px; }
.btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 13px; margin-top: 6px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 auto !important; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef3e6; color: var(--green); }
.pill.warn { background: #fef3c7; color: var(--warn); }
.pill.bad { background: #fee2e2; color: var(--bad); }
.pill.ok { background: #dcfce7; color: var(--ok); }
.banner { background: #ecfccb; border: 1px solid var(--lime); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.champion-banner { background: var(--green); color: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; font-size: 17px; font-weight: 700; }
.champion-banner .sub { font-size: 13px; font-weight: 400; color: #d9f99d; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
a { color: var(--lime-dark); }
.error { color: var(--bad); font-size: 14px; margin-top: 8px; }
.helper { background: #f7fee7; border: 1px dashed var(--lime-dark); border-radius: 9px; padding: 10px 12px; font-size: 13px; margin-top: 6px; }
.helper summary { cursor: pointer; font-weight: 700; color: var(--lime-dark); }
.qrbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qrbox .code { font-size: 26px; font-weight: 800; letter-spacing: 3px; }

/* ---- pairing tile ---- */
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.tile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tile-head .t { font-weight: 800; font-size: 15px; }
.series-line { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.tile-body { display: flex; gap: 10px; }
.tile-names { flex: 0 0 38%; display: flex; flex-direction: column; justify-content: space-around; font-size: 14px; }
.tile-names .team { font-weight: 600; line-height: 1.35; }
.tile-names .vs { color: var(--muted); font-size: 12px; font-weight: 700; margin: 4px 0; }
.tile-games { flex: 1; display: flex; gap: 8px; }
.game-col { flex: 1; min-width: 62px; text-align: center; }
.game-col .glabel { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.game-col input { padding: 8px 4px; text-align: center; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.game-col .final { font-size: 20px; font-weight: 800; padding: 6px 0; }
.game-col .gstatus { font-size: 11px; font-weight: 700; }
.game-col .notplayed { color: var(--muted); font-size: 13px; font-weight: 600; padding: 22px 0; }
.tile-follow { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.chip.done { background: #dcfce7; border-color: var(--ok); color: var(--ok); font-weight: 700; }
.chip:disabled { cursor: default; opacity: .75; }
.format-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---- modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(20,40,25,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; padding: 18px; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 16px; } }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; display: none; z-index: 60; max-width: 90vw; }
