:root {
    /* Приложение спроектировано под ширину телефона — на широких экранах
       (например, в полноэкранном режиме Telegram на ПК) центрируем его в
       этой ширине вместо растягивания на весь экран, иначе сетки карточек,
       нижняя навигация и модалки-шторки становятся нелепо широкими. */
    --app-max-width: 480px;
    /* Отступы под "родную" плавающую панель Telegram (крестик/название/меню)
       и вырезы устройства в полноэкранном режиме — значения подставляет
       applyTelegramSafeArea() в app.js через tg.safeAreaInset. По умолчанию
       0, пока Telegram их не прислал (или если открыто не в Telegram). */
    --tg-safe-top: 0px;
    --tg-safe-bottom: 0px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    overflow-x: hidden;
    width: 100%;
    background-color: #0f0f0f;
}

body {
    background-color: #0f0f0f;
    color: #ffffff;
    padding-bottom: 80px;
    overflow-x: hidden;
    width: 100%;
    max-width: var(--app-max-width);
    margin: 0 auto;
    position: relative;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Шапка маркетплейса */
.header {
    padding: calc(14px + var(--tg-safe-top)) 16px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(28, 20, 46, 0.55) 0%, rgba(15, 15, 15, 0) 100%);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    background-color: #333;
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.avatar:active {
    transform: scale(0.94);
}

.balance {
    background: linear-gradient(135deg, #241c3d 0%, #1c1c1e 100%);
    padding: 6px 9px 6px 10px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(124, 92, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.balance .balance-num {
    font-size: 14px;
    letter-spacing: 0.2px;
}

.balance .diamond-icon {
    font-size: 13px;
    filter: drop-shadow(0 0 4px rgba(124, 92, 255, 0.5));
}

.add-btn {
    background: linear-gradient(135deg, #8a6bff 0%, #5b3fd9 100%);
    color: #fff;
    border: none;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(90, 63, 217, 0.5);
    transition: transform 0.12s ease;
}

.add-btn:active {
    transform: scale(0.9);
}

/* Фильтры и поиск */
.filter-section {
    padding: 0 16px 14px;
}

.search-box {
    position: relative;
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 12px 12px 40px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.search-box input:focus {
    border-color: rgba(124, 92, 255, 0.55);
    background: #1c1c20;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e93;
}

.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.sort-trigger-btn, .dropdown-filter {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease, transform 0.1s ease;
}

.sort-trigger-btn {
    padding: 8px 10px;
    fill: #fff;
}

.sort-trigger-btn:active, .dropdown-filter:active {
    transform: scale(0.94);
    background: #232326;
}

/* Сетка карточек */
.market-grid {
    padding: 0 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.nft-card {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.nft-card:active {
    transform: scale(0.97);
    border-color: rgba(124, 92, 255, 0.3);
}

/* profile-content уже даёт 16px отступа слева/справа — раньше сетка и
   фильтры добавляли поверх ещё +10px каждый, из-за чего по краям экрана
   получалась широкая тёмная полоса. Убираем лишний слой отступа: сетка и
   фильтры теперь опираются только на padding родителя, карточки при этом
   становятся немного шире/крупнее. */
#storageGrid.market-grid {
    padding: 0;
    gap: 10px;
}

#storageScreen .filter-section {
    padding-left: 0;
    padding-right: 0;
}

#storageGrid .nft-title {
    font-size: 15px;
}

#storageGrid .nft-number {
    font-size: 12px;
    margin-bottom: 0;
}

#storageGrid .nft-info {
    padding: 10px 10px 12px;
}

.nft-image-container {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 30%, rgba(124, 92, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%), #121214;
}

.nft-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    padding: 4px;
    border-radius: 8px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nft-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

/* Точка монтажа Lottie-анимации подарка — лежит поверх статичной картинки
   тем же размером, до подтверждённой загрузки полностью прозрачна и не
   перехватывает клики (реагирует картинка/карточка под ней). Как только
   анимация готова (.is-loaded), сама картинка под ней прячется в JS. */
.nft-anim-mount {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nft-anim-mount canvas,
.nft-anim-mount svg {
    width: 100% !important;
    height: 100% !important;
}

.nft-card:active .nft-img {
    transform: scale(1.04);
}

.nft-info {
    padding: 10px;
}

.nft-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.nft-number {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 6px;
}

.nft-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nft-price {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #d9c8ff;
}

.cart-btn {
    background: linear-gradient(135deg, #8a6bff 0%, #5b3fd9 100%);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(90, 63, 217, 0.4);
    transition: transform 0.12s ease;
}

.cart-btn:active {
    transform: scale(0.9);
}

.nft-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-quick-btn {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.45);
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #ffd700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.order-quick-btn:active {
    background: rgba(255, 215, 0, 0.25);
    transform: scale(0.94);
}

/* Карточка товара в "Хранилище" — вместо цены/корзины одна полноширинная
   кнопка "Выставить на продажу" (переопределяем колоночный .action-btn). */
.nft-bottom .storage-relist-btn {
    width: 100%;
    min-height: 40px;
    background: #2c2c2e;
    border: 1px solid rgba(10, 132, 255, 0.45);
    color: #0a84ff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    padding: 10px 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
}

#storageGrid .nft-card {
    cursor: pointer;
}

.nft-bottom .storage-relist-btn:active {
    background: rgba(10, 132, 255, 0.18);
    transform: scale(0.98);
}

/* Стили экрана профиля */
.profile-header {
    padding: calc(12px + var(--tg-safe-top)) 16px 12px;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.profile-content {
    padding: 0 16px;
}

.profile-top-card {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.balance-box {
    flex: 1.2;
    background: linear-gradient(135deg, #2b2345 0%, #1c1c1e 100%);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 110px;
}

.diamond-big {
    font-size: 20px;
}

.balance-num {
    font-size: 20px;
    font-weight: bold;
}

.balance-label {
    font-size: 12px;
    color: #8e8e93;
}

.stats-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-mini-card {
    background: #1c1c1e;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.stat-mini-card:active {
    background: #2c2c2e;
}

.stat-title {
    font-size: 13px;
    color: #8e8e93;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
}

.section-title {
    font-size: 12px;
    color: #8e8e93;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.action-btn {
    background: #1c1c1e;
    border: none;
    border-radius: 14px;
    padding: 14px 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.action-icon {
    font-size: 18px;
    background: #2c2c2e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Игровой хаб (пока визуальная заглушка) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.game-tile {
    position: relative;
    background: linear-gradient(135deg, #241f38 0%, #1c1c1e 100%);
    border: 1px solid #2c2c2e;
    border-radius: 16px;
    padding: 18px 0 16px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
}

.game-tile-icon {
    font-size: 26px;
}

.game-tile-name {
    letter-spacing: 0.2px;
}

.game-tile-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #b8b8bd;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 7px;
    border-radius: 20px;
}

.history-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 10px;
}

.history-item {
    background: #1c1c1e;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-icon-box {
    background: #2c2c2e;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.history-action {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.history-status {
    font-size: 12px;
    color: #34c759;
}

.history-status span {
    color: #8e8e93;
    margin-left: 4px;
}

.history-sum {
    font-size: 14px;
    font-weight: 600;
}

.history-sum.negative {
    color: #fff;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max-width);
    background: #161618;
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + var(--tg-safe-bottom));
    z-index: 50;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8e8e93;
    font-size: 10px;
    gap: 4px;
    cursor: pointer;
}

.nav-item.active {
    color: #ffffff;
}

.nav-icon {
    font-size: 18px;
}
.wallet-container {
    flex-shrink: 1;
    min-width: 0;
    margin-right: 6px;
    max-width: 160px;
    overflow: hidden;
    display: flex;
    justify-content: flex-end;
}

.wallet-btn {
    background: linear-gradient(135deg, #241c3d 0%, #1c1c1e 100%);
    border: 1px solid rgba(124, 92, 255, 0.25);
    width: auto;
    height: auto;
    min-width: 0;
    max-width: 100%;
    border-radius: 18px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease;
}

.wallet-btn:active {
    transform: scale(0.95);
}

.wallet-btn * {
    max-width: 100%;
}
/* Модальное окно кошелька */
.wallet-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    justify-content: center;
    align-items: flex-end;
}

.wallet-modal.active {
    display: flex;
}

.wallet-modal-content {
    background: #18181a;
    width: 100%;
    max-width: var(--app-max-width);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 30px;
    position: relative;
    box-sizing: border-box;
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #2c2c2e;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wallet-modal-header {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 10px;
}

.wallet-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.wallet-modal-header p {
    font-size: 13px;
    color: #8e8e93;
    padding: 0 20px;
    line-height: 1.4;
}

.connect-tg-btn {
    width: 100%;
    background: #2ea6ff;
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 24px;
}

.other-apps-title {
    text-align: center;
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 16px;
}

.wallets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.wallet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wallet-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.wallet-app-icon.tonkeeper { background: #0098ea; }
.wallet-app-icon.gram { background: #4a90e2; }
.wallet-app-icon.mywallet { background: #1c3faa; }
.wallet-app-icon.view-all { background: #2c2c2e; }

.wallet-item span:last-child {
    font-size: 11px;
    color: #8e8e93;
    text-align: center;
    white-space: nowrap;
}

.ton-connect-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #2c2c2e;
    padding-top: 16px;
    font-size: 13px;
    color: #8e8e93;
}

.help-icon {
    background: #2c2c2e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}
/* Стили для модального окна вывода */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    position: relative;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.withdraw-hint {
    color: #8e8e93;
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.4;
}

.withdraw-input-box {
    margin: 20px 0;
}

.withdraw-input-box input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background-color: #2a2a2a;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
}

.withdraw-input-box input:focus {
    border-color: #007aff;
    outline: none;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #8e8e93;
    padding: 60px 20px;
    font-size: 14px;
}
/* === Добавка к style.css: мультивыбор фильтров === */

/* Кнопки-пилюли фильтров (заменяют старые <select>) */
.filter-pill {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.filter-pill:active {
    transform: scale(0.94);
}

.filter-pill.has-selection {
    background: linear-gradient(135deg, #2b2345 0%, #241c3d 100%);
    color: #d9c8ff;
    border-color: rgba(124, 92, 255, 0.4);
}

.filter-pill .pill-count {
    background: #ffd700;
    color: #000;
    font-weight: 700;
    font-size: 11px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Модалка мультивыбора */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    justify-content: center;
    align-items: flex-end;
}

.filter-modal.active {
    display: flex;
}

.filter-picker-content {
    background: #18181a;
    width: 100%;
    max-width: var(--app-max-width);
    max-height: 80vh;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.filter-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-picker-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.filter-picker-search {
    position: relative;
    margin-bottom: 14px;
}

.filter-picker-search input {
    width: 100%;
    background: #1c1c1e;
    border: none;
    border-radius: 12px;
    padding: 12px 12px 12px 40px;
    color: #fff;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.filter-picker-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e93;
}

.filter-picker-select-all {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    font-size: 14px;
    color: #8e8e93;
    cursor: pointer;
    border-bottom: 1px solid #2c2c2e;
    margin-bottom: 4px;
}

.filter-picker-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.filter-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    cursor: pointer;
}

.filter-picker-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #ffd700;
}

.filter-picker-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
    background: #2c2c2e;
}

.filter-picker-thumb.is-color {
    border-radius: 50%;
}

.filter-picker-thumb.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #8e8e93;
}

.filter-picker-name {
    flex: 1;
    font-size: 14px;
}

.filter-picker-rarity {
    background: #2c2c2e;
    color: #ffd700;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

.filter-picker-empty {
    text-align: center;
    color: #8e8e93;
    font-size: 13px;
    padding: 24px 0;
}

.filter-picker-footer {
    display: flex;
    gap: 10px;
    padding-top: 14px;
}

.filter-picker-reset {
    flex: 1;
    background: #2c2c2e;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.filter-picker-apply {
    flex: 2;
    background: #ffd700;
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Иконка символа на карточке товара, когда это картинка, а не эмодзи */
.nft-badge-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

/* Форма выставления NFT на продажу */
.modal-content.listing-form {
    max-width: 360px;
    text-align: left;
}

.listing-field-label {
    display: block;
    font-size: 12px;
    color: #8e8e93;
    margin: 12px 0 6px;
}

.listing-select {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.listing-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Детальная карточка лота (открывается по клику на 🛒) */
.modal-content.listing-detail-content {
    max-width: 360px;
    text-align: left;
    padding: 16px;
}

.listing-detail-image-wrap {
    width: 75%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #333;
    position: relative;
}

.listing-detail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.listing-detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-top: 14px;
}

.listing-detail-number {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 14px;
}

.listing-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1c1c1e;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 14px;
}

.listing-detail-label {
    color: #8e8e93;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.listing-detail-value {
    font-weight: 600;
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

.listing-detail-fee,
.listing-fee-note {
    text-align: center;
    color: #8e8e93;
    font-size: 12px;
    margin: 12px 0;
}

#confirmCreateListingBtn {
    width: 100%;
    margin-top: 12px;
    text-align: center;
}

.listing-detail-buy {
    width: 100%;
    background: #1c1c1e;
    color: #ffd700;
    border: 2px solid #ffd700;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* .action-btn задаёт flex-direction: column (для кнопок с иконкой сверху и
       текстом снизу) — здесь это не нужно, из-за этого "Купить"/цена/эмодзи
       расползались на отдельные строки. Возвращаем обычную однострочную кнопку. */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.listing-detail-cancel {
    width: 100%;
    background: #1c1c1e;
    color: #ff453a;
    border: 2px solid #ff453a;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    margin-top: 10px;
}

.listing-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

/* === Экран "История" === */
.history-list {
    list-style: none;
    padding-bottom: 90px; /* место под фиксированную нижнюю навигацию */
}

.history-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #2c2c2e;
}

.history-row.has-gift {
    cursor: pointer;
}

.trade-item-row {
    cursor: pointer;
}

.history-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    background: #2c2c2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.history-thumb.is-icon {
    font-size: 18px;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 2px;
}

.history-amount {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-amount.positive {
    color: #34c759;
}

.history-amount.negative {
    color: #ff453a;
}

.history-detail-amount {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.history-detail-amount.positive {
    color: #34c759;
}

.history-detail-amount.negative {
    color: #ff453a;
}

/* === Экран "Ордеры" === */
#ordersScreen .section-title {
    font-size: 12px;
    letter-spacing: 0.4px;
    color: #8e8e93;
}

.orders-create-btn {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 18px;
    padding: 16px 0;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    border: none;
    border-radius: 16px;
    color: #1c1c1e;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255, 159, 10, 0.28);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.orders-create-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(255, 159, 10, 0.22);
}

.orders-create-btn .action-icon {
    background: rgba(28, 28, 30, 0.14);
    color: #1c1c1e;
    width: 28px;
    height: 28px;
    font-size: 15px;
}

/* Капсула вкладок приподнята над фоном, активный пункт светится золотом —
   это парная (но самостоятельная) версия капсулы из #tradeTabs, где активный
   пункт светится фиолетовым. Так "Ордеры" (сделки за 💎) и "Трейд" (сделки
   с людьми) визуально различимы, оставаясь одной системой. */
.orders-tabs {
    display: flex;
    gap: 5px;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 14px;
}

.orders-tab {
    flex: 1;
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 12px;
    font-weight: 600;
    padding: 11px 2px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.2px;
    transition: color 0.15s ease, background 0.15s ease;
}

.orders-tab.active {
    background: linear-gradient(135deg, #3a2f14 0%, #211c1a 100%);
    color: #ffd700;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.3);
}

/* Строки списков ордеров/предложений — приподнятые карточки вместо плоских
   строк с чертой снизу, в том же языке, что и у списков "Трейда". */
#ordersActiveList .history-row,
#ordersHistoryList .history-row,
#ordersOffersList .history-row {
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 8px;
    border-bottom: none;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

#ordersActiveList .history-row.has-gift:active,
#ordersHistoryList .history-row.has-gift:active {
    transform: scale(0.98);
    border-color: rgba(255, 215, 0, 0.3);
}

#ordersScreen .history-thumb {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#ordersScreen .empty-state {
    text-align: center;
    color: #6b6b70;
    font-size: 13px;
    padding: 32px 0;
}

.order-row-price {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.order-row-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: #8e8e93;
}

.order-row-status.is-active {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.order-row-status.is-filled {
    background: rgba(138, 107, 255, 0.18);
    color: #d9c8ff;
}

.order-row-status.is-cancelled {
    background: rgba(255, 255, 255, 0.06);
    color: #6b6b70;
}

.order-detail-cancel-btn {
    border-color: #ff453a;
    color: #ff453a;
}

/* Кнопка "Создать ордер" в карточке быстрого ордера (по кнопке 🧾) —
   переопределяем цвет .listing-detail-buy (золотой, как у "Купить"),
   чтобы действие визуально не путалось с покупкой. */
.quick-order-confirm-btn {
    background: #1c1c1e;
    color: #0a84ff;
    border: 2px solid #0a84ff;
}

.order-row-cancel {
    background: #201417;
    color: #ff6961;
    border: 1px solid rgba(255, 69, 58, 0.3);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.order-row-cancel:active {
    transform: scale(0.95);
}

.offer-accept-btn {
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1c1e;
    border: none;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 159, 10, 0.25);
    transition: transform 0.1s ease;
}

.offer-accept-btn:active {
    transform: scale(0.96);
}

.offer-accept-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* =====================================================================
   ЭКРАН "ТРЕЙД" (P2P-обмен подарками)
   Визуальный язык: тот же тёмный холст (#0f0f0f), что и у всего апп-а,
   но акцент смещён на фиолетовый (в цвет аватара/баланса в шапке) для
   всего, что связано с "человеком" в обмене (поиск, выбранный партнёр),
   и на золотой (в цвет основных CTA) — для самого действия обмена.
   "Отдаёте" и "получаете" получают устойчивую цветовую кодировку:
   красноватый для исходящего, изумрудный для входящего — как знаки
   минуса/плюса в истории транзакций.
   ===================================================================== */

#tradeScreen .profile-content {
    padding-top: 4px;
}

#tradeScreen .section-title {
    font-size: 12px;
    letter-spacing: 0.4px;
    color: #8e8e93;
}

.trade-panel {
    padding-bottom: 90px; /* место под фиксированную нижнюю навигацию */
}

/* Вкладки Новый / Входящие / Мои обмены — приподнятая капсула со свечением
   активного пункта вместо плоской заливки, только в пределах трейда. */
#tradeTabs {
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 5px;
    margin-bottom: 18px;
}

#tradeTabs .orders-tab {
    padding: 11px 2px;
    letter-spacing: 0.2px;
    transition: color 0.15s ease, background 0.15s ease;
}

#tradeTabs .orders-tab.active {
    background: linear-gradient(135deg, #34294f 0%, #211c30 100%);
    color: #d9c8ff;
    box-shadow: inset 0 0 0 1px rgba(138, 107, 255, 0.35);
}

/* --- Поиск получателя --- */
.trade-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.trade-search-row input {
    flex: 1;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 13px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.trade-search-row input:focus {
    border-color: rgba(138, 107, 255, 0.55);
}

.trade-search-row input::placeholder {
    color: #6b6b70;
}

.trade-find-btn {
    width: auto;
    flex-direction: row;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(135deg, #8a6bff 0%, #5b3fd9 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(90, 63, 217, 0.35);
    transition: transform 0.1s ease;
}

.trade-find-btn:active {
    transform: scale(0.96);
}

.trade-found-list {
    margin-bottom: 4px;
}

.trade-found-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 6px;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.trade-found-row:active {
    transform: scale(0.98);
    border-color: rgba(138, 107, 255, 0.4);
}

.trade-found-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2c2c2e;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(138, 107, 255, 0.3);
}

.trade-found-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.trade-found-row span {
    color: #6b6b70;
    font-size: 16px;
}

/* Карточка выбранного партнёра — тёплая фиолетовая подложка, чтобы было
   сразу видно "с кем" собирается обмен, отдельно от списков ниже. */
.trade-selected-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(138, 107, 255, 0.16) 0%, rgba(28, 28, 30, 0.6) 65%);
    border: 1px solid rgba(138, 107, 255, 0.25);
    border-radius: 14px;
    padding: 13px 14px;
    margin: 6px 0 18px;
    font-size: 13px;
    color: #a9a9ae;
}

.trade-selected-user::before {
    content: '🔄';
    font-size: 15px;
    filter: drop-shadow(0 0 4px rgba(138, 107, 255, 0.6));
}

.trade-selected-user b {
    color: #fff;
}

.trade-subtitle {
    margin-top: 20px;
    margin-bottom: 2px;
    font-size: 11px;
}

/* Список "Ваши предметы" — нейтральный тон */
#tradeMyItemsList.trade-pick-list {
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    padding-left: 10px;
}

/* Список "Предметы получателя" — тонкая золотая направляющая, чтобы глаз
   сразу различал две колонки выбора при быстрой прокрутке. */
#tradeTheirItemsList.trade-pick-list {
    border-left: 2px solid rgba(255, 215, 0, 0.25);
    padding-left: 10px;
}

.trade-pick-list {
    padding-bottom: 4px;
}

.trade-pick-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    margin-bottom: 4px;
    border-radius: 12px;
    border-bottom: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.trade-pick-row:active {
    background: rgba(255, 255, 255, 0.04);
}

.trade-pick-row input[type="checkbox"] {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    accent-color: #ffd700;
}

/* Прогрессивное улучшение: подсвечиваем выбранную строку целиком.
   Браузеры без поддержки :has() просто не получают подсветку —
   выбор всё равно виден по чекбоксу. */
.trade-pick-row:has(input:checked) {
    background: rgba(255, 215, 0, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.25);
}

.trade-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.trade-status-badge.is-pending { background: rgba(10, 132, 255, 0.15); color: #0a84ff; }
.trade-status-badge.is-accepted { background: rgba(52, 199, 89, 0.15); color: #34c759; }
.trade-status-badge.is-declined,
.trade-status-badge.is-cancelled,
.trade-status-badge.is-failed { background: rgba(255, 69, 58, 0.15); color: #ff453a; }

/* --- Модалка деталей обмена --- */
#tradeDetailModal .trade-detail-meta {
    text-align: center;
    color: #8e8e93;
    font-size: 13px;
    margin-bottom: 4px;
}

#tradeDetailModal #tradeDetailGiveTitle {
    color: #ff8a80;
}

#tradeDetailModal #tradeDetailGetTitle {
    color: #7ee6a8;
}

#tradeDetailModal .history-list .history-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.trade-detail-actions .action-btn {
    flex: 1;
    flex-direction: row;
    justify-content: center;
    padding: 14px 0;
    font-weight: 700;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1c1e;
}

