/* ==========================================================
   MEGALAND — кастомный стиль для темы lullaby-dark (EasyDonate)
   Идея: «воксельный» сайт. Лазурит + глоустоун на глубоком
   синем «дипслейте». Ступенчатые углы, как у блоков, кнопки
   с фаской как в игровом меню, XP-полоска онлайна.
   Подключать ПОСЛЕ style.css темы.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&family=Pixelify+Sans:wght@500;600;700&display=swap');

:root {
    --ml-deep:      #0a1022;   /* дипслейт: фон страницы */
    --ml-night:     #060a17;   /* самый тёмный: футер, слоты */
    --ml-panel:     #111a36;   /* панели и карточки */
    --ml-panel-hi:  #18234a;   /* панель при наведении */
    --ml-lapis:     #274991;   /* брендовый синий */
    --ml-lapis-hi:  #4f7cff;   /* светлый лазурит */
    --ml-glow:      #ffb43a;   /* глоустоун: главный акцент */
    --ml-glow-dk:   #c97d10;
    --ml-text:      #e9eeff;
    --ml-muted:     #8e9bc4;
    --ml-px:        6px;       /* размер «пикселя» */

    --ml-font-pixel: 'Pixelify Sans', 'Onest', sans-serif;
    --ml-font-text:  'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* ступенчатые углы, как у блока */
    --ml-notch: polygon(
        0 var(--ml-px), var(--ml-px) var(--ml-px), var(--ml-px) 0,
        calc(100% - var(--ml-px)) 0, calc(100% - var(--ml-px)) var(--ml-px), 100% var(--ml-px),
        100% calc(100% - var(--ml-px)), calc(100% - var(--ml-px)) calc(100% - var(--ml-px)), calc(100% - var(--ml-px)) 100%,
        var(--ml-px) 100%, var(--ml-px) calc(100% - var(--ml-px)), 0 calc(100% - var(--ml-px))
    );
}

/* ---------- База ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--ml-font-text) !important;
    color: var(--ml-text);
    background-color: var(--ml-deep) !important;
    /* едва заметная воксельная сетка */
    background-image:
        linear-gradient(rgba(79,124,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,124,255,.045) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-font-smoothing: antialiased;
}

body .bg-elegant-dark { background-color: transparent !important; }
body .bg-elegant      { background-color: var(--ml-panel) !important; }
body .bg-elegant-night{ background-color: var(--ml-night) !important; }
.fill-elegant-dark    { fill: var(--ml-deep) !important; }

::selection { background: var(--ml-glow); color: #1a1200; }

a { transition: color .15s steps(3); }
a:hover { color: var(--ml-glow); }

:focus-visible {
    outline: 3px solid var(--ml-glow) !important;
    outline-offset: 3px;
}

/* скроллбар */
* { scrollbar-width: thin; scrollbar-color: var(--ml-lapis) var(--ml-night); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ml-night); }
::-webkit-scrollbar-thumb {
    background: var(--ml-lapis);
    border: 3px solid var(--ml-night);
}
::-webkit-scrollbar-thumb:hover { background: var(--ml-lapis-hi); }

/* ---------- Заголовки ---------- */
h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    font-family: var(--ml-font-pixel) !important;
    letter-spacing: .01em;
}

/* заголовки секций: ступенчатая «ступенька» под текстом */
section h2.h1,
section h2.h2 {
    position: relative;
    padding-bottom: 22px;
}
section h2.h1::after,
section h2.h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 72px; height: 12px;
    background:
        linear-gradient(var(--ml-glow), var(--ml-glow)) 0 6px / 48px 6px no-repeat,
        linear-gradient(var(--ml-glow), var(--ml-glow)) 24px 0 / 48px 6px no-repeat;
}
section .text-center::after,
section h2.text-center::after { left: 50%; transform: translateX(-50%); }

/* ---------- Навигация ---------- */
.navbar-main { padding-top: 18px; padding-bottom: 18px; }

.navbar-main .navbar-brand img { max-height: 44px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }

.navbar-main .nav-link {
    position: relative;
    font-weight: 600;
    color: var(--ml-text) !important;
    padding: 10px 16px !important;
}
.navbar-main .nav-link i { color: var(--ml-glow); margin-right: 8px; }
.navbar-main .nav-link::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 2px;
    height: var(--ml-px);
    background: var(--ml-glow);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s steps(5);
}
.navbar-main .nav-link:hover::after { transform: scaleX(1); }
.navbar-main .nav-link:hover { color: #fff !important; }

@media (max-width: 991.98px) {
    .navbar-main .navbar-collapse { background: var(--ml-panel) !important; }
}

/* ---------- Первый экран ---------- */
#welcome-section { position: relative; }

/* затемнение к низу, чтобы название читалось на любом фоне */
#welcome-section::after {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 25% 55%, rgba(10,16,34,.15), rgba(10,16,34,.75) 70%),
        linear-gradient(180deg, rgba(10,16,34,.35), rgba(10,16,34,.9));
    pointer-events: none;
    z-index: 1;
}
#welcome-section .container { position: relative; z-index: 2; }

