/* Rally Minis: the glass look of Apex Minis (docs/project/sistema-de-design.md there), dark */
:root { --bg: #0c0f14; --ink: #f4f4f0; --dim: #aab3c2; --label: #8b95a5; --line: rgba(255, 255, 255, .13); --gold: #f5c542; --up: #4cd964; --down: #ff7a6b;
  --go1: #8ff04a; --go2: #5fc81f; --accent: #ff8a4c;
  --font: "Saira", system-ui, -apple-system, "Segoe UI", sans-serif; --cond: "Saira Condensed", "Saira", system-ui, sans-serif;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025)); --shadow: 0 14px 34px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .09); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
html.driving, html.driving body { height: 100%; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
button { font-family: var(--font); }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
html:not(.driving) #game { display: none; }
html.driving .site, html.driving .sheetbg { display: none !important; }

/* ---------- the site: as Apex Minis (a rail on the left, a bar on top, a start bar; on a phone a tab bar) ---------- */
:root { --hot: #e8501a; --soft: rgba(232, 80, 26, .16); }
.site { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding: 14px; min-height: 100vh; }   /* full width, as Apex Minis */
.rail { position: sticky; top: 14px; height: calc(100vh - 28px); display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 0 14px; border-radius: 24px;
  border: 1px solid var(--line); background: linear-gradient(180deg, #151a21 0%, #12161c 52%, #2e1a10 100%); box-shadow: var(--shadow); overflow-y: auto; }
.rbrand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px 14px; }
.rbrand .btxt { display: none; }
.logo { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ff9a5c, var(--hot)); font: 800 italic 23px var(--cond); color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 138, 76, .35), 0 0 18px rgba(232, 80, 26, .35); }
.ngrp { font: 700 11px var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--label); text-align: center; padding: 14px 4px 6px; }
.rail a, .rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 2px 12px; padding: 11px 2px; border: 0; border-radius: 14px; background: none;
  color: #cfd6e0; text-decoration: none; font: 600 11px var(--font); cursor: pointer; transition: background .15s, color .15s; }
