/*
 * «Талисман на 2027» (/2027/, /2027/t/<код>/). Ночная палитра открытки и
 * витрины наборов: navy + золото. Козу рисует talisman.js (SVG).
 */
@font-face {
    font-family: "TlComedy";
    src: url("/tools/fonts/comedy/comedy.ttf") format("truetype");
    font-display: swap;
}

.tl {
    --tl-night: #121b2e;
    --tl-deep: #0c1424;
    --tl-slate: #465366;
    --tl-snow: #f4efe3;
    --tl-muted: #b3bccd;
    --tl-gold: #e6c46a;
    --tl-champagne: #efdaa5;
    --tl-rare: #65c1e3;
    position: relative;
    /* Одна сцена на весь экран: подвала на этих страницах нет, фон — до
       низа окна (под фиксированной шапкой сайта). */
    min-height: calc(100vh - var(--site-header-height, 64px));
    min-height: calc(100svh - var(--site-header-height, 64px));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 44px;
    padding: 32px 16px 48px;
    background:
        radial-gradient(1.6px 1.6px at 12% 18%, rgba(255, 255, 255, .7) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 32% 64%, rgba(255, 255, 255, .6) 50%, transparent 51%),
        radial-gradient(2px 2px at 76% 22%, rgba(255, 255, 255, .7) 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 88% 70%, rgba(255, 255, 255, .6) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 54% 38%, rgba(255, 255, 255, .5) 50%, transparent 51%),
        radial-gradient(1.8px 1.8px at 22% 88%, rgba(255, 255, 255, .6) 50%, transparent 51%),
        radial-gradient(1.3px 1.3px at 66% 90%, rgba(255, 255, 255, .5) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 6% 52%, rgba(255, 255, 255, .5) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 94% 44%, rgba(255, 255, 255, .5) 50%, transparent 51%),
        radial-gradient(120% 80% at 50% 0%, #22345a 0%, var(--tl-night) 55%, var(--tl-deep) 100%);
    background-color: var(--tl-deep);
    color: var(--tl-snow);
}

/* Промо-шапка (partials/_talisman_header.html.twig). */
.siteHeaderBar--talisman {
    background: linear-gradient(180deg, #1a2742 0%, #131d33 100%);
    border-bottom: 1px solid rgba(230, 196, 106, 0.4);
}

/* Меню сайта уже 1200 px — сетка «логотип + бургер»; у промо-шапки бургера нет. */
.siteHeaderBar--talisman .siteHeaderBar__inner {
    display: flex;
    grid-template-areas: none;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tlh__eyebrow {
    font: 700 12px/1 OpenSansSemiBold, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #e6c46a;
}

.tlh__links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tlh__links a,
.tlh__links a:hover,
.tlh__links a:focus {
    color: #f4efe3;
    font: 600 14px/1 OpenSansSemiBold, sans-serif;
    text-decoration: none;
}

.tlh__links a:hover {
    color: #e6c46a;
}

.tlh__links .tlh__site {
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(230, 196, 106, 0.55);
}

@media (max-width: 600px) {
    .tlh__eyebrow { display: none; }
    .tlh__links { gap: 12px; }
    .tlh__links a { font-size: 13px; }
}

/* Как это работает + пример открытки (только на /2027/). */
.tl-how {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.tl-steps {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: tl;
}

.tl-steps li {
    position: relative;
    display: grid;
    gap: 2px;
    padding-left: 44px;
    counter-increment: tl;
}

.tl-steps li::before {
    content: counter(tl);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(230, 196, 106, 0.15);
    color: var(--tl-gold);
    font: 700 14px/1 OpenSansSemiBold, sans-serif;
}

.tl-steps b {
    font-size: 16px;
}

.tl-steps span {
    font-size: 14px;
    line-height: 1.45;
    color: var(--tl-muted);
}

.tl-sample {
    display: grid;
    gap: 8px;
    margin: 0;
}

.tl-sample img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    transform: rotate(-2deg);
}

.tl-sample figcaption {
    font-size: 13px;
    color: var(--tl-muted);
    text-align: center;
}

@media (max-width: 767px) {
    .tl-how { grid-template-columns: minmax(0, 1fr); }
}


.tl [hidden] {
    display: none !important;
}

.tl-stage {
    max-width: 460px;
    margin: 0 auto;
}

.tl-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.tl-eyebrow {
    margin: 0;
    font-size: 12px;
    font-family: OpenSansSemiBold, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tl-gold);
}

.tl-title {
    margin: 0;
    font: 400 48px/1.05 "TlComedy", "Comic Sans MS", cursive;
    color: var(--tl-snow);
    text-wrap: balance;
}

.tl-title b {
    font-weight: 400;
    color: var(--tl-gold);
}

.tl-title--sm {
    font-size: 36px;
}

.tl-lead {
    margin: 0;
    /* Две строки на компьютере, а не «четверостишие» (замечание владельца). */
    max-width: 46ch;
    text-wrap: balance;
    font-size: 16px;
    line-height: 1.5;
    color: #d3d9e5;
}

.tl-nobr {
    white-space: nowrap;
}

.tl-fine {
    margin: 0;
    font-size: 13px;
    color: var(--tl-muted);
}

.tl-error {
    color: #ff9c8f;
}

.tl-demo {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
}

.tl-demo span {
    display: block;
    width: 96px;
}

.tl-demo span:nth-child(2) {
    width: 124px;
}

.tl-demo svg {
    display: block;
    width: 100%;
    height: auto;
}

.tl-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
}

.tl-btn,
.tl-btn:hover,
.tl-btn:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 16px;
    border: 0;
    font: 700 16px/1.2 OpenSansSemiBold, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tl-btn--gold,
.tl-btn--gold:hover,
.tl-btn--gold:focus {
    background: var(--tl-gold);
    color: #1a1406;
    box-shadow: 0 8px 24px rgba(230, 196, 106, 0.25);
}

.tl-btn--ghost,
.tl-btn--ghost:hover,
.tl-btn--ghost:focus {
    background: transparent;
    color: var(--tl-snow);
    box-shadow: inset 0 0 0 1px #4a5b80;
}

/* Наведение — только у мыши: на телефоне :hover залипает после тапа. */
@media (hover: hover) {
    .tl-btn--gold:hover {
        background: var(--tl-champagne);
        box-shadow: 0 10px 30px rgba(230, 196, 106, 0.4);
        transform: translateY(-1px);
    }

    .tl-btn--ghost:hover {
        background: rgba(230, 196, 106, 0.08);
        box-shadow: inset 0 0 0 1px var(--tl-gold);
        transform: translateY(-1px);
    }

    .tl-link:hover {
        color: var(--tl-snow);
    }

    .tl-sheet .tl-link:hover {
        color: #1f2522;
    }

    /* Значок мессенджера светлеет и чуть подрастает. */
    .tl .sendKit__ico:hover i {
        filter: brightness(1.15);
        transform: scale(1.06);
    }

    .tl .sendKit__ico--copy:hover i {
        filter: none;
        background: #f1f3f6;
    }
}

.tl-btn:active {
    transform: translateY(1px);
}

.tl-free {
    color: var(--tl-gold);
}

.tl-btn:focus-visible,
.tl-link:focus-visible,
.tl-gift:focus-visible {
    outline: 2px solid var(--tl-gold);
    outline-offset: 2px;
}

.tl-back {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Отделена от кнопок над ней — «Вернуться» не главное действие. */
    margin-top: 16px;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--tl-muted);
    font: 600 14px/1 OpenSansSemiBold, sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tl-back:hover,
.tl-back:focus-visible {
    background: rgba(230, 196, 106, 0.14);
    color: var(--tl-gold);
}

.tl-back span {
    font-size: 16px;
}


.tl-link {
    padding: 6px;
    border: 0;
    background: none;
    color: var(--tl-muted);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Рулетка */
.tl-spinning {
    margin: 0;
    font: 400 32px/1 "TlComedy", "Comic Sans MS", cursive;
}

.tl-reel-wrap {
    position: relative;
    width: 100%;
    height: 156px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px #2b3a5e;
}

.tl-reel {
    position: absolute;
    top: 14px;
    left: 0;
    display: flex;
    gap: 12px;
    will-change: transform;
}

.tl-tile {
    flex: none;
    display: grid;
    place-items: center;
    width: 112px;
    height: 128px;
    border-radius: 16px;
    background: var(--tl-slate);
}

.tl-tile svg {
    width: 100px;
    height: 100px;
}

/* После остановки соседние плитки приглушены — взгляд на выпавшую. */
.tl-tile {
    transition: filter 0.35s, opacity 0.35s;
}

.tl-reel.is-done .tl-tile:not(.is-win) {
    filter: blur(2px);
    opacity: 0.45;
}

/* Выпавшая плитка на остановке. */
.tl-tile.is-win {
    background: #55678a;
    animation: tl-win 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes tl-win {
    50% { transform: scale(1.12); }
}

/* Снег — как в витрине наборов на главной: два слоя с разной скоростью. */
.tl::before,
.tl::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1.5px 1.5px at 120px 80px, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(2px 2px at 220px 150px, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 70px 190px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 300px 40px, rgba(236, 200, 120, 0.7), transparent);
    background-size: 340px 240px;
    opacity: 0.6;
    animation: tl-snow 26s linear infinite;
}

.tl::after {
    background-image:
        radial-gradient(3px 3px at 60px 60px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2.5px 2.5px at 260px 170px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 380px 20px, rgba(255, 255, 255, 0.6), transparent);
    background-size: 460px 320px;
    opacity: 0.5;
    animation-duration: 17s;
}

.tl > * {
    position: relative;
    z-index: 1;
}

@keyframes tl-snow {
    from { background-position: 0 0; }
    to { background-position: 60px 240px; }
}

.tl-pointer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 124px;
    transform: translateX(-50%);
    border-radius: 18px;
    box-shadow: inset 0 0 0 2px var(--tl-gold), inset 0 0 30px rgba(230, 196, 106, 0.25);
    pointer-events: none;
}

/* Результат */
.tl-result__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tl-chip {
    padding: 5px 12px;
    border-radius: 999px;
    font: 700 11px/1 OpenSansSemiBold, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tl-chip--rare {
    color: var(--tl-rare);
    box-shadow: inset 0 0 0 1px currentColor;
}

.tl-chip--gold {
    background: var(--tl-gold);
    color: #1a1406;
}

.tl-medal {
    position: relative;
    display: grid;
    place-items: center;
    /* Кольцо — тенью за пределами круга (до 9 px): отступы, чтобы чип сверху
       и подпись снизу не прилипали (замечание владельца). */
    margin: 18px 0 22px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--tl-slate);
    box-shadow: 0 0 0 7px var(--tl-night), 0 0 0 8px var(--tl-champagne);
}

.tl-medal.is-rare {
    box-shadow: 0 0 0 7px var(--tl-night), 0 0 0 9px var(--tl-rare), 0 0 40px rgba(101, 193, 227, 0.35);
}

.tl-medal.is-gold {
    box-shadow: 0 0 0 7px var(--tl-night), 0 0 0 9px var(--tl-gold), 0 0 50px rgba(230, 196, 106, 0.5);
}

.tl-medal svg {
    width: 212px;
    height: 212px;
}

.tl-pop {
    animation: tl-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes tl-pop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }
}