.trade-decline-btn {
    background: #201417 !important;
    color: #ff6961 !important;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

/* --- Доплата TON --- */
.trade-topup-row {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-topup-direction {
    display: flex;
    gap: 6px;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.trade-topup-dir-btn {
    flex: 1;
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 2px;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.trade-topup-dir-btn.active {
    background: linear-gradient(135deg, #3a2f14 0%, #2c2c2e 100%);
    color: #ffd700;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.25);
}

#tradeTopupAmount {
    width: 100%;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

#tradeTopupAmount:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.4);
}

.trade-fee-note {
    margin-top: 10px;
    font-size: 11px;
    color: #6b6b70;
    line-height: 1.5;
}

.trade-topup-note {
    /* display:table (а не inline-block) — чтобы margin:auto реально центрировал
       саму плашку в родителе с text-align:left, а не только текст внутри неё. */
    display: table;
    margin: 0 auto 12px;
    text-align: center;
    color: #1c1c1e;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Кнопка "Предложить обмен" — приводим в один регистр с "Купить"/"Создать
   ордер": та же золотая заливка, чтобы главное действие экрана читалось
   с первого взгляда, без отдельного класса в HTML. */
#tradeSubmitBtn {
    flex-direction: row;
    justify-content: center;
    margin-top: 22px;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 700;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1c1e;
    box-shadow: 0 8px 20px rgba(255, 159, 10, 0.28);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#tradeSubmitBtn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(255, 159, 10, 0.22);
}

/* --- Списки "Входящие" / "Мои обмены" --- */
#tradeIncomingList.trade-panel .history-row,
#tradeMineList.trade-panel .history-row {
    padding: 12px 10px;
    margin-bottom: 6px;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

#tradeIncomingList.trade-panel .history-row:active,
#tradeMineList.trade-panel .history-row:active {
    transform: scale(0.98);
    border-color: rgba(138, 107, 255, 0.35);
}

#tradeScreen .empty-state {
    text-align: center;
    color: #6b6b70;
    font-size: 13px;
    padding: 32px 0;
}

/* =====================================================================
   ИГРА "СЛОТЫ"
   ===================================================================== */

.slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Заметная кнопка правил в шапке — золотая обводка, чтобы бросалась в глаза */
.slots-rules-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.55);
    color: #ffd700;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px 7px 10px;
    border-radius: 20px;
    cursor: pointer;
}