.rail a span, .rail button span { display: none; }
.rail a:hover, .rail button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail a.on { background: var(--soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(232, 80, 26, .4); }
.rail a.on svg { color: var(--hot); }
.rail .nlow { margin-top: auto; }
[data-tool=snd] .m, [data-tool=snd].off .w { display: none; }
[data-tool=snd].off .m { display: inline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 8px 10px 8px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow); }
.burger, .tbrand { display: none; }
.tbrand { font: 800 italic 20px var(--cond); text-transform: uppercase; letter-spacing: .02em; }
.tbrand em { color: var(--accent); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--dim); min-width: 0; white-space: nowrap; }
.crumb a { color: var(--dim); text-decoration: none; } .crumb a:hover { color: #fff; }
.crumb b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.crumb i { font-style: normal; color: var(--label); }
.ttag { color: var(--label); font-size: 13px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.tools button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; }
.tools button:hover { background: rgba(255, 255, 255, .08); }
.tools .mycar { width: 64px; }
.tools .mycar img { width: 54px; height: 29px; object-fit: contain; }

.pg { flex: 1; padding: 0 2px 20px; }
h1 { font: 800 italic 38px var(--cond); text-transform: uppercase; margin: 24px 0 4px; letter-spacing: .01em; }
.pdesc { color: var(--dim); font-size: 14px; margin: 0 0 18px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 5px; margin-bottom: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); max-width: 100%; }
.pills button { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px; border: 0; border-radius: 13px; background: none; color: var(--ink);
  font: 700 12px var(--cond); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.pills button i { width: 9px; height: 9px; border-radius: 50%; }
.pills button:hover { background: rgba(255, 255, 255, .06); }
.pills button.on { background: var(--hot); color: #fff; }
/* the conditions on the rally page (0.9.0): a label, then the pills */
.condbox { margin-top: 22px; }
.pills.cond { display: flex; width: fit-content; margin-bottom: 8px; align-items: center; }
.plab { flex: none; padding: 0 10px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.cnote { margin: 4px 4px 0; font-size: 13px; color: var(--dim); }
.mflag { display: inline-block; width: 16px; height: 11px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.gold { color: var(--gold); }
.slash { position: absolute; top: 10px; right: 14px; font: 800 italic 14px var(--cond); letter-spacing: -.1em; color: rgba(255, 255, 255, .28); z-index: 2; }

/* the rally cards: glass, the flag along the top, a diagonal sheen, chosen in orange (as the car cards there) */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rcard { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: 20px; border: 1px solid var(--line);
  background: var(--glass); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.rcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 52%, rgba(255, 255, 255, .045) 52%, rgba(255, 255, 255, .045) 64%, transparent 64%); pointer-events: none; }
.rcard:hover, .rcard:focus-visible { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); outline: none; }
.rcard.on { border-color: var(--hot); box-shadow: 0 0 0 1px var(--hot), 0 10px 30px rgba(232, 80, 26, .28); background: linear-gradient(180deg, rgba(232, 80, 26, .2), rgba(255, 255, 255, .02)); }
.rflag { position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 2; }
.thumb { display: block; height: 140px; background-size: 220px; background-position: center; border-bottom: 1px solid var(--line); }
.thumb canvas { width: 100%; height: 100%; display: block; }
.rbody { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px 16px; }
.rname { font: 800 italic 21px var(--cond); text-transform: uppercase; letter-spacing: .01em; }
.rreg { color: var(--dim); font-size: 13px; }
.rmeta { color: var(--label); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: var(--ink); font-size: 12px; }
.rbest { font: 700 italic 15px var(--cond); color: var(--gold); margin-top: 2px; }

/* the start bar (Start grid there): the rally chosen, your car, its stages, the green start */
.startbar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 10px 12px 10px 20px; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(232, 80, 26, .45); background: linear-gradient(90deg, rgba(232, 80, 26, .3), rgba(22, 25, 31, .96) 38%); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }
.startbar .strip { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.sbcar { width: 64px; height: 34px; object-fit: contain; flex: none; }
.sbtxt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sbtxt b { font: 800 italic 22px var(--cond); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbtxt small { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startbar .primary { min-height: 50px; padding: 10px 26px; font: 800 italic 19px var(--cond); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.startbar .glass { min-height: 46px; white-space: nowrap; }

/* one rally: the hero and its stages */
.hero { position: relative; margin-top: 18px; padding: 18px 24px 22px 30px; border-radius: 22px; border: 1px solid var(--line); background-size: cover; background-position: center; box-shadow: var(--shadow); overflow: hidden; }
.hero h1 { margin-top: 14px; }
.hero .strip { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.rpbest { font: 700 italic 17px var(--cond); color: var(--gold); margin: 0; }
.stages { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.srow { display: grid; grid-template-columns: 52px 120px 1fr auto auto; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow); }
.ss { font: 800 italic 22px var(--cond); color: var(--accent); }
.srow canvas { width: 120px; height: 72px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.sinfo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sname { font: 800 italic 19px var(--cond); text-transform: uppercase; }
.smeta { color: var(--dim); font-size: 13px; }
.sf { text-transform: capitalize; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 2px; border: 1px solid rgba(0, 0, 0, .4); vertical-align: -1px; }
.sbest { font: 700 italic 18px var(--cond); color: var(--gold); font-variant-numeric: tabular-nums; }

/* every stage (Circuits there): small glass cards, the shape on top */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.scard { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 22%, transparent), rgba(255, 255, 255, .03) 55%); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .12s; }
.scard:hover, .scard:focus-visible { transform: translateY(-2px); border-color: rgba(255, 255, 255, .32); outline: none; }
.scard canvas { width: 100%; height: 104px; display: block; }
.scap { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 12px; }
.scard .sname { font-size: 16px; }
.scard .smeta { font-size: 12px; text-transform: none; }

/* the cars (Garage there) */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cgroup { grid-column: 1 / -1; margin: 10px 0 0; font: 800 italic 20px var(--cond); text-transform: uppercase; letter-spacing: .04em; }
.cgroup:first-child { margin-top: 0; }
.ccard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 12px 14px; overflow: hidden; border-radius: 18px; border: 1px solid var(--line);
  background: var(--glass); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .12s; }
.ccard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, .05) 55%, transparent 55%); pointer-events: none; }
.ccard:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.ccard.on { border-color: var(--hot); box-shadow: 0 0 0 1px var(--hot), 0 10px 30px rgba(232, 80, 26, .28); background: linear-gradient(180deg, rgba(232, 80, 26, .22), rgba(255, 255, 255, .02)); }
.cname { align-self: flex-start; font: 800 italic 16px var(--cond); text-transform: uppercase; }
.ccard img { width: 100%; max-width: 150px; height: 80px; object-fit: contain; }

/* records and how to play */
.rgrid, .how { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rec, .hcard { padding: 16px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow); }
.rec h3, .hcard h3 { margin: 0 0 10px; font: 800 italic 19px var(--cond); text-transform: uppercase; }
.rec table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rec td { padding: 7px 2px; border-top: 1px solid var(--line); }
.rec td + td { text-align: right; color: var(--gold); font-weight: 700; }
.rec .tot td { font-weight: 700; }
.hcard ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 14px; line-height: 1.6; }

