/* «Новогодние окна» - «сказочная книга» (владелец выбрала 30.11.2026 из четырёх стилей: «вот сейчас красивый дом,
   надо всё такое сделать»). Вместо рисунков кодом - живопись гуашью: башня, ночное небо с замками, ёлочные шары,
   сова, подарки, кубок (static/img, нарисованы генератором картинок по одному описанию стиля). Страницы - листы
   пергамента со вклеенными иллюстрациями: белая бумага картинок исчезает в mix-blend-mode: multiply.
   Башня - картинка с тёмными окнами, горящие окна - плитки из той же картинки поверх (полоса tower-windows.jpg),
   порядок окон - снизу вверх, слева направо. Своя тема игры - решение владельца 29.11.2026; логотип LEVITA -
   готовым файлом, шрифты бренда My + Spectral. Без имён, гербов, персонажей и шрифтов чужих франшиз. Свечей рядом
   с местами и именами нет (29.11: «похороны»). Движение выключается при prefers-reduced-motion. Код на экране
   педагога - всегда на белом. Картинки из CSS кешируются на неделю без ?v=: меняя картинку после старта, менять
   и имя файла. */

@font-face { font-family: "My"; src: url("../fonts/My.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/Spectral-Regular.woff2") format("woff2"); font-display: swap; }

:root {
  --night: #080d1f;
  --night-2: #101a38;
  --night-3: #1a2650;
  --text: #f6e7c4;
  --muted: rgba(246, 231, 196, .76);
  --gold: #d9b45a;
  --gold-soft: #f3d589;
  --gold-deep: #a9823c;
  --line: rgba(217, 180, 90, .42);
  --parch: #f6e9cb;
  --parch-2: #e8d09c;
  --ink: #2b1b0b;
  --ink-muted: rgba(43, 27, 11, .72);
  --wax: #81202f;
  --wax-2: #a12d3e;
  --wax-dark: #561320;
  --candle: #ffc95e;
  --error: #ffb3a7;
  --font-display: "My", serif;
  --font-body: "Spectral", serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M3 41V16Q3 3 16 3h25' fill='none' stroke='%23a9823c' stroke-width='1.6'/%3E%3Cpath d='M8 41V19Q8 8 19 8h22' fill='none' stroke='%23a9823c' stroke-width='.8'/%3E%3Cpath d='M13 13l4 1.2-1.2 4-4-1.2z' fill='%2381202f'/%3E%3Ccircle cx='27' cy='3.2' r='1.6' fill='%23a9823c'/%3E%3Ccircle cx='3.2' cy='27' r='1.6' fill='%23a9823c'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body { margin: 0; color: var(--text); font-family: var(--font-body); font-size: 18px; line-height: 1.5; min-height: 100vh;
       background: var(--night); overflow-x: hidden; }
