/*
 * Дополнения темы UnixMine к стилям MineSide (ms/css - без изменений): свой логотип, окна покупки на <dialog>,
 * поля формы заказа, выбор режима, документы и реквизиты в подвале, cookie. Палитра - оранжевая (стили MineSide перекрашены из красного).
 */

main { display: block; }
main:focus { outline: none; }

/* Логотип UnixMine вместо логотипа MineSide */
.header .navbar .logo .pic,
.footer > .wrapper .logo > .wrapper .pic { background-image: url(img/logo.svg?v=2); }

.header .navbar .navbar-mobile { color: #ffa726; font-size: 22px; }
.header .navbar > .navbar-wrapper > .block-center > ul > li > a > .fa { margin-right: 4px; }
.header .navbar > .navbar-wrapper > .block-center > ul > li.active > a { color: #e65100; }

.col-green { color: #43a047; }
.col-red { color: #f44336; }

/* ---------- Выбор режима (над разделами) ---------- */

.tabs > .mode-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 40px 0 0; list-style: none; }
.tabs > .mode-links > li > a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 24px;
    border-radius: 24px;
    background: #fff;
    color: #424242;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: rgba(0, 0, 0, .12) 0 1px 6px, rgba(0, 0, 0, .12) 0 1px 4px;
    transition: all 450ms cubic-bezier(.23, 1, .32, 1) 0ms;
}
.tabs > .mode-links > li > a:hover { color: #ff9800; }
.tabs > .mode-links > li.active > a { background: #ff9800; color: rgba(0, 0, 0, .7); box-shadow: inset 0 -4px 0 #e65100; }
.tabs > .mode-links .icon { width: 24px; height: 24px; background: no-repeat center / contain; }

.sale-note { margin: -10px 0 0; font-weight: 700; color: #e65100; }  /* -10px: под кнопками разделов уже есть нижний отступ */
.items > .item-id > .price s { opacity: .55; font-weight: 400; margin-right: 4px; }
.items > .item-id:focus-visible { outline: 3px solid #ff9800; outline-offset: 2px; }

/* ---------- Окна MineSide на <dialog> ---------- */

dialog.modal {
    box-sizing: border-box;
    border: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    color: inherit;
    inset: 0;
}
dialog.modal[open] { display: block; }
dialog.modal::backdrop { background: transparent; }
.modal > .wrapper > .modal-content > .modal-header .fa { margin-right: 6px; }

#buy-modal > .wrapper > .modal-content { padding: 32px 40px; }
#buy-modal .modal-body { display: grid; gap: 12px; }
#buy-modal .input-block > input { height: 52px; line-height: 52px; font-size: 18px; }
#buy-modal .modal-footer { grid-template-columns: 1fr 1fr; }
#buy-modal .modal-footer [data-buy-price] { font-style: normal; }
#buy-modal .modal-footer [data-buy-price] s { opacity: .6; font-weight: 400; margin-right: 4px; }

.field__error { display: none; margin-top: 4px; font-size: 13px; color: #c62828; text-align: center; }
.field.is-invalid > input,
.field.is-invalid .promo-row > input { box-shadow: inset 0 0 0 2px #ff9800; }
.field.is-invalid .field__error { display: block; }

.promo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.promo-row > input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    box-sizing: border-box;
    border: 0;
    border-radius: 4px;
    outline: none;
    background: #eee;
    font-size: 18px;
    text-align: center;
}
.promo-row > input:focus { box-shadow: rgba(0, 0, 0, .16) 0 3px 10px, rgba(0, 0, 0, .23) 0 3px 10px; }
.promo-row > .btn { height: 44px; }
.promo__status { display: block; min-height: 0; font-size: 13px; text-align: center; color: #757575; }
.promo__status:empty { display: none; }
.promo__status.is-ok { color: #2e7d32; }
.promo__status.is-error { color: #c62828; }

.buy-hint { margin: 0; padding: 8px 12px; border-radius: 4px; background: #fff3e0; color: #8a5a17; font-size: 13px; line-height: 1.5; text-align: center; }
.buy-hint.is-error { background: #ffebee; color: #c62828; }
.buy-note, .buy-legal { margin: 0; font-size: 12px; line-height: 1.5; color: #9e9e9e; text-align: center; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; color: #616161; text-align: left; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #ff9800; }
.check a, .buy-legal a { text-decoration: underline; }
.check__error { margin: 0; font-size: 13px; color: #c62828; text-align: center; }

/* Выбор способа оплаты */
.pay-options { display: grid; gap: 10px; }
.pay-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #eee;
    color: #212121;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 450ms cubic-bezier(.23, 1, .32, 1) 0ms;
}
.pay-option:hover { background: #fff3e0; box-shadow: inset 0 -4px 0 #ff9800; }
.pay-option__logo img { display: block; width: 96px; height: 40px; object-fit: contain; }
.pay-option__text { display: grid; }
.pay-option__title { font-weight: 700; }
.pay-option__desc { font-size: 13px; color: #757575; line-height: 1.4; }
.pay-option > .fa { font-size: 24px; color: #ff9800; }

/* ---------- Подвал: документы, реквизиты, оплата ---------- */

.footer-legal { padding-top: 20px; padding-bottom: 28px; border-top: 1px solid #e0e0e0; font-size: 13px; line-height: 1.6; color: #757575; text-align: center; }
.footer-legal__docs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; font-weight: 700; }
.footer-legal__seller { margin: 10px 0 0; }
.footer-legal__pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; margin-top: 12px; }
.footer-legal__pay .pay-logos { margin: 0; }

/* ---------- Cookie ---------- */

.cookie {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    max-width: 760px;
    margin: auto;
    padding: 16px 20px;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: rgba(0, 0, 0, .16) 0 3px 10px, rgba(0, 0, 0, .23) 0 3px 10px;
}
.cookie[hidden] { display: none; }
.cookie p { flex: 1 1 320px; margin: 0; }

@media (max-width: 767px) {
    #buy-modal > .wrapper > .modal-content { padding: 24px 20px; }
    #buy-modal .modal-footer { grid-template-columns: 1fr; }
    .tabs > .mode-links { justify-content: center; }
}

/* Кнопки разделов магазина - компактнее, чтобы помещались в один ряд */
@media (min-width: 768px) {
    .tabs .tab-links { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); grid-gap: 14px; padding: 24px 0; }
    .tabs .tab-links > li > a { grid-template-columns: 52px calc(100% - 52px); height: 52px; border-bottom-width: 5px; border-radius: 12px; }
    .tabs .tab-links > li > a > .block-left { padding: 10px; }
    .tabs .tab-links > li > a:active > .block-left,
    .tabs .tab-links > li.active > a > .block-left { padding: 12px; }
    .tabs .tab-links > li > a > .block-left > .icon { height: 32px; width: 32px; }
    .tabs .tab-links > li > a > .block-right { line-height: 42px; font-size: 17px; }
}

/* Карточки товаров: одной высоты в ряду, цена внизу, картинка занимает свободное место */
.items > .item-id { display: flex; flex-direction: column; }
.items > .item-id > .image { flex: 1 1 auto; min-height: 114px; height: auto; }
.items > .item-id > .price { margin-top: auto; flex: none; }

/* Кнопки разделов: иконка и текст по центру лицевой части кнопки (без нижней полосы) */
@media (min-width: 768px) {
    .tabs .tab-links > li > a { align-items: stretch; }
    .tabs .tab-links > li > a > .block-left,
    .tabs .tab-links > li > a:active > .block-left,
    .tabs .tab-links > li.active > a > .block-left { display: flex; align-items: center; justify-content: center; padding: 0; height: auto; }
    .tabs .tab-links > li > a > .block-right { display: flex; align-items: center; justify-content: center; line-height: 1.1; }
}
.buy-agree { margin: 0; font-size: 13px; line-height: 1.5; color: #616161; text-align: center; }
.buy-agree a { text-decoration: underline; }

/* Окно покупки: одна кнопка «Оплатить» по центру, закрытие - крестиком */
#buy-modal .modal-content { position: relative; }
#buy-modal .modal-footer { grid-template-columns: 1fr; justify-items: center; }
#buy-modal .modal-footer > div { width: 100%; max-width: 320px; }
.buy-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: none; font-size: 26px; line-height: 1; color: #9e9e9e; cursor: pointer; }
.buy-x:hover { color: #424242; }

/* Значок Discord (SVG) - по центру круглой кнопки, как шрифтовые значки рядом */
.livedrops > .start > .top > ul.links > li > a svg { display: block; margin: 9px auto 0; }

/* Цены без курсива */
.price, .price *, [data-buy-price], [data-buy-price] * { font-style: normal; }

/* Плавные переходы между страницами и разделами */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .2s ease-in-out both; }
::view-transition-new(root) { animation: page-in .36s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }

/* Карточки товаров плавно появляются при смене раздела */
.tabs > .tab-list > .tab-id.active .items > .item-id { animation: card-in .5s cubic-bezier(.22, 1, .36, 1) both; }
.items > .item-id:nth-child(2) { animation-delay: .03s; }
.items > .item-id:nth-child(3) { animation-delay: .06s; }
.items > .item-id:nth-child(4) { animation-delay: .09s; }
.items > .item-id:nth-child(5) { animation-delay: .12s; }
.items > .item-id:nth-child(6) { animation-delay: .15s; }
.items > .item-id:nth-child(n+7) { animation-delay: .18s; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }

/* Окна: плавное открытие и закрытие. Само окно (dialog) - тёмная подложка на весь экран, поэтому плавно проявляется только оно (opacity),
   а двигается и увеличивается карточка внутри: иначе по краям экрана на время анимации открывается светлая полоса страницы */
dialog.modal[open] { animation: backdrop-in .3s ease both; }
dialog.modal.is-closing { animation: backdrop-out .18s ease-in both; }
dialog.modal[open] > .wrapper > .modal-content { animation: modal-in .34s cubic-bezier(.22, 1, .36, 1) both; }
dialog.modal.is-closing > .wrapper > .modal-content { animation: modal-out .18s ease-in both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    @view-transition { navigation: none; }
}

/* Место под полосу прокрутки занято всегда: страница не ездит вбок между короткими и длинными страницами */
html { scrollbar-gutter: stable; }

/* Полоса прокрутки в стиле сайта: узкая, закруглённая, без стрелок */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #ececec; }
::-webkit-scrollbar-thumb { background: #fb8c00; border: 3px solid #ececec; border-radius: 8px; min-height: 48px; }
::-webkit-scrollbar-thumb:hover { background: #ef6c00; }
::-webkit-scrollbar-thumb:active { background: #e65100; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: #ececec; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: #fb8c00 #ececec; }
}

/* Курсор вне белого окна - обычная стрелка (подложка закрывает окно кликом, но на кнопку не похожа) */
dialog.modal, dialog.modal > .wrapper { cursor: default; }
dialog.modal > .wrapper > .modal-content { cursor: auto; }

/* Правила по режимам: быстрые ссылки и метка режима у раздела */
.rules__nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.rules__nav a { padding: 10px 18px; border-radius: 12px; background: #fb8c00; color: rgba(0, 0, 0, .75); font-weight: 700; text-transform: uppercase; box-shadow: inset 0 -4px 0 #e65100, rgba(0, 0, 0, .16) 0 3px 10px; transition: transform .2s, box-shadow .2s; }
.rules__nav a:hover { transform: translateY(-2px); text-decoration: none; }
.rules__tag { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 6px; background: #fb8c00; color: rgba(0, 0, 0, .75); font-size: 12px; font-weight: 700; vertical-align: middle; }
.rules__section { scroll-margin-top: 20px; }

/* Прокрутка к якорям (кнопки на странице правил) - плавная */
html { scroll-behavior: smooth; }

.rules__nav { justify-content: center; }
.rules__penalty { white-space: normal; }

.rules__nav { margin: 24px 0 28px; }

/* Плашка режима - в строке с заголовком раздела, по центру высоты текста */
.rules__tag { display: inline-block; margin: 0 0 0 10px; vertical-align: middle; position: relative; top: -2px; }

/* Окно «Играть» (div-окно MineSide): плавно появляется и исчезает; пока закрыто - не принимает мышь,
   а пока открыто - перекрывает страницу целиком, кнопки под подложкой не реагируют на наведение */
div.modal { display: block; visibility: hidden; opacity: 0; pointer-events: none; cursor: default; transition: opacity .25s ease, visibility 0s linear .25s; }
div.modal.active { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .25s ease; }
div.modal > .wrapper > .modal-content { transform: translateY(18px) scale(.97); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
div.modal.active > .wrapper > .modal-content { transform: none; }

/* Окно «Играть»: крестик, как у окна покупки */
div.modal > .wrapper > .modal-content { position: relative; }

/* Окно результата оплаты: одна широкая кнопка по центру */
#result-modal .modal-footer { grid-template-columns: 1fr; justify-items: center; }
#result-modal .modal-footer > div { width: 100%; max-width: 320px; }
#result-modal .modal-body a { text-decoration: underline; font-weight: 700; }

/* Телефон: окна покупки и оплаты по ширине экрана (dialog по умолчанию content-box: 100% + поля уезжали вправо), заголовок не под крестиком */
@media (max-width: 575px) {
    dialog.modal { padding: 10px; }
    dialog.modal > .wrapper { padding: 0; }
    dialog.modal > .wrapper > .modal-content > .modal-header { padding-right: 32px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
    #buy-modal > .wrapper > .modal-content, #pay-modal > .wrapper > .modal-content, #result-modal > .wrapper > .modal-content { padding: 20px 16px; }
    #buy-modal .input-block > input, .promo-row > input { height: 48px; line-height: 48px; font-size: 16px; }
    .promo-row { grid-template-columns: minmax(0, 1fr) auto; }
    .buy-x { top: 6px; right: 6px; }
    div.modal > .wrapper { padding: 0; }
    div.modal > .wrapper > .modal-content { padding: 20px 16px; }
}

/* Телефон и планшет: логотип и название проекта видны всегда, меню и онлайн - под кнопкой «три полоски» (как в MineSide) */
@media (max-width: 991px) {
    .header .navbar { padding-bottom: 10px; min-height: 0; }
    .header .navbar > .navbar-wrapper { display: grid; grid-template-columns: 100%; min-height: 0; grid-gap: 10px; }
    .header .navbar > .navbar-wrapper > .block-left { padding: 8px 64px 0 0; min-height: 64px; display: flex; align-items: center; }
    .header .navbar > .navbar-wrapper > .block-center,
    .header .navbar > .navbar-wrapper > .block-right { display: none; }
    .header .navbar.active > .navbar-wrapper > .block-center,
    .header .navbar.active > .navbar-wrapper > .block-right { display: block; }
    .header .navbar > .navbar-wrapper .logo { grid-template-columns: 48px minmax(0, 1fr); grid-gap: 14px; }
    /* Заголовок «Последние покупки» выступает над блоком на 52px: места под ним хватает и при раскрытом меню (не налезает на онлайн) */
    .livedrops { padding-top: 68px; }
    .header .navbar.active { padding-bottom: 16px; }
    .header .navbar .monitoring .copy-clipboard { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Кнопки соцсетей: три одинаковых круглых кнопки в ряд, значки строго по центру */
@media (max-width: 767px) {
    .livedrops > .start > .top > ul.links { display: flex; justify-content: center; gap: 16px; margin: 0; padding: 0; }
    .livedrops > .start > .top > ul.links > li,
    .livedrops > .start > .top > ul.links > li:last-child { text-align: center; flex: 0 0 auto; }
    .livedrops > .start > .top > ul.links > li > a {
        display: flex; align-items: center; justify-content: center;
        width: 48px; height: 48px; border-radius: 24px; line-height: 1; font-size: 22px;
    }
    .livedrops > .start > .top > ul.links > li > a svg { margin: 0; }
}
