/* The register card as a phone app: the same screens as the e-paper device, laid out with real
   type. The keypad is the 4 x 4 membrane the device wears, in the same order. */
/* Liberation Sans, the device's face (SIL OFL), so the phone reads like the panel */
@font-face { font-family: "Liberation Sans"; src: url(LiberationSans-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url(LiberationSans-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }
:root {
  --bg: #161616; --panel: #f4f1ea; --ink: #141414; --muted: #6b6b6b; --accent: #1f7a4d;
  --key: #2a2a2a; --key-ink: #f2f2f2; --key-fn: #3a5fa8; --key-ok: #1f7a4d; --key-back: #a83a3a; --key-sym: #4a4a4a;
  --sighter: #d9d4c7;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--key-ink); font-family: "Liberation Sans", Arial, Helvetica, sans-serif; overscroll-behavior: none; }
#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* The "screen": header, body, footer on a paper-coloured panel */
#hdr { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; background: var(--panel); color: var(--ink); padding: 10px 14px 6px; font-size: 15px; }
#hl { font-weight: 700; font-size: 18px; }
#hc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#hr { color: var(--muted); white-space: nowrap; }
#hr .sign { color: var(--accent); font-weight: 700; margin-right: 6px; }
#screen { flex: 1; min-height: 0; overflow: auto; background: var(--panel); color: var(--ink); padding: 8px 14px 10px; }
#foot { display: flex; justify-content: space-between; gap: 10px; background: var(--panel); color: var(--muted); padding: 6px 14px 12px; font-size: 14px; border-radius: 0 0 12px 12px; }
#hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hint.note { color: var(--accent); font-weight: 600; }
#link { white-space: nowrap; }
#link.off { color: var(--key-back); font-weight: 600; }

/* Screen content */
.title { font-size: 24px; font-weight: 700; margin: 10px 0 6px; }
.sub { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.input { font-size: 40px; font-weight: 700; letter-spacing: 2px; min-height: 52px; margin: 6px 0; }
.input .cursor { display: inline-block; width: 2px; height: 36px; background: var(--ink); vertical-align: -6px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.list { list-style: none; padding: 0; margin: 4px 0; }
.list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 10px; border-radius: 8px; font-size: 18px; }
.list li .n { font-weight: 700; color: var(--muted); min-width: 1.2em; }
.list li.cur { background: var(--ink); color: var(--panel); }
.list li.cur .n { color: var(--panel); }
.list li .meta { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.list li.cur .meta { color: var(--panel); opacity: .8; }
.pos { display: flex; gap: 10px; margin: 12px 0; }
.pos div { flex: 1; text-align: center; padding: 16px 0; border: 2px solid var(--ink); border-radius: 10px; font-size: 22px; font-weight: 700; }
.pos div.cur { background: var(--ink); color: var(--panel); }
.pos div small { display: block; font-size: 13px; font-weight: 500; }

/* Scoring: the card fills the panel; boxes are sized by fitCells() */
.card { --cell: 60px; display: flex; flex-direction: column; min-height: 100%; }
.big { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; min-height: 76px; }
.lead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big > .lead:only-child { margin-left: auto; }  /* scoring: the name sits just left of the value, at the right */
.lead .n { font-size: 24px; font-weight: 700; color: var(--muted); }
.big .v { font-size: 76px; line-height: 1; font-weight: 800; letter-spacing: -2px; }
.lead .sub { width: 100%; font-size: 15px; color: var(--muted); }
.sighters { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sighters .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: right; line-height: 1.2; }
.sighters .srow { display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(5, var(--cell)); gap: 8px; margin: 0; justify-content: space-between; }
.card.sign .grid { grid-template-columns: repeat(10, var(--cell)); gap: 4px; }
.card.sign .cell { border-radius: 6px; }
.card.sign .big { min-height: 0; margin-bottom: 10px; }
.card.sign .sighters { margin-bottom: 8px; }
.cell { width: var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .5); font-weight: 700; border-radius: 10px; background: #fff; border: 1px solid #c9c4b8; }
.cell.empty { color: #b9b3a6; font-weight: 400; }
.cell { position: relative; }
.cell.conv::after { content: ""; position: absolute; left: -16%; right: -16%; top: 50%; height: 3px; margin-top: -1.5px; background: var(--key-back); border-radius: 2px; transform: rotate(-45deg); }
.convert { padding: 14px 12px; border-radius: 10px; background: var(--ink); color: var(--panel); font-size: 20px; display: flex; flex-direction: column; gap: 6px; }
.convert b { font-size: 24px; }
.cell.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.tot { text-align: right; font-size: 28px; font-weight: 700; white-space: nowrap; }
.card .sub { margin: 8px 0 0; }
.long .big .v { font-size: 64px; } .long .lead .n { font-size: 20px; } .long .tot { font-size: 24px; }
.instruct { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 100%; padding: 8px 0; text-align: center; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: .02em; }
.instruct .lead { width: 90%; margin-top: 12px; }
.confirm { margin-top: auto; padding-top: 12px; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.confirm .hold { margin: 6px auto; width: 90%; }
.hold { height: 14px; border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; flex: 1; }
.hold div { height: 100%; background: var(--accent); width: 0; transition: width .1s linear; }
.menu { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.menu li { padding: 12px 10px; border-radius: 8px; font-size: 18px; background: #fff; border: 1px solid #c9c4b8; }
.menu li.cur { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.menu li .n { font-weight: 700; color: var(--muted); margin-right: 8px; }
.menu li.cur .n { color: var(--panel); }
.warn { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }

/* Keypad: 4 x 4 like the membrane */
#pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 12px 12px; background: var(--bg); }
#pad button { font: inherit; font-size: 28px; font-weight: 600; height: 64px; border: 0; border-radius: 12px; background: var(--key); color: var(--key-ink); touch-action: none; user-select: none; -webkit-user-select: none; }
#pad button:active, #pad button.down { filter: brightness(1.6); transform: translateY(1px); }
#pad button.fn { background: var(--key-fn); font-size: 22px; }
#pad button.ok { background: var(--key-ok); }
#pad button.back { background: var(--key-back); }
#pad button.sym { background: var(--key-sym); }
@media (min-height: 760px) { #pad button { height: 72px; } }
@media (max-height: 700px) { #pad button { height: 54px; font-size: 24px; } .big .v { font-size: 72px; } }

/* First-run setup */
.setup { padding: 20px 0; font-size: 16px; }
.setup code { background: #fff; padding: 2px 6px; border-radius: 4px; }

/* Setting the phone up (register code, passkey, "set up your passkey?"; 25 Oct 2026): not the card, so in OnTarget's
   own dress, as /pad and the range's landing page: navy bar, the mark and wordmark, Michroma and Satoshi, white cards,
   orange pill buttons. body.onboard hides the paper header, footer and keypad. */
@font-face { font-family: "Michroma"; src: url(michroma-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Satoshi"; src: url(satoshi-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url(satoshi-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
body.onboard { --navy: #000c2e; --line: #011E50; --orange: #FD5902; --page: #f1f5f9; --slate: #0f172a; --soft: #64748b; background: var(--navy); }
body.onboard #hdr, body.onboard #foot, body.onboard #pad { display: none; }
body.onboard #screen { background: var(--page); color: var(--slate); padding: 0; font: 15px/1.5 "Satoshi", system-ui, sans-serif; }
.ob-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; background: var(--navy); border-bottom: 1px solid var(--line); color: #fff; }
.brand-chip { background: #f1f5f9; border-radius: 6px; display: flex; padding: 1px; }
.brand-chip img { width: 32px; height: 32px; display: block; }
.brand-word { font: 14px "Michroma", sans-serif; letter-spacing: .2em; color: var(--orange); white-space: nowrap; }
.brand-word .s { font-size: .8em; } .brand-word .a { margin-left: -.2em; } .brand-word .live { color: #34d399; }
.ob-bar .ob-app { margin-left: auto; font-weight: 700; font-size: 14px; color: #e8edf5; }
.ob { max-width: 480px; margin: 0 auto; padding: 26px 16px 40px; }
.ob .eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.ob h1 { font: 20px/1.35 "Michroma", sans-serif; letter-spacing: .02em; margin: 0 0 10px; color: var(--slate); }
.ob .lede { color: #475569; margin: 0 0 20px; }
.ob .card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; margin: 0 0 14px; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.ob .card h2 { font: 14px "Michroma", sans-serif; letter-spacing: .02em; margin: 0 0 6px; }
.ob .card p { color: var(--soft); font-size: 14px; margin: 0 0 14px; }
.ob .btn { display: block; width: 100%; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent; font: 700 16px "Satoshi", sans-serif; text-align: center; text-decoration: none; cursor: pointer; background: var(--orange); color: #fff; }
.ob .btn:active { filter: brightness(.92); }
.ob .btn.ghost { background: transparent; color: var(--slate); border-color: #cbd5e1; }
.ob .btn + .btn { margin-top: 10px; }
.ob details { margin-top: 14px; }
.ob summary { cursor: pointer; color: var(--soft); font-size: 14px; }
.ob input { width: 100%; margin: 10px 0; padding: 11px 12px; font: 17px "Satoshi", sans-serif; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--slate); letter-spacing: .04em; }
.ob input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgb(253 89 2 / .18); }
.ob .msg { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: 14px; }
.ob .msg.info { background: #eff6ff; color: #1e40af; }
.ob .camview { width: 100%; max-height: 42vh; object-fit: cover; border-radius: 12px; margin: 0 0 12px; background: #000; display: block; }
.ob .fine { color: #94a3b8; font-size: 13px; margin: 18px 0 0; text-align: center; }
#pad[hidden] { display: none; }  /* the claim screen hides the keypad (#pad sets display: grid) */
