/* Iga3D Mini App — фирменный стиль: мягкая глубина, живые переходы, нативная тема Telegram */

:root {
    /* Тема берётся из Telegram, фирменный синий — свой, из логотипа */
    --bg:     var(--tg-theme-bg-color, #ffffff);
    --bg-2:   var(--tg-theme-secondary-bg-color, #f1f3f6);
    --text:   var(--tg-theme-text-color, #14171a);
    --hint:   var(--tg-theme-hint-color, #8a949e);
    --link:   var(--tg-theme-link-color, #0064d2);

    --brand:      #0064d2;
    --brand-2:    #4d9bff;
    --brand-deep: #004ea4;
    --on-brand:   #ffffff;
    --gold:       #e8a83c;
    --danger:     #e23b3b;

    --grad-brand: linear-gradient(135deg, var(--brand-deep), var(--brand) 55%, #2a83ee);

    /* Поверхности и разделители выводим из темы, чтобы работало и в тёмной */
    --card:  color-mix(in srgb, var(--bg-2) 88%, var(--bg));
    --card-2: var(--bg-2);
    --line:  color-mix(in srgb, var(--text) 9%, transparent);
    --line-soft: color-mix(in srgb, var(--text) 5%, transparent);
    --hi:    rgba(255, 255, 255, .65);           /* верхний блик карточек */
    --shadow:       0 10px 30px -14px rgba(16, 24, 40, .28);
    --shadow-lg:    0 22px 50px -22px rgba(16, 24, 40, .38);
    --shadow-press: 0 3px 10px -4px rgba(16, 24, 40, .3);
    --glow-a: .16;                                /* яркость фонового свечения */

    --radius:    20px;
    --radius-sm: 14px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Тёмная тема: блики и тени ведут себя иначе */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --hi: rgba(255, 255, 255, .06);
        --shadow:       0 12px 32px -16px rgba(0, 0, 0, .8);
        --shadow-lg:    0 26px 56px -24px rgba(0, 0, 0, .9);
        --shadow-press: 0 3px 12px -4px rgba(0, 0, 0, .7);
        --glow-a: .24;
    }
}
html[data-theme="dark"] {
    --hi: rgba(255, 255, 255, .06);
    --shadow:       0 12px 32px -16px rgba(0, 0, 0, .8);
    --shadow-lg:    0 26px 56px -24px rgba(0, 0, 0, .9);
    --shadow-press: 0 3px 12px -4px rgba(0, 0, 0, .7);
    --glow-a: .24;
}
html[data-theme="light"] {
    --hi: rgba(255, 255, 255, .65);
    --shadow:       0 10px 30px -14px rgba(16, 24, 40, .28);
    --shadow-lg:    0 22px 50px -22px rgba(16, 24, 40, .38);
    --shadow-press: 0 3px 10px -4px rgba(16, 24, 40, .3);
    --glow-a: .16;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 16px;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---------- Фоновое свечение ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient .glow { position: absolute; border-radius: 50%; filter: blur(70px); }
.ambient .g1 {
    top: -180px; left: 50%; transform: translateX(-50%);
    width: 460px; height: 460px;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 68%);
    opacity: var(--glow-a);
}
.ambient .g2 {
    bottom: -220px; right: -120px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, color-mix(in srgb, var(--gold) 45%, transparent), transparent 70%);
    opacity: calc(var(--glow-a) * .7);
}

/* ---------- Фирменный знак ---------- */
.brand-mark {
    display: block;
    width: 100%; height: 100%;
    background: url("assets/logo-light.png") center / contain no-repeat;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .brand-mark { background-image: url("assets/logo-dark.png"); }
}
html[data-theme="dark"] .brand-mark { background-image: url("assets/logo-dark.png"); }
html[data-theme="light"] .brand-mark { background-image: url("assets/logo-light.png"); }

/* ---------- 3D-куб ---------- */
.cube {
    width: 68px; height: 68px;
    position: relative;
    transform-style: preserve-3d;
    animation: spin 7s linear infinite;
    margin: 0 auto;
}
.cube .face {
    position: absolute; inset: 0;
    border: 2px solid var(--brand);
    border-radius: 9px;
    background: linear-gradient(140deg,
        color-mix(in srgb, var(--brand) 26%, transparent),
        color-mix(in srgb, var(--brand-2) 8%, transparent));
    box-shadow: 0 0 22px -6px color-mix(in srgb, var(--brand) 60%, transparent);
    opacity: 0;
    /* грани появляются одна за другой — как слои при печати */
    animation: layer .5s var(--ease) forwards;
}
.f1 { transform: rotateY(0deg)   translateZ(34px); animation-delay: .05s; }
.f2 { transform: rotateY(90deg)  translateZ(34px); animation-delay: .15s; }
.f3 { transform: rotateY(180deg) translateZ(34px); animation-delay: .25s; }
.f4 { transform: rotateY(270deg) translateZ(34px); animation-delay: .35s; }
.f5 { transform: rotateX(90deg)  translateZ(34px); animation-delay: .45s; }
.f6 { transform: rotateX(-90deg) translateZ(34px); animation-delay: .55s; }
@keyframes layer { to { opacity: .92; } }
@keyframes spin {
    from { transform: rotateX(-22deg) rotateY(0deg); }
    to   { transform: rotateX(-22deg) rotateY(360deg); }
}

/* ---------- Заставка ---------- */
.splash {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; background: var(--bg);
    z-index: 50;
    transition: opacity .5s var(--ease);
}
.splash::before {
    content: "";
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 42%, transparent), transparent 65%);
    filter: blur(50px);
    animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { opacity: .5; transform: scale(1); }
    50%      { opacity: .9; transform: scale(1.12); }
}
.splash > * { position: relative; }
.splash.fade { opacity: 0; pointer-events: none; }
.splash-title {
    margin-top: 26px;
    font-size: 30px; font-weight: 800; letter-spacing: -.02em;
    animation: rise .6s var(--ease) .3s both;
}
.splash-title span { color: var(--brand-2); }
.splash-sub {
    color: var(--hint); font-size: 13px; letter-spacing: .04em;
    animation: rise .6s var(--ease) .42s both;
}
.splash-bar {
    margin-top: 26px;
    width: 128px; height: 3px; border-radius: 99px;
    background: var(--line);
    overflow: hidden;
    animation: rise .5s var(--ease) .5s both;
}
.splash-bar i {
    display: block; height: 100%; width: 100%;
    border-radius: 99px; background: var(--grad-brand);
    transform-origin: 0 50%;
    animation: fill .85s var(--ease) forwards;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Каркас ---------- */
.app {
    padding: 20px 18px calc(30px + env(safe-area-inset-bottom));
    max-width: 560px; margin: 0 auto;
}
.app.hidden { display: none; }
.screen { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Главная: шапка ---------- */
.hero {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 18px 0 28px;
}
.hero-mark {
    width: 92px; height: 92px; padding: 20px;
    border-radius: 26px;
    background: linear-gradient(160deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg), inset 0 1px 0 var(--hi);
    animation: pop .6s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.hero-title {
    margin: 18px 0 4px;
    font-size: 32px; font-weight: 800; letter-spacing: -.03em;
    animation: rise .5s var(--ease) .08s both;
}
.hero-title .accent {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
    margin: 0; color: var(--hint); font-size: 15px;
    animation: rise .5s var(--ease) .14s both;
}
.chips {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
    margin-top: 16px;
    animation: rise .5s var(--ease) .2s both;
}
.chip {
    font-size: 12px; font-weight: 600; letter-spacing: .01em;
    padding: 6px 12px; border-radius: 99px;
    color: var(--hint);
    background: var(--card);
    border: 1px solid var(--line-soft);
}

/* ---------- Карточки-действия ---------- */
.actions { display: flex; flex-direction: column; gap: 12px; }
.card {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    width: 100%; text-align: left;
    padding: 16px 18px; border: 1px solid var(--line); cursor: pointer;
    background: linear-gradient(180deg, var(--card), var(--bg));
    color: var(--text);
    border-radius: var(--radius);
    overflow: hidden;                 /* блик ::after не должен выходить за карточку */
    box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
    animation: rise .5s var(--ease) both;
    font-family: inherit;
}
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .14s; }
.card:active { transform: scale(.975); box-shadow: var(--shadow-press); }

.card-primary {
    background: var(--grad-brand);
    color: var(--on-brand);
    border-color: transparent;
    box-shadow: 0 16px 38px -18px color-mix(in srgb, var(--brand) 90%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .28);
}
/* мягкий блик, пробегающий по главной карточке */
.card-primary::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .22) 50%, transparent 62%);
    transform: translateX(-120%);
    animation: sheen 4.5s var(--ease) 1.2s infinite;
    pointer-events: none;
}
@keyframes sheen { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }

.card-ico {
    width: 48px; height: 48px; flex: 0 0 48px;
    display: grid; place-items: center;
    font-size: 23px; border-radius: 15px;
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.card-primary .card-ico {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .26);
}
.ico-img { width: 28px; height: 28px; object-fit: contain; display: block; }
.card-primary .ico-img { filter: brightness(0) invert(1); }  /* логотип белым на синей карточке */
.card-body { flex: 1; min-width: 0; position: relative; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card-desc { font-size: 13px; opacity: .72; margin-top: 2px; }
.card-arrow { display: grid; place-items: center; opacity: .5; transition: transform .25s var(--ease); }
.card-arrow svg { width: 20px; height: 20px; }
.card:active .card-arrow { transform: translateX(4px); }

/* ссылка на отзывы */
.reviews-link {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin: 20px auto 0; padding: 11px 20px;
    background: var(--card); border: 1px solid var(--line); cursor: pointer;
    border-radius: 99px;
    color: var(--hint); font-size: 14px; font-weight: 600; font-family: inherit;
    transition: transform .2s var(--ease), color .2s var(--ease);
    animation: rise .5s var(--ease) .2s both;
}
.reviews-link:active { transform: scale(.96); color: var(--text); }
.reviews-link .star { color: var(--gold); }
.reviews-link #reviews-link-avg { color: var(--gold); font-weight: 800; }

.brand-foot {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--hint); font-size: 12px; margin-top: 32px; letter-spacing: .02em;
}
.brand-foot .brand-mark.sm { width: 34px; height: 34px; opacity: .8; }

/* ---------- Прогресс шагов ---------- */
.progress { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.progress .dot {
    flex: 1; height: 5px; padding: 0;
    border-radius: 99px;
    background: var(--line);
    transition: background .4s var(--ease);
}
.progress .dot.done { background: color-mix(in srgb, var(--brand) 45%, transparent); }
.progress .dot.active {
    background: var(--grad-brand);
    box-shadow: 0 0 14px -3px color-mix(in srgb, var(--brand) 80%, transparent);
}
.progress-label {
    text-align: center; color: var(--hint);
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    margin: 0 0 24px;
}

/* ---------- Шаги формы ---------- */
.step-title { font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 6px; }
.step-hint { color: var(--hint); font-size: 14px; margin: 0 0 20px; }
.step { animation: slideIn .4s var(--ease) both; }
.step.leaving { animation: slideOut .3s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(-24px); } }

.field-label {
    display: block;
    font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--hint); margin: 0 0 7px 2px;
}
.field {
    width: 100%; padding: 15px 16px; margin-bottom: 14px;
    font-size: 16px; color: var(--text);
    background: var(--card-2); border: 1.5px solid transparent;
    border-radius: var(--radius-sm); outline: none;
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
    font-family: inherit;
}
.field::placeholder { color: var(--hint); }
.field:focus {
    border-color: var(--brand);
    background: var(--bg);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}
