/* Weigh Me In - mobile first */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0e2236;
  color: #14202e;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 520px; margin: 0 auto; padding: 4px 14px 40px; }

.top {
  max-width: 520px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { margin: 0; font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: .2px; }
.brand img { display: block; height: 54px; width: auto; }
.saved-note { font-size: .72rem; color: #8fb3cc; }

.update-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #1ca7d8; color: #fff; padding: 10px 14px; font-size: .9rem; font-weight: 600;
}
.update-banner[hidden] { display: none; }
.update-banner button { background: #fff; color: #0e2236; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: .85rem; }

/* buttons */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 10px;
  padding: 11px 16px; background: #e7edf3; color: #14202e;
}
.btn:active { filter: brightness(.92); }
.btn-big { width: 100%; padding: 16px; font-size: 1.15rem; border-radius: 12px; }
.btn-primary { background: #1ca7d8; color: #fff; }
.btn-go { background: #1fbf5c; color: #fff; }
.btn-small { padding: 7px 14px; font-size: .85rem; }
.btn-ghost { width: 100%; margin-top: 8px; background: transparent; color: #5a6b7c; border: 1px solid #c9d3dc; }
.btn-danger { width: 100%; margin-top: 18px; background: #fcebeb; color: #a32d2d; }
.btn[hidden] { display: none; }

.back-btn { background: none; border: 0; color: #8fd3f0; font: inherit; font-weight: 600; font-size: 1rem; padding: 10px 2px; cursor: pointer; }

/* angler list */
.angler-list { list-style: none; margin: 14px 0 0; padding: 0; }
.angler-list li {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 9px; cursor: pointer;
}
.angler-list li:active { background: #eaf2f8; }
.peg-badge {
  flex: none; min-width: 52px; text-align: center;
  background: #0e2236; color: #fff; border-radius: 9px; padding: 6px 8px; line-height: 1.1;
}
.peg-badge small { display: block; font-size: .6rem; letter-spacing: .08em; opacity: .75; text-transform: uppercase; }
.peg-badge strong { font-size: 1.2rem; }
.a-main { flex: 1; min-width: 0; }
.a-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-sub { font-size: .8rem; color: #6a7a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-total { text-align: right; flex: none; font-weight: 800; font-size: 1.05rem; color: #0e2236; font-variant-numeric: tabular-nums; }
.a-total small { display: block; font-weight: 500; font-size: .72rem; color: #6a7a8a; }
.empty { color: #9fb9cc; text-align: center; margin: 34px 10px; line-height: 1.5; }
.empty b { color: #fff; }

/* angler screen */
.card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.head-card { display: flex; align-items: center; gap: 12px; }
.head-main { flex: 1; min-width: 0; }
.head-name { font-size: 1.25rem; font-weight: 800; }
.head-sub { color: #5a6b7c; font-size: .9rem; margin-top: 2px; }
.total-card { text-align: center; background: #1ca7d8; color: #fff; }
.total-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.total-value { font-size: 2.6rem; font-weight: 900; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.total-sub { font-size: .9rem; opacity: .95; }

.entry-title { display: block; font-weight: 700; margin-bottom: 8px; }
.entry-row { display: flex; gap: 10px; margin-bottom: 10px; }
.entry-field { flex: 1; display: flex; align-items: center; gap: 8px; background: #f1f4f8; border: 2px solid #d6dee7; border-radius: 12px; padding: 4px 14px; }
.entry-field:focus-within { border-color: #1ca7d8; background: #fff; }
.entry-field input { width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 2.1rem; font-weight: 800; text-align: right; padding: 6px 0; color: #14202e; outline: none; }
.entry-field span { font-size: 1.2rem; font-weight: 700; color: #5a6b7c; }
.entry-msg { min-height: 1.2em; margin: 8px 0 0; font-size: .88rem; font-weight: 600; color: #a32d2d; }
.entry-msg.ok { color: #0c7a3d; }

.fish-list { list-style: none; margin: 0; padding: 0; }
.fish-list li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.fish-list li.editing { outline: 3px solid #1ca7d8; }
.fish-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #e7edf3; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #35506a; }
.fish-w { flex: 1; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fish-btn { background: transparent; border: 1px solid #c9d3dc; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .78rem; font-weight: 600; color: #35506a; cursor: pointer; }
.fish-btn.del { color: #a32d2d; border-color: #ecc3c3; }

/* add/edit sheet */
.sheet { position: fixed; inset: 0; background: rgba(5,14,24,.7); display: flex; align-items: flex-end; justify-content: center; z-index: 50; overflow-y: auto; }
.sheet[hidden] { display: none; }
.sheet-card { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet-card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.sheet-card label { display: block; font-weight: 700; font-size: .85rem; margin: 12px 0 5px; }
.sheet-card input { width: 100%; font: inherit; font-size: 1.1rem; padding: 12px; border: 2px solid #d6dee7; border-radius: 10px; background: #f8fafc; }
.sheet-card input:focus { outline: none; border-color: #1ca7d8; background: #fff; }
.two { display: flex; gap: 10px; }
.two > div { flex: 1; min-width: 0; }
.sheet-card .btn-big { margin-top: 14px; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #0a1a2b; border-top: 1px solid #28425c; padding-bottom: env(safe-area-inset-bottom); }
.tabs[hidden] { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-weight: 700; font-size: .8rem; padding: 9px 4px 10px; border: 0; border-right: 1px solid #28425c; border-radius: 0; background: transparent; color: #7f9db5; cursor: pointer; margin: 0; width: auto; }
.tab:last-child { border-right: 0; }
.tab svg { width: 24px; height: 24px; display: block; }
.tab.on { color: #fff; box-shadow: inset 0 3px 0 #1ca7d8; }

/* results */
.lake-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lake-btn { font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 999px; border: 2px solid #28425c; background: transparent; color: #9fc3da; cursor: pointer; }
.lake-btn.on { background: #fff; border-color: #fff; color: #0e2236; }
.res-card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.res-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.res-title h2 { margin: 0; font-size: 1.2rem; }
.res-title span { font-size: .8rem; color: #6a7a8a; }
.res-kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #6a7a8a; font-weight: 700; margin: 0 0 4px; }
.winner-box { background: #fff4c9; border: 2px solid #e3b400; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.winner-box small { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: #8a6a00; }
.winner-box strong { font-size: 1.15rem; }
.winner-box div { font-size: .85rem; color: #5b4a00; }
.res-list { list-style: none; margin: 0; padding: 0; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #edf1f5; }
.res-list li:first-child { border-top: 0; }
.res-pos { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #e7edf3; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #35506a; }
.res-list li.first .res-pos { background: #e3b400; color: #fff; }
.res-who { flex: 1; min-width: 0; }
.res-who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-who small { color: #6a7a8a; font-size: .78rem; }
.res-wt { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.sections-head { color: #fff; font-size: 1rem; margin: 18px 2px 8px; font-weight: 800; }

/* ---- matches + online results ---- */
.status-btn{width:auto;display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.12);color:#fff;border:0;border-radius:999px;padding:7px 12px;font-size:.8rem;font-weight:700;margin:0}
.status-btn .sdot{width:10px;height:10px;border-radius:50%;background:#9bb;display:inline-block}
.status-btn.ok .sdot{background:#1fbf5c}.status-btn.wait .sdot{background:#ffc21a}.status-btn.bad .sdot{background:#e5484d}
.match-bar{display:flex;align-items:center;gap:10px;background:#fff;border:2px solid var(--line,#bfd0ca);border-radius:12px;padding:6px 10px;margin-bottom:12px}
.match-bar .back-btn{width:auto;margin:0;padding:8px 6px}
.match-bar .mb-main{flex:1;min-width:0}.match-bar .mb-main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-bar .mb-main small{color:#46605f}
.match-bar .btn-small{width:auto}
.acct-card{display:block;width:100%;text-align:left;margin-top:18px;padding:14px 16px;border-radius:14px;border:2px dashed #7a9a96;background:#fff;color:inherit;font:inherit}
.acct-card b{display:block;font-size:1.05rem}.acct-card span{font-size:.88rem;color:#46605f}
.acct-card.on{border-style:solid;border-color:#1fbf5c}
.acct-h{margin:0 0 6px;font-size:1.2rem}.acct-p{margin:0 0 12px;color:#46605f;font-size:.92rem}
.acct-form label{display:block;margin-top:10px;font-weight:700}
.acct-url{word-break:break-all;background:#eef3f1;border-radius:10px;padding:10px 12px;margin:0 0 12px;font-size:.9rem}
a.acct-open{display:block;text-align:center;text-decoration:none}
#viewAccount .card{margin-bottom:14px}
.match-bar[hidden]{display:none}
.match-bar .back-btn{color:#1478a6}

.seg{display:flex;gap:6px;margin:0 0 14px}
.seg-btn{flex:1;width:auto;padding:9px 4px;font:inherit;font-weight:700;font-size:.82rem;border:2px solid #c9d3dc;background:#fff;color:#14202e;border-radius:10px;margin:0}
.seg-btn.on{background:#1ca7d8;border-color:#1ca7d8;color:#fff}
.people{list-style:none;margin:0 0 12px;padding:0}
.people li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 0;border-top:1px solid #e0e7ec}
.people li:first-child{border-top:0}
.people small{display:block;color:#5a6b7c;font-size:.8rem}
.invite-box{background:#fff4c9;border:3px solid #e0a400;border-radius:12px;padding:10px 14px;margin:8px 0 14px;text-align:center}
.invite-box strong{display:block;font-size:1.8rem;letter-spacing:3px}
.invite-box small{color:#6b5200}
.acct-form input,#peopleBox input{width:100%}

a.acct-open{margin-bottom:10px}
.acct-form input,#peopleBox input{width:100%;font:inherit;font-size:1.15rem;min-height:56px;padding:14px;border:2px solid #d6dee7;border-radius:12px;background:#f8fafc;margin-top:4px}
.acct-form input:focus,#peopleBox input:focus{outline:none;border-color:#1ca7d8;background:#fff}
.acct-form label{margin-top:14px}
.acct-form .btn-big{margin-top:6px}

main{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
.saved-h{margin:6px 2px 4px;color:#fff;font-size:1.3rem}
.saved-p{margin:0 2px 14px;color:#9fc3da;font-size:.92rem}
#viewSaved .btn-big{margin-top:16px}
.btn-ghost-light{width:100%;margin:0 0 12px;background:transparent;color:#9fc3da;border:1px solid #28425c;font-size:.9rem}
.tabs{border-bottom:3px solid #3a5a78}
.status-btn{white-space:nowrap}
.link-btn{display:block;width:100%;background:none;border:0;color:#1478a6;font:inherit;font-weight:700;padding:14px 0 4px;margin:0;cursor:pointer;text-align:center}
/* keep the footer menu pinned to the very bottom of the screen, also on iPhones */
html { height: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
/* iPhone home screen app: sit the menu lower, closer to the bottom edge */
.tabs { padding-bottom: max(2px, calc(env(safe-area-inset-bottom) - 18px)); }
.tab { padding-bottom: 8px; }
/* thin line under the menu buttons, marking the bottom of the footer bar */
.tabs { --pb: max(2px, calc(env(safe-area-inset-bottom) - 18px)); padding-bottom: var(--pb); background-image: linear-gradient(#5a82a3, #5a82a3); background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 calc(100% - var(--pb)); }
/* on a computer: use the width of the screen */
@media (min-width: 700px) {
  .top, main { max-width: min(1200px, 94vw); }
  .top { padding-left: 0; padding-right: 0; }
  main { padding-left: 0; padding-right: 0; }
  .update-banner { max-width: none; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 18px; max-width: 520px; }
  .angler-list, .res-list { width: 100%; }
}
@media (min-width: 1000px) {
  #resultsBody { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; align-items: start; }
  #resultsBody .sections-head { grid-column: 1 / -1; }
  #resultsBody .res-card:first-child { grid-column: 1 / -1; }
}
