body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    height: 100vh;
    margin: 0;
    padding: 20px;
    color: white;
    text-align: center;
}

h1 {
    color: white;
    margin: 20px 0;
}

/* Контейнер кнопок */
.button-container {
    position: absolute;
    top: 79px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    display: none; /* Скрыто по умолчанию */
    padding: 0 16px;
}

/* Кнопка игры */
.game-button {
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    isolation: isolate;
}

.game-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(161, 161, 161, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.game-button:hover {
    transform: scale(1.04);
    box-shadow: 0 0 18px rgba(163, 163, 163, 0.2);
}

.game-button:hover::before {
    opacity: 1;
}

.game-button img {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.game-button span {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(20, 20, 20, 0.6));
    color: #6b6b6b;
    padding: 10px;
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* Нижняя навигация */
.nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #0f0f0f;
    padding: 6px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid #2c2c2e;
    z-index: 1000;
}

.nav-button {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-button svg {
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.2s;
}

.nav-button.active {
    color: #fff;
}

.nav-button.active svg {
    opacity: 1;
    transform: scale(1.05);
}

.nav-button:hover svg {
    opacity: 0.85;
}

/* Страница профиля */
.profile-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    color: white;
    display: none;
    z-index: 999;
    padding: 20px;
    padding-top: 90px;
    box-sizing: border-box;
    overflow-y: auto;
    text-align: center;
}

.profile-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.profile-info {
    text-align: left;
}

.profile-username {
    font-size: 18px;
    font-weight: bold;
}

.profile-level {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 5px;
}

.progress-container {
    width: 200px;
    height: 6px;
    background: linear-gradient(90deg, #333, #555); /* Темно-светлый градиент */
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e2a963, #cc7000); /* Темно-оранжевый градиент */
    transition: width 1s ease; /* Анимация заполнения */
}

.progress-numbers {
    font-size: 12px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

.settings-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.settings-button:hover {
    opacity: 1;
}

.profile-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.profile-buttons-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px; /* Меньше, чем у .profile-card (20px), для подгонки размера */
    margin-bottom: 20px;
    width: 100%; /* Полная ширина для лучшей подгонки на мобильных */
    box-sizing: border-box;
}

.profile-buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 auto; /* Убрали 20px margin, чтобы не добавлять лишнее пространство */
    width: 100%; /* Подгонка по ширине карточки */
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.history-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    position: relative;
}

.history-title {
    font-size: 16px;
    margin-bottom: 10px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.filter-button:hover {
    opacity: 1;
}

.sort-button {
    background: none;
    border: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: 10px;
}

.sort-button:hover {
    opacity: 1;
}

.filters-menu, .sort-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    width: 200px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.sort-menu button {
    display: block;
    width: 100%;
    padding: 8px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    margin-bottom: 5px;
}

.sort-menu button:hover {
    background: #444;
}

.filter-section {
    margin-bottom: 10px;
}

.filter-section span {
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-bottom: 5px;
}

.filter-section label {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 5px;
    background: #2a2a2a;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-section label:hover {
    background: #3a3a3a;
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #333;
    border: 1px solid #555;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: #333;
}

input[type="checkbox"]:checked::after,
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #cc7000;
    border-radius: 50%;
}

.filters-menu button {
    width: 100%;
    padding: 8px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.filters-menu button:hover {
    background: #444;
}

.game-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.game-history-item, .transaction-history-item {
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    color: #ccc;
}

.game-type, .transaction-type {
    font-weight: bold;
    color: #fff;
}

.opponent, .outcome, .stake, .date, .amount, .status, .reason {
    margin-top: 5px 
}

.profile-page button {
    cursor: pointer;
}

.button-paymentplus {
    position: absolute;
    top: 8.5px; /* От верха */
    right: 10px; /* От правой стенки */
    width: 30px; /* высота */
    height: 30px; /* ширина */
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 2000;
    object-fit: contain;
    cursor: pointer;
    transition: filter 0.2s ease; 
}

.button-paymentplus:hover {
    filter: brightness(80%); /* делает изображение чуть темнее */
    transform: scale(1.01); /* Типо не увеличивает изображение особо не чем не помогает */
}

.fon-paymentplus {
    position: fixed;
    top: 15px;
    right: 10px;
    width: 125px;
    height: 50px;
    background-color: rgba(50, 50, 50, 0.932);
    border-radius: 12px;
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-left: 7.5px; 
    cursor: pointer;
}
.user-info img {
    width: 40px !important;  /* !important на случай переопределений */
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;  /* Не даёт flex растягивать */
}

.top-line {
    display: flex;
    justify-content: space-between;
    background-color: rgb(12, 12, 12);
    padding: 20px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.button-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    border-radius: 10px;
    z-index: 0;
}

.image-container {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - 120px);
}

/* Окно с 10 этажа */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    padding: 30px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal__main {
    position: relative;
    width: 100%;
    max-width: 370px;
    background-color: #1e1e1e;
    color: #fff;
    border-radius: 16px;
    padding: 20px;
    margin: auto;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(100vh); }
    to { transform: translateY(0); }
}

