/* «Путь вратаря» — фирменный стиль: светлый фон, лайм-акцент, Unbounded + Lato. */

@font-face {
  font-family: 'Unbounded';
  src: url('/static/fonts/Unbounded.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('/static/fonts/Lato-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('/static/fonts/Lato-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --lime: #8FE000;
  --lime-deep: #6FB800;
  --ink: #14181C;
  --muted: #6B7280;
  --bg: #F4F6F3;
  --card: #FFFFFF;
  --line: #E6E9E4;
  --shadow: 0 2px 10px rgba(20, 24, 28, 0.06);
  --radius: 16px;

  /* Цвета типов голов (дублируют типы_и_правила.json, реальные значения приходят с сервера) */
  --t-brosok: #C8102E;
  --t-dobivanie: #1F6FEB;
  --t-trafik: #F5A200;
  --t-peredacha: #2FA84F;
  --t-1v1: #7B2FBF;
  --t-podstavlenie: #6B7280;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

h1, h2, h3, .brand, .num {
  font-family: 'Unbounded', 'Lato', sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* --- Шапка --- */
.appbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.appbar .back {
  border: 0; background: var(--card); box-shadow: var(--shadow); color: var(--ink);
  width: 40px; height: 40px; border-radius: 12px; font-size: 20px; cursor: pointer;
}
.brand { font-size: 18px; text-transform: uppercase; }
.brand .accent { color: var(--lime-deep); }

/* --- Карточки/секции --- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; border: 1px solid var(--line);
}
.card h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- Прогресс-бар дня (10 секторов) --- */
.progress-wrap { text-align: center; }
.progress-pct { font-size: 40px; margin: 4px 0 2px; }
.progress-pct span { font-size: 18px; color: var(--muted); }
.sectors { display: flex; gap: 5px; margin: 12px 0; }
.sectors .seg {
  flex: 1; height: 14px; border-radius: 6px; background: #E9ECE6;
  transition: background .25s ease;
}
.sectors .seg.on { background: var(--lime); }
.motivation { font-family: 'Unbounded'; font-weight: 700; font-size: 15px; margin-top: 6px; min-height: 22px; }

/* --- Кнопки разделов --- */
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section-btn {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; cursor: pointer; text-align: left;
  font-family: 'Unbounded'; font-weight: 700; font-size: 15px; color: var(--ink);
}
.section-btn .ico { font-size: 26px; }
.section-btn:active { transform: scale(0.98); }

/* --- Общие элементы форм --- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); border-color: var(--lime); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; border: 0; border-radius: 14px; cursor: pointer;
  font-family: 'Unbounded'; font-weight: 700; font-size: 15px;
  background: var(--lime); color: #10240A;
}
.btn:active { transform: scale(0.99); }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }

/* --- Список рутины --- */
.check-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: 0; }
.check-item .box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto;
  font-size: 16px; color: #fff; background: #fff;
}
.check-item .box.on { background: var(--lime); border-color: var(--lime); }
.check-item .title { flex: 1; }
.check-item .title.done { color: var(--muted); text-decoration: line-through; }
.check-item .del { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* --- Пилюли выбора (хват, тип гола) --- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px;
  cursor: pointer; font-size: 14px; color: var(--ink);
}
.pill.on { background: var(--lime); border-color: var(--lime); color: #10240A; font-weight: 700; }

/* --- Экран «сухаря» --- */
.sukhar {
  text-align: center; padding: 40px 20px; background: linear-gradient(160deg, #10240A, #1c3b10);
  color: #fff; border-radius: var(--radius);
}
.sukhar .big { font-family: 'Unbounded'; font-weight: 900; font-size: 26px; color: var(--lime); margin: 8px 0; }
.sukhar .em { font-size: 54px; }

/* --- Всплывающие сообщения --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 50; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* --- Холст отметки голов --- */
.picker-wrap { text-align: center; }
.zone-canvas {
  width: 100%; height: auto; display: block; border-radius: 12px;
  background: #EAF2F6; touch-action: manipulation; border: 1px solid var(--line);
}
.pick-hint { font-size: 14px; color: var(--muted); margin: 8px 0; }
.pick-zone { font-family: 'Unbounded'; font-weight: 700; }

/* --- Фишки голов --- */
.goal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.goal-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 8px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px;
}
.goal-chip .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.goal-chip .x { cursor: pointer; color: var(--muted); font-size: 15px; }

/* --- Строки статистики / игр --- */
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.tile .n { font-family: 'Unbounded'; font-weight: 800; font-size: 24px; }
.tile .l { font-size: 12px; color: var(--muted); }
.game-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.game-row:last-child { border-bottom: 0; }
.game-row .gr-main { flex: 1; }
.game-row .gr-date { font-weight: 700; }
.rec-zone { border-left: 4px solid var(--lime); padding: 6px 0 6px 12px; margin: 10px 0; }
.rec-zone .z { font-family: 'Unbounded'; font-weight: 700; font-size: 14px; }

.type-pill { display: inline-flex; align-items: center; gap: 8px; }
.type-pill .dot { width: 12px; height: 12px; border-radius: 50%; }

/* --- Тёмная тема Telegram (аккуратный минимум) --- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EDEFEA; --bg: #15181B; --card: #1E2226; --line: #2C3136; --muted: #9AA1A8;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
  }
  input, select, textarea { background: #262b30; }
  .check-item .box { background: #262b30; }
}
