/* Знаешь меня? — базовая дизайн-система. См. DESIGN.md */

:root {
  --milk: #FFF7F3;
  --ink: #2B1B20;
  --lipstick: #E62E4D;
  --peach: #FFDFD5;
  --wine: #7A1F35;
  --gold: #F5B301;
  --shadow: 0 2px 16px rgba(43, 27, 32, .07);
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100svh;
}

.col {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, .display {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(28px, 8vw, 40px); font-weight: 900; }
h2 { font-size: 22px; font-weight: 700; }

.muted { color: rgba(43, 27, 32, .55); }
.wine { color: var(--wine); }
.accent { color: var(--lipstick); }

.num { font-variant-numeric: tabular-nums; }
.pct { font-family: var(--display); font-weight: 900; color: var(--lipstick); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--lipstick);
  color: #fff;
  box-shadow: 0 6px 20px rgba(230, 46, 77, .35);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(230, 46, 77, .45); }
.btn-ghost {
  background: transparent;
  color: var(--wine);
  border: 2px solid var(--peach);
  width: 100%;
}
.btn-ghost:hover { background: var(--peach); }
.btn-small { min-height: 44px; padding: 10px 18px; font-size: 15px; width: auto; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- чипсы ответов ---------- */
.chip {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  border: 2px solid var(--peach);
  border-radius: 16px;
  background: #fff;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.98); }
.chip.selected {
  border-color: var(--lipstick);
  background: #FFF0EC;
  font-weight: 600;
}
.chip + .chip { margin-top: 10px; }

/* ---------- карточки ---------- */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.bubble {
  background: #fff;
  border-radius: 18px 18px 18px 4px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 15px;
}

/* ---------- фирменная цензура ---------- */
.censored {
  position: relative;
  display: inline-block;
  color: transparent;
  user-select: none;
  white-space: nowrap;
}
.censored::after {
  content: '';
  position: absolute;
  inset: 8% -2%;
  background: var(--ink);
  border-radius: 4px;
  transform: rotate(-1.2deg);
  transition: opacity .5s ease, transform .5s ease;
}
.censored.blur::after { background: rgba(43, 27, 32, .16); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.censored.revealed { color: inherit; user-select: auto; }
.censored.revealed::after { opacity: 0; transform: rotate(-1.2deg) scaleX(.1); transform-origin: right; }

.lock { filter: blur(6px); user-select: none; pointer-events: none; }

/* ---------- лидерборд ---------- */
.row-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.row-lead + .row-lead { margin-top: 10px; }
.row-lead .place { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--wine); min-width: 26px; }
.row-lead .ava { font-size: 24px; }
.row-lead .who { flex: 1; min-width: 0; }
.row-lead .who .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-lead .who .title { font-size: 13px; color: rgba(43, 27, 32, .55); }
.row-lead .score { font-family: var(--display); font-weight: 900; font-size: 20px; color: var(--lipstick); }
.row-lead.top .place { color: var(--gold); }

/* ---------- прогресс-точки ---------- */
.pips { display: flex; gap: 8px; justify-content: center; }
.pip { width: 8px; height: 8px; border-radius: 999px; background: var(--peach); transition: background .2s, width .2s; }
.pip.on { background: var(--lipstick); width: 24px; }

/* ---------- прогресс-бар вопросов ---------- */
.qbar { height: 6px; background: var(--peach); border-radius: 999px; overflow: hidden; }
.qbar > i { display: block; height: 100%; background: var(--lipstick); border-radius: 999px; transition: width .3s ease; }

/* ---------- поля ---------- */
.input {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border: 2px solid var(--peach);
  border-radius: 16px;
  font-family: var(--body);
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .12s;
}
.input:focus { border-color: var(--lipstick); }
.input::placeholder { color: rgba(43, 27, 32, .35); }

/* ---------- бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--peach);
  color: var(--wine);
  font-size: 13px;
  font-weight: 600;
}
.badge-gold { background: #FFF3D6; color: #8a6400; }

/* ---------- конфетти ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 10px; height: 14px;
  border-radius: 2px;
  animation: confetti-fall 2.8s ease-in forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .1; }
}

/* ---------- утилиты ---------- */
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid var(--lipstick); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- темы теста (quiz.html) ---------- */
body[data-theme='y2k'] { --milk: #FFEFF5; --peach: #FFD6E6; --lipstick: #F02D7D; --wine: #8F1D53; }
body[data-theme='diary'] {
  --milk: #FBF8F1; --peach: #E9E2CE; --lipstick: #C4452E; --wine: #6B4A2E;
  background-image: linear-gradient(rgba(107, 74, 46, .06) 1px, transparent 1px);
  background-size: 100% 28px;
}
body[data-theme='beige'] { --milk: #F6F0E8; --peach: #EADFD0; --lipstick: #A66A4F; --wine: #5C4433; }
body[data-theme='black'] {
  --milk: #171114; --ink: #FFF3EE; --peach: #3A2A30; --lipstick: #FF4D6D; --wine: #FFB3C0;
  --shadow: 0 2px 16px rgba(0, 0, 0, .4);
}
body[data-theme='black'] .card, body[data-theme='black'] .chip, body[data-theme='black'] .row-lead, body[data-theme='black'] .bubble, body[data-theme='black'] .input { background: #241A1E; color: var(--ink); }
body[data-theme='black'] .chip.selected { background: #33222A; }
body[data-theme='black'] .censored::after { background: #FFF3EE; }
body[data-theme='hearts'] { --milk: #FFF0F0; --peach: #FFD9D9; --lipstick: #E6323C; --wine: #94222B; }
