/* PushRace. Layout, rounding and type are PlankRace's app.css; colours are PushRace's (lime, yellow, very dark green). */
:root {
  --ground: #0B2412; --card: #12321A; --card-border: #1F4A2A; --track: #1A4023; --line: #2B5836;
  --lime: #A6E22E; --lime-soft: #D9F3A3; --yellow: #FFE234; --hold-band: #4D4712; --pause-band: #2F4D14;
  --text: #F4F8EA; --text-soft: #D7E5C6; --muted: #A5C09A; --ink: #0B2412;
  --display: "Avenir Next Condensed", "Bahnschrift Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--text); font: 16px/1.45 var(--body); }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
input { font: inherit; color: var(--text); }
a { color: var(--lime); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top)) 24px calc(12px + env(safe-area-inset-bottom)); }
.screen { flex: 1; display: flex; flex-direction: column; }
.stack > * + * { margin-top: 16px; }
.stack-s > * + * { margin-top: 10px; }
.grow { flex: 1 1 10px; min-height: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row > .fill { flex: 1; }
.between { justify-content: space-between; }
.center { text-align: center; }

/* Type */
.display { font-family: var(--display); font-weight: 800; font-stretch: condensed; font-variant-numeric: tabular-nums; line-height: 1.02; letter-spacing: .01em; }
.h1 { font-size: 34px; }
.h2 { font-size: 30px; }
.cap { font-size: 12px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.cap2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.soft { color: var(--text-soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.foot { font-size: 13px; }
.tiny { font-size: 12px; }
.yellow { color: var(--yellow); }
.lime { color: var(--lime); }
.semi { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }

/* Brand */
.brand { display: inline-block; font-family: var(--display); font-weight: 900; font-stretch: condensed; font-size: 38px; line-height: 1;
  transform: skewX(-12deg); transform-origin: bottom left; white-space: nowrap; letter-spacing: .01em; }
.brand .p { color: var(--lime); } .brand .r { color: var(--yellow); }

/* Cards */
.card { background: var(--card); border-radius: 16px; padding: 16px; }
.card.bordered { border: 1px solid var(--card-border); }
.card.tight { padding: 12px 14px; }
.card.yellow-edge { border: 1px solid rgba(255, 226, 52, .5); }

/* Buttons */
.big { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border-radius: 18px;
  background: var(--lime); color: var(--ink); font-family: var(--display); font-weight: 800; font-stretch: condensed; font-size: clamp(18px, 6vw, 24px); letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; padding: 0 10px; text-align: center; }
.big:active { opacity: .85; }
.big.yellow { background: var(--yellow); } .big.light { background: var(--text); } .big.soft { background: var(--lime-soft); }
.big.dark { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.outline { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; padding: 0 10px; border-radius: 14px;
  border: 1px solid var(--line); color: var(--text-soft); font-size: 15px; font-weight: 600; text-align: center; }
.outline.on-lime { border-color: var(--lime); color: var(--lime); background: rgba(166, 226, 46, .12); }
.outline.on-yellow { border-color: var(--yellow); color: var(--yellow); background: rgba(255, 226, 52, .12); }
.link { font-size: 15px; font-weight: 600; color: var(--lime); width: 100%; padding: 8px 0; }
.link.inline { width: auto; padding: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.square { width: 58px; height: 58px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
svg.i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top .icons { display: flex; gap: 8px; flex: none; }
.top .brand { min-width: 0; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 8px; }
.bar .title { flex: 1; font-weight: 700; font-size: 17px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .done { font-weight: 600; color: var(--lime); min-width: 44px; text-align: right; }

/* Timer */
.target-card { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--card-border); }
.gauge { position: relative; width: 240px; height: 231px; margin: 0 auto; }
.gauge svg { position: absolute; left: 0; top: 9px; width: 240px; height: 240px; overflow: visible; }
.gauge .inner { position: absolute; left: 0; right: 0; top: 9px; height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.gauge .status { font-size: 12px; letter-spacing: .13em; color: var(--muted); max-width: 170px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge .status.hot { color: var(--lime); }
.gauge .time { font-size: 84px; }
.gauge .sub { font-size: 13px; font-weight: 600; color: var(--yellow); max-width: 150px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { display: flex; gap: 6px; padding-top: 4px; }
.pips i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.done { background: var(--yellow); } .pips i.now { background: var(--lime); }
.tiles { display: flex; gap: 10px; }
.tile { flex: 1; background: var(--card); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.tile .v { font-size: 22px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }

/* Switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--yellow); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; }

/* Fields */
.field { width: 100%; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); outline: none; font-size: 16px; }
.field:focus { border-color: var(--lime); }
.field.on-ground { background: var(--ground); padding: 12px; border-radius: 12px; }

/* Setup */
.progress { display: flex; gap: 6px; justify-content: center; }
.progress i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width .2s; }
.progress i.on { background: var(--lime); } .progress i.cur { width: 22px; }
.rule { display: flex; gap: 12px; align-items: flex-start; }
.rule .n { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--lime); width: 22px; line-height: 1.1; }
.option { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; border: 2px solid var(--card-border); }
.option.sel { border-color: var(--yellow); }
.ring { position: relative; width: 230px; height: 230px; margin: 0 auto; }
.ring svg { width: 230px; height: 230px; transform: rotate(-90deg); }
.ring .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.marks .m { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--card-border); }
.marks .m:first-child { border-top: 0; }

/* Lists */
.list-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 11px 14px; width: 100%; text-align: left; }
.list-row.me { box-shadow: inset 0 0 0 1px var(--lime); }
.rank { font-family: var(--display); font-weight: 800; font-size: 26px; width: 30px; color: var(--muted); }
.rank.first { color: var(--lime); }
.chev { color: var(--muted); }
.legend { display: flex; gap: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; height: 220px; display: block; }
.code-box { border: 1px dashed var(--lime); border-radius: 14px; padding: 16px; text-align: center; font-size: 22px; user-select: all; }
.privacy li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-soft); }
.privacy { list-style: none; margin: 0; padding: 0; }
.privacy li + li { margin-top: 8px; }
.privacy svg { color: var(--yellow); flex: none; margin-top: 1px; }
.msg-err { font-size: 13px; color: var(--lime); }
.msg-ok { font-size: 13px; color: var(--yellow); }

/* Day done */
.overlay { position: fixed; inset: 0; z-index: 40; background: var(--ground); display: flex; justify-content: center; }
.overlay > .inner { width: 100%; max-width: 480px; display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 24px calc(12px + env(safe-area-inset-bottom)); }
.dim { position: fixed; inset: 0; background: #000; opacity: 0; transition: opacity 1.2s; pointer-events: none; z-index: 41; }
.dim.on { opacity: .65; pointer-events: auto; }

/* Dialogs */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--ground); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 22px; border-bottom: 1px solid var(--line); } }
.dlg-btn { display: block; width: 100%; padding: 14px; border-radius: 14px; background: var(--card); font-weight: 600; font-size: 16px; }
.dlg-btn.danger { color: #FF6B5B; }
.dlg-btn.cancel { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: 440px; width: calc(100% - 32px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.notice-bar { background: rgba(166, 226, 46, .12); border: 1px solid rgba(166, 226, 46, .5); color: var(--lime-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; }

@media (max-height: 700px) { .gauge .time { font-size: 72px; } }
@media (max-width: 360px) { #app { padding-left: 16px; padding-right: 16px; } .icon-btn { width: 40px; height: 40px; } .tile { padding: 8px 9px; } .tile .v { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Settings > Language */
select.lang-select { font: inherit; color: var(--text); background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 60%; }

/* ---- PushRace's own adjustments to the PlankRace sheet */
.switch input:checked + span { background: var(--lime); }
.pips i.done { background: var(--lime); } .pips i.now { background: var(--yellow); }
.msg-err { color: #FF8A7A; }
.gauge .time { font-size: 104px; }
.gauge .sub { color: var(--yellow); max-width: 170px; }
@media (max-height: 700px) { .gauge .time { font-size: 88px; } }

/* ---- The push-up set screen */
.ps-status { min-height: 50px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 17px; font-weight: 600; color: var(--yellow); }
.ps-count { flex: 1 1 180px; min-height: 180px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 22px; background: var(--card); border: 1px solid var(--card-border); user-select: none; -webkit-user-select: none; }
.ps-count:active { background: var(--track); }
.ps-count .n { font-size: clamp(110px, 42vw, 190px); color: var(--lime); }
.ps-count .n.hit { color: var(--yellow); }
.ps-view { position: relative; width: 112px; height: 112px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); flex: none; }
.ps-view video, .ps-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.icon-btn.on { color: var(--lime); border-color: var(--lime); }

/* Lists: the text takes the room, the button sits on the right */
.list-row > .fill { flex: 1; min-width: 0; }

/* Logo: PUSH is 88% of the size of RACE */
.brand .p { font-size: .88em; }
