/* Brand colours come from sporthouse-fit (branding.py): yellow #FFC641,
   black #111111. Inside Telegram the --tg-* variables set by its SDK win, so
   the page follows the user's Telegram theme. */
:root {
  --bg: #f4f4f2;
  --text: #111111;
  --muted: #6b6b6b;
  --accent: #ffc641;
  --accent-text: #111111;
  --notice-bg: #ffffff;
  --border: #e2e2de;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #f4f4f2;
    --muted: #a3a3a0;
    --notice-bg: #1c1c1c;
    --border: #2e2e2e;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--text));
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  max-width: 480px;
  min-height: var(--tg-viewport-stable-height, 100vh);
  margin: 0 auto;
  /* Device safe area, plus Telegram's own insets in fullscreen mode. */
  padding: calc(
      24px + env(safe-area-inset-top, 0px) +
        var(--tg-content-safe-area-inset-top, 0px)
    )
    calc(20px + env(safe-area-inset-right, 0px))
    calc(
      24px + env(safe-area-inset-bottom, 0px) +
        var(--tg-content-safe-area-inset-bottom, 0px)
    )
    calc(20px + env(safe-area-inset-left, 0px));
}

/* A declaration with var() never falls back to the one before it, so the
   dynamic viewport unit needs its own block. */
@supports (height: 100dvh) {
  main {
    min-height: var(--tg-viewport-stable-height, 100dvh);
  }
}

.brand {
  margin: 0 0 40px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Yellow as a background: as text on the light theme it is unreadable. */
.brand span {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
}

h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
}

.lead {
  margin: 0;
  color: var(--tg-theme-hint-color, var(--muted));
}

/* The controls sit at the bottom, within reach of a thumb. */
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button:active {
  opacity: 0.85;
}

.link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: var(--tg-theme-link-color, inherit);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button:focus-visible,
.link:focus-visible {
  outline: 3px solid var(--tg-theme-text-color, var(--text));
  outline-offset: 3px;
}

.notice {
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--tg-theme-secondary-bg-color, var(--notice-bg));
  font-size: 15px;
}