.slots-rules-btn:active {
    background: rgba(255, 215, 0, 0.22);
    transform: scale(0.96);
}

/* Кнопка "Админ-консоль" в профиле — выглядит как остальные пункты списка,
   а не квадратная плитка (переопределяем колоночный .action-btn). */
.admin-panel-btn {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.35);
    color: #ff6961;
}

.admin-panel-btn:active {
    background: rgba(255, 69, 58, 0.18);
}

.admin-panel-btn .action-icon {
    background: rgba(255, 69, 58, 0.16);
}

/* Круглая кнопка "Обновить" в шапке админ-консоли */
.admin-refresh-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.admin-refresh-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

/* Сетка статистики админ-консоли */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: linear-gradient(160deg, #1f1f22 0%, #17171a 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-stat-card-wide {
    grid-column: span 2;
}

.admin-stat-icon {
    font-size: 20px;
}

.admin-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #ffd700;
    word-break: break-word;
}

.admin-stat-label {
    font-size: 12px;
    color: #8e8e93;
}

.slots-rules-btn-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slots-content {
    padding: 4px 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slots-title {
    font-size: 22px;
    font-weight: 800;
    margin: 4px 0 14px;
    letter-spacing: 0.3px;
}

.slots-balance-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 18px;
    font-size: 13px;
}