.tl-name {
    margin: 0;
    font: 400 46px/1 "TlComedy", "Comic Sans MS", cursive;
    color: var(--tl-snow);
}

.tl-traits {
    display: grid;
    gap: 8px;
    width: 100%;
    margin: 4px 0 0;
    text-align: left;
}

.tl-trait {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.tl-trait dt {
    font: 700 11px/1.3 OpenSansSemiBold, sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tl-gold);
}

.tl-trait dd {
    margin: 2px 0 0;
    font-size: 15.5px;
    line-height: 1.4;
}

.tl-make {
    width: 100%;
    margin: 0;
}

.tl-make .tl-btn {
    width: 100%;
}

.tl-make__note {
    margin: 8px 0 0;
    color: var(--tl-muted);
    font-size: 12.5px;
    line-height: 1.4;
    text-align: center;
}

.tl-actions {
    display: grid;
    gap: 8px;
    width: 100%;
    /* Отделены от характеристик отступом и тонкой линией — иначе сливаются
       (замечание владельца, дважды). */
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(230, 196, 106, 0.18);
}

/* Подарок */
.tl-gift {
    width: 180px;
    height: 180px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.tl-gift svg {
    width: 100%;
    height: 100%;
    animation: tl-wiggle 2.2s ease-in-out infinite;
    transform-origin: 50% 90%;
}

@keyframes tl-wiggle {
    0%, 70%, 100% { transform: rotate(0); }
    76% { transform: rotate(-6deg); }
    84% { transform: rotate(5deg); }
    92% { transform: rotate(-3deg); }
}

/* Лист «Поделиться» */
.tl-sheet {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 8, 16, 0.6);
}