.area { resize: none; line-height: 1.5; }

/* короткая подсказка под полем */
.field-note {
    margin: -8px 0 14px 2px;
    font-size: 12px; color: var(--hint);
}

/* сегмент-переключатель */
.seg {
    display: flex; gap: 4px; padding: 4px;
    background: var(--card-2); border-radius: var(--radius-sm); margin-bottom: 14px;
}
.seg-btn {
    flex: 1; padding: 11px; border: none; cursor: pointer;
    background: transparent; color: var(--hint);
    font-size: 14px; font-weight: 600; border-radius: 11px;
    transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
    font-family: inherit;
}
.seg-btn.active {
    background: var(--bg); color: var(--text);
    box-shadow: var(--shadow-press);
}

.note {
    display: flex; gap: 10px; align-items: flex-start;
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent);
    color: var(--text); font-size: 13px; line-height: 1.5;
    padding: 13px 14px; border-radius: var(--radius-sm);
    animation: rise .3s var(--ease) both;
}
.note + .note { margin-top: 10px; }
.note-ico { flex: none; font-size: 15px; line-height: 1.35; }
.note a { color: var(--link); text-decoration: none; font-weight: 700; }

.btn-ghost.wide { width: 100%; margin-top: 10px; }

/* ---------- Промокод ---------- */
.promo { margin-top: 18px; }
.promo-row { display: flex; gap: 10px; align-items: stretch; }
.promo-row .field {
    flex: 1; margin-bottom: 0;
    text-transform: uppercase; letter-spacing: .06em;
}
.promo-row .field::placeholder { text-transform: none; letter-spacing: normal; }
.promo-apply {
    flex: 0 0 auto; padding: 0 18px;
    font-size: 14px; font-weight: 700; white-space: nowrap;
    border-radius: var(--radius-sm);
}
.promo-apply:disabled { opacity: .5; }
.promo-msg {
    margin-top: 10px; padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px; line-height: 1.4;
    display: flex; align-items: center; gap: 8px;
    animation: rise .3s var(--ease) both;
}
.promo-msg.ok {
    background: color-mix(in srgb, #2bb673 14%, transparent);
    color: #1fa363;
    border: 1px solid color-mix(in srgb, #2bb673 26%, transparent);
}
.promo-msg.err {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
}
.promo.is-applied .field { border-color: color-mix(in srgb, #2bb673 55%, transparent); }

/* ---------- Загрузчик фото ---------- */
.uploader { margin-top: 12px; animation: rise .3s var(--ease) both; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.thumbs:empty { display: none; }
.thumb {
    position: relative; aspect-ratio: 1 / 1;
    border-radius: 13px; overflow: hidden;
    background: var(--card-2); border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-press);
    animation: pop .3s var(--ease) both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; padding: 0; border: none; cursor: pointer;
    display: grid; place-items: center;
    border-radius: 50%; background: rgba(10, 14, 20, .68); color: #fff;
    font-size: 15px; line-height: 1;
    backdrop-filter: blur(4px);
}
.thumb-x:active { transform: scale(.9); }

/* ---------- Кнопки ---------- */
.nav-row {
    display: flex; gap: 12px; margin-top: 26px;
    position: sticky; bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 5;
}
/* липкая панель действий не должна «висеть» на просвечивающем фоне */
#screen-new .nav-row, #screen-buy .nav-row, #screen-product-edit .nav-row {
    padding: 10px 0;
    background: linear-gradient(180deg, transparent, var(--bg) 35%);
}
.review-form .nav-row { position: static; margin-top: 18px; }

.btn-solid, .btn-ghost, .btn-danger {
    flex: 1; padding: 15px; border: none; cursor: pointer;
    font-size: 16px; font-weight: 700; border-radius: var(--radius-sm);
    font-family: inherit;
    transition: transform .2s var(--ease), opacity .2s, box-shadow .2s var(--ease);
}
.btn-solid {
    background: var(--grad-brand); color: var(--on-brand);
    box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--brand) 90%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-ghost {
    background: var(--card-2); color: var(--text);
    border: 1px solid var(--line-soft);
}
.btn-solid:active, .btn-ghost:active, .btn-danger:active { transform: scale(.97); }
.btn-solid.wide { width: 100%; margin-top: 22px; }

/* ---------- Экран успеха ---------- */
#screen-done .done { text-align: center; padding: 34px 10px; animation: rise .5s var(--ease) both; }
.done-badge {
    width: 118px; height: 118px; margin: 0 auto;
    display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%);
    animation: pop .5s var(--ease) both;
}
.done-title { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 8px; }
.done-sub { color: var(--hint); line-height: 1.55; margin: 0; }
.done-sub b { color: var(--text); }
.check { width: 92px; height: 92px; }
.check-c { stroke: var(--brand); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s var(--ease) forwards; }
.check-m { stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .4s .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Шапка экрана ---------- */
/* Своя кнопка «Назад» рядом с заголовком: нативная кнопка Telegram видна
   не во всех клиентах, а вне Telegram её нет вовсе. */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 12px;
    margin: -20px -18px 18px;
    padding: 14px 18px 12px;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
}
.topbar-title {
    flex: 1; min-width: 0; margin: 0;
    font-size: 20px; font-weight: 800; letter-spacing: -.025em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
    width: 38px; height: 38px; flex: none; padding: 0;
    display: grid; place-items: center; cursor: pointer;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card); color: var(--text);
    transition: transform .2s var(--ease), background .2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.9); background: var(--card-2); }