/* название: «выдавленные» объёмные буквы, как логотип игры */
.shop-name {
    font-family: var(--ml-font-pixel) !important;
    font-weight: 700 !important;
    font-size: clamp(3.4rem, 10vw, 7.5rem) !important;
    line-height: .95 !important;
    letter-spacing: .02em;
    color: #fff;
    text-shadow:
        0 1px 0 #3a63c4, 0 2px 0 #3a63c4, 0 3px 0 #315aba,
        0 4px 0 #2a4fa8, 0 5px 0 #274991, 0 6px 0 #1d3a78,
        0 7px 0 #172f62, 0 8px 0 #12264f,
        0 16px 28px rgba(0,0,0,.55);
}

/* онлайн-счётчик */
.general-online {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 8px 16px;
    background: rgba(6,10,23,.7);
    clip-path: var(--ml-notch);
    box-shadow: inset 0 0 0 2px rgba(79,124,255,.35);
    font-weight: 600;
    color: var(--ml-text);
}
.general-online::before {
    content: "";
    width: 10px; height: 10px;
    background: #5dff8a;
    box-shadow: 0 0 10px #5dff8a;
    animation: ml-live 1.6s steps(2) infinite;
}
@keyframes ml-live { 50% { opacity: .25; } }

#welcome-section img.fh-300 {
    filter: drop-shadow(0 18px 0 rgba(0,0,0,.25)) drop-shadow(0 0 32px rgba(79,124,255,.35));
}

/* ---------- Серверы: XP-полоска ---------- */
.progress-wrapper { padding: 18px 20px; background: var(--ml-panel); clip-path: var(--ml-notch); box-shadow: inset 0 0 0 2px rgba(79,124,255,.22); }
.progress-wrapper .progress-info { color: var(--ml-text); font-weight: 600; }

.progress-wrapper .progress {
    height: 20px;
    padding: 3px;
    border-radius: 0 !important;
    background: var(--ml-night) !important;
    box-shadow: inset 0 0 0 2px #000 !important;
}
.progress-wrapper .progress-bar:not(.skeleton-box) {
    border-radius: 0 !important;
    background-color: transparent !important;
    /* сегменты, как у полоски опыта */
    background-image: repeating-linear-gradient(
        90deg,
        #6fa0ff 0 10px, transparent 10px 12px
    ) !important;
    box-shadow: 0 0 14px rgba(79,124,255,.55);
}

/* ---------- Поиск ---------- */
.shop-search, .input-group .form-control {
    background-color: var(--ml-panel) !important;
    color: var(--ml-text) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: inset 0 0 0 2px rgba(79,124,255,.3) !important;
    height: 46px;
}
.input-group .form-control::placeholder { color: var(--ml-muted); }
.input-group .form-control:focus {
    box-shadow: inset 0 0 0 2px var(--ml-glow) !important;
}
.input-group .input-group-text {
    border-radius: 0 !important;
    background: var(--ml-lapis) !important;
    color: #fff !important;
}

/* ---------- Карточки товаров ---------- */
.profile-card {
    filter: drop-shadow(0 6px 0 rgba(0,0,0,.35));
    transition: filter .2s, transform .2s steps(4);
}
.profile-card:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)) drop-shadow(0 0 18px rgba(255,180,58,.35));
}

.profile-card > .card {
    position: relative;
    margin-top: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(160deg, var(--ml-panel-hi), var(--ml-panel)) !important;
    clip-path: var(--ml-notch);
    box-shadow: inset 0 0 0 2px rgba(79,124,255,.25) !important;
    overflow: hidden;
}
/* верхний «слой» блока, как трава на земле, только лазуритовый */
.profile-card > .card::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0;
    height: var(--ml-px);
    background: repeating-linear-gradient(
        90deg,
        #5b8cff 0 18px, #3f6fe0 18px 24px, #5b8cff 24px 42px, #2f58b8 42px 48px
    );
    z-index: 3;
    pointer-events: none;
}

.profile-card .card-image {
    background-color: var(--ml-night) !important;
    box-shadow: inset -2px 0 0 rgba(79,124,255,.25);
}
.profile-card .card-image img { image-rendering: pixelated; }

.profile-card .card-title {
    font-family: var(--ml-font-pixel) !important;
    color: #fff;
}
.profile-card .card-footer h6,
.profile-card .card-footer .price {
    font-family: var(--ml-font-pixel) !important;
    color: var(--ml-glow);
    font-size: 1.15rem;
    letter-spacing: .02em;
}

