/* HudPost Games: the shared post-your-score sheet, board names, and the player pages (since 1.8.0). Mobile first. */
:root {
  --hpb-bg: #0b1020;
  --hpb-panel: #141b33;
  --hpb-line: rgba(255, 255, 255, 0.16);
  --hpb-text: #f4f6ff;
  --hpb-soft: #b9c2e0;
  --hpb-accent: #fde047;
  --hpb-blue: #0090c1;
  --hpb-bad: #fca5a5;
  --hpb-good: #86efac;
  --hpb-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- names on the games' own boards: nickname on line one (full width), "@handle · Town" on line two */
.hpb-who { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; line-height: 1.3; }
a.hpb-who:hover .hpb-nick, a.hpb-who:focus-visible .hpb-nick { text-decoration: underline; }
.hpb-nick { display: block; overflow: hidden; white-space: nowrap; } /* board.js steps the font down rather than cut it */
.hpb-sub { display: flex; align-items: center; gap: 0.35em; min-width: 0; margin-top: 3px; font-size: 0.8em; font-weight: 400; opacity: 0.85; white-space: nowrap; }
.hpb-sub .hpb-handle { flex: 0 1 auto; }
.hpb-rtown { flex: none; }
.hpb-who .hpb-logo { width: 1.3em; height: 1.3em; margin-right: 0.15em; }
.hpb-handle { display: inline-flex; align-items: center; gap: 0.25em; min-width: 0; overflow: hidden; white-space: nowrap; }
.hpb-htext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpb-logo { flex: none; width: 1em; height: 1em; vertical-align: -0.125em; }
li:has(> strong > .hpb-who) { cursor: pointer; }
li > strong:has(> .hpb-who) { min-width: 0; overflow: hidden; }
/* The town column is gone from these rows (it is on line two): rank, name, points; Car Flip keeps its street tag. */
ol li:has(> strong > .hpb-who) { grid-template-columns: 2.6em minmax(0, 1fr) auto; }
ol li:has(> strong > .hpb-who):has(> :nth-child(4)) { grid-template-columns: 2.6em minmax(0, 1fr) auto auto; }
ol li:has(> strong > .hpb-who) > strong { flex: 1 1 auto; }

/* ---- the sheet */
html.hpb-open, html.hpb-open body { overflow: hidden; }
.hpb-layer {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 6, 18, 0.72);
  font: 16px/1.45 var(--hpb-font); color: var(--hpb-text);
  -webkit-text-size-adjust: 100%;
}
.hpb-sheet {
  position: relative; box-sizing: border-box; width: 100%; max-width: 480px;
  max-height: 100%; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--hpb-panel); border: 1px solid var(--hpb-line); border-bottom: 0; border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  text-align: left;
}
@media (min-width: 560px) and (min-height: 560px) {
  .hpb-layer { align-items: center; }
  .hpb-sheet { border-radius: 18px; border-bottom: 1px solid var(--hpb-line); max-height: 92vh; padding: 24px; }
}
.hpb-sheet *, .hpb-page * { box-sizing: border-box; }
.hpb-h { margin: 0 36px 12px 0; font: 800 22px/1.2 var(--hpb-font); color: var(--hpb-text); letter-spacing: 0; text-transform: none; }
.hpb-p { margin: 0 0 12px; color: var(--hpb-soft); }
.hpb-small { font-size: 14px; }
.hpb-x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: var(--hpb-text); font: 26px/1 var(--hpb-font); cursor: pointer;
}
.hpb-form { display: grid; gap: 14px; margin: 0; }
.hpb-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hpb-label { font-weight: 700; font-size: 15px; color: var(--hpb-text); padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.hpb-hint { font-size: 13px; color: var(--hpb-soft); }
.hpb-sheet input[type=text], .hpb-sheet input[type=email], .hpb-sheet select,
.hpb-page input[type=text], .hpb-page select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--hpb-line); border-radius: 10px;
  background: #0b1126; color: var(--hpb-text); font: 16px/1.2 var(--hpb-font); /* 16px: phones do not zoom in */
}
.hpb-sheet select option, .hpb-page select option { color: #111; background: #fff; }
.hpb-sheet input:focus, .hpb-sheet select:focus, .hpb-page input:focus, .hpb-page select:focus { outline: 2px solid var(--hpb-accent); outline-offset: 1px; }
.hpb-srow { display: grid; grid-template-columns: 22px 7.5em minmax(0, 1fr) 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.hpb-slogo { display: flex; justify-content: center; font-size: 20px; color: var(--hpb-soft); }
.hpb-at { position: relative; display: block; min-width: 0; }
.hpb-at > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--hpb-soft); pointer-events: none; }
.hpb-sheet .hpb-at input, .hpb-page .hpb-at input { padding-left: 26px; }
.hpb-rm { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--hpb-text); font: 20px/1 var(--hpb-font); cursor: pointer; }
.hpb-rm[hidden], .hpb-sheet [hidden] { display: none !important; }
.hpb-check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--hpb-text); cursor: pointer; }
.hpb-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--hpb-accent); }
.hpb-check a { color: var(--hpb-accent); }
.hpb-trap { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.hpb-msg { margin: 0; min-height: 0; color: var(--hpb-bad); font-size: 14px; }
.hpb-msg:empty { display: none; }
.hpb-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px;
  border: 0; border-radius: 999px; background: var(--hpb-accent); color: #111; font: 800 16px/1.2 var(--hpb-font);
  text-decoration: none; cursor: pointer;
}
.hpb-btn:disabled { opacity: 0.6; cursor: default; }
.hpb-big { width: 100%; }
.hpb-btn-2 { background: transparent; color: var(--hpb-text); box-shadow: inset 0 0 0 2px var(--hpb-line); }
.hpb-btn-danger { background: #b91c1c; color: #fff; }
.hpb-link { padding: 4px 0; border: 0; background: none; color: var(--hpb-accent); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; justify-self: start; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the player pages */
body.hpb-page { margin: 0; min-height: 100vh; background: var(--hpb-bg); color: var(--hpb-text); font: 16px/1.5 var(--hpb-font); }
.hpb-wrap { max-width: 560px; margin: 0 auto; padding: 28px 16px 40px; }
.hpb-page h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.15; }
.hpb-page h2 { margin: 24px 0 8px; font-size: 18px; color: var(--hpb-accent); text-transform: uppercase; letter-spacing: 0.04em; }
.hpb-page p { color: var(--hpb-soft); }
.hpb-page strong { color: var(--hpb-text); }
.hpb-page a { color: var(--hpb-accent); }
.hpb-page a.hpb-btn { color: #111; }
.hpb-page a.hpb-btn-2 { color: var(--hpb-text); }
.hpb-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.hpb-actions form { margin: 0; }
.hpb-fine { font-size: 14px; color: var(--hpb-soft); }
.hpb-fine form { display: inline; }
.hpb-foot { margin-top: 36px; font-size: 14px; text-align: center; }
.hpb-card { padding: 22px 18px; border: 1px solid var(--hpb-line); border-radius: 18px; background: var(--hpb-panel); }
.hpb-kicker { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hpb-accent) !important; }
.hpb-nickname { word-break: break-word; }
.hpb-town { margin: 0 0 12px; font-size: 18px; }
.hpb-handles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.hpb-handles li { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 15px; max-width: 100%; }
.hpb-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.hpb-facts div { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.hpb-facts dt { font-size: 13px; color: var(--hpb-soft); }
.hpb-facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.hpb-bests { margin: 0; padding: 0; list-style: none; }
.hpb-bests li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hpb-line); }
.hpb-bests a { color: var(--hpb-text); }
.hpb-best { font-weight: 800; color: var(--hpb-accent); }
.hpb-page .hpb-form { margin-top: 8px; }
.hpb-page .hpb-hrow { grid-template-columns: 1fr; }
.hpb-page fieldset { margin: 0; padding: 0; border: 0; }
.hpb-page .hpb-hrow { margin-bottom: 8px; }
.hpb-ok { color: var(--hpb-good) !important; font-weight: 700; }
.hpb-error { color: var(--hpb-bad) !important; font-weight: 700; }
.hpb-danger { margin-top: 28px; padding: 14px; border: 1px solid rgba(252, 165, 165, 0.4); border-radius: 12px; }
.hpb-danger summary { cursor: pointer; font-weight: 700; color: var(--hpb-bad); }