.modal__title {
    font-size: 18px;
    margin: 0 0 10px;
    text-align: center;
    font-weight: 600;
}

.modal__divider {
    border: none;
    height: 1px;
    background-color: #ffffff30;
    margin: 4px 0;
}

.modal__close {
    background: rgba(128, 128, 128, 0.5);
    border: none;
    color: #fff;
    font-size: 24px;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.modal__close:hover {
    background: rgba(128, 128, 128, 0.8);
}

.modal__wallet-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
}

.modal__wallet {
    width: 100%;
    max-width: 220px;
    height: 38px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #333;
    /*background: linear-gradient(90deg, #e2a963, #cc7000); /* Тот же цвет, что у пополнить/вывести */
    color: #fff;
    border: none;
    padding: 0 15px;
    margin: auto;
    gap: 8px;
}

.modal__wallet:hover {
    background: #444;
    /*background: linear-gradient(90deg, #f0b975, #d87b00); /* Светлее при наведении */
    transform: scale(1.02);
}

.modal__wallet.connected {
    border: 2px solid #cc7000; /* Обводка как у активных кнопок */
}

.wallet-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.modal__options {
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
    margin: 0;
}

.modal__option-btn {
    flex: 1;
    padding: 10px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, border 0.3s, transform 0.2s;
    max-width: 160px;
    height: 40px;
}

.modal__option-btn.active {
    background: #444;
    border: 2px solid #cc7000;
    transform: scale(1.02);
}

.modal__option-btn:hover {
    background: #555;
    transform: scale(1.02);
}

.modal__deposit-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards 0.1s;
    margin: 0;
}

.modal__method-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.modal__method-btn {
    flex: 1;
    padding: 10px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.3s, border 0.3s, transform 0.2s;
    max-width: 160px;
    height: 40px;
}

.modal__method-btn.active {
    background: #444;
    border: 2px solid #cc7000;
    transform: scale(1.02);
}

.modal__method-btn:hover {
    background: #555;
    transform: scale(1.02);
}

.method-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.modal__soon {
    color: #fff;
    text-align: center;
    font-size: 16px;
    padding: 20px 0 10px 0;
    margin: 0;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
    line-height: 1;
}

.modal__stars-content {
    margin: 0;
    padding: 0;
    min-height: 50px; /* Минимальная высота для контента */
    display: flex;
    align-items: flex-end; /* Привязка к нижней части */
    justify-content: center;
}

.modal__container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards 0.2s;
}

.modal__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
    margin-bottom: 4px;
    text-align: center;
}

.modal__input {
    width: 100%;
    max-width: 250px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #2e2e2e;
    color: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    height: 40px;
}

.modal__input.modern-input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
    height: 40px;
}

.modal__input.modern-input:focus {
    border-color: #cc7000;
    box-shadow: 0 0 8px rgba(204, 112, 0, 0.3);
    outline: none;
}

.modal__info {
    font-size: 12px;
    color: #facc15;
    margin-bottom: 8px;
    text-align: center;
}