.primary, .glass { min-height: 40px; padding: 8px 18px; border-radius: 14px; font: 700 15px var(--font); cursor: pointer; }
.primary { border: 0; background: linear-gradient(180deg, var(--go1), var(--go2)); color: #0d1a08; box-shadow: 0 8px 22px rgba(95, 200, 31, .25); }
.glass { border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .05); color: var(--ink); }
.primary:hover, .glass:hover { filter: brightness(1.08); }
.back { min-height: 36px; }
.foot { margin-top: 18px; text-align: center; color: var(--label); font-size: 12px; }

/* the phone's tab bar and menu sheet (hidden on a computer) */
.tabbar { display: none; }
.sheetbg { position: fixed; inset: 0; z-index: 30; background: rgba(4, 6, 9, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; }
.sheetin { width: min(520px, 100%); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 28, 35, .98), rgba(12, 14, 18, .98)); display: flex; flex-direction: column; gap: 8px; }
.sheetin .tbrand { display: block; margin: 0 4px 6px; }
.srowb { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04); color: var(--ink); font: 600 15px var(--font); cursor: pointer; }
.srowb i { font-style: normal; color: var(--label); font-size: 20px; }
.sw { width: 42px; height: 24px; border-radius: 12px; background: var(--go2); position: relative; }
.sw::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.srowb.off .sw { background: rgba(255, 255, 255, .2); } .srowb.off .sw::after { right: auto; left: 3px; }
.sfoot { margin: 8px 4px 0; color: var(--label); font-size: 12px; text-align: center; }