.tl-sheet__box {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 520px;
    padding: 18px;
    border-radius: 20px;
    /* С превью чата окно высокое — на низком экране прокручивается. */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: #f6f3ec;
    color: #1d2333;
}

.tl-sheet__title {
    margin: 0;
    font: 700 15px/1.3 OpenSansSemiBold, sans-serif;
}

.tl-chat {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 12px;
    border-radius: 14px;
    background: #e6ebe8;
}

.tl-chat__bubble {
    display: grid;
    gap: 6px;
    justify-self: end;
    width: 88%;
    padding: 8px;
    border-radius: 12px 12px 4px 12px;
    background: #dcf5e2;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.tl-chat__text {
    margin: 0;
    padding: 0 4px;
    font-size: 13.5px;
    line-height: 1.4;
    word-break: break-word;
}

.tl-chat__url {
    color: #1a73c8;
}

.tl-chat__card {
    display: grid;
    gap: 2px;
    padding: 0 0 4px 8px;
    border-left: 3px solid #13803b;
}

.tl-chat__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    margin-bottom: 4px;
    border-radius: 8px;
    background: #0c1424;
    object-fit: cover;
}

.tl-chat__site {
    font-size: 11.5px;
    color: #13803b;
}

.tl-chat__title {
    font: 700 13px/1.3 OpenSansSemiBold, sans-serif;
}