.modal__btn {
    width: 100%;
    max-width: 160px;
    height: 40px;
    background: linear-gradient(90deg, #e2a963, #cc7000);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.modal__btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal__btn:hover:not(:disabled) {
    background: linear-gradient(90deg, #f0b975, #d87b00);
    transform: scale(1.02);
}

.tab-icon {
    width: 22px;
    height: 22px;
    margin-right: 4px;
}

.modal__bonus {
    background-color: #ff3b30;
    color: white;
    border-radius: 8px;
    font-size: 10px;
    padding: 0px 4px;
}

.balance {
    color: #ffffff;
    padding: 8px 14px;
    font-weight: bold;
    margin-top: 2px;
    margin-right: 15px;
}

.stars {
    width: 20px;
    height: 20px;
    margin-top: -2px;
    margin-right: -10px;
}

.ton-connect-modal,
div[class*="ton-connect"],
div[class*="tonconnect"] {
    z-index: 20000 !important;
}

#loader {
    transition: opacity 1s ease;
    opacity: 1;
}

#loader.fade-out {
    opacity: 0;
}

* {
    user-select: none !important;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

button, a, input, textarea {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    outline: none !important;
    touch-action: manipulation;
}

button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: none !important;
    box-shadow: none !important;
}

body::-webkit-scrollbar {
    display: none;
}

.progress-container-top {
    width: 90px;
    height: 4px;
    background: linear-gradient(90deg, #333, #555);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 2px;
}

.progress-fill-top {
    height: 100%;
    background: linear-gradient(90deg, #e2a963, #cc7000);
    transition: width 1s ease;
    width: 0%;
}

@keyframes level-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.level-up {
    animation: level-up 0.5s ease-out;
}

/* Кнопка истории в профиле */
.history-button, .styles-button {
    background: linear-gradient(90deg, #e2a963, #cc7000);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s;
    flex: 1;
}

.history-button:hover, .styles-button:hover {
    transform: scale(1.05);
}

/* Модальное окно истории */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-modal.show {
    opacity: 1;
}

.history-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.history-modal.show .history-modal-content {
    transform: scale(1);
}

.history-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(128, 128, 128, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.history-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.history-tab {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.history-tab.active {
    background: #1a1a1a;
    border-bottom: 2px solid #cc7000;
}

.history-content {
    display: none;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    position: relative;
}

.history-content.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #cc7000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 5px auto 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.styles-content {
    color: #ccc;
    text-align: center;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0; /* или даже 1 */
  pointer-events: none; /* ✅ фон не перехватывает клики */
}

.particle {
  position: absolute;
  top: -20px;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 70%);
  border-radius: 50%;
  animation: fall linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 0.8;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(100vh) rotate(360deg) scale(0.3);
    opacity: 0;
  }
}

/* Стили для настроек */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    background: #222;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.settings-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #fff;
    text-align: left;
}

.sound-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sound-label {
    font-size: 14px;
    color: #ccc;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #d3d3d3;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #cc7000;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.volume-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-slider {
    -webkit-appearance: none; /* Это для самого ползунка */
    appearance: none; /* Стандартное свойство */
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #cc7000, #a55a00);
    outline: none;
    transition: opacity .2s;
    border-radius: 3px;
}

.volume-slider:hover {
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; /* А это для бегунка в WebKit */
    appearance: none;
    width: 18px;
    height: 18px;
    background: #d3d3d3;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(204, 112, 0, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #d3d3d3;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(204, 112, 0, 0.5);
    border: none; /* Добавьте это для Firefox */
}

.volume-slider::-moz-range-track {
    background: linear-gradient(90deg, #cc7000, #a55a00);
    height: 6px;
    border-radius: 3px;
    border: none;
}

.support-button {
    background: linear-gradient(90deg, #e2a963, #cc7000);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, background 0.3s;
    margin-top: auto;
}

.support-button:hover {
    transform: scale(1.02);
    background: linear-gradient(90deg, #f0b975, #d87b00);
}

.support-button svg {
    width: 24px;
    height: 24px;
}

.levels-scroll {
    overflow-x: auto;
    padding: 10px 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.levels-container {
    position: relative;
    height: 150px;
    width: 2000px;
    margin: 0 auto;
}

.levels-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 12px;
    background: #333;
    transform: translateY(-50%);
    border-radius: 2px;
}

.levels-fill-max {
    position: absolute;
    top: 50%;
    left: 0;
    height: 12px;
    background: linear-gradient(90deg, #e2a96388, #cc700088);
    transform: translateY(-50%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.levels-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 12px;
    background: linear-gradient(90deg, #e2a963, #cc7000);
    transform: translateY(-50%);
    border-radius: 2px;
    transition: width 0.5s ease;
    overflow: visible;
}

.level-point {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease;
}

.level-point.passed polygon {
    fill: #cc7000;
}

.level-point polygon {
    fill: #000000;
}

.level-point text {
    fill: #ffffff;
}

.level-cut {
    position: absolute;
    top: 50%;
    width: 1px;
    height: 20px;
    background: #555;
    transform: translate(-50%, -50%);
}

.points-label, .cut-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 40px;
    font-size: 12px;
    color: #aaa;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.levels-content {
    color: #ccc;
    text-align: center;
    padding: 10px 20px 20px;
}

.spark {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%; /* Круглые для "искр" */
    box-shadow: 0 0 10px #ff4500, 0 0 20px #ffd700, 0 0 30px #ff8c00; /* Сильнее свечение */
    filter: blur(1px); /* Размытие для естественности */
    opacity: 0.9;
    animation-duration: 0.6s !important;
    animation-iteration-count: infinite !important;
    animation-timing-function: ease-out !important; /* Ускорение в конце для "рывка" */
}

@keyframes spark1 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(20px, -5px) scale(1.2); opacity: 0; } /* Вправо с подъемом */
}

@keyframes spark2 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(25px, 5px) scale(0.8); opacity: 0; } /* Вправо вниз */
}

@keyframes spark3 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(18px, -10px) scale(1.5); opacity: 0; } /* Вправо сильно вверх */
}