@media (min-width: 1500px) {
  .site { grid-template-columns: 220px minmax(0, 1fr); }
  .rbrand { flex-direction: row; justify-content: flex-start; padding: 0 20px 14px; }
  .rbrand .btxt { display: block; font: 800 italic 22px var(--cond); text-transform: uppercase; } .rbrand .btxt em { color: var(--accent); }
  .ngrp { text-align: left; padding-left: 24px; }
  .rail a, .rail button { flex-direction: row; gap: 12px; padding: 10px 12px; font: 700 13px var(--cond); letter-spacing: .08em; text-transform: uppercase; }
  .rail a span, .rail button span { display: inline; }
}
@media (max-width: 820px) {
  .site { display: block; padding: 10px 12px; }
  .rail { display: none; }
  .top { position: sticky; top: 0; z-index: 6; margin: -10px -12px 0; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-radius: 0; border-width: 0 0 1px; background: rgba(12, 15, 20, .92); backdrop-filter: blur(10px); box-shadow: none; }
  .burger { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); cursor: pointer; }
  .tbrand { display: block; }
  .crumb, .ttag, .tools [data-nav=how], .tools [data-tool=snd] { display: none; }
  .tools { border: 0; background: none; padding: 0; }
  h1 { font-size: 30px; margin-top: 18px; }
  .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pills button { flex: none; }
  .tabbar { position: fixed; z-index: 7; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 66px; display: flex; padding: 0 6px; border-radius: 22px;
    border: 1px solid var(--line); background: linear-gradient(180deg, rgba(24, 28, 35, .96), rgba(46, 26, 16, .96)); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; color: #cfd6e0;
    font: 700 11.5px var(--cond); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
  .tabbar button.on { color: var(--accent); }
  .site::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: calc(20px + env(safe-area-inset-bottom)); background: var(--bg); z-index: 6; }
  .startbar { position: fixed; left: 10px; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 8px 8px 16px; gap: 10px; }
  .sbcar, .startbar .glass { display: none; }
  .sbtxt b { font-size: 18px; }
  .sbtxt small { font-size: 12px; }
  .startbar .primary { min-height: 48px; padding: 8px 16px; font-size: 17px; }
  .foot { padding-bottom: 96px; }
  .hasbar .foot { padding-bottom: 166px; }
  .hero { padding: 14px 16px 18px 22px; }
  .srow { grid-template-columns: 44px 1fr auto; grid-template-areas: "ss info best" "map map go"; row-gap: 10px; }
  .srow .ss { grid-area: ss; } .srow .sinfo { grid-area: info; } .srow .sbest { grid-area: best; }
  .srow canvas { grid-area: map; width: 100%; height: 90px; } .srow .glass { grid-area: go; align-self: stretch; min-height: 44px; }
  .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rgrid, .how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