.tl-chat__desc {
    font-size: 12.5px;
    line-height: 1.35;
    color: #3d4550;
}

.tl-chat__time {
    justify-self: end;
    font-size: 10.5px;
    color: #66706b;
}

.tl-chat__caption {
    font-size: 12px;
    color: #66706b;
    text-align: center;
}

.tl-sheet__icons {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 4px;
}

.tl-sheet .tl-link {
    color: #5b6477;
}

.tl .sendKit__ico,
.tl .sendKit__ico:hover,
.tl .sendKit__ico:focus {
    display: grid;
    grid-template-rows: 46px auto;
    justify-items: center;
    gap: 5px;
    color: #1f2522;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

.tl .sendKit__ico i {
    display: grid;
    transition: filter 0.2s, transform 0.2s, background 0.2s;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
}

.tl .sendKit__ico--tg i { background: #2aabee; }
.tl .sendKit__ico--wa i { background: #25d366; }
.tl .sendKit__ico--vk i { background: #0077ff; }
.tl .sendKit__ico--ok i { background: #f7931e; }
.tl .sendKit__ico--max i { background: linear-gradient(135deg, #3d8bff, #8a3dff); }
.tl .sendKit__ico--copy i {
    background: #fff;
    color: #1f2522;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tl-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 420px) {
    .tl-title { font-size: 40px; }
    .tl-medal { width: 196px; height: 196px; }
    .tl-medal svg { width: 188px; height: 188px; }
    .tl-sheet__icons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .tl-pop, .tl-gift svg, .tl::before, .tl::after, .tl-tile.is-win { animation: none; }
}

/* Широкий экран — крупнее (в конце файла: иначе базовые правила перебивают). */
@media (min-width: 900px) {
    .tl-stage { max-width: 520px; }
    .tl-title { font-size: 64px; }
    .tl-demo span { width: 128px; }
    .tl-demo span:nth-child(2) { width: 168px; }
}

/* Рулетка на широком экране — во всю ширину сцены, плитки крупнее: в
   колонке 520 px прокрутка была мелкой и «мелькала» (замечание владельца). */
@media (min-width: 900px) {
    .tl-screen[data-tl-spin] { width: min(980px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
    .tl-reel-wrap { height: 250px; border-radius: 28px; }
    .tl-reel { top: 20px; gap: 18px; }
    .tl-tile { width: 180px; height: 210px; border-radius: 24px; }
    .tl-tile svg { width: 164px; height: 164px; }
    .tl-pointer { width: 196px; border-radius: 28px; }
    .tl-spinning { font-size: 44px; }
    /* Абзац шире колонки рулетки (520 px) — две строки, а не четыре. */
    .tl-lead { width: min(660px, calc(100vw - 48px)); max-width: none; font-size: 17px; }
}

/* Шесть значков в ряд на узком экране не влезают — по три. */
@media (max-width: 480px) {
    .tl-sheet__icons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 4px;
    }
}