@keyframes spark4 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(22px, 8px) scale(1.0); opacity: 0; } /* Вправо с поворотом */
}

@keyframes spark5 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(30px, 0) scale(1.3); opacity: 0; } /* Прямо вправо */
}

@keyframes spark6 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(25px, -3px) scale(0.9); opacity: 0; }
}

@keyframes spark7 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(28px, 10px) scale(1.4); opacity: 0; }
}

@keyframes spark8 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(20px, -8px) scale(1.1); opacity: 0; }
}

@keyframes spark9 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(35px, 2px) scale(1.2); opacity: 0; } /* Далеко вправо */
}

@keyframes spark10 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(24px, -6px) scale(0.7); opacity: 0; }
}

.styles-header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #222;
  padding: 10px;
  border-bottom: 1px solid #333;
  border-radius: 8px 8px 0 0;
}

.style-btn {
  padding: 8px 16px;
  background: #2d2d2d;
  color: #eee;
  border: 1px solid #555;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
}

.style-btn:hover {
  background: #3b3b3b;
  transform: scale(1.02);
}

.styles-preview {
  position: relative;
  height: 250px; /* Высота для демонстрации */
  padding: 20px;
  background: #1A1A1A;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Убедиться в overflow hidden для поля, чтобы эффект в пределах */
.preview-field {
  width: 200px;
  height: 250px; /* Фиксированная высота, не расширяется */
  background: linear-gradient(145deg, #cccccc, #888888) !important;
  border-radius: 15px;
  position: relative;
  visibility: visible !important;
  overflow: hidden !important; /* Эффект в пределах поля */
}

.preview-avatar {
  position: absolute;
  top: 30px; /* отступ от верха */
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background: #444444; /* тёмно-серый круг для авы */
  border-radius: 50%;
}

.preview-nick {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 20px;
  background: #444444 !important;
  border-radius: 10px;
  visibility: visible !important;
}

.styles-divider {
  border: none;
  height: 1px;
  background: #444;
  margin: 10px 0;
}

.apply-btn {
  background: linear-gradient(90deg, #e2a963, #cc7000);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.2s;
  width: 100%;
}

.apply-btn:hover {
  transform: scale(1.05);
}

.style-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2100; /* Повышен для sub-модалов */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.style-modal.show {
  opacity: 1;
}

.style-modal-content {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 300px;
  position: relative;
  display: flex;
  justify-content: space-around;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  pointer-events: auto; /* Для содержимого */
}

.style-modal.show .style-modal-content {
  transform: scale(1);
}

.style-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(128, 128, 128, 0.5);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.option-square {
  width: 120px;
  height: 120px;
  background: #333;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer; /* Курсор для клика */
  transition: border 0.2s;
  position: relative;
  z-index: 10; /* Выше всего */
  pointer-events: auto;
}

.option-square.selected {
  border: 2px solid #cc7000; /* Темно-оранжевый обвод */
}

.no-symbol {
  font-size: 40px;
  color: #ccc;
}

.frame-preview {
  width: 80px;
  height: 80px;
  border: 2px solid #888; /* Серовая рамка */
  border-radius: 50%;
}

.bg-preview svg, .flowers-preview, .comets-preview {
  width: 100%;
  height: 100%;
  color: #ccc;
}

.comets-preview, .comets-effect {
  position: relative;
  overflow: hidden;
  width: 200px !important;
  height: 250px !important; /* Фиксированная высота, не расширяется */
}

.comets-preview::before, .comets-preview::after,
.comets-effect::before, .comets-effect::after {
  position: absolute;
  width: 2px;
  height: 60px;
  background: linear-gradient(transparent, white);
  animation: comet-fall 3s linear infinite; /* Медленнее - 3s */
  opacity: 0.8;
  transform-origin: top;
}

.comets-preview::after, .comets-effect::after {
  left: 70%;
  animation-delay: -0.75s;
  height: 40px;
}

@keyframes comet-fall {
  0% { transform: translateY(-100%); opacity: 1; }
  100% { transform: translateY(1200%); opacity: 0; } /* Ещё дальше для полного пролёта */
}

.bg-preview, .nick-frame-preview {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Подгонка по размеру */
}

.question-symbol {
  font-size: 40px;
  color: #ccc;
  font-weight: bold;
}

.comet {
  position: absolute;
  width: 2px;
  height: 60px;
  background: linear-gradient(transparent, white);
  animation: comet-fall 3s linear infinite;
  transform-origin: top;
  opacity: 0.8;
}

.preview-field.default-bg {
    background: linear-gradient(145deg, #cccccc, #888888) !important;
}

.preview-field.custom-bg {
    background-image: url('photo/raw.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-color: transparent !important;
}

.current-points-frame {
    text-align: center;
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 5px 10px;
    margin: 5px auto 0;
    width: fit-content;
}

.reward-icon {
    position: absolute;
    top: -45px; /* Поднимаем весь блок над уровнем */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px; /* Добавляем зазор между SVG и стрелкой */
}

/* Страница маркета */
.market-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    color: white;
    display: none;
    z-index: 999;
    padding: 0; /* Убрано padding для фикса верха */
    box-sizing: border-box;
    overflow: hidden; /* Страница не скроллится */
    text-align: center;
}

.market-header.fixed {
    position: fixed;
    top: 79px; /* Ниже top-line */
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 10px 20px;
    z-index: 1001; /* Выше скролла */
    box-sizing: border-box;
}

.profile-buttons {
    display: flex;
    justify-content: space-around;
    margin: 0;
}

.goods-scroll {
    height: 100vh;
    overflow-y: auto;
    padding-top: 150px;
    padding-bottom: 60px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Квадратики побольше */
    gap: 15px;
    justify-items: center;
}

.option-square {
    width: 150px; /* Побольше */
    height: 150px;
    background: #333;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: border 0.2s;
    animation: slideUp 0.5s ease forwards; /* Анимация выхода снизу */
    opacity: 0; /* Начально скрыто для анимации */
}

.option-square:nth-child(1) { animation-delay: 0.1s; }
.option-square:nth-child(2) { animation-delay: 0.2s; }
.option-square:nth-child(3) { animation-delay: 0.3s; }
.option-square:nth-child(4) { animation-delay: 0.4s; }
.option-square:nth-child(5) { animation-delay: 0.5s; }
.option-square:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.question-symbol {
    font-size: 60px; /* Больше */
    color: #ccc;
    font-weight: bold;
}

/* Обновление для consistency страниц */
.button-container, .profile-page, .market-page {
    opacity: 1;
    transition: opacity 0.2s ease; /* Ускорено */
}

.style-modal .option-square {
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

.market-dev-text {
    font-size: 18px;
    font-weight: bold;
    color: #ccc;
    text-align: center;
    padding: 10px;
}

#transitionOverlay {
    transition: opacity 0.1s ease; /* Ускорено для возврата в меню */
}

#gameLoader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 10000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.circle-border {
  width: 100px;
  height: 100px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
}

.spinner {
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top: 4px solid #cc7000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: -4px;
  left: -4px;
  box-sizing: border-box;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}