/* заглушки загрузки */
.skeleton-box { background-color: #1b2850 !important; border-radius: 0 !important; }

/* ---------- Кнопки: фаска как в игровом меню ---------- */
.btn {
    font-family: var(--ml-font-pixel);
    font-weight: 600;
    letter-spacing: .02em;
    border: 0 !important;
    border-radius: 0 !important;
    clip-path: var(--ml-notch);
    transition: transform .1s steps(2), filter .15s;
}

.btn-primary,
.btn-success,
.btn-secondary {
    color: #231500 !important;
    background-color: var(--ml-glow) !important;
    box-shadow:
        inset 4px 4px 0 rgba(255,255,255,.45),
        inset -4px -4px 0 var(--ml-glow-dk) !important;
}
.btn-primary:hover,
.btn-success:hover,
.btn-secondary:hover {
    background-color: #ffc866 !important;
    filter: brightness(1.05);
}
/* нажатие: фаска переворачивается */
.btn-primary:active,
.btn-success:active,
.btn-secondary:active {
    transform: translateY(2px);
    box-shadow:
        inset 4px 4px 0 var(--ml-glow-dk),
        inset -4px -4px 0 rgba(255,255,255,.35) !important;
}

.btn-outline-primary,
.btn-outline-light,
.btn-dark {
    color: var(--ml-text) !important;
    background: var(--ml-panel-hi) !important;
    box-shadow:
        inset 4px 4px 0 rgba(255,255,255,.12),
        inset -4px -4px 0 rgba(0,0,0,.4) !important;
}
.btn-outline-primary:hover,
.btn-outline-light:hover,
.btn-dark:hover { background: var(--ml-lapis) !important; }

.badge { border-radius: 0 !important; font-family: var(--ml-font-pixel); }

/* ---------- Корзина (плавающая кнопка) ---------- */
.basket-button {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 68px; height: 68px;
    margin: 0 22px 22px 0;
    border-radius: 0 !important;
    background: var(--ml-glow) !important;
    color: #231500 !important;
    font-size: 1.5rem;
    clip-path: var(--ml-notch);
    box-shadow:
        inset 5px 5px 0 rgba(255,255,255,.45),
        inset -5px -5px 0 var(--ml-glow-dk) !important;
    cursor: pointer;
    transition: transform .12s steps(2);
}
.basket-button:hover { transform: translateY(-3px); color: #231500 !important; }

/* бейдж не должен обрезаться clip-path — переносим внутрь */
.basket-button .cart-counter {
    top: 4px !important; right: 4px !important;
    min-width: 24px; height: 24px;
    padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e4412f !important;
    color: #fff;
    font-size: .8rem;
    border-radius: 0 !important;
    box-shadow: 0 0 0 2px var(--ml-night);
}

/* ---------- Модальные окна ---------- */
.modal-backdrop.show { opacity: .8; background: #03060f; }

.modal-content {
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--ml-text);
    background: var(--ml-panel) !important;
    clip-path: var(--ml-notch);
    box-shadow: inset 0 0 0 2px rgba(79,124,255,.4) !important;
}
.modal-header, .modal-footer { border-color: rgba(79,124,255,.2) !important; }
.modal .close { color: var(--ml-text); text-shadow: none; opacity: .8; }
.modal .close:hover { color: var(--ml-glow); opacity: 1; }

/* ---------- Инструкция: здесь порядок действительно важен ---------- */
.main-instruction { padding-bottom: 24px; }

.main-instruction p.font-weight-bolder {
    display: inline-block;
    margin-top: 18px;
    padding: 4px 12px;
    font-family: var(--ml-font-pixel);
    font-size: 1.1rem;
    color: #231500;
    background: var(--ml-glow);
    clip-path: var(--ml-notch);
}
.main-instruction p.font-weight-bolder + p {
    margin: 8px 0 0;
    padding-left: 16px;
    max-width: 52ch;
    color: var(--ml-muted);
    line-height: 1.65;
    border-left: 4px dotted rgba(79,124,255,.45);
}

/* ---------- Футер ---------- */
.footer {
    position: relative;
    margin-top: 48px;
    color: var(--ml-muted);
}
/* верхний край в виде ряда блоков */
.footer::before {
    content: "";
    position: absolute; left: 0; right: 0; top: -12px;
    height: 12px;
    background:
        repeating-linear-gradient(90deg, var(--ml-night) 0 36px, transparent 36px 72px) 0 0 / 100% 12px no-repeat,
        repeating-linear-gradient(90deg, transparent 0 36px, var(--ml-night) 36px 72px) 0 6px / 100% 6px no-repeat;
    pointer-events: none;
}
.footer a { color: var(--ml-lapis-hi) !important; }
.footer a:hover { color: var(--ml-glow) !important; }
.footer-brand img { max-height: 36px; }

/* ---------- Адаптив ---------- */
@media (max-width: 575.98px) {
    :root { --ml-px: 4px; }
    .shop-name { text-shadow: 0 2px 0 #3a63c4, 0 4px 0 #274991, 0 6px 0 #12264f, 0 12px 20px rgba(0,0,0,.5); }
    .basket-button { width: 58px; height: 58px; margin: 0 14px 14px 0; }
}

/* ---------- Без анимаций, если человек так настроил систему ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
