:root {
  --green: #0b3d2e;
  --green2: #145c44;
  --accent: #f5c518;
  --bg: #f4f6f5;
  --card: #ffffff;
  --line: #e2e6e4;
  --text: #15201b;
  --muted: #6b7a73;
  --win: #1a7a4c;
  --ru: #2f6fb0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  padding-bottom: 64px;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--green);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.bar { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px 6px; }
.bar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.updated { font-size: 11px; color: #bfe0d1; }

nav#tabs { display: flex; gap: 0; padding: 0 6px 6px; }
nav#tabs button {
  flex: 1;
  background: transparent;
  color: #cfe6dc;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 600;
}
nav#tabs button.active { color: #fff; border-bottom-color: var(--accent); }

main { padding: 12px; max-width: 720px; margin: 0 auto; }
.view.hidden { display: none; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.card h2 { margin: 0; padding: 12px 14px; font-size: 15px; background: var(--green2); color: #fff; display: flex; justify-content: space-between; }
.card h2 .pot { font-weight: 600; color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-top: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.win td { background: #eafaf1; }
tr.ru td { background: #eef4fb; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; color: #fff; margin-left: 6px; }
.badge.w { background: var(--win); }
.badge.r { background: var(--ru); }
.pay { font-weight: 700; color: var(--win); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.banner {
  background: #fff8e1;
  border: 1px solid #f0e0a8;
  color: #6a5800;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
select, input {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
button.primary {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
}
button.primary:disabled { opacity: .5; }
button.ghost {
  background: transparent;
  border: 1px solid #cfe6dc;
  color: #cfe6dc;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.entry-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.entry-row .nm { flex: 1; font-size: 14px; }
.entry-row .nm small { display: block; color: var(--muted); }
.entry-row input { width: 92px; }
.saved { color: var(--win); font-size: 12px; font-weight: 700; }

footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
}
.potline { font-size: 13px; }
.potline b { color: var(--accent); }

.lock { font-size: 12px; color: var(--muted); padding: 14px; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: #15201b; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* --- Auction view --- */
.banner.ok { background: #eafaf1; border-color: #b6e3ca; color: #145c44; }

.auc-head { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.ah-row { display: flex; gap: 8px; }
.ah-row + .ah-row { margin-top: 6px; }
.ah-cell b.pos { color: var(--win); }
.ah-cell b.neg { color: #b3261e; }
.ah-cell { flex: 1; background: var(--bg); border-radius: 9px; padding: 7px 9px; text-align: center; }
.ah-cell.hi { background: #fff8e1; }
.ah-cell span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ah-cell b { font-size: 18px; display: block; line-height: 1.15; }
.ah-cell small { font-size: 10px; color: var(--muted); }
.ah-bar { position: relative; height: 18px; background: var(--line); border-radius: 999px; margin: 9px 0 6px; overflow: hidden; }
.ah-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green2); border-radius: 999px; transition: width .3s; }
.ah-bartxt { position: relative; font-size: 11px; line-height: 18px; color: #fff; padding-left: 8px; font-weight: 600; mix-blend-mode: difference; }
.ah-msg { font-size: 12px; padding: 5px 0 2px; font-weight: 600; }
.ah-msg.hot { color: #b3261e; } .ah-msg.cold { color: #b06a00; } .ah-msg.ok { color: var(--muted); }
.ah-late { font-size: 11px; color: var(--muted); }
.ah-late.on { color: #145c44; font-weight: 600; }

.filterbar { display: flex; gap: 6px; margin-bottom: 8px; }
.filterbar button { flex: 1; padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.filterbar button.active { background: var(--green); color: #fff; border-color: var(--green); }

.auc-list { display: flex; flex-direction: column; gap: 7px; }
.auc-row { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.auc-row.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.auc-row.sold { opacity: .62; }
.auc-row.mine { background: #eafaf1; border-color: #b6e3ca; }
.auc-main { display: flex; align-items: center; gap: 8px; }
.auc-nm { flex: 1; font-size: 14px; font-weight: 600; }
.auc-nm .ord { color: var(--muted); font-weight: 700; font-size: 12px; }
.auc-nm small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.auc-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.auc-stats b { color: var(--text); }
.auc-stats .pos { color: var(--win); font-weight: 700; }
.auc-stats .neg { color: #b3261e; }
.auc-stats .note { font-style: italic; }
.hot { color: #b3261e; font-weight: 700; }
.hot.sand { color: #8a5a00; }
.sold-tag { margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--win); }
.mine-tag { margin-top: 4px; font-size: 11px; font-weight: 600; color: #0b6b3a; background: #eafaf1; border: 1px solid #b6e3ca; border-radius: 7px; padding: 3px 7px; }
.mine-tag b { font-size: 12px; }

.flag { font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px; letter-spacing: .04em; color: #fff; }
.flag.pounce { background: #1a7a4c; }
.flag.ceiling { background: #b06a00; }
.flag.pass { background: #b3261e; }
.flag.watch { background: #c9d2cd; color: #46524c; }
.pos { color: var(--win); } .neg { color: #b3261e; }
tr.pounce-row td { background: #eafaf1; }

.sell-btn { background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 700; width: auto; }
.undo-btn { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 14px; width: auto; }

/* --- Jason target badge + flight-money emphasis --- */
.jbadge { display: inline-block; background: #6d28d9; color: #fff; font-size: 10px; font-weight: 800; width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 50%; vertical-align: middle; }
.rankchip { display: inline-block; font-size: 10px; font-weight: 700; color: var(--muted); background: #eef1ef; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.rankchip.rich { color: #7a4d00; background: #fff1cc; }
.ownchip { display: inline-block; font-size: 9px; font-weight: 800; color: #fff; background: var(--win); border-radius: 5px; padding: 1px 4px; }
.vrtag { color: #7a4d00; font-weight: 700; }
.byline { color: var(--muted); font-weight: 400; font-style: italic; }
.auc-row.valrich { border-color: #f0d28a; box-shadow: 0 0 0 1px #f0d28a inset; }
tr.valrich-row td, tr.rich-row td { background: #fff8e7; }

/* --- Reports hub --- */
.reports-list { display: flex; flex-direction: column; gap: 10px; }
.report-link {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text);
}
.report-link:active { background: #eafaf1; }
.rl-title { display: block; font-size: 16px; font-weight: 700; color: var(--green); }
.rl-arrow { color: var(--accent); font-weight: 800; }
.rl-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.reports-head {
  font-size: 16px; color: var(--green); margin: 22px 0 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--line);
}

/* --- Printable bid sheet --- */
.print-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.print-sheet { background: #fff; }
.print-title { font-size: 16px; margin: 0 0 8px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-table th, .print-table td { padding: 4px 6px; border: 1px solid var(--line); text-align: left; }
.print-table th { background: var(--green2); color: #fff; font-size: 10px; }
.print-table td.num, .print-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.print-table .pteam { font-weight: 600; }
.print-table .pplayers { color: var(--muted); }
.print-table tr.jrow td { background: #f3edff; }
.print-table .jcell { color: #6d28d9; font-weight: 800; }

@media print {
  header, footer, nav#tabs, .no-print, .auc-head, .banner { display: none !important; }
  body { background: #fff; padding: 0; }
  main { max-width: none; padding: 0; }
  .view.hidden { display: none; }
  #view-print { display: block !important; }
  .print-title { font-size: 14px; }
  .print-table { font-size: 9.5px; }
  .print-table th, .print-table td { padding: 2px 4px; }
  .print-table th { background: #ddd !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-table tr.jrow td { background: #ece4ff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-table thead { display: table-header-group; } /* repeat header each page */
  .print-table tr { page-break-inside: avoid; }
}
