/* Shared look for every app: dark pit-wall theme + her team colour as the accent. */
:root {
  --bg: #0f0f14;
  --panel: #1b1b24;
  --panel2: #262632;
  --line: #34343f;
  --text: #f4f4f6;
  --muted: #9a9aa8;
  --f1red: #e10600;
  --good: #3ddc84;
  --bad: #ff4d4d;
  --team: #ff8000;
  --team2: #47c7fc;
  --team-text: #000;
  --radius: 14px;
  --font: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap zoom on iPad */
}

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.1; font-weight: 800; letter-spacing: .01em; }
h1 { font-size: clamp(26px, 5vw, 40px); text-transform: uppercase; font-style: italic; }
a { color: var(--team); }

/* Top bar with the home button; put <header class="topbar"> first in <body>. */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(90deg, var(--panel), var(--bg));
  border-bottom: 3px solid var(--team);
}
.topbar .title { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 20px; flex: 1; }
.home-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 12px;
  border-radius: 10px; background: var(--panel2); color: var(--text);
  text-decoration: none; font-weight: 700;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

button, .btn {
  font: inherit; font-weight: 700;
  min-height: 48px; padding: 10px 20px;
  border: 0; border-radius: 12px;
  background: var(--panel2); color: var(--text);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .08s ease, filter .15s ease;
}
button:active, .btn:active { transform: scale(.96); }
button:disabled { opacity: .45; cursor: default; }
button.primary, .btn.primary { background: var(--team); color: var(--team-text); }
button.danger { background: var(--f1red); color: #fff; }

input, select {
  font: inherit; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 46px;
}

.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; }
.big { font-size: clamp(36px, 9vw, 80px); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Pill showing a team colour stripe, e.g. <span class="teamtag" style="--c:#FF8000">McLaren</span> */
.teamtag {
  display: inline-block; padding: 2px 10px 2px 8px;
  border-left: 5px solid var(--c, var(--team));
  background: var(--panel2); border-radius: 4px; font-weight: 700;
}

/* Chequered flag strip decoration. */
.checker {
  height: 12px;
  background: repeating-conic-gradient(#fff 0 25%, #000 0 50%) 0 0 / 12px 12px;
}

@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop .35s ease-out both; }
