/* ---------- Токены ---------- */
:root {
  --bg:        #14121c;
  --bg-glow:   #1c1730;
  --surface:   #1e1b29;
  --surface-2: #272235;
  --border:    #372f4a;
  --border-2:  #4a3f63;
  --text:      #f2eefb;
  --muted:     #9a92b0;
  --muted-2:   #6f6684;

  --gold:      #f4c95d;
  --gold-dim:  #c8a13f;
  --violet:    #7b5aa6;
  --rose:      #e0709a;
  --danger:    #e06767;

  --radius:    14px;
  --radius-sm: 9px;

  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --shadow: 0 18px 50px -22px rgba(0,0,0,.75);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-glow) 0%, transparent 55%),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ---------- Шапка ---------- */
.hero { margin-bottom: 30px; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
h1 .accent { color: var(--gold); }

.lead {
  color: var(--muted);
  font-size: clamp(15px, 2.4vw, 17px);
  max-width: 60ch;
  margin: 0;
}

/* ---------- Карточки ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, #1b1826 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 4px;
}
.card-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* ---------- Поля ввода ---------- */
label.field { display: block; margin-bottom: 18px; }
label.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
input[type="text"], input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 13px 15px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(244,201,93,.14);
}
input::placeholder { color: var(--muted-2); }

/* ---------- Кнопки ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  cursor: pointer;
  transition: transform .1s, filter .15s, background .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #f6d074, var(--gold));
  color: #2a1e05;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--muted);
  font-weight: 600;
  padding: 9px 14px;
}
.btn-ghost:hover { border-color: var(--gold-dim); color: var(--text); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Быстрые действия над календарём ---------- */
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--gold-dim); color: var(--text); }

/* ---------- Календарь ---------- */
.months { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 620px) { .months { grid-template-columns: 1fr; } }

.month-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-transform: capitalize;
  margin: 0 0 12px;
  color: var(--text);
}
.dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: transform .08s, border-color .12s, background .12s;
}
.day.empty { background: transparent; border: none; cursor: default; }
.day.disabled {
  color: var(--muted-2);
  background: transparent;
  border-color: transparent;
  cursor: not-allowed;
}
.day.weekend:not(.disabled):not(.selected) { color: var(--rose); }
.day:not(.disabled):not(.empty):hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.day.selected {
  background: linear-gradient(180deg, #f6d074, var(--gold));
  border-color: var(--gold);
  color: #2a1e05;
}
.day.today::after {
  content: "";
  position: absolute;
  bottom: 6px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%);
}
.day.selected.today::after { background: #2a1e05; }

/* режим тепловой карты (админка): число внутри + подпись снизу */
.day.heat { cursor: pointer; flex-direction: column; gap: 0; }
.day.heat .n { font-size: 15px; font-weight: 700; line-height: 1; }
.day.heat.zero { color: var(--muted-2); }
.day.heat.picked { outline: 2px solid var(--gold); outline-offset: 1px; }
.day.heat.best::before {
  content: "★";
  position: absolute;
  top: 3px; right: 5px;
  font-size: 10px;
  color: var(--gold);
}

/* ---------- Счётчик выбранного ---------- */
.counter {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.counter b { font-family: var(--font-display); font-size: 22px; color: var(--gold); }

/* ---------- Тосты ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #7a3b3b; }

/* ---------- Легенда тепла ---------- */
.legend { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; flex-wrap: wrap; }
.legend .bar {
  height: 10px; width: 180px; border-radius: 999px;
  background: linear-gradient(90deg, #2e2a44, #7b5aa6, #e0709a, #f4c95d);
}
.legend .lab { font-size: 12px; color: var(--muted); }

/* ---------- Топ дат ---------- */
.top { display: grid; gap: 10px; }
.top-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.top-row .rank { font-family: var(--font-display); font-weight: 700; color: var(--muted-2); }
.top-row.win .rank { color: var(--gold); }
.top-row .d { font-weight: 600; }
.top-row .d small { color: var(--muted); font-weight: 500; margin-left: 8px; }
.top-row .meter {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
}
.top-row .meter .track {
  width: 90px; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden;
}
.top-row .meter .fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); }

/* ---------- Детали дня (админка) ---------- */
.detail { margin-top: 18px; }
.detail h4 { font-family: var(--font-display); font-size: 15px; margin: 0 0 10px; }
.names { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: 13px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.pill.no { color: var(--muted-2); opacity: .8; }

/* ---------- Прочее ---------- */
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin: 0 0 6px; }
.stat b { font-family: var(--font-display); font-size: 26px; color: var(--gold); display: block; }
.stat span { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted-2); font-size: 13px; margin-top: 14px; }
.center { text-align: center; }
a.link { color: var(--gold); text-decoration: none; font-weight: 600; }
a.link:hover { text-decoration: underline; }
.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