/* ------------------------------------------------------------------ the box before play (HPBoard.pregame) */
.hpb-pre { margin: 12px auto 4px; padding: 10px 12px; max-width: 640px; border-radius: 14px; background: rgba(255, 209, 102, 0.09); border: 1px solid rgba(255, 209, 102, 0.4); text-align: left; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.3; color: inherit; }
.hpb-pre-h { margin: 0 0 6px; font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; color: #ffd166; }
.hpb-pre-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.hpb-pre-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.hpb-pre-list li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 8px; cursor: default; }
.hpb-pre-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.07); }
.hpb-pre-towns li { grid-template-columns: 1.6em minmax(0, 1fr) auto; }
.hpb-pre-n { opacity: 0.8; font-weight: 700; }
.hpb-pre-who { display: flex; flex-direction: column; min-width: 0; }
.hpb-pre-who b, .hpb-pre-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpb-pre-who small { font-size: 11px; opacity: 0.8; }
.hpb-pre-tag { font-size: 11px; opacity: 0.75; }
.hpb-pre-pts { text-align: right; font-weight: 800; color: #ffd166; }
.hpb-pre-open { opacity: 0.8; outline: 1px dashed rgba(255, 209, 102, 0.6); outline-offset: -1px; }
.hpb-pre-sub { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.hpb-pre-note { margin: 4px 0 0; font-size: 12px; opacity: 0.8; }
.hpb-pre-call { margin: 8px 0 0; font-size: 14px; font-weight: 800; text-align: center; }
@media (max-width: 520px) { .hpb-pre-cols { grid-template-columns: 1fr; gap: 8px; } .hpb-pre { padding: 8px 10px; } .hpb-pre-list li { padding: 4px 8px; } }
/* "Played before? Sign in": a quiet line under the two ticks, and the status line while the sheet waits. */
.hpb-signin-line { margin: 2px 0 0; text-align: left; opacity: 0.9; }
.hpb-signin-line .hpb-link { justify-self: start; }
.hpb-msg[role="status"]:not(:empty) { color: #9ae6b4; }
