/* ===================== Викторина — общий стиль ===================== */
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(../fonts/manrope-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(../fonts/manrope-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url(../fonts/manrope-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url(../fonts/manrope-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(../fonts/manrope-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(../fonts/manrope-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Unbounded'; font-weight: 700; font-display: swap; src: url(../fonts/unbounded-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 700; font-display: swap; src: url(../fonts/unbounded-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Unbounded'; font-weight: 900; font-display: swap; src: url(../fonts/unbounded-cyrillic-900-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 900; font-display: swap; src: url(../fonts/unbounded-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
  --bg: #f5fbfc;
  --ink: #0a2a38;
  --ink-2: #33586a;
  --muted: #6f8d9a;
  --line: rgba(10, 42, 56, .09);
  --sea: #0fb5c6;
  --sea-2: #16d3c3;
  --deep: #066b86;
  --abyss: #043c4f;
  --ice: #e6fbfd;
  --diamond: linear-gradient(135deg, #ffffff 0%, #dff8fb 22%, #c4eef6 45%, #e3ecff 68%, #f6eeff 85%, #ffffff 100%);
  --aqua: linear-gradient(135deg, #12c6d0 0%, #0aa3c2 55%, #0a78a8 100%);
  --aqua-soft: linear-gradient(135deg, rgba(18,198,208,.14), rgba(10,120,168,.10));
  --ok: #10b981;
  --bad: #f04867;
  --gold: #f2b200;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .85);
  --shadow: 0 1px 1px rgba(4,60,79,.04), 0 8px 24px -6px rgba(4,60,79,.14), 0 24px 60px -24px rgba(4,60,79,.22);
  --shadow-sm: 0 1px 2px rgba(4,60,79,.06), 0 4px 14px -4px rgba(4,60,79,.14);
  --r: 20px;
  --r-sm: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Морская подложка: мягкие пятна бирюзы под матовым стеклом */
.sea-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #f8fdfe 0%, #eef9fb 100%); }
.sea-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.sea-bg i:nth-child(1) { width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle, #9feef0 0%, rgba(159,238,240,0) 70%); }
.sea-bg i:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 10vmax; background: radial-gradient(circle, #a9d8ff 0%, rgba(169,216,255,0) 70%); animation-delay: -8s; }
.sea-bg i:nth-child(3) { width: 40vmax; height: 40vmax; left: 20vmax; bottom: -20vmax; background: radial-gradient(circle, #b6f5e4 0%, rgba(182,245,228,0) 70%); animation-delay: -15s; }
.sea-bg i:nth-child(4) { width: 30vmax; height: 30vmax; right: 10vmax; bottom: -8vmax; background: radial-gradient(circle, #e6d9ff 0%, rgba(230,217,255,0) 70%); animation-delay: -4s; opacity: .4; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}

.display { font-family: var(--display); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Бриллиантовый текст */
.diamond-text {
  background: linear-gradient(100deg, #066b86 0%, #0fb5c6 30%, #6fd6ff 48%, #9a8cff 62%, #0fb5c6 78%, #066b86 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: -220% 0; } }

/* ---------- Кнопки ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; user-select: none;
  font: 700 15px/1 var(--font); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 16px; border-radius: 14px; white-space: nowrap;
  background: var(--glass-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { color: #fff; background: var(--aqua); border-color: transparent; box-shadow: 0 8px 22px -8px rgba(10,120,168,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ok { color: #fff; background: linear-gradient(135deg, #22d39a, #0ea878); border-color: transparent; box-shadow: 0 8px 22px -8px rgba(14,168,120,.7); }
.btn-bad { color: #fff; background: linear-gradient(135deg, #ff6b86, #e2385a); border-color: transparent; box-shadow: 0 8px 22px -8px rgba(226,56,90,.7); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-lg { height: 58px; font-size: 17px; border-radius: 16px; }
.btn.on { background: var(--ice); border-color: rgba(15,181,198,.55); color: var(--deep); }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.input, select.input, textarea.input {
  width: 100%; font: 600 16px/1.35 var(--font); color: var(--ink);
  padding: 13px 14px; border-radius: 13px; outline: none;
  background: rgba(255,255,255,.88); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { border-color: var(--sea); box-shadow: 0 0 0 4px rgba(15,181,198,.15); }

/* ---------- Чипы и бейджи ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--ice); color: var(--deep); border: 1px solid rgba(15,181,198,.25); }
.chip.gold { background: #fff6d6; color: #8a6200; border-color: #f6dc84; }
.chip.bad { background: #ffe8ed; color: #b0213f; border-color: #ffc2cf; }
.chip.ok { background: #e1fbf1; color: #047857; border-color: #a7ecd2; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c3d1d7; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }

/* ---------- Уведомления ---------- */
.toasts { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 15px; background: rgba(255,255,255,.9); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2); text-align: center; }
.toast.ok { color: #047857; }
.toast.bad { color: #b0213f; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- Модальное окно ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(4,60,79,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.modal { width: min(100%, 560px); max-height: 92vh; overflow: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(4,60,79,.25); animation: sheet .3s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal { border-radius: 24px; } }
.modal h3 { margin: 0 0 14px; font: 700 18px/1.2 var(--display); }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* Значок стоимости (бриллиантовая плашка) */
.value-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 34px; padding: 0 12px; border-radius: 10px; font: 900 16px/1 var(--display); color: var(--deep); background: var(--diamond); border: 1px solid rgba(15,181,198,.3); box-shadow: inset 0 1px 0 #fff, 0 4px 12px -4px rgba(6,107,134,.35); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(15,181,198,.2); border-top-color: var(--sea); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.offline-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; padding: 8px calc(12px) calc(8px + var(--safe-b)); text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: rgba(240,72,103,.92); }

/* Переключатель языка на телефоне */
.lang-toggle { position: fixed; z-index: 700; right: 12px; bottom: calc(12px + var(--safe-b)); width: 46px; height: 34px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); font: 800 13px/1 var(--font); color: var(--deep); cursor: pointer; }