.slots-balance-label {
    color: #8e8e93;
}

.slots-balance-value {
    font-weight: 700;
    color: #ffd700;
}

/* Корпус автомата — многослойный градиент + хромированная золотая рамка
   с двойным свечением (внешний мягкий ореол + внутренний бортик), чтобы
   выглядело как настоящий игровой кабинет, а не плоская панель. */
.slots-machine {
    position: relative;
    width: 100%;
    max-width: 340px;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(255, 215, 0, 0.10) 0%, rgba(255, 215, 0, 0) 55%),
        linear-gradient(160deg, #2f2650 0%, #1c1531 50%, #120c1e 100%);
    border-radius: 26px;
    padding: 16px 14px 14px;
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.45),
        0 0 0 5px rgba(20, 14, 32, 0.9),
        0 0 0 6px rgba(255, 215, 0, 0.18),
        0 16px 34px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.3s ease;
}

.slots-machine.slots-win-flash {
    animation: slotsWinFlash 0.9s ease;
}

@keyframes slotsWinFlash {
    0% {
        box-shadow:
            0 0 0 1px rgba(255, 215, 0, 1),
            0 0 0 5px rgba(20, 14, 32, 0.9),
            0 0 40px 10px rgba(255, 215, 0, 0.65),
            0 16px 34px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow:
            0 0 0 1px rgba(255, 215, 0, 0.45),
            0 0 0 5px rgba(20, 14, 32, 0.9),
            0 0 0 6px rgba(255, 215, 0, 0.18),
            0 16px 34px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
}

/* Неоновая вывеска "JACKPOT" сверху корпуса, как маркиза на настоящем автомате */
.slots-marquee {
    text-align: center;
    margin-bottom: 10px;
}

.slots-marquee-text {
    display: inline-block;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #fff6d8;
    text-shadow:
        0 0 4px rgba(255, 230, 130, 0.9),
        0 0 12px rgba(255, 215, 0, 0.8),
        0 0 24px rgba(255, 165, 0, 0.5);
    animation: slotsMarqueeFlicker 2.4s ease-in-out infinite;
}

@keyframes slotsMarqueeFlicker {
    0%, 94%, 100% { opacity: 1; }
    96% { opacity: 0.55; }
}

/* Гирлянда ламп по всей ширине — чередуем золото/красный, как на бортике
   настоящего игрового автомата. */
.slots-machine-lights {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    margin-bottom: 12px;
}

.slots-machine-lights span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd700;
    opacity: 0.3;
    animation: slotsLightBlink 1.6s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.7);
}

.slots-machine-lights span:nth-child(odd) {
    background: #ff6b3d;
    box-shadow: 0 0 6px rgba(255, 107, 61, 0.7);
}

.slots-machine-lights span:nth-child(1) { animation-delay: 0s; }
.slots-machine-lights span:nth-child(2) { animation-delay: 0.1s; }
.slots-machine-lights span:nth-child(3) { animation-delay: 0.2s; }
.slots-machine-lights span:nth-child(4) { animation-delay: 0.3s; }
.slots-machine-lights span:nth-child(5) { animation-delay: 0.4s; }
.slots-machine-lights span:nth-child(6) { animation-delay: 0.5s; }
.slots-machine-lights span:nth-child(7) { animation-delay: 0.6s; }
.slots-machine-lights span:nth-child(8) { animation-delay: 0.7s; }

.slots-machine.is-spinning .slots-machine-lights span {
    animation-duration: 0.4s;
}

@keyframes slotsLightBlink {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.slots-reels {
    position: relative;
    display: flex;
    gap: 6px;
    background: #08080a;
    border-radius: 18px;
    padding: 10px;
    box-shadow:
        inset 0 4px 12px rgba(0, 0, 0, 0.7),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.slot-reel-window {
    flex: 1;
    height: 100px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #050505 0%, #17171a 20%, #201f24 50%, #17171a 80%, #050505 100%);
    border-radius: 13px;
    box-shadow:
        0 0 0 1px #302f36,
        0 0 0 2px rgba(255, 215, 0, 0.12),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.slot-reel-window::before,
.slot-reel-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    z-index: 2;
}

.slot-reel-window::before {
    top: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0));
}

.slot-reel-window::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0));
}

/* Диагональный глянцевый блик поверх стекла барабана — придаёт объём,
   как будто перед символами настоящее выпуклое стекло. */
.slot-reel-shine {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(115deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.03) 22%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 70%,
        rgba(255, 255, 255, 0.05) 100%);
}

.slot-reel-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.slot-symbol {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.55));
}

.slot-reel-strip.slot-reel-landed .slot-symbol:last-child {
    animation: slotSymbolLand 0.26s ease;
}

@keyframes slotSymbolLand {
    0% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

/* Линия выплаты — золотая полоса поперёк центра барабанов, с маленькими
   треугольниками-указателями по бокам, как на настоящих автоматах. */
.slots-payline {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    transform: translateY(-1px);
    background: linear-gradient(90deg, rgba(255,215,0,0), rgba(255,215,0,0.9) 12%, rgba(255,215,0,0.9) 88%, rgba(255,215,0,0));
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    z-index: 4;
    pointer-events: none;
}

.slots-payline-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
    z-index: 4;
    pointer-events: none;
}

.slots-payline-arrow.is-left { left: -3px; }
.slots-payline-arrow.is-right { right: -3px; }

/* Нижняя табличка корпуса с брендом — как декоративная планка снизу автомата */
.slots-machine-base {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.slots-machine-base-text {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 215, 0, 0.55);
}

.slots-machine-base-gem {
    font-size: 11px;
    opacity: 0.7;
}

.slots-result {
    min-height: 20px;
    margin: 16px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #8e8e93;
    text-align: center;
}

.slots-result.is-win {
    color: #ffd700;
    animation: slotsResultPulse 0.5s ease;
}

.slots-result.is-lose {
    color: #ff453a;
}

@keyframes slotsResultPulse {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Панель ставки */
.slots-bet-panel {
    width: 100%;
    max-width: 340px;
    margin-top: 14px;
}

.slots-bet-label {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 8px;
}

.slots-bet-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slots-bet-step-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #2c2c2e;
    background: #1c1c1e;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.slots-bet-step-btn:active {
    background: #2c2c2e;
    transform: scale(0.94);
}

.slots-bet-step-btn:disabled {
    opacity: 0.4;
}

.slots-bet-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.slots-bet-input-wrap input {
    width: 100%;
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    padding: 11px 34px 11px 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.slots-bet-input-wrap input:disabled {
    opacity: 0.5;
}

.slots-bet-diamond {
    position: absolute;
    right: 12px;
    font-size: 14px;
    pointer-events: none;
}

.slots-bet-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.slots-bet-quick-btn {
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    color: #b8b8bd;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 0;
    border-radius: 10px;
    cursor: pointer;
}

.slots-bet-quick-btn:active {
    background: #2c2c2e;
    color: #fff;
}

.slots-bet-quick-btn:disabled {
    opacity: 0.4;
}

/* Кнопка "Крутить" — крупная, золотой градиент, с пульсацией в покое */
.slots-spin-btn {
    width: 100%;
    max-width: 340px;
    margin-top: 18px;
    padding: 16px 0;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1a1a1a;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 165, 0, 0.35);
    animation: slotsSpinBtnPulse 2.2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
}

.slots-spin-btn:active {
    transform: scale(0.97);
}

.slots-spin-btn:disabled {
    cursor: default;
    animation: none;
    opacity: 0.85;
}

@keyframes slotsSpinBtnPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(255, 165, 0, 0.35); }
    50% { box-shadow: 0 8px 28px rgba(255, 165, 0, 0.65); }
}

/* Спиннер вместо текста, пока идёт вращение */
.slots-spin-btn.is-spinning .slots-spin-btn-text::after {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(26, 26, 26, 0.25);
    border-top-color: #1a1a1a;
    animation: slotsSpinnerRotate 0.7s linear infinite;
}

@keyframes slotsSpinnerRotate {
    to { transform: rotate(360deg); }
}

/* Модалка правил */
.slots-rules-content {
    max-width: 340px;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
}

.slots-rules-content h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 19px;
}

.slots-rules-desc {
    font-size: 13px;
    color: #b8b8bd;
    line-height: 1.5;
    margin-bottom: 16px;
}

.slots-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.slots-rules-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    padding: 10px 14px;
}

.slots-rules-row.is-top {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255,215,0,0.14) 0%, #1c1c1e 70%);
}