.screen-h { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 20px; }

/* ---------- Список заказов ---------- */
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order {
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
    animation: rise .45s var(--ease) both;
}
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.order-num { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.order-text { font-size: 15px; line-height: 1.45; }
.order-meta {
    display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px;
    color: var(--hint); font-size: 13px;
}
.order-meta > span, .order-meta > a {
    background: var(--card-2); border: 1px solid var(--line-soft);
    padding: 5px 10px; border-radius: 99px;
}
.order-meta b { color: var(--text); font-weight: 700; }
.order-link { color: var(--link); text-decoration: none; font-weight: 600; }

.badge {
    font-size: 12px; font-weight: 700; padding: 5px 11px;
    border-radius: 99px; white-space: nowrap;
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    color: var(--brand);
}
.badge.s-new      { background: color-mix(in srgb, #8a949e 18%, transparent); color: #7b8492; }
.badge.s-accepted { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.badge.s-printing { background: color-mix(in srgb, #f0a93c 20%, transparent); color: #d98b1a; }
.badge.s-delivery { background: color-mix(in srgb, #7b61ff 18%, transparent); color: #7b61ff; }
.badge.s-done     { background: color-mix(in srgb, #2bb673 20%, transparent); color: #1fa363; }
.badge.s-rejected { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* статусная полоса прогресса */
.track { display: flex; gap: 4px; margin-top: 14px; }
.track i {
    flex: 1; height: 5px; border-radius: 99px;
    background: var(--line);
    transition: background .5s var(--ease), box-shadow .5s var(--ease);
}
.track i.on { background: var(--grad-brand); }
.track i.on:last-of-type { box-shadow: 0 0 12px -2px color-mix(in srgb, var(--brand) 80%, transparent); }

/* ---------- Пустые состояния ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--hint); animation: rise .5s var(--ease) both; }
.empty-ico {
    width: 88px; height: 88px; margin: 0 auto 18px;
    display: grid; place-items: center;
    font-size: 40px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 14%, transparent), transparent 72%);
}
.empty p { line-height: 1.55; margin: 0 0 22px; }
.empty .btn-solid { flex: none; padding: 14px 28px; }

/* ---------- Скелетоны ---------- */
.skeleton {
    height: 118px; border-radius: var(--radius);
    background: var(--card-2);
    position: relative; overflow: hidden;
}
.shop-grid .skeleton { height: auto; aspect-ratio: 3 / 4; }
.reviews-list .skeleton { height: 96px; }
.skeleton::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent,
                color-mix(in srgb, var(--text) 7%, transparent), transparent);
    transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Магазин: витрина ---------- */
.btn-add {
    width: 42px; height: 42px; flex: 0 0 42px; border: none; cursor: pointer;
    border-radius: 13px; background: var(--grad-brand); color: var(--on-brand);
    font-size: 23px; line-height: 1; display: grid; place-items: center;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 90%, transparent);
    transition: transform .2s var(--ease);
}
.btn-add:active { transform: scale(.92); }

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcard {
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    cursor: pointer; box-shadow: var(--shadow);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
    animation: rise .45s var(--ease) both;
}
.pcard:active { transform: scale(.97); box-shadow: var(--shadow-press); }
.pcard.is-off { opacity: .55; }
.pcard-img { position: relative; aspect-ratio: 4 / 3; background: var(--card-2); overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-noimg {
    width: 100%; height: 100%; display: grid; place-items: center;
    font-size: 34px; opacity: .45;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
}
.pcard-noimg.big { font-size: 64px; }
.pcard-disc {
    position: absolute; top: 8px; left: 8px;
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
    padding: 4px 9px; border-radius: 99px;
    box-shadow: 0 6px 14px -6px rgba(226, 59, 59, .9);
}
.pcard-hidden {
    position: absolute; top: 8px; right: 8px;
    background: rgba(10, 14, 20, .66); color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 9px; border-radius: 99px; backdrop-filter: blur(4px);
}
.pcard-body { padding: 11px 12px 14px; }
.pcard-title {
    font-size: 14px; font-weight: 700; line-height: 1.32;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-price { margin-top: 7px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.price-new { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.price-old { font-size: 12px; color: var(--hint); text-decoration: line-through; }
.price-badge { font-size: 11px; font-weight: 800; color: var(--danger); }

/* ---------- Магазин: карточка товара ---------- */
.gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    border-radius: var(--radius); background: var(--card-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    scrollbar-width: none; -ms-overflow-style: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; }
.gallery .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; min-height: 6px; }
.gallery-dots i {
    width: 6px; height: 6px; border-radius: 99px;
    background: color-mix(in srgb, var(--hint) 40%, transparent);
    transition: width .3s var(--ease), background .3s var(--ease);
}
.gallery-dots i.on { background: var(--brand); width: 20px; }
.prod-info { padding: 14px 2px 0; }
.prod-title { font-size: 23px; font-weight: 800; letter-spacing: -.025em; margin: 6px 0 10px; }
.prod-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.prod-price .price-new { font-size: 26px; }
.prod-price .price-old { font-size: 15px; }
.prod-price .price-badge { font-size: 14px; }
.prod-desc { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; margin: 0; }

#btn-buy-product {
    position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 5;
}
.admin-bar { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.admin-bar .btn-ghost, .admin-bar .btn-danger { min-width: 116px; padding: 13px; font-size: 15px; }
.btn-danger {
    background: color-mix(in srgb, var(--danger) 14%, transparent);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
}

/* форма товара */
.price-row { display: flex; gap: 12px; }
.price-col { flex: 1; min-width: 0; }

/* мини-превью товара на экране покупки */
.buy-product {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px; margin-bottom: 20px;
    box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
}
.buy-thumb {
    width: 74px; height: 56px; flex: 0 0 74px;
    border-radius: 12px; overflow: hidden; background: var(--card-2);
}
.buy-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.buy-thumb .pcard-noimg { font-size: 24px; }
.buy-pinfo { flex: 1; min-width: 0; }
.buy-ptitle {
    font-size: 15px; font-weight: 700; margin-bottom: 4px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Тост ---------- */
.toast {
    position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
    transform: translate(-50%, 30px); opacity: 0;
    background: rgba(16, 20, 28, .92); color: #fff;
    padding: 13px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    pointer-events: none; z-index: 80;
    transition: transform .35s var(--ease), opacity .35s var(--ease);
    max-width: 82vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Отзывы ---------- */
.rating-summary {
    display: flex; align-items: center; gap: 18px;
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px; margin-bottom: 16px;
    box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
}
.rating-big {
    font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.04em;
    background: linear-gradient(140deg, var(--gold), #f5d089);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rating-meta { flex: 1; min-width: 0; }
.rating-stars { font-size: 19px; letter-spacing: 2px; color: color-mix(in srgb, var(--hint) 42%, transparent); }
.rating-stars .on { color: var(--gold); }
.rating-count { color: var(--hint); font-size: 13px; margin-top: 5px; }

#review-cta { margin-bottom: 18px; }
#review-cta .btn-solid.wide { margin-top: 0; }

.review-form {
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px; margin-bottom: 18px;
    box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
    animation: rise .35s var(--ease) both;
}
.review-form .step-title { font-size: 19px; margin-bottom: 14px; }
.star-pick { display: flex; gap: 8px; margin-bottom: 16px; }
.star-pick button {
    flex: 1; background: var(--card-2); border: 1px solid var(--line-soft); cursor: pointer;
    font-size: 28px; line-height: 1; padding: 9px 0; border-radius: 13px;
    color: color-mix(in srgb, var(--hint) 42%, transparent);
    transition: transform .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.star-pick button.on {
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    border-color: color-mix(in srgb, var(--gold) 26%, transparent);
}
.star-pick button:active { transform: scale(1.12); }

.reviews-list { display: flex; flex-direction: column; gap: 11px; }
.review {
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 17px;
    box-shadow: var(--shadow);
    animation: rise .4s var(--ease) both;
}
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-author { font-weight: 700; font-size: 15px; }
.review-stars { font-size: 14px; letter-spacing: 1px; color: color-mix(in srgb, var(--hint) 42%, transparent); flex: 0 0 auto; }
.review-stars .on { color: var(--gold); }
.review-text { margin-top: 9px; line-height: 1.55; font-size: 14px; }
.review-date { margin-top: 9px; color: var(--hint); font-size: 12px; }

/* ---------- Меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .cube .face { opacity: .92; }
}

/* ---------- Трансляция печати ---------- */
.card-live {
    background: linear-gradient(135deg, #b3202e, #e0333f 55%, #ff5a5f);
    color: #fff; border-color: transparent;
    box-shadow: 0 16px 38px -18px rgba(224,51,63,.9), inset 0 1px 0 rgba(255,255,255,.28);
}
.card-live .card-ico { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.26); }
/* мигающая точка «в эфире» */
.card-live .card-title::after {
    content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px;
    border-radius: 50%; background: #fff; vertical-align: middle;
    animation: livedot 1.4s ease-in-out infinite;
}
@keyframes livedot { 0%,100%{opacity:1} 50%{opacity:.25} }

.stream-stage {
    position: relative; width: 100%; aspect-ratio: 4/3;
    background: #000; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stream-img { width: 100%; height: 100%; object-fit: contain; display: block; background:#000; }
.stream-placeholder {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--hint); font-size: 14px; text-align: center; padding: 20px;
}
.stream-full {
    position: absolute; top: 10px; right: 10px;
    width: 38px; height: 38px; border: none; cursor: pointer;
    display: grid; place-items: center; border-radius: 11px;
    background: rgba(10,14,20,.55); color: #fff; backdrop-filter: blur(6px);
}
.stream-full svg { width: 20px; height: 20px; }
.stream-full:active { transform: scale(.92); }
.stream-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; gap: 14px; align-items: center;
    padding: 20px 14px 10px; color: #fff; font-size: 14px; font-weight: 700;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.6));
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.stream-overlay #ov-pct { font-size: 17px; }

.stream-cards { display: flex; gap: 10px; margin-top: 14px; }
.stat-card {
    flex: 1; text-align: center; padding: 14px 8px;
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.stat-v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat-l { font-size: 12px; color: var(--hint); margin-top: 3px; }
.stream-note { margin-top: 12px; color: var(--hint); font-size: 13px; text-align: center; min-height: 18px; }

/* полноэкранный режим: картинка во весь экран, статистика поверх снизу */
.stream-stage:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.stream-stage:fullscreen .stream-img { object-fit: contain; }

/* ---------- Админ-панель ---------- */
.admin-entry {
    display: block; width: 100%; margin: 22px 0 0;
    padding: 13px; border: 1px dashed var(--line); cursor: pointer;
    background: transparent; color: var(--hint);
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; font-family: inherit;
    transition: color .2s var(--ease), border-color .2s var(--ease);
}
.admin-entry:active { color: var(--text); border-color: var(--brand); }
.admin-h { font-size: 15px; font-weight: 800; margin: 4px 0 14px; letter-spacing: -.01em; }
.admin-streams { display: flex; flex-direction: column; gap: 12px; }
.astream {
    background: linear-gradient(180deg, var(--card), var(--bg));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow);
}
.astream-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.astream-name { font-weight: 700; font-size: 15px; }
.astream-meta { color: var(--hint); font-size: 13px; margin-top: 4px; display: flex; gap: 14px; }
.astream-meta b { color: var(--text); }
.astream-toggle {
    flex: 0 0 auto; border: none; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 11px;
    transition: transform .15s var(--ease);
}
.astream-toggle:active { transform: scale(.95); }
.astream-toggle.on  { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.astream-toggle.off { background: var(--grad-brand); color: #fff; }
