/* Две темы: день (по умолчанию, цвета логобука Магра) и ночь (брендовый синий со звёздами).
   Тема берётся из выбора человека, а если выбора нет, из настроек его устройства. */
:root {
  color-scheme: light;
  --bg: #fffafb;
  --bg2: #fff3f7;
  --surface: #ffffff;
  --surface2: #fff0f5;
  --line: #f1d3de;
  --text: #2b1216;
  --muted: #7b5560;
  --strong: #1c0a0e;
  --gold: #d4281c;
  --gold-dim: #e585ac;
  --accent: #0b519b;
  --danger: #b3261e;
  --btn-from: #ff4a3d;
  --btn-to: #dc2318;
  --btn-text: #fff;
  --header-bg: rgba(255, 250, 251, .88);
  --glow1: #deeeff;
  --glow2: #ffe7ef;
  --stars: none;
  --logo: #fd0000;
  --wave: #fd0000;
  --wave-op: .85;
  --note-bg: rgba(229, 133, 172, .1);
  --shadow: 0 8px 30px rgba(120, 40, 60, .14);
  --radius: 14px;
  --sans: "Avenir Next", Avenir, "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="night"] {
    --bg: #06162d;
  --bg2: #0a2142;
  --surface: #0d2a52;
  --surface2: #123663;
  --line: #245289;
  --text: #e8f1ff;
  --muted: #a6bddb;
  --strong: #fff;
  --gold: #f6a5c4;
  --gold-dim: #e585ac;
  --accent: #7fb8ff;
  --danger: #ff9aa8;
  --btn-from: #ffc2d7;
  --btn-to: #e585ac;
  --btn-text: #2b0a17;
  --header-bg: rgba(6, 22, 45, .86);
  --glow1: rgba(11, 81, 155, .65);
  --glow2: rgba(229, 133, 172, .14);
  --stars: url(brand/stars.svg);
  --logo: #ffe7ef;
  --wave: #e585ac;
  --wave-op: .6;
  --note-bg: rgba(255, 255, 255, .05);
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #06162d; --bg2: #0a2142; --surface: #0d2a52; --surface2: #123663; --line: #245289;
    --text: #e8f1ff; --muted: #a6bddb; --strong: #fff;
    --gold: #f6a5c4; --gold-dim: #e585ac; --accent: #7fb8ff; --danger: #ff9aa8;
    --btn-from: #ffc2d7; --btn-to: #e585ac; --btn-text: #2b0a17;
    --header-bg: rgba(6, 22, 45, .86);
    --glow1: rgba(11, 81, 155, .65); --glow2: rgba(229, 133, 172, .14);
    --stars: url(brand/stars.svg);
    --logo: #ffe7ef; --wave: #e585ac; --wave-op: .6;
    --note-bg: rgba(255, 255, 255, .05); --shadow: 0 8px 30px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 17px/1.6 var(--sans); color: var(--text);
  background: var(--stars), radial-gradient(1100px 520px at 85% -160px, var(--glow1) 0%, transparent 70%), radial-gradient(900px 480px at 0% -120px, var(--glow2) 0%, transparent 70%), var(--bg);
  background-attachment: fixed, scroll, scroll, scroll;
}
a { color: var(--gold); }
a:hover { color: var(--strong); }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); color: var(--strong); }
h2 { font-size: 1.5rem; color: var(--gold); }
h3 { font-size: 1.15rem; color: var(--strong); }
p { margin: 0 0 1em; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Шапка */
.site-header { border-bottom: 1px solid var(--line); background: var(--header-bg); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-family: var(--sans); font-size: 1.35rem; color: var(--gold); text-decoration: none; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; font-size: .95rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--strong); }
.nav a[aria-current="page"] { color: var(--strong); border-bottom-color: var(--gold); }

/* Основа страницы */
main { padding: 28px 0 48px; }
.hero { text-align: center; padding: 28px 0 8px; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto 1em; }
.kicker { color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 24px 0; }
.tile {
  display: block; text-decoration: none; color: var(--text); background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--gold-dim); color: var(--text); }
.tile .ico { font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 8px; font-family: var(--sans); }
.tile h3 { margin-bottom: .3em; }
.tile p { color: var(--muted); margin: 0; font-size: .97rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.panel.soon { border-style: dashed; border-color: var(--gold-dim); background: transparent; }
.note { border-left: 3px solid var(--gold-dim); padding: 8px 14px; color: var(--muted); font-size: .92rem; margin: 16px 0; background: var(--note-bg); border-radius: 0 8px 8px 0; }

/* Формы */
form.calc { display: grid; gap: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
label { display: block; font-size: .92rem; color: var(--muted); margin-bottom: 4px; }
input[type=date], input[type=time], input[type=text], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.checks label { display: flex; gap: 10px; align-items: center; color: var(--text); margin: 0; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 12px; padding: 12px 22px; min-height: 48px;
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to)); color: var(--btn-text); text-decoration: none; display: inline-block; text-align: center;
}
button:hover, .btn:hover { filter: brightness(1.07); color: var(--btn-text); }
button.ghost, .btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); }
button.ghost:hover { color: var(--strong); }
.error { color: var(--danger); margin: 0; min-height: 1.4em; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; }
legend { padding: 0 8px; color: var(--gold); font-family: var(--sans); }