/* ---------- driving: as Apex Minis (0.12.0, the owner: "o layout tem que se aproximar mais do apex-minis") ---------- */
:root { --panel: rgba(14, 17, 24, .84); --sg: #35d07f; --sy: #ffd338; --sp: #b667ff; }
#dhud { position: fixed; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
.tower { background: var(--panel); border-radius: 8px; padding: 10px 12px 12px; width: 236px; max-width: 58vw; font-family: var(--cond); font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--line); }
.tbar { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tlogo { font: 800 italic 15px var(--cond); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.tlogo em { color: var(--hot); }
#t-ss { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--dim); white-space: nowrap; }
.tname { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tname b { font-size: 17px; font-weight: 700; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tname small { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#clock { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: .01em; }
#clock.done { color: var(--sy); }
.sectors { display: flex; gap: 4px; }
.sec { flex: 1; min-width: 0; background: rgba(255, 255, 255, .1); border-radius: 3px; padding: 3px 0 4px; text-align: center; display: flex; flex-direction: column; color: var(--dim); }
.sec span { font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.sec b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.sec.g { background: var(--sg); color: #06250f; } .sec.y { background: var(--sy); color: #2b2200; } .sec.p { background: var(--sp); color: #1b0b2b; } .sec.w { color: var(--ink); }
.pair { display: flex; gap: 14px; border-top: 1px solid var(--line); padding-top: 7px; }
.pair div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pair b { font-size: 19px; font-weight: 700; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--label); }
#t-best { color: var(--sp); }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.map { background: var(--panel); border-radius: 8px; padding: 6px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.map canvas { width: 118px; height: 102px; display: block; }
.minfo { font: 700 11px var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-top: 3px; white-space: nowrap; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
.spd { background: var(--panel); border-radius: 8px; width: 130px; padding: 7px 10px 8px; font-family: var(--cond); font-variant-numeric: tabular-nums; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.spd b { font-size: 36px; font-weight: 800; line-height: 1; }
.spd span { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--label); margin-top: 1px; }
.spd i { font-style: normal; font-size: 15px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1; border-top: 1px solid var(--line); width: 100%; margin-top: 7px; padding-top: 7px; }
.dtools { display: flex; gap: 6px; pointer-events: auto; }
.dtools button { font: 700 12px var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 0 11px; min-height: 36px; cursor: pointer; }
.dtools button:hover { border-color: var(--ink); }
#view.on { border-color: var(--gold); color: var(--gold); }
.up { color: var(--up); } .down { color: var(--down); }
#r-note { font-weight: 700; }
#count { position: fixed; left: 50%; top: 24%; transform: translate(-50%, -50%); font: 800 italic 110px var(--cond); color: var(--gold);
  text-shadow: 0 4px 18px rgba(0, 0, 0, .55); pointer-events: none; font-variant-numeric: tabular-nums; }
#count.go { color: var(--go1); }
#keys { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line);
  font-size: 12px; color: var(--dim); white-space: nowrap; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .14); color: var(--ink); font: 600 11px var(--font); text-align: center; }

/* the phone's three zones (Left, right, brake; the screen in thirds 38 / 24 / 38): drawn as Apex Minis, round arrows at the sides and BRAKE in the middle */
#pad { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); display: none; pointer-events: none; padding: 0 16px;
  justify-content: space-between; align-items: center; }
.touch #pad { display: flex; }
#pad .zl, #pad .zr { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); background: rgba(14, 17, 24, .32);
  color: #fff; font-size: 22px; transition: background .08s; }
#pad .zb { padding: 9px 20px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .3); background: rgba(14, 17, 24, .32); color: rgba(255, 255, 255, .85);
  font: 700 13px var(--cond); letter-spacing: .14em; transition: background .08s; }
#pad.l .zl, #pad.r .zr { background: rgba(53, 208, 127, .55); border-color: var(--sg); }
#pad.b .zb, #pad.b .zl, #pad.b .zr { background: rgba(229, 72, 77, .6); border-color: #e5484d; }
.touch #keys, .touch .hint { display: none; }
#tip { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); width: min(320px, calc(100% - 24px)); padding: 10px 14px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); text-align: center; font-size: 14px; line-height: 1.45; display: none; pointer-events: none; }
.touch.counting #tip { display: block; }

/* the result card */
#result { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 10, .4); padding: 16px; backdrop-filter: blur(3px); }
.card { width: min(380px, 100%); padding: 20px 22px; border-radius: 22px; background: linear-gradient(180deg, rgba(22, 25, 31, .94), rgba(12, 14, 18, .94));
  border: 1px solid var(--line); text-align: center; box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
#r-stage { font-size: 13px; color: var(--dim); }
#r-title { font: 800 italic 18px var(--cond); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; color: var(--accent); }
#r-time { font: 800 italic 54px var(--cond); font-variant-numeric: tabular-nums; line-height: 1.05; margin: 2px 0; }
#r-note { font-size: 14px; margin-bottom: 12px; }
#r-splits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; margin-bottom: 16px; }
#r-splits td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: left; }
#r-splits td + td { text-align: right; }
#r-splits .tot td { font-weight: 700; color: var(--gold); }
#r-btns { display: flex; flex-direction: column; gap: 8px; }
#r-btns button { width: 100%; min-height: 46px; }
.hint { margin-top: 8px; font-size: 12px; color: var(--label); }

@media (max-width: 640px) {
  #dhud { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .tower { width: 196px; padding: 7px 9px 9px; gap: 5px; }
  .tlogo { font-size: 13px; } #t-ss { font-size: 12px; }
  .tname b { font-size: 14px; }
  #clock { font-size: 30px; }
  .sec b { font-size: 13px; }
  .pair b { font-size: 16px; } .label { font-size: 11px; }
  .side { gap: 6px; }
  .map { padding: 4px; } .map canvas { width: 88px; height: 76px; } .minfo { max-width: 88px; font-size: 11px; letter-spacing: .02em; }
  .spd { width: 98px; padding: 4px 8px 5px; } .spd b { font-size: 26px; } .spd i { font-size: 12px; margin-top: 4px; padding-top: 4px; }
  .dtools { flex-direction: column; align-items: stretch; width: 98px; }
}
}