body > * { position: relative; z-index: 2; }
a { color: var(--gold-soft); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* ---------- небо: живопись с северным сиянием и замками внизу, поверх - мерцание и снег ---------- */
.sky { position: fixed !important; inset: 0; z-index: 0 !important; pointer-events: none; overflow: hidden;
       background: var(--night) url("../img/sky.jpg") center bottom / cover no-repeat; }
.sky::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 31, .3), rgba(8, 13, 31, 0) 30%, rgba(8, 13, 31, .25) 100%); }
.sky__stars { position: absolute; inset: 0; background-size: 380px 480px; opacity: .55; animation: twinkle 5s ease-in-out infinite;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 33% 18%, #fffbe8 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 58% 6%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 81% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 92% 32%, #fffbe8 50%, transparent 51%), radial-gradient(1.5px 1.5px at 44% 37%, #fff 50%, transparent 51%); }
@keyframes twinkle { 0%, 100% { opacity: .6; } 50% { opacity: .2; } }
.sky__snow, .sky__snow2 { position: absolute; left: 0; right: 0; top: -420px; height: calc(100% + 420px);
  background-size: 300px 420px; will-change: transform; animation: snow 22s linear infinite; }
.sky__snow { opacity: .7;
  background-image:
    radial-gradient(2.4px 2.4px at 10% 12%, #fff 50%, transparent 51%), radial-gradient(1.8px 1.8px at 38% 30%, #fff 50%, transparent 51%),
    radial-gradient(2.8px 2.8px at 72% 18%, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 90% 62%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 24% 78%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 58% 88%, #fff 50%, transparent 51%); }
.sky__snow2 { opacity: .45; animation-duration: 34s; background-size: 420px 420px;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 40%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 48% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 80% 70%, #fff 50%, transparent 51%), radial-gradient(1.1px 1.1px at 64% 46%, #fff 50%, transparent 51%); }
@keyframes snow { from { transform: translateY(0); } to { transform: translateY(420px); } }

/* ---------- шапка ---------- */
.top { position: relative; padding: 16px 16px 2px; display: flex; justify-content: center; }
.top__logo img { display: block; width: 112px; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .7)); }

.page { max-width: 520px; margin: 0 auto; padding: 6px 16px 64px; }
.foot { max-width: 520px; margin: 0 auto; padding: 18px 16px 150px; font-size: 14px; color: var(--muted);
        border-top: 1px solid var(--line); display: flex; gap: 8px 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* появление: блоки страницы поднимаются по очереди */
.page > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.page > *:nth-child(2) { animation-delay: .06s; } .page > *:nth-child(3) { animation-delay: .12s; }
.page > *:nth-child(4) { animation-delay: .18s; } .page > *:nth-child(5) { animation-delay: .24s; }
.page > *:nth-child(6) { animation-delay: .3s; } .page > *:nth-child(n+7) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- типографика ---------- */
h1, .display { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.12; margin: 6px 0 10px;
  color: var(--gold-soft); letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6d8 0%, #f3d589 45%, #c99b44 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .85)); }
h2 { font-family: var(--font-body); font-size: 22px; line-height: 1.25; margin: 30px 0 12px; color: var(--gold-soft);
     display: flex; align-items: center; gap: 10px; }
h2::before { content: "\2726"; font-size: 14px; color: var(--candle); }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
p { margin: 0 0 14px; }
.lead { font-size: 19px; }
/* буквица, как в сказочной книге */
.lead::first-letter { float: left; margin: 5px 8px 0 0; font-family: var(--font-display); font-size: 3.05em; line-height: .82;
  color: var(--gold-soft); text-shadow: 0 0 14px rgba(255, 201, 94, .5); }
.card .lead::first-letter { color: var(--wax); text-shadow: none; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.hero-title { text-align: center; margin: 2px 0 4px; text-wrap: balance; }
.hero-sub { text-align: center; margin: 0; font-size: 15px; color: var(--muted); text-shadow: 0 1px 4px #000; }

/* лента-заголовок */
.ribbon { display: inline-block; position: relative; margin: 0 0 12px; padding: 6px 22px; font-size: 15px; letter-spacing: .04em;
  color: var(--gold-soft); background: linear-gradient(180deg, var(--wax-2), var(--wax)); border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* ---------- кнопки: сургуч с золотым кантом ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 28px;
       border-radius: 999px; border: 1px solid var(--gold); font: inherit; font-size: 18px; text-decoration: none;
       cursor: pointer; letter-spacing: .01em; transition: box-shadow .25s ease-out, transform .15s ease-out, filter .2s; }
.btn--main { background: radial-gradient(ellipse at 50% 0%, #c43c50, var(--wax) 60%, var(--wax-dark));
             color: var(--gold-soft); box-shadow: inset 0 0 0 2px rgba(243, 213, 137, .25), 0 3px 0 var(--wax-dark),
             0 0 22px rgba(161, 45, 62, .5); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn--main:hover { box-shadow: inset 0 0 0 2px rgba(243, 213, 137, .4), 0 3px 0 var(--wax-dark), 0 0 32px rgba(255, 201, 94, .45); }
.btn--dark { background: var(--night-3); color: var(--gold-soft); }
.btn--line { background: rgba(8, 13, 31, .45); color: var(--gold-soft); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible,
button:focus-visible, label.option:focus-within { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.btn-row { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.btn-row .btn { width: 100%; }
.btn--small { min-height: 40px; padding: 6px 14px; font-size: 15px; margin: 2px 0; }

/* ---------- формы ---------- */
form .field { margin: 0 0 16px; }
label { display: block; margin: 0 0 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 18px; color: var(--ink);
  background: #fcf5e3 var(--noise); border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 2px 6px rgba(120, 90, 40, .18);
}
textarea { min-height: 0; resize: vertical; line-height: 1.4; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; font-size: 16px; line-height: 1.4; }
.check input { width: 24px; height: 24px; flex: 0 0 24px; margin: 2px 0 0; accent-color: var(--wax); }
.hint { font-size: 15px; color: var(--muted); margin: 4px 0 0; }
.error { background: rgba(129, 32, 47, .7); border: 1px solid var(--error); color: #ffe9e4; border-radius: 12px;
         padding: 12px 14px; margin: 0 0 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin: 0 0 8px; color: var(--gold-soft); }
.option { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line);
          border-radius: 12px; margin: 0 0 8px; cursor: pointer; background: rgba(16, 26, 56, .78); }
.option input { width: 22px; height: 22px; accent-color: var(--wax); }

/* ---------- пергамент с золотыми уголками: страница книги ---------- */
.card, .legal { position: relative; color: var(--ink); border-radius: 6px;
  background: var(--noise), radial-gradient(ellipse at 50% 0%, #fbf2dc, transparent 70%), linear-gradient(180deg, var(--parch), var(--parch-2));
  border: 1px solid #b89550;
  box-shadow: inset 0 0 0 4px rgba(246, 233, 203, .9), inset 0 0 0 5px rgba(169, 130, 60, .55), inset 0 0 34px rgba(150, 110, 45, .45),
              0 10px 28px rgba(0, 0, 0, .5), 0 0 34px rgba(255, 201, 94, .08); }
.card::before, .legal::before { content: ""; position: absolute; inset: 6px; pointer-events: none;
  background: var(--corner) top left / 30px no-repeat; }
.card::after, .legal::after { content: ""; position: absolute; inset: 6px; pointer-events: none;
  background: var(--corner) top left / 30px no-repeat; transform: rotate(180deg); }
.card { padding: 22px 20px; margin: 18px 0; }
.card a, .legal a { color: var(--wax); }
.card .btn--line { color: var(--wax); border-color: var(--wax); background: transparent; }
.card .muted, .card .hint, .legal .muted { color: var(--ink-muted); }
.card > p:first-child strong, .card > .vignette + p strong, .card__title { font-size: 19px; color: var(--wax); }
.card--dark { background: linear-gradient(180deg, var(--night-3), var(--night-2)); color: var(--text); border: 1px solid var(--line);
              box-shadow: 0 0 28px rgba(255, 201, 94, .14); }
.card--dark::before, .card--dark::after { display: none; }
.card--dark a { color: var(--gold-soft); }
.card--row { display: flex; align-items: center; gap: 14px; }
.card--row p { margin: 0; }
/* иллюстрации, вклеенные в страницу: белая бумага картинки растворяется в пергаменте */
.vignette { display: block; height: auto; mix-blend-mode: multiply; pointer-events: none; }
.vignette--top { width: 46%; margin: -6px auto 4px; }
.vignette--right { float: right; width: 118px; margin: -10px -8px 4px 8px; }
.vignette--side { width: 70px; flex: 0 0 70px; }
.vignette--fly { animation: fly 5.5s ease-in-out infinite; }
@keyframes fly { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-4px, -8px) rotate(-2deg); } }

.notice { border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; background: rgba(16, 26, 56, .78);
          border: 1px solid var(--line); }
/* окно зажглось: золотой свет и искры */
.notice--ok { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #fff5c8, var(--candle) 70%, #f0a63a);
              color: var(--ink); border-color: #e0a13a; font-size: 19px; box-shadow: 0 0 34px rgba(255, 201, 94, .55); }
.notice--ok::before, .notice--ok::after { content: "\2726"; position: absolute; color: #fff; font-size: 18px;
  animation: spark 1.8s ease-out 2 both; }
.notice--ok::before { top: 6px; right: 14px; }
.notice--ok::after { bottom: 6px; right: 46px; animation-delay: .4s; font-size: 13px; }
@keyframes spark { 0% { opacity: 0; transform: scale(.3) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(30deg); }
                   100% { opacity: 0; transform: scale(.6) rotate(60deg); } }
.notice--ok a { color: var(--wax); }
.copy { clear: both; display: flex; gap: 8px; margin-top: 10px; }
.copy input { font-size: 15px; min-width: 0; flex: 1 1 auto; }
.copy .btn { flex: 0 0 auto; padding: 12px 18px; }
ul.plain { padding-left: 20px; }
ul.plain li { margin: 0 0 6px; }

/* ---------- башня: живопись с тёмными окнами, горящие окна - плитки той же картинки поверх ---------- */
.tower { position: relative; margin: 0 -16px; background: var(--night-2);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 3.5%, #000 83%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 3.5%, #000 83%, transparent 100%); }
/* высота 3:2 к ширине отступом, а не aspect-ratio: на iOS 14 без него башня схлопнулась бы в ноль */
.tower::before { content: ""; display: block; padding-top: 150%; }
.tower__art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tower__wins { position: absolute; inset: 0; }
.tower__wins i { position: absolute; display: block; }
.tower__wins i.on { background-image: url("../img/tower-windows.jpg"); background-repeat: no-repeat;
  animation-name: lit; animation-duration: 1.1s; animation-timing-function: ease-out; animation-fill-mode: both; }
/* окно N: место на картинке, его плитка в полосе и задержка - окна загораются снизу вверх одно за другим */
.tower__wins i:nth-child(1) { left: 34.180%; top: 63.737%; width: 10.254%; height: 9.375%;
  background-size: 1174.29% 104.86%; background-position: 0.000% 0; animation-delay: .45s; }
.tower__wins i:nth-child(2) { left: 44.629%; top: 63.672%; width: 10.352%; height: 9.310%;
  background-size: 1163.21% 105.59%; background-position: 9.317% 0; animation-delay: .62s; }
.tower__wins i:nth-child(3) { left: 55.273%; top: 64.193%; width: 9.961%; height: 8.919%;
  background-size: 1208.82% 110.22%; background-position: 18.656% 0; animation-delay: .79s; }
.tower__wins i:nth-child(4) { left: 34.473%; top: 54.297%; width: 10.156%; height: 9.440%;
  background-size: 1185.58% 104.14%; background-position: 27.724% 0; animation-delay: .96s; }
.tower__wins i:nth-child(5) { left: 44.824%; top: 53.971%; width: 10.254%; height: 9.701%;
  background-size: 1174.29% 101.34%; background-position: 36.968% 0; animation-delay: 1.13s; }
.tower__wins i:nth-child(6) { left: 55.176%; top: 54.557%; width: 10.156%; height: 9.245%;
  background-size: 1185.58% 106.34%; background-position: 46.236% 0; animation-delay: 1.3s; }
.tower__wins i:nth-child(7) { left: 34.570%; top: 44.141%; width: 10.059%; height: 9.831%;
  background-size: 1197.09% 100.00%; background-position: 55.398% 0; animation-delay: 1.47s; }
.tower__wins i:nth-child(8) { left: 45.020%; top: 44.596%; width: 9.863%; height: 9.245%;
  background-size: 1220.79% 106.34%; background-position: 64.399% 0; animation-delay: 1.64s; }
.tower__wins i:nth-child(9) { left: 55.273%; top: 44.792%; width: 9.961%; height: 8.854%;
  background-size: 1208.82% 111.03%; background-position: 73.386% 0; animation-delay: 1.81s; }
.tower__wins i:nth-child(10) { left: 34.766%; top: 35.026%; width: 9.766%; height: 9.115%;
  background-size: 1233.00% 107.86%; background-position: 82.259% 0; animation-delay: 1.98s; }
.tower__wins i:nth-child(11) { left: 45.020%; top: 34.896%; width: 9.961%; height: 8.984%;
  background-size: 1208.82% 109.42%; background-position: 91.247% 0; animation-delay: 2.15s; }
.tower__wins i:nth-child(12) { left: 55.469%; top: 35.091%; width: 9.668%; height: 9.049%;
  background-size: 1245.45% 108.63%; background-position: 100.000% 0; animation-delay: 2.32s; }
/* только прозрачность: яркость плитки показала бы её прямоугольник с камнем вокруг окна */
@keyframes lit { from { opacity: 0; } to { opacity: 1; } }
/* свет в окне дышит, как живое пламя внутри; тёплый ореол ложится на камень */
.tower__wins i.on::before { content: ""; position: absolute; inset: -20% -36%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 200, 100, .42), rgba(255, 200, 100, 0)); mix-blend-mode: screen;
  animation: flick 3.4s ease-in-out infinite alternate; }
.tower__wins i.on:nth-child(3n)::before { animation-duration: 2.7s; }
.tower__wins i.on:nth-child(3n+1)::before { animation-duration: 4.1s; animation-delay: -1.2s; }
@keyframes flick { from { opacity: .5; } 50% { opacity: 1; } to { opacity: .7; } }
/* только что зажжённое окно: темнота, вспышка, волна света и искры */
.tower__wins i.on.ignite { animation-name: ignite; animation-duration: 2.6s; }
@keyframes ignite { 0%, 30% { opacity: 0; } 44% { opacity: 1; } 100% { opacity: 1; } }
.tower__wins i.ignite::after { content: ""; position: absolute; left: 50%; top: 46%; width: 340%; aspect-ratio: 1; border-radius: 50%;
  pointer-events: none; background: radial-gradient(closest-side, rgba(255, 250, 228, 1), rgba(255, 214, 120, .7) 30%, rgba(255, 190, 90, 0));
  mix-blend-mode: screen; opacity: 0; transform: translate(-50%, -50%) scale(.2);
  animation: burst 2.6s ease-out both; animation-delay: inherit; }
@keyframes burst { 0%, 28% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
                   44% { opacity: 1; transform: translate(-50%, -50%) scale(.85); }
                   100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
.tower__wins b { position: absolute; width: 14px; height: 14px; opacity: 0; background: #fff6d6;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: sparkle 2.6s ease-out both; animation-delay: inherit; }
.tower__wins b:nth-child(1) { left: -48%; top: -6%; }
.tower__wins b:nth-child(2) { right: -52%; top: 14%; width: 11px; height: 11px; }
.tower__wins b:nth-child(3) { left: -34%; bottom: 6%; width: 10px; height: 10px; }
.tower__wins b:nth-child(4) { right: -28%; top: -20%; width: 9px; height: 9px; }
@keyframes sparkle { 0%, 40% { opacity: 0; transform: scale(0) rotate(0); } 56% { opacity: 1; transform: scale(1.25) rotate(45deg); }
                     100% { opacity: 0; transform: scale(.4) rotate(100deg); } }
/* окна сверх двенадцати - звёзды над шпилем */
.tower__stars { position: absolute; top: 4%; left: 63%; padding: 1px 10px; border-radius: 999px; font-size: 16px; line-height: 1.5;
  color: var(--gold-soft); background: rgba(8, 13, 31, .6); border: 1px solid var(--line); text-shadow: 0 0 10px rgba(255, 201, 94, .85); }
.tower__stars.ignite { animation: pop 1.4s ease-out .8s both; }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@media (min-width: 640px) {
  .tower { margin: 0; border-radius: 4px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 3.5%, #000 83%, transparent 100%),
                        linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(180deg, transparent 0, #000 3.5%, #000 83%, transparent 100%),
                        linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
            mask-composite: intersect; }
}

/* ---------- тёмное стекло поверх живописи: рейтинги на главной, вход на первой странице ---------- */
.glass { position: relative; z-index: 3; margin: 0 0 18px; padding: 16px 16px 18px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, rgba(20, 30, 64, .86), rgba(9, 13, 32, .95)); border: 1px solid rgba(217, 180, 90, .6);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 236, 190, .15); }
.tower + .glass { margin-top: -24%; }
.glass p { margin: 0 0 12px; }
.glass .lead { text-align: left; }
.glass .btn { width: 100%; min-height: 48px; }
.glass .btn-row { margin: 14px 0 0; }
.ranks__week { margin: 0 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.ranks__goal { margin: 8px 0 12px; font-size: 16px; }
/* места - нарисованные ёлочные шары: 1 - золото, 2 - серебро, 3 - медь, дальше - красное стекло */
.medals { display: flex; justify-content: space-around; gap: 8px; }
.medal { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; line-height: 1.3; color: var(--muted); }
.medal b { position: relative; z-index: 0; display: flex; align-items: center; justify-content: center; width: 64px; height: 77px;
  padding-top: 15px; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; color: #4a2c06;
  text-shadow: 0 1px 0 rgba(255, 246, 210, .6); transform-origin: 50% 0; animation: sway 4.6s ease-in-out infinite alternate; }
.medal b::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/bauble-gold.png") center / contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(255, 201, 94, .5)); }
.medal:nth-child(2) b { animation-duration: 5.3s; animation-delay: -2s; }
.medal--silver b { color: #2c313c; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.medal--silver b::before { background-image: url("../img/bauble-silver.png"); filter: drop-shadow(0 0 10px rgba(205, 215, 240, .35)); }
.medal--copper b { color: #3a1905; text-shadow: 0 1px 0 rgba(255, 228, 200, .5); }
.medal--copper b::before { background-image: url("../img/bauble-copper.png"); filter: drop-shadow(0 0 10px rgba(240, 150, 90, .35)); }
.medal--glass b { color: #fff3dc; text-shadow: 0 1px 2px rgba(40, 0, 0, .8); }
.medal--glass b::before { background-image: url("../img/bauble-copper.png");
  filter: hue-rotate(-28deg) saturate(1.7) brightness(.78) drop-shadow(0 0 10px rgba(200, 40, 60, .35)); }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
/* гирлянда до первого места: сколько окон у первой, столько лампочек; мои - горят */
.lights { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 9px; margin: 12px 0 2px; padding-top: 8px; }
.lights i { position: relative; width: 14px; height: 20px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .4) 0 14%, rgba(246, 231, 196, .16) 48%, rgba(246, 231, 196, .07));
  box-shadow: inset 0 0 0 1px rgba(246, 231, 196, .2); }
/* цоколь и провод до соседней лампочки, провод провисает */
.lights i::before { content: ""; position: absolute; left: 3.5px; top: -5px; width: 7px; height: 6px; border-radius: 1.5px; background: #8a7440; }
.lights i::after { content: ""; position: absolute; left: 7px; top: -6px; width: 23px; height: 6px;
  border-bottom: 1.5px solid rgba(217, 180, 90, .6); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.lights i:last-child::after { display: none; }
.lights i.on { animation: glow 2.6s ease-in-out infinite; }
.lights i.on:nth-child(4n+1) { background: radial-gradient(circle at 36% 30%, #fff 0 14%, #ff9aa0 38%, #e0323d 80%);
  box-shadow: 0 0 9px 2px rgba(255, 80, 90, .6); }
.lights i.on:nth-child(4n+2) { background: radial-gradient(circle at 36% 30%, #fff 0 14%, #ffe28f 38%, #f0a63a 80%);
  box-shadow: 0 0 9px 2px rgba(255, 201, 94, .75); }
.lights i.on:nth-child(4n+3) { background: radial-gradient(circle at 36% 30%, #fff 0 14%, #a6efc0 38%, #2fae64 80%);
  box-shadow: 0 0 9px 2px rgba(70, 210, 120, .6); }
.lights i.on:nth-child(4n) { background: radial-gradient(circle at 36% 30%, #fff 0 14%, #b5dcff 38%, #3d8be0 80%);
  box-shadow: 0 0 9px 2px rgba(90, 160, 255, .6); }
.lights i.on:nth-child(3n) { animation-delay: -1.3s; }
@keyframes glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.3) saturate(1.15); } }

.progress { text-align: center; margin: 4px 0 6px; font-size: 21px; color: var(--gold-soft); text-shadow: 0 0 12px rgba(255, 201, 94, .3); }
.tiers { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.tiers li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px;
            border: 1px solid rgba(169, 130, 60, .5); background: rgba(255, 250, 235, .45); }
.tiers .tier__n { font-weight: 600; min-width: 74px; color: var(--wax); }
.tiers li::before { content: "\2726"; color: rgba(169, 130, 60, .7); }
/* получено: галочка, а не только цвет */
.tiers .done { background: linear-gradient(90deg, rgba(255, 201, 94, .65), rgba(255, 201, 94, .2)); border-color: var(--gold-deep); }
.tiers .done::before { content: "\2713"; color: var(--wax); font-weight: 600; }

/* ---------- вкладки и таблицы рейтинга ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.tabs a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 15px;
          background: rgba(8, 13, 31, .5); }
.tabs a.on { background: radial-gradient(ellipse at 50% 0%, #c43c50, var(--wax)); border-color: var(--gold); color: var(--gold-soft); }
/* пьедестал - нарисованная ветка с шарами: 2 - 1 - 3, цифры мест лежат на шарах, имена под ними */
.podium { margin: -10px -8px 8px; }
.podium__plate { position: relative; }
.podium__art { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.podium__n { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 30px; line-height: 1;
  color: #2c313c; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.podium__n:nth-of-type(1) { left: 16.7%; top: 78.4%; }
.podium__n:nth-of-type(2) { left: 50.1%; top: 63.7%; font-size: 42px; color: #4a2c06; text-shadow: 0 1px 0 rgba(255, 246, 210, .75); }
.podium__n:nth-of-type(3) { left: 83.3%; top: 80.8%; color: #3a1905; text-shadow: 0 1px 0 rgba(255, 228, 200, .6); }
.podium__places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; text-align: center; }
.podium__places > div { min-width: 0; }
.podium__who { font-size: 15px; line-height: 1.25; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.podium__places > div:nth-child(2) .podium__who { font-weight: 600; }
.podium__v { font-size: 13px; color: var(--ink-muted); margin: 2px 0 0; }
.board { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.board li { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px;
            border-bottom: 1px dashed rgba(169, 130, 60, .55); }
.board li:last-child { border-bottom: 0; }
.board .n { font-weight: 600; text-align: center; color: var(--wax); font-family: var(--font-display); font-size: 20px; }
.board .v { font-variant-numeric: tabular-nums; text-align: right; font-size: 18px; }
.board .v small { display: block; font-size: 12px; color: var(--ink-muted); }
.board .me { background: linear-gradient(90deg, rgba(255, 201, 94, .45), rgba(255, 201, 94, .12)); border-radius: 8px; }
.board .who small { display: block; font-size: 13px; color: var(--ink-muted); }

/* ---------- экран педагога: код всегда на белом, иначе камера не прочтёт ---------- */
.live { text-align: center; }
.live__qr { background: #fff; border-radius: 16px; padding: 12px; display: inline-block; border: 3px solid var(--gold);
            box-shadow: 0 0 0 6px rgba(8, 13, 31, .6), 0 0 40px rgba(255, 201, 94, .4); }
.live__qr svg { display: block; width: min(80vw, 380px); height: auto; }
.live__timer { font-size: 16px; color: var(--muted); margin: 10px 0 0; }
.live__bar { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 14px auto 0; max-width: 380px; }
.live__bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f0a63a, var(--candle), #fff2b3);
                  transition: width 1s linear; }
.live__count { font-family: var(--font-display); font-size: 30px; margin: 16px 0 4px; color: var(--gold-soft); }
.newcomer { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.newcomer form { display: flex; gap: 8px; }
.newcomer .btn { min-height: 44px; padding: 8px 16px; font-size: 16px; flex: 1; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
table.list th { color: var(--gold-soft); font-weight: 600; }
table.list td.num, table.list th.num { font-variant-numeric: tabular-nums; text-align: right; }
.legal table.list th { color: var(--wax); }
.legal table.list th, .legal table.list td { border-bottom-color: rgba(169, 130, 60, .5); }

/* ---------- юридические тексты: пергамент, тёмные чернила ---------- */
.legal { padding: 24px 20px; margin: 6px 0 18px; }
.legal h1 { background: none; -webkit-text-fill-color: var(--wax); color: var(--wax); filter: none; font-size: 28px; }
.legal h2 { font-size: 20px; margin: 24px 0 8px; color: var(--wax); }
.legal h2::before { color: var(--wax); }
.legal h2::after { background: linear-gradient(90deg, rgba(129, 32, 47, .35), transparent); }
.legal h3 { font-size: 18px; margin: 18px 0 6px; }
.legal ul { padding-left: 22px; margin: 0 0 14px; }
.legal li { margin: 0 0 6px; }
.legal p, .legal li { font-size: 17px; }
.legal .blank { font-style: italic; color: var(--ink-muted); }
.legal mark { background: var(--candle); color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.legal-table { min-width: 480px; }

/* ---------- плашка о cookie ---------- */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(16, 26, 56, .96); color: var(--text);
          border-top: 1px solid var(--gold); padding: 12px 16px; display: flex; gap: 12px; align-items: center;
          justify-content: center; flex-wrap: wrap; font-size: 15px; line-height: 1.35; backdrop-filter: blur(4px); }
.cookie p { margin: 0; max-width: 420px; }
.cookie .btn { min-height: 44px; padding: 8px 22px; font-size: 16px; }

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