/* Результаты */
.result { margin-top: 24px; }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 12px 0 20px; }
.stat { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat .big { font-family: var(--sans); font-size: 2.6rem; color: var(--gold); line-height: 1.1; }
.stat .cap { font-size: .85rem; color: var(--muted); }
.stat .ttl { color: var(--strong); font-family: var(--sans); }
.tags { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); background: var(--bg2); border-radius: 99px; padding: 3px 12px; font-size: .9rem; color: var(--text); }
table.planets { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.planets th, table.planets td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.planets th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.glyph { font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", var(--sans); color: var(--gold); font-size: 1.3em; }
.rx { color: var(--danger); font-size: .8rem; margin-left: 6px; border: 1px solid var(--danger); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.meter { height: 12px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.score { font-family: var(--sans); font-size: 3rem; color: var(--gold); line-height: 1; }

/* Таро */
.cards { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin: 20px 0; }
.card-slot { width: 190px; text-align: center; }
.card-slot .pos { color: var(--gold); font-family: var(--sans); margin-bottom: 8px; }
.tcard { width: 190px; height: 300px; perspective: 900px; cursor: pointer; border: 0; background: none; padding: 0; display: block; margin: 0 auto; border-radius: 14px; }
.tcard .in { display: block; position: relative; width: 100%; height: 100%; transition: transform .7s; transform-style: preserve-3d; }
.tcard.open .in { transform: rotateY(180deg); }
.tcard .face, .tcard .back { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 2px solid #e585ac; overflow: hidden; }
.tcard .back {
  background: repeating-conic-gradient(from 0deg at 50% 50%, #0d4a8f 0 15deg, #0a3b73 15deg 30deg);
  display: flex; align-items: center; justify-content: center; font-size: 3.4rem; color: #ffe7ef;
}
.tcard .back::after { content: ""; position: absolute; inset: 10px; border: 1px solid #e585ac; border-radius: 8px; }
.tcard .face { transform: rotateY(180deg); background: linear-gradient(170deg, #0f5aa8, #061c3d 70%); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 10px; }
.tcard .face::after { content: ""; position: absolute; inset: 7px; border: 1px solid #e585ac; border-radius: 9px; pointer-events: none; }
.tcard .roman { font-family: var(--sans); color: #ffb3cd; font-size: 1.3rem; letter-spacing: .1em; }
.tcard .sym { font-size: 5.2rem; line-height: 1; color: #ffe7ef; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", var(--sans); text-shadow: 0 0 22px rgba(229, 133, 172, .7); }
.tcard .cname { font-family: var(--sans); color: #fff; font-size: 1.1rem; text-align: center; line-height: 1.2; }
.tcard.rev .face .sym { transform: rotate(180deg); }
.card-text { text-align: left; margin-top: 14px; font-size: .97rem; }
.card-text h3 { text-align: center; }
.card-text .rv { display: inline-block; color: var(--danger); font-size: .85rem; border: 1px solid var(--danger); border-radius: 6px; padding: 0 6px; margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .tcard .in { transition: none; } .tile { transition: none; } }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--muted); font-size: .88rem; }
.site-footer p { margin: 0 0 .6em; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .card-slot, .tcard { width: 160px; }
  .tcard { height: 254px; }
  .tcard .sym { font-size: 4.2rem; }
}

/* «Мой путь» */
.coll { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.coll .it { background: var(--surface2); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; gap: 2px; }
.coll .it.locked { background: var(--bg2); border-color: var(--line); opacity: .6; }
.coll .roman { color: var(--gold); font-family: var(--sans); font-size: .85rem; }
.coll .sym { font-size: 2rem; line-height: 1.2; color: var(--gold); }
.coll .nm { font-size: .76rem; color: var(--strong); line-height: 1.25; overflow-wrap: anywhere; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.badge { border: 1px solid var(--gold-dim); border-radius: 12px; padding: 10px 14px; background: var(--surface2); display: grid; gap: 2px; }
.badge strong { color: var(--gold); font-weight: 600; }
.badge.locked { border-color: var(--line); background: var(--bg2); opacity: .65; }
.badge.locked strong { color: var(--muted); }
.reward { border-color: var(--gold-dim); }
.reward .gain { color: var(--gold); font-family: var(--sans); font-size: 1.2rem; }

/* Карты-метафоры */
textarea { resize: vertical; line-height: 1.5; }
.how { color: var(--muted); padding-left: 1.2em; margin: 0 0 1em; }
.cart { position: relative; width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; border: 2px solid var(--gold-dim); background: var(--bg2); box-shadow: var(--shadow); }
.cart img, .cart svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.cart.small { max-width: none; border-width: 1px; border-radius: 10px; box-shadow: none; }
.mcard { display: grid; gap: 18px; margin: 18px 0; }
.mcard .mtext h3 { font-size: 1.4rem; }
.mq { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.mq li { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.mq .lbl { color: var(--gold); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.notes, .gift { margin: 16px 0; }
.gift input { margin: 12px 0 6px; }
.el-block { margin: 18px 0; }
.coll.meta { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.coll.meta .it { padding: 6px; font: inherit; color: inherit; cursor: pointer; min-height: 0; font-weight: 400; align-content: start; }
.coll.meta button.it:hover { filter: none; border-color: var(--gold); }
.coll.meta .it .cart { width: 100%; }
.coll.meta .it .nm { font-size: .72rem; }
.coll.meta .it.locked { min-height: 120px; align-content: center; cursor: default; }
.coll.meta .it .qm { font-size: 1.8rem; color: var(--gold); line-height: 1.2; }
.gift-in { border-color: var(--gold); }
@media (min-width: 720px) { .mcard { grid-template-columns: 260px 1fr; align-items: start; } .mcard .cart { margin: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Прогноз на день */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Бренд: логотип красится цветом темы, поэтому он один файл на обе темы */
.logo-mark { display: inline-block; aspect-ratio: 2405 / 2561; background: var(--logo); -webkit-mask: url(brand/logo.svg) center / contain no-repeat; mask: url(brand/logo.svg) center / contain no-repeat; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand .logo-mark { width: 50px; }
.brand-name { font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand:hover .brand-name { color: var(--strong); }
.hero-logo { width: 150px; margin: 0 auto 14px; }
.hero { position: relative; padding-bottom: 64px; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: var(--wave); opacity: var(--wave-op); -webkit-mask: url(brand/waves.svg) center / 100% 100% no-repeat; mask: url(brand/waves.svg) center / 100% 100% no-repeat; pointer-events: none; }

/* Переключатель дня и ночи */
button.theme-toggle { margin-left: auto; min-height: 40px; padding: 6px 14px; border-radius: 99px; background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; }
button.theme-toggle:hover { color: var(--strong); border-color: var(--gold-dim); filter: none; }
.site-header .wrap { row-gap: 2px; }
.brand { order: 1; }
button.theme-toggle { order: 2; }
.nav { order: 3; flex-basis: 100%; }
.brand .logo-mark { width: 44px; }

/* Варианты формулировок: кнопка «Сказать иначе» под текстом */
.vtext { margin: 0 0 14px; }
.vtext p { margin-bottom: 6px; }
button.vbtn { min-height: 36px; padding: 4px 14px; font-size: .85rem; border-radius: 99px; }

/* === Сборка карты на глазах (assets/js/reveal.js, страница karta-na-glazah.html) ===
   Блок всегда тёмный, как ночное небо, в обеих темах сайта: цвета ночной темы заданы здесь самому блоку. */
.reveal {
  --gold: #f6a5c4; --gold-dim: #e585ac; --accent: #7fb8ff; --text: #e8f1ff; --muted: #a6bddb; --strong: #fff;
  --line: #245289; --surface: #0d2a52; --bg2: #0a2142; --danger: #ff9aa8; --note-bg: rgba(255, 255, 255, .05);
  --btn-from: #ffc2d7; --btn-to: #e585ac; --btn-text: #2b0a17;
  position: relative; max-width: 680px; margin: 16px auto; padding: 0 0 18px; overflow: hidden;
  color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 38%, #0f3c78 0%, #08214a 52%, #040f22 100%);
  box-shadow: var(--shadow);
}
.reveal a { color: var(--gold); }
.reveal-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.reveal-canvas { display: block; width: 100%; height: 100%; }
.reveal-actions { display: flex; gap: 10px; justify-content: center; padding: 0 16px 6px; min-height: 48px; }
.reveal-actions button[hidden] { display: none; }
.reveal-info { padding: 6px 20px 0; }
.reveal-info h3 { color: var(--strong); }
.reveal-info h4 { margin: 0 0 .3em; font-size: 1.05rem; font-weight: 600; color: var(--strong); }
.reveal-item { margin-bottom: 4px; }
.reveal-planets { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 4px 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); font-size: .95rem; }
.reveal-legend { margin: 8px 0 12px; }
.rv-key { white-space: nowrap; margin-right: 8px; }
.rv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: baseline; margin-right: 3px; }
.reveal-disclaimer { margin-top: 12px; }
/* Строки текста проявляются мягко */
.rv-line { opacity: 0; transform: translateY(6px); transition: opacity .9s ease, transform .9s ease; }
.rv-line.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv-line { opacity: 1; transform: none; transition: none; } }
@media (max-width: 520px) { .reveal-info { padding: 6px 14px 0; } .reveal { border-radius: 12px; } }
