/* BORZ CHALLENGE — простое спокойное оформление в цветах Govza: ровный тёмно-зелёный фон, плоские карточки, один акцент */
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(fonts/rubik-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(fonts/rubik-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2212; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(fonts/rubik-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(fonts/rubik-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2212; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap; src: url(fonts/rubik-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Rubik; font-weight: 700; font-display: swap; src: url(fonts/rubik-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2212; }

:root {
  --bg: #023933;          /* Govza deep */
  --surface: #0a463f;     /* карточки — чуть светлее фона */
  --surface2: #0f514a;
  --line: rgba(241, 242, 233, .08);
  --text: #f1f2e9;        /* Govza chalk */
  --text2: rgba(241, 242, 233, .62);
  --text3: rgba(241, 242, 233, .4);
  --accent: #e3ed69;      /* Govza «заряд» — только активное и главное действие */
  --gold: #e8c15a; --silver: #c9d0d4; --bronze: #d99566;
  --up: #7fe3c0; --down: #ff9a8b;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); }
body { min-height: 100vh; color: var(--text); font-family: Rubik, system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { width: 1em; height: 1em; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; }
.view { padding: calc(var(--safe-t) + 16px) 16px calc(104px + var(--safe-b)); }

/* ── шапка ─────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand { flex: 1; }
.brand-borz { font-weight: 700; font-size: 22px; letter-spacing: .04em; }
.brand-borz span { color: var(--accent); }
.brand-sp { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--text3); }
.brand-sp img { height: 11px; opacity: .85; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); font-size: 18px; color: var(--text2); }
.icon-btn:active { opacity: .7; }

/* ── общий километраж: одно число ───────────────── */
.total { display: flex; align-items: baseline; gap: 6px; margin-bottom: 16px; }
.total b { font-size: 30px; font-weight: 700; }
.total span { color: var(--text2); font-size: 15px; }

/* ── вкладки периодов ───────────────────────────── */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); margin-bottom: 22px; }
.seg button { padding: 9px 4px; border-radius: 10px; font-size: 13px; color: var(--text2); transition: background .2s, color .2s; }
.seg button.on { background: var(--accent); color: var(--bg); font-weight: 500; }

/* ── подиум ─────────────────────────────────────── */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin-bottom: 22px; text-align: center; }
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod-ava { position: relative; margin-bottom: 12px; }
.pod .ava { width: 68px; height: 68px; font-size: 22px; border: 2px solid var(--ring); }
.pod.p1 .ava { width: 84px; height: 84px; font-size: 26px; }
.pod-num { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--bg); background: var(--ring); }
.pod-crown { position: absolute; left: 50%; top: -20px; transform: translateX(-50%); width: 26px; height: 20px; color: var(--gold); }
.pod-name { font-weight: 500; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.pod-km { margin-top: 4px; font-size: 13px; color: var(--text2); }
.p1 { --ring: var(--gold); } .p2 { --ring: var(--silver); } .p3 { --ring: var(--bronze); }

/* ── список ─────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 26px 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--surface); }
.row:active { background: var(--surface2); }
.row.me { box-shadow: inset 0 0 0 1.5px var(--accent); }
.row-place { font-weight: 500; font-size: 14px; color: var(--text3); text-align: center; }
.row .ava { width: 40px; height: 40px; font-size: 14px; }
.row-name { min-width: 0; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.row-name small { display: block; font-size: 12px; color: var(--text3); }
.row-km { text-align: right; font-weight: 700; font-size: 15px; white-space: nowrap; }
.row-km small { font-weight: 400; font-size: 12px; color: var(--text3); margin-left: 2px; }
.move { display: block; font-size: 11px; font-weight: 500; }
.move.up { color: var(--up); } .move.down { color: var(--down); }

/* ── аватар ─────────────────────────────────────── */
.ava { position: relative; border-radius: 50%; display: grid; place-items: center; font-weight: 500; color: var(--text); background: var(--av, #155e55); overflow: hidden; flex: none; }
.ava img { width: 100%; height: 100%; object-fit: cover; }

/* ── поля ───────────────────────────────────────── */
.search { display: none; margin-bottom: 14px; }
.search.on { display: block; }
.search input, .field input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid transparent; background: var(--surface);
  color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.search input:focus, .field input:focus { border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.km-input { font-size: 34px !important; font-weight: 700; text-align: center; }

/* ── спонсоры ───────────────────────────────────── */
.sponsors { margin-top: 28px; display: grid; gap: 8px; }
.sp-title { font-size: 12px; color: var(--text3); text-align: center; margin: 6px 0 2px; }
.sp-main { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface); }
.sp-main img { height: 30px; }
.sp-main span, .sp span { font-size: 12px; color: var(--text3); }
.sp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp { padding: 14px; border-radius: 16px; background: var(--surface); text-align: center; }
.sp b { display: block; font-weight: 500; font-size: 15px; }

/* ── нижнее меню ────────────────────────────────── */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20; width: min(520px, 100%);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 24px calc(6px + var(--safe-b));
  background: rgba(2, 57, 51, .94); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text3); padding: 6px 0; }
.tab svg { font-size: 22px; }
.tab.on { color: var(--text); }
.tab-add .plus { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; color: var(--bg); background: var(--accent); }
.tab-add:active .plus { transform: scale(.94); }

/* ── экраны ─────────────────────────────────────── */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.bar h1 { flex: 1; font-size: 20px; font-weight: 500; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 18px; }
.hero .ava { width: 96px; height: 96px; font-size: 30px; margin-bottom: 10px; }
.hero h2 { font-size: 21px; font-weight: 500; line-height: 1.25; }
.hero p { color: var(--text2); margin-top: 4px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.chip { padding: 8px 14px; border-radius: 99px; background: var(--surface); font-size: 13px; color: var(--text); position: relative; overflow: hidden; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chip.accent { background: var(--accent); color: var(--bg); font-weight: 500; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat { padding: 14px; border-radius: 14px; background: var(--surface); }
.stat small { display: block; font-size: 12px; color: var(--text2); }
.stat b { display: block; margin-top: 4px; font-size: 20px; font-weight: 700; }
.stat b span { font-size: 12px; font-weight: 400; color: var(--text2); margin-left: 3px; }
.card { padding: 16px; border-radius: 16px; background: var(--surface); margin-bottom: 14px; }
.card h3 { font-size: 15px; font-weight: 500; margin-bottom: 12px; display: flex; justify-content: space-between; }
.card h3 small { font-weight: 400; color: var(--text3); }
.chart { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 4px; height: 80px; }
.chart i { display: block; border-radius: 4px; background: var(--accent); min-height: 3px; }
.chart i.zero { background: rgba(241, 242, 233, .1); }
.chart-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 6px; font-size: 9px; color: var(--text3); text-align: center; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { padding: 10px 6px; border-radius: 12px; text-align: center; background: var(--bg); font-size: 11px; color: var(--text3); }
.badge i { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%; font-size: 13px; font-weight: 700; font-style: normal; background: rgba(241, 242, 233, .06); color: var(--text3); }
.badge.got { color: var(--text); }
.badge.got i { background: var(--accent); color: var(--bg); }
.runs { display: flex; flex-direction: column; gap: 10px; }
.run { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.run-ph { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--bg); display: grid; place-items: center; color: var(--text3); font-size: 18px; }
.run-ph img { width: 100%; height: 100%; object-fit: cover; }
.run b { font-weight: 500; } .run small { display: block; font-size: 12px; color: var(--text3); }
.st { font-size: 11px; padding: 3px 8px; border-radius: 99px; }
.st.pending { background: rgba(227, 237, 105, .14); color: var(--accent); }
.st.approved { background: rgba(127, 227, 192, .14); color: var(--up); }
.st.rejected { background: rgba(255, 154, 139, .14); color: var(--down); }
.photo-pick { position: relative; display: grid; place-items: center; gap: 4px; min-height: 140px; border-radius: 14px; border: 1.5px dashed rgba(241, 242, 233, .25); background: var(--surface); color: var(--text2); text-align: center; overflow: hidden; cursor: pointer; padding: 12px; }
.photo-pick svg { font-size: 26px; color: var(--accent); }
.photo-pick small { color: var(--text3); max-width: 240px; }
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn { display: block; width: 100%; padding: 15px; border-radius: 14px; font-weight: 500; font-size: 16px; text-align: center; background: var(--accent); color: var(--bg); }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--surface); color: var(--text); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--text2); line-height: 1.45; margin-bottom: 14px; }
.empty { text-align: center; padding: 36px 20px; color: var(--text2); }
.empty svg { font-size: 34px; color: var(--text3); margin-bottom: 8px; }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -150%); z-index: 40; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; transition: transform .3s var(--ease); }
.toast.on { transform: translate(-50%, 0); }
.toast.bad { background: #ffc2b8; }
.fade { animation: fade .25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
.skeleton { height: 60px; border-radius: 14px; background: var(--surface); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
