:root {
  --pink: #ff3d9a;
  --cyan: #27e0ff;
  --yellow: #ffe93b;
  --ink: rgba(8, 14, 30, 0.66);
  --font: "Avenir Next Condensed", "Avenir Next", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a1020; color: #fff; font-family: var(--font); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; font-style: italic; font-weight: 700; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); }
.panel { position: absolute; background: var(--ink); border-radius: 14px; padding: 12px 16px; backdrop-filter: blur(6px); border-bottom: 3px solid var(--pink); }
.lbl { font-size: 13px; letter-spacing: 0.14em; color: var(--cyan); margin-right: 8px; font-style: normal; }
.of { opacity: 0.6; font-size: 0.6em; margin-left: 2px; }

.tl { top: 16px; left: 16px; min-width: 190px; }
.tl .row { font-size: 30px; line-height: 1.1; display: flex; align-items: baseline; }
.tl .row.big { font-size: 58px; color: var(--yellow); }
.tl .row.small { font-size: 20px; }
#board { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 15px; font-style: normal; font-weight: 600; }
#board li { display: flex; gap: 8px; align-items: center; padding: 1.5px 0; opacity: 0.85; }
#board li.me { color: var(--yellow); opacity: 1; }
#board i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
#board span.gap { margin-left: auto; opacity: 0.7; font-variant-numeric: tabular-nums; }

.tc { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
#time { font-size: 46px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#street { display: inline-block; margin-top: 2px; padding: 3px 14px; border-radius: 999px; background: var(--ink); font-size: 16px; font-style: normal; letter-spacing: 0.06em; border: 1px solid rgba(39, 224, 255, 0.5); }

.tr { top: 16px; right: 16px; padding: 8px; border-bottom-color: var(--cyan); }
#minimap { width: 280px; height: 186px; display: block; border-radius: 8px; }
.laps { display: flex; gap: 14px; padding: 6px 6px 0; font-size: 15px; font-variant-numeric: tabular-nums; font-style: normal; }
.laps .lbl { font-size: 11px; margin-right: 5px; }

.bc { position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%); text-align: center; }
.speed { font-size: 92px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.speed small { font-size: 22px; margin-left: 8px; color: var(--cyan); letter-spacing: 0.08em; }
.boost { width: 300px; height: 10px; margin: 10px auto 6px; border-radius: 6px; background: rgba(8, 14, 30, 0.7); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.25); }
#boostBar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow)); transform-origin: left; }
.sub { display: flex; gap: 18px; justify-content: center; font-size: 15px; font-style: normal; font-weight: 600; opacity: 0.92; }
.sub b { color: var(--yellow); }
#assist { color: var(--cyan); }
#assist.off { color: #fff; opacity: 0.5; }

#arrow { position: absolute; left: 50%; top: 50%; font-size: 54px; color: var(--pink); margin: -32px 0 0 -27px; opacity: 0; transition: opacity 0.2s; font-style: normal; filter: drop-shadow(0 0 10px rgba(255, 61, 154, 0.9)); }
#msg { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); font-size: 34px; letter-spacing: 0.05em; padding: 6px 22px; border-radius: 10px; background: var(--ink); opacity: 0; transition: opacity 0.25s; white-space: nowrap; }
#msg.show { opacity: 1; }
#msg.warn { color: var(--yellow); border-bottom: 3px solid var(--pink); }
#count { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); font-size: 190px; color: var(--yellow); text-shadow: 0 0 40px rgba(255, 61, 154, 0.9), 0 6px 0 rgba(0, 0, 0, 0.35); }
.help { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12.5px; font-style: normal; font-weight: 500; opacity: 0.7; white-space: nowrap; letter-spacing: 0.03em; }

#menu, #results { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, rgba(10, 16, 40, 0.25), rgba(10, 16, 40, 0.72)); overflow: auto; padding: 16px; }
.card { width: min(680px, 100%); background: rgba(8, 14, 30, 0.8); border-radius: 22px; padding: 30px 36px 26px; backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); text-align: center; }
.kicker { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cyan); font-weight: 600; }
h1 { font-size: 68px; line-height: 0.95; margin: 8px 0 6px; font-style: italic; font-weight: 800; letter-spacing: 0.01em; }
h1 span { color: var(--pink); text-shadow: 0 0 26px rgba(255, 61, 154, 0.7); }
.route { margin: 0 0 18px; font-size: 17px; opacity: 0.9; font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.facts div { background: rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 10px 6px; }
.facts b { display: block; font-size: 23px; color: var(--yellow); font-style: italic; }
.facts span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.opts { display: flex; gap: 24px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.opt label { display: block; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; margin-bottom: 6px; }
.seg { display: inline-flex; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 3px; }
.seg button { font: inherit; font-weight: 700; font-size: 16px; color: #fff; background: none; border: 0; padding: 7px 16px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--cyan); color: #06121f; }
#start, #again { font: inherit; font-style: italic; font-weight: 800; font-size: 26px; letter-spacing: 0.04em; color: #fff; background: linear-gradient(90deg, var(--pink), #ff7a3d); border: 0; border-radius: 14px; padding: 13px 44px; cursor: pointer; box-shadow: 0 10px 30px rgba(255, 61, 154, 0.45); }
#start:disabled { filter: grayscale(0.7); opacity: 0.7; cursor: wait; box-shadow: none; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 20px; font-size: 14px; font-weight: 500; opacity: 0.92; }
kbd { font: inherit; font-weight: 700; font-size: 12px; background: rgba(255, 255, 255, 0.14); border-radius: 5px; padding: 2px 7px; margin-right: 4px; border-bottom: 2px solid rgba(255, 255, 255, 0.25); }
.fine { font-size: 13px; opacity: 0.65; margin: 14px 0 0; font-weight: 500; }

#resTable { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 18px; font-variant-numeric: tabular-nums; }
#resTable th { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; font-weight: 600; padding: 4px 8px; }
#resTable td { padding: 7px 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-weight: 600; }
#resTable td:nth-child(2) { text-align: left; }
#resTable tr.me td { color: var(--yellow); }
#resTable i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }

#pause { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 14, 30, 0.55); font-size: 80px; font-style: italic; font-weight: 800; text-align: center; }
#pause small { display: block; font-size: 18px; font-style: normal; font-weight: 500; opacity: 0.8; }

@media (max-width: 900px) {
  .speed { font-size: 64px; }
  #minimap { width: 200px; height: 133px; }
  .help, .laps { display: none; }
  h1 { font-size: 48px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}

.credit { position: absolute; right: 12px; bottom: 8px; font-size: 11px; font-style: normal; font-weight: 500; opacity: 0.6; }
.facts i { font-style: normal; }

/* result switcher: always on screen, bottom left */
#versions { position: fixed; left: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 12px; background: rgba(8, 14, 30, 0.82); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); font-size: 13px; }
#versions span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; margin-right: 6px; }
#versions button { font: inherit; font-weight: 600; color: #fff; background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
#versions button b { color: var(--cyan); margin-right: 4px; }
#versions button.on { background: var(--cyan); color: #06121f; }
#versions button.on b { color: #06121f; }
@media (max-width: 900px) { .credit { display: none; } }