.slots-rules-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.slots-rules-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.slots-rules-mult {
    font-size: 14px;
    font-weight: 800;
    color: #ffd700;
}

.slots-rules-bets {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.slots-rules-bet-item {
    flex: 1;
    background: #1c1c1e;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
}

.slots-rules-bet-item span {
    display: block;
    font-size: 11px;
    color: #8e8e93;
    margin-bottom: 4px;
}

.slots-rules-bet-item b {
    font-size: 14px;
}

.slots-rules-close-btn {
    width: 100%;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1a1a1a;
    font-weight: 800;
    padding: 13px 0;
}

/* =====================================================================
   ИГРА "РУЛЕТКА" — переиспользует базовые классы слотов (панель ставки,
   кнопка спина, модалка правил), здесь только специфика самого колеса.
   ===================================================================== */

.roulette-wheel-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 6px auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roulette-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #1c1c1e;
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.35), 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(0, 0, 0, 0.5);
    will-change: transform;
}

.roulette-wheel-wrap.is-spinning .roulette-wheel {
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.85), 0 0 30px 6px rgba(255, 215, 0, 0.4), inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.roulette-wheel-hub {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1c1c1e;
    border: 2px solid #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Стрелка-указатель — зафиксирована сверху колеса и никогда не крутится */
.roulette-pointer {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #ffd700;
    z-index: 4;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.roulette-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin-bottom: 14px;
    max-width: 320px;
}

.roulette-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #b8b8bd;
}

.roulette-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* =====================================================================
   ИГРА "БОМБЕР" (мины, поле 5x5)
   ===================================================================== */

.bomber-content {
    padding-bottom: 28px;
}

.bomber-bombs-panel {
    width: 100%;
    max-width: 340px;
    margin-bottom: 16px;
}

.bomber-bombs-label {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 8px;
    text-align: center;
}

.bomber-bombs-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.bomber-bombs-btn {
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    color: #b8b8bd;
    font-size: 16px;
    font-weight: 800;
    padding: 10px 0;
    border-radius: 12px;
    cursor: pointer;
}

.bomber-bombs-btn.is-active {
    background: rgba(255, 69, 58, 0.15);
    border-color: #ff453a;
    color: #ff6961;
}

.bomber-bombs-btn:disabled {
    opacity: 0.45;
}

.bomber-stats-row {
    width: 100%;
    max-width: 340px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.bomber-stat-box {
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bomber-stat-label {
    font-size: 10px;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bomber-stat-value {
    font-size: 15px;
    font-weight: 800;
    color: #ffd700;
}

.tower-stats-row .bomber-stat-box {
    background: linear-gradient(160deg, #1f1f22 0%, #17171a 100%);
    border-color: rgba(255, 215, 0, 0.18);
}

/* Поле 7x7 */
.bomber-field {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: repeat(var(--bomber-cols, 7), 1fr);
    grid-template-rows: repeat(var(--bomber-cols, 7), 1fr);
    gap: 5px;
    background: #0f0f0f;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 8px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 20px rgba(0,0,0,0.4);
}

.bomber-cell {
    background: linear-gradient(160deg, #2c2c2e 0%, #1c1c1e 100%);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    transition: transform 0.12s ease, background 0.2s ease;
}

.bomber-cell:not(:disabled):active {
    transform: scale(0.9);
}

.bomber-cell:disabled {
    cursor: default;
}

.bomber-cell.is-safe {
    background: linear-gradient(160deg, #234a2b 0%, #16301c 100%);
    border-color: rgba(52, 199, 89, 0.55);
    animation: bomberCellReveal 0.25s ease;
}

.bomber-cell.is-bomb {
    background: linear-gradient(160deg, #4a2323 0%, #301616 100%);
    border-color: rgba(255, 69, 58, 0.6);
}

.bomber-cell.is-bomb.is-hit {
    background: linear-gradient(160deg, #7a1f1f 0%, #4a1010 100%);
    border-color: #ff453a;
    animation: bomberHitFlash 0.5s ease;
}

@keyframes bomberCellReveal {
    0% { transform: scale(0.7); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bomberHitFlash {
    0% { box-shadow: 0 0 0 4px rgba(255, 69, 58, 0.6); }
    100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

.bomber-actions {
    width: 100%;
    max-width: 340px;
}

.bomber-cashout-btn {
    background: linear-gradient(135deg, #4ee08a 0%, #34c759 45%, #16a34a 100%);
    box-shadow: 0 8px 20px rgba(52, 199, 89, 0.35);
}

@keyframes bomberCashoutBtnPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(52, 199, 89, 0.35); }
    50% { box-shadow: 0 8px 28px rgba(52, 199, 89, 0.65); }
}

.bomber-cashout-btn {
    animation: bomberCashoutBtnPulse 1.6s ease-in-out infinite;
}

/* Таблица рисков в модалке правил */
.bomber-rules-table {
    width: 100%;
    margin: 14px 0;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    overflow: hidden;
}

.bomber-rules-row {
    display: grid;
    grid-template-columns: 0.6fr 1.3fr 1fr;
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #2c2c2e;
}

.bomber-rules-row:last-child {
    border-bottom: none;
}

.bomber-rules-head {
    background: #1c1c1e;
    color: #8e8e93;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#bomberRulesModal .slots-rules-desc {
    font-size: 15px;
    line-height: 1.6;
    color: #d1d1d6;
}

#bomberRulesModal .slots-rules-content h2 {
    font-size: 21px;
}

.bomber-risk-low { color: #34c759; font-weight: 700; }
.bomber-risk-mid { color: #ffd700; font-weight: 700; }
.bomber-risk-high { color: #ff9f0a; font-weight: 700; }
.bomber-risk-extreme { color: #ff453a; font-weight: 700; }

.bomber-rules-note {
    font-size: 12px !important;
    color: #8e8e93 !important;
}


/* =====================================================================
   ИГРА "БАШНЯ" (подъём по этажам, чем выше — тем больше множитель и риск)
   ===================================================================== */

.tower-content {
    padding-bottom: 28px;
    position: relative;
}

/* Тёплое золотое свечение фона под всей игрой — чисто декоративное. */
.tower-content::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.14) 0%, rgba(255, 215, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.tower-content .slots-title,
.tower-content .slots-balance-pill,
.tower-content .bomber-stats-row,
.tower-content .tower-field,
.tower-content .slots-result,
.tower-content .slots-bet-panel,
.tower-content .tower-actions {
    position: relative;
    z-index: 1;
}

.tower-content .slots-title {
    background: linear-gradient(135deg, #fff6d8 0%, #ffd700 55%, #b8860b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 18px rgba(255, 215, 0, 0.25);
}

/* Панель этажей: снизу вверх, текущий этаж активен, прокрутка если не влезает */
.tower-field {
    width: 100%;
    max-width: 340px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.06) 0%, rgba(255, 215, 0, 0) 55%),
        linear-gradient(180deg, #0d0d10 0%, #060607 100%);
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: 18px;
    padding: 12px 10px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        inset 0 0 40px rgba(0,0,0,0.5),
        0 10px 26px rgba(0,0,0,0.45);
    scroll-behavior: smooth;
}

.tower-floor-row {
    display: grid;
    grid-template-columns: 30px 1fr 56px;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 13px;
    background: #1c1c1e;
    border: 1px solid #333336;
    opacity: 0.45;
    transition: opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.tower-floor-row.is-current {
    opacity: 1;
    background: linear-gradient(160deg, #322914 0%, #1c1810 100%);
    border-color: #ffd700;
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.4),
        0 0 22px rgba(255, 215, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: scale(1.015);
    animation: towerRowGlow 1.8s ease-in-out infinite;
}

.tower-floor-row.is-cleared {
    opacity: 0.92;
    background: linear-gradient(160deg, rgba(52, 199, 89, 0.1) 0%, rgba(28, 28, 30, 1) 100%);
    border-color: rgba(52, 199, 89, 0.5);
}

.tower-floor-row.is-locked {
    opacity: 0.38;
}

@keyframes towerRowGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.4), 0 0 18px rgba(255, 215, 0, 0.14), inset 0 1px 0 rgba(255,255,255,0.06); }
    50% { box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.55), 0 0 28px rgba(255, 215, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.06); }
}

.tower-floor-label {
    font-size: 12px;
    font-weight: 800;
    color: #b8b8bd;
    text-align: center;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    background: #29292c;
    border: 1px solid #3a3a3d;
    margin: 0 auto;
}

.tower-floor-row.is-current .tower-floor-label {
    color: #1c1810;
    background: linear-gradient(160deg, #ffe27a 0%, #ffd700 60%, #d4a300 100%);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.tower-floor-row.is-cleared .tower-floor-label {
    color: #fff;
    background: linear-gradient(160deg, #3fcf6f 0%, #269447 100%);
    border-color: #34c759;
}

.tower-floor-tiles {
    display: grid;
    grid-template-columns: repeat(var(--tower-tiles, 4), 1fr);
    gap: 7px;
}

.tower-tile {
    position: relative;
    background: linear-gradient(160deg, #4c4c50 0%, #2b2b2e 100%);
    border: 2px solid #5c5c60;
    border-radius: 11px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #e5e5ea;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 7px rgba(0,0,0,0.4);
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Лёгкий глянцевый блик сверху плитки — чисто декоративный слой. */
.tower-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.tower-floor-row.is-current .tower-tile {
    background: linear-gradient(160deg, #626268 0%, #38383c 100%);
    border-color: rgba(255, 215, 0, 0.8);
}

.tower-tile:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: #ffd700;
}

.tower-tile:not(:disabled):active {
    transform: scale(0.9);
}

.tower-tile:disabled {
    cursor: default;
}

.tower-floor-row.is-locked .tower-tile {
    background: linear-gradient(160deg, #29292b 0%, #19191b 100%);
    border-color: #333336;
    color: #6e6e73;
}

.tower-tile.is-safe {
    background: linear-gradient(160deg, #3ecf6e 0%, #1d4425 100%);
    border-color: #34c759;
    color: #fff;
    box-shadow: 0 0 14px rgba(52, 199, 89, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: towerTileReveal 0.3s ease;
}

.tower-tile.is-trap {
    background: linear-gradient(160deg, #7a3838 0%, #441d1d 100%);
    border-color: #ff453a;
    color: #fff;
}

.tower-tile.is-trap.is-hit {
    background: linear-gradient(160deg, #b52d2d 0%, #5a1212 100%);
    border-color: #ff453a;
    animation: towerHitFlash 0.6s ease, towerHitShake 0.4s ease;
}

@keyframes towerTileReveal {
    0% { transform: scale(0.7); opacity: 0.4; }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes towerHitFlash {
    0% { box-shadow: 0 0 0 6px rgba(255, 69, 58, 0.65); }
    100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

@keyframes towerHitShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.tower-floor-multiplier {
    font-size: 11px;
    font-weight: 800;
    color: #9a9aa0;
    text-align: center;
    background: #232326;
    border: 1px solid #333336;
    border-radius: 20px;
    padding: 4px 0;
}

.tower-floor-row.is-current .tower-floor-multiplier {
    color: #1c1810;
    background: linear-gradient(135deg, #ffe27a 0%, #ffd700 100%);
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.tower-floor-row.is-cleared .tower-floor-multiplier {
    color: #fff;
    background: linear-gradient(135deg, #3fcf6f 0%, #269447 100%);
    border-color: rgba(52, 199, 89, 0.6);
}

.tower-actions {
    width: 100%;
    max-width: 340px;
}

.tower-start-btn {
    background: linear-gradient(135deg, #ffe27a 0%, #ffd700 55%, #c9a100 100%) !important;
    color: #1c1810 !important;
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.3) !important;
}

.tower-cashout-btn {
    background: linear-gradient(135deg, #4fe38a 0%, #34c759 60%, #1e9c45 100%) !important;
    box-shadow: 0 6px 18px rgba(52, 199, 89, 0.32) !important;
}


/* =====================================================================
   ИГРА "КОСТИ" (обычный кубик 1-6, ставка на одно число, x3)
   ===================================================================== */

.dice-content {
    padding-bottom: 28px;
}

/* Кубик с точками и анимацией броска */
.dice-cube-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0 18px;
    perspective: 600px;
}

.dice-cube {
    width: 96px;
    height: 96px;
    background: linear-gradient(160deg, #ffffff 0%, #e4e4e6 100%);
    border-radius: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 -3px 6px rgba(0,0,0,0.08);
    transition: transform 0.15s ease;
}

.dice-pip {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-pip::after {
    content: '';
    width: 60%;
    height: 60%;
    max-width: 14px;
    max-height: 14px;
    border-radius: 50%;
    background: #1a1a1a;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.dice-pip.is-on::after {
    opacity: 1;
    transform: scale(1);
}

.dice-cube.is-rolling {
    animation: diceRollSpin 0.5s linear infinite;
}

@keyframes diceRollSpin {
    0%   { transform: rotate(0deg) scale(1); }
    25%  { transform: rotate(8deg) scale(1.03); }
    50%  { transform: rotate(-6deg) scale(0.98); }
    75%  { transform: rotate(5deg) scale(1.02); }
    100% { transform: rotate(0deg) scale(1); }
}

.dice-cube.is-settled {
    animation: diceSettleBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes diceSettleBounce {
    0%   { transform: scale(1.25) rotate(0deg); }
    60%  { transform: scale(0.92) rotate(-4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.dice-cube.is-win {
    box-shadow: 0 10px 26px rgba(52, 199, 89, 0.55), inset 0 -3px 6px rgba(0,0,0,0.08);
}

.dice-cube.is-lose {
    box-shadow: 0 10px 26px rgba(255, 69, 58, 0.5), inset 0 -3px 6px rgba(0,0,0,0.08);
}

/* Выбор числа для ставки */
.dice-numbers-panel {
    width: 100%;
    max-width: 340px;
    margin-bottom: 14px;
}

.dice-numbers-label {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 8px;
    text-align: center;
}

.dice-numbers-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.dice-number-btn {
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    color: #b8b8bd;
    font-size: 15px;
    font-weight: 800;
    padding: 10px 0;
    border-radius: 10px;
    cursor: pointer;
}

.dice-number-btn.is-active {
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    border-color: #ffd700;
    color: #1a1a1a;
}

.dice-number-btn:disabled {
    opacity: 0.5;
}

.dice-stats-row {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 16px;
}

.dice-roll-btn {
    margin-top: 6px;
}

/* =====================================================================
   ИГРА "ПЛИНКО" (шарик через колышки в одну из 9 корзин)
   ===================================================================== */

.plinko-content {
    padding-bottom: 28px;
}

/* Строка примеров множителей в модалке правил — переиспользует стили
   карманов доски (.plinko-bin), просто крупнее и в один ряд без сетки. */
.plinko-rules-mults {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 12px 0;
}

.plinko-rules-mults .plinko-bin {
    flex: 1 1 auto;
    min-width: 34px;
    font-size: 11px;
    padding: 7px 4px 10px;
}

/* Доска: колышки треугольником + падающий шарик */
.plinko-board-wrap {
    width: 100%;
    max-width: 340px;
    margin-bottom: 14px;
}

/* Указатель точки старта шарика над доской — вместо "аватарки" из
   референса тут собственно шарик (тот же стиль, что и у падающего). */
.plinko-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 4px;
}

.plinko-launcher-arrow {
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 12px solid #ff9f0a;
    filter: drop-shadow(0 2px 4px rgba(255, 159, 10, 0.5));
}

.plinko-launcher-ball {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8dc, #ffd700 55%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.plinko-board {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.35;
    background: radial-gradient(ellipse at 50% 0%, #1c1c1e 0%, #0f0f0f 70%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 20px rgba(0,0,0,0.4);
}

.plinko-pegs-layer {
    position: absolute;
    inset: 6% 4% 4%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.plinko-peg-row {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.plinko-peg {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5a5a5e;
    box-shadow: 0 0 3px rgba(255,255,255,0.15);
}

.plinko-ball {
    position: absolute;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8dc, #ffd700 55%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 2;
}

.plinko-ball.is-win {
    box-shadow: 0 0 12px 3px rgba(52, 199, 89, 0.7);
}

.plinko-ball.is-lose {
    box-shadow: 0 0 12px 3px rgba(255, 69, 58, 0.6);
}

.plinko-ball.is-settled {
    animation: plinkoBallBounce 0.4s ease-out;
}

@keyframes plinkoBallBounce {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Корзины множителей внизу доски */
.plinko-bins {
    display: grid;
    grid-template-columns: repeat(17, 1fr);
    gap: 2px;
    margin-top: 6px;
}

.plinko-bin {
    text-align: center;
    font-size: 7px;
    font-weight: 800;
    padding: 5px 0 8px;
    color: #1a1a1a;
    clip-path: polygon(0% 0%, 100% 0%, 100% 60%, 50% 100%, 0% 60%);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.plinko-bin-low {
    background: linear-gradient(160deg, #8e8e93, #6b6b70);
    color: #fff;
}

.plinko-bin-mid {
    background: linear-gradient(160deg, #4ee08a, #34c759);
}

.plinko-bin-high {
    background: linear-gradient(160deg, #ffb347, #ff9f0a);
}

.plinko-bin-extreme {
    background: linear-gradient(160deg, #ff6b6b, #ff453a);
    color: #fff;
}

.plinko-bin.is-landed {
    transform: scale(1.18) translateY(-3px);
    filter: brightness(1.25) drop-shadow(0 4px 10px rgba(255, 215, 0, 0.6));
}

.plinko-drop-btn {
    margin-top: 6px;
}

/* =====================================================================
   ОРДЕРА ПО КОЛЛЕКЦИИ ("Смотреть ордера" на Маркете) + количество в
   форме создания ордера — переиспользует .filter-pill, .orders-tabs,
   .slots-bet-controls и стили строк .history-row, здесь только то,
   чего не было: сама кнопка на Маркете, обёртка модалки и список.
   ===================================================================== */

/* Кнопка-пилюля "Смотреть ордера" в фильтр-баре Маркета — золотая, чтобы
   выделяться на фоне обычных фильтров (она не фильтрует, а открывает
   отдельный экран). display переключается из JS (см. updateMarketOrdersButton). */
.market-orders-btn {
    background: linear-gradient(135deg, #3a2f14 0%, #211c1a 100%);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.35);
    font-weight: 700;
}

.collection-orders-content {
    max-height: 82vh;
    display: flex;
    flex-direction: column;
}

.collection-orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.collection-orders-toolbar .orders-tabs {
    margin-bottom: 0;
    flex: 1;
}

.collection-orders-add-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1c1e;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 159, 10, 0.28);
    transition: transform 0.1s ease;
}

.collection-orders-add-btn:active {
    transform: scale(0.94);
}

.collection-orders-head {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 72px 96px;
    gap: 8px;
    padding: 0 6px 10px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b6b70;
}

.collection-orders-price-sort {
    background: none;
    border: none;
    padding: 0;
    color: #6b6b70;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    cursor: pointer;
    transition: color 0.12s ease;
}

.collection-orders-price-sort:active {
    color: #ffd700;
}

.collection-orders-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 2px;
}

.collection-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 72px 96px;
    align-items: center;
    gap: 8px;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

/* Свои ордеры выделены не только рамкой, но и лёгким золотым свечением
   слева — так их видно с одного взгляда даже во вкладке "Все ордеры",
   не читая цену. */
.collection-order-row.is-mine {
    border-color: rgba(255, 215, 0, 0.35);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, #16161a 22%);
}

.collection-order-row.is-mine::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ffe066 0%, #ff9f0a 100%);
}

.collection-order-col-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.collection-order-col-name > div {
    min-width: 0;
    flex: 1;
}

.collection-order-thumb {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.collection-order-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.collection-order-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-order-traits {
    font-size: 10.5px;
    color: #8e8e93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.collection-order-col-qty {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #cfcfd2;
}

.collection-order-progress {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.collection-order-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #ffd700 0%, #ff9f0a 100%);
}

.collection-order-col-price {
    font-size: 13px;
    font-weight: 800;
    color: #d9c8ff;
    text-align: right;
    white-space: nowrap;
}

.collection-orders-list .empty-state {
    text-align: center;
    color: #6b6b70;
    font-size: 13px;
    padding: 32px 0;
}

/* Степпер количества в форме создания ордера — переиспользует визуал
   степпера ставки из игр (.slots-bet-controls/.slots-bet-step-btn), просто
   без диамант-иконки поверх поля ввода. */
.order-qty-controls {
    margin-bottom: 12px;
}

.order-qty-controls .slots-bet-input-wrap input {
    text-align: center;
}

/* =====================================================================
   МОДАЛКА "СОЗДАТЬ ОРДЕР" — форма собрана из тех же переиспользуемых полей,
   что и другие модалки (продажа лота, вывод средств), поэтому раньше
   выглядела разнородно: поле цены было в чужой сине-серой палитре
   (осталось от формы вывода), а кнопка отправки — обычной серой, как
   второстепенное действие. Приводим всё к единому языку модалки:
   тёмные поля с золотым фокусом и золотая кнопка отправки, как у
   "Предложить обмен"/"Создать ордер" на других экранах. Всё заскоуплено
   под #createOrderModal, чтобы не задеть форму продажи лота и вывод
   средств — они используют те же базовые классы.
   ===================================================================== */

#createOrderModal .listing-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b6b70;
}

#createOrderModal .listing-select {
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.15s ease;
}

#createOrderModal .listing-select:not(:disabled):active {
    border-color: rgba(255, 215, 0, 0.35);
}

#createOrderModal .withdraw-input-box {
    margin: 4px 0 0;
}

#createOrderModal .withdraw-input-box input {
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 13px 14px;
    font-weight: 700;
    transition: border-color 0.15s ease;
}

#createOrderModal .withdraw-input-box input:focus {
    border-color: rgba(255, 215, 0, 0.4);
}

#createOrderModal .order-qty-controls .slots-bet-step-btn {
    border-color: rgba(255, 255, 255, 0.07);
}

#createOrderModal .order-qty-controls .slots-bet-step-btn:active {
    border-color: rgba(255, 215, 0, 0.35);
    color: #ffd700;
}

#createOrderModal .order-qty-controls .slots-bet-input-wrap input {
    border-color: rgba(255, 255, 255, 0.07);
}

/* Сноска про списание/возврат денег — раньше просто серый абзац текста,
   теперь приподнятая карточка-подсказка, чтобы не терялась под кнопкой. */
#createOrderModal .listing-fee-note {
    text-align: left;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.5;
    margin: 16px 0;
}

#confirmCreateOrderBtn {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 700;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1c1e;
    box-shadow: 0 8px 20px rgba(255, 159, 10, 0.28);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#confirmCreateOrderBtn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(255, 159, 10, 0.22);
}

/* =====================================================================
   ЭКРАН "ИСТОРИЯ ОПЕРАЦИЙ" — редизайн (фильтры, группировка по дням,
   карточки вместо плоских строк). Всё заскоуплено под #historyList /
   #historyFilters, чтобы не задеть .history-row в других местах
   (Ордеры, Трейд, карточка коллекции), где используется тот же класс.
   ===================================================================== */

.history-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.history-filters::-webkit-scrollbar {
    display: none;
}

.history-filter-btn {
    flex-shrink: 0;
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #b8b8bd;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.history-filter-btn:active {
    transform: scale(0.95);
}

.history-filter-btn.active {
    background: linear-gradient(135deg, #2b2345 0%, #241c3d 100%);
    border-color: rgba(124, 92, 255, 0.5);
    color: #fff;
}

#historyList {
    padding-bottom: 90px;
}

#historyList .history-date-sep {
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 14px 2px 8px;
}

#historyList .history-date-sep:first-child {
    padding-top: 0;
}

/* Карточка вместо плоской строки с нижней чертой */
#historyList .history-row {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 8px;
    gap: 12px;
}

#historyList .history-row.has-gift:active {
    background: #232326;
    transform: scale(0.99);
}

/* Цветной ободок иконки в зависимости от категории операции */
#historyList .history-thumb.is-icon {
    font-size: 20px;
    background: #2c2c2e;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#historyList .history-row.is-in .history-thumb.is-icon {
    background: rgba(52, 199, 89, 0.14);
    box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.35);
}

#historyList .history-row.is-out .history-thumb.is-icon {
    background: rgba(255, 69, 58, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.3);
}

#historyList .history-row.is-game .history-thumb.is-icon {
    background: rgba(255, 215, 0, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.4);
}

#historyList .history-row.is-gift .history-thumb {
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}

#historyList .history-name {
    font-size: 14px;
    font-weight: 700;
}

#historyList .history-meta {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 3px;
}

/* Сумма — теперь пилюля с мягкой подложкой вместо голого текста */
.history-amount-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 10px;
}

.history-amount-arrow {
    font-size: 11px;
    opacity: 0.8;
}

.history-amount-pill.positive {
    color: #34c759;
    background: rgba(52, 199, 89, 0.12);
}

.history-amount-pill.negative {
    color: #ff453a;
    background: rgba(255, 69, 58, 0.1);
}

/* Пустое состояние — крупнее и дружелюбнее */
.history-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 70px 30px 40px;
    color: #8e8e93;
}

.history-empty-icon {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.history-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.history-empty-sub {
    font-size: 13px;
    line-height: 1.5;
    max-width: 260px;
}

/* Небольшая полировка суммы в детальной карточке операции */
.history-detail-amount {
    padding: 10px 0;
}

/* =====================================================================
   ЭКРАН "ХРАНИЛИЩЕ" (инвентарь) — редизайн карточек. Заскоуплено под
   #storageScreen / .storage-*, .nft-card и .market-grid в Маркете не
   затрагиваются.
   ===================================================================== */

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

.storage-count-badge {
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #b8b8bd;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Карточка предмета — лёгкий градиент-подложка + приподнятие при тапе */
#storageGrid .storage-card {
    cursor: pointer;
    background: linear-gradient(165deg, #1c1c1f 0%, #17171a 100%);
}

#storageGrid .storage-card:active {
    transform: scale(0.97);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Бейдж редкости — для действительно редких трейтов (≤5%) */
.storage-rarity-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(255, 165, 0, 0.4);
    letter-spacing: 0.2px;
}

/* Трейт-чипы (модель / фон) под номером подарка */
.storage-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.storage-trait-chip {
    background: rgba(255, 255, 255, 0.06);
    color: #b8b8bd;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Подсказку "Выставить на продажу" убрали — вся карточка и так кликабельна
   и открывает то же самое окно выставления на продажу. */

/* Пустое состояние Хранилища — крупнее и дружелюбнее, как в Истории */
.storage-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 70px 30px 40px;
    color: #8e8e93;
}

.storage-empty-icon {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.storage-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.storage-empty-sub {
    font-size: 13px;
    line-height: 1.5;
    max-width: 260px;
}

/* === Промо-карточка коллекции в Маркете (когда выбрана ровно 1 коллекция) ===
   Единственная карточка в сетке с золотым, а не фиолетовым акцентом — это
   намеренно: золото в приложении уже читается как "главное действие"
   (кнопки "Купить"/"Создать ордер"/"Продать"), так что глаз сразу отличает
   этот промо-тайл от обычных лотов, даже не читая текст. */
.market-offer-card {
    cursor: default;
    border-color: rgba(255, 215, 0, 0.22);
    box-shadow: 0 10px 26px rgba(255, 159, 10, 0.14);
}

.market-offer-image {
    background: linear-gradient(160deg, #ffe066 0%, #ffd700 55%, #ff9f0a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.market-offer-image::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.4), transparent 55%);
    pointer-events: none;
}

/* Тонкое зернистое кольцо по краю картинки — добавляет карточке глубины,
   не отвлекая от цифры цены по центру. */
.market-offer-image::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(28, 20, 8, 0.12);
    pointer-events: none;
}

.market-offer-icon-badge {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(28, 20, 8, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(28, 20, 8, 0.16);
}

.market-offer-icon {
    position: relative;
    opacity: 0.92;
}

.market-offer-label {
    position: relative;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(28, 20, 8, 0.6);
}

.market-offer-balance {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 21px;
    font-weight: 800;
    color: #1c1408;
    max-width: 100%;
    padding: 0 6px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.market-offer-diamond {
    font-size: 17px;
    flex-shrink: 0;
}

.market-offer-top-bid {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.market-offer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-offer-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease;
}

.market-offer-orders-btn {
    background: #16161a;
    color: #e6e6e8;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.market-offer-orders-btn:active {
    transform: scale(0.97);
    border-color: rgba(255, 215, 0, 0.3);
}

.market-offer-sell-btn {
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
    color: #1c1408;
    box-shadow: 0 4px 14px rgba(255, 159, 10, 0.3);
}

.market-offer-sell-btn:active {
    transform: scale(0.97);
    filter: brightness(1.05);
}


/* =====================================================================
   ПОПОЛНЕНИЕ БАЛАНСА (реальный TON) — экран ожидания подтверждения
   транзакции в блокчейне + карточка с данными для ручного перевода.
   ===================================================================== */

.deposit-pending-spinner {
    width: 36px;
    height: 36px;
    margin: 12px auto 16px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: deposit-spin 0.9s linear infinite;
}

@keyframes deposit-spin {
    to { transform: rotate(360deg); }
}

.deposit-pending-status {
    text-align: center;
    font-size: 13px;
    color: #d0d0d5;
    margin-bottom: 14px;
    min-height: 32px;
}

.deposit-manual-box {
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.deposit-manual-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    color: #9a9a9f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.deposit-manual-row:last-child {
    border-bottom: none;
}

.deposit-manual-row code {
    color: #ffd700;
    font-size: 12px;
    font-weight: 700;
    word-break: break-all;
    text-align: right;
    margin-left: 10px;
}

/* Второстепенная кнопка (например "Отмена" рядом с основным действием) —
   тот же .action-btn, просто без заливки, с рамкой. */
.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9a9a9f;
    margin-top: 8px;
}

/* Модалка "Недостаточно средств" при попытке начать игру без нужного баланса */
.insufficient-funds-content h2 {
    font-size: 18px;
    margin: 4px 0 10px;
}

.insufficient-funds-icon {
    width: 56px;
    height: 56px;
    margin: 6px auto 12px;
    border-radius: 50%;
    background: rgba(255, 69, 58, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.insufficient-funds-text {
    color: #9a9a9f;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 18px;
}

.insufficient-funds-content #insufficientFundsDepositBtn {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #6ec6ff 0%, #0a84ff 55%, #0060d1 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.insufficient-funds-content #insufficientFundsDepositBtn::before {
    content: '+';
    font-size: 16px;
    font-weight: 800;
    margin-right: 2px;
}

.insufficient-funds-content #insufficientFundsDepositBtn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.insufficient-funds-content #insufficientFundsCloseBtn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #b8b8bd;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.insufficient-funds-content #insufficientFundsCloseBtn:active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
    transform: scale(0.97);
}


/* =====================================================================
   МОДАЛКА "ДОБАВИТЬ NFT" — просто инструкция по реальному депозиту через
   Telegram Business (никаких ручных полей, никакого фейкового ввода
   трейтов — см. app.js). Карточка-ссылка на чат + кнопка обновить.
   ===================================================================== */

.deposit-nft-content {
    text-align: center;
}

.deposit-nft-icon {
    width: 64px;
    height: 64px;
    margin: 4px auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 215, 0, 0.35), rgba(255, 159, 10, 0.08) 70%);
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.deposit-nft-content h2 {
    margin-bottom: 10px;
}

.deposit-nft-desc {
    text-align: left;
    color: #9a9a9f;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}

/* Карточка-ссылка на чат — самолётик слева, юзернейм по центру, стрелка
   справа: выглядит как переход, а не как обычная кнопка с текстом. */
.deposit-nft-target-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255, 224, 102, 0.14) 0%, rgba(255, 159, 10, 0.10) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.deposit-nft-target-card:active {
    transform: scale(0.98);
    border-color: rgba(255, 215, 0, 0.55);
}

.deposit-nft-target-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 45%, #ff9f0a 100%);
}

.deposit-nft-target-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.deposit-nft-target-label {
    font-size: 11px;
    color: #9a9a9f;
}

.deposit-nft-target-username {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deposit-nft-target-arrow {
    flex-shrink: 0;
    color: #ffd700;
    display: flex;
    align-items: center;
}

.deposit-nft-unavailable {
    text-align: center;
    font-size: 12px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

/* Второстепенная кнопка "Я уже отправил" — тонкая рамка, значок обновления
   слегка крутится при наведении/клике, чтобы явно читаться как "проверить". */
.deposit-nft-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 0;
    color: #d0d0d5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.deposit-nft-refresh-btn:active {
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.deposit-nft-refresh-icon {
    font-size: 15px;
    transition: transform 0.4s ease;
}

.deposit-nft-refresh-btn:active .deposit-nft-refresh-icon {
    transform: rotate(180deg);
}

/* =====================================================================
   ПРИБЫЛЬ ПЛОЩАДКИ (adminScreen) — карточки "за 24ч/всего" + разбивка
   по источникам. Переиспользует .admin-stat-card/.admin-stats-grid.
   ===================================================================== */

.admin-revenue-title {
    margin-top: 4px;
}

.admin-revenue-card .admin-stat-value {
    color: #34c759;
}

.admin-revenue-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.admin-revenue-row {
    background: linear-gradient(160deg, #1f1f22 0%, #17171a 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-revenue-row-label {
    font-size: 14px;
    font-weight: 600;
    color: #e6e6e8;
}

.admin-revenue-row-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.admin-revenue-row-24h {
    font-size: 14px;
    font-weight: 800;
}

.admin-revenue-row-24h.positive {
    color: #34c759;
}

.admin-revenue-row-24h.negative {
    color: #ff453a;
}

.admin-revenue-row-all {
    font-size: 11px;
    color: #8e8e93;
}

.admin-payout-box {
    background: linear-gradient(160deg, #1f2a1f 0%, #17171a 100%);
    border: 1px solid rgba(52, 199, 89, 0.25);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
}

.admin-payout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-payout-label {
    font-size: 13px;
    color: #8e8e93;
}

.admin-payout-value {
    font-size: 18px;
    font-weight: 800;
    color: #34c759;
}

.admin-payout-btn {
    width: 100%;
    flex-direction: row;
    background: linear-gradient(135deg, #34c759 0%, #248a3d 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border: none;
    padding: 13px 0;
    border-radius: 12px;
}

.admin-payout-btn:disabled {
    opacity: 0.6;
}

.admin-payout-hint {
    font-size: 11px;
    color: #8e8e93;
    margin-top: 10px;
    line-height: 1.4;
    text-align: center;
}
