:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --accent: #ffc107;
    --accent-hover: #0056b3;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --primary: #6366f1;
    --secondary: #ec4899;
    --bg: #0f172a;
    --gold: #ffcc00;
    --gold-dark: #e6b800;
    --gold-light: #ffdd33;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
   --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

body.dark-mode {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    
}

.background-gradient {
    position: absolute;
    overflow-y:auto;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.15) 0%, transparent 70%),
                radial-gradient(ellipse at bottom, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
}

@font-face {
  font-family: 'Montserrat-Regular'; /* имя шрифта */
  src: url('/static/fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat-Medium'; /* имя шрифта */
  src: url('/static/fonts/Montserrat-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat-Bold';
  src: url('/static/fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: bold; /* 700 */
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat-SemiBold';
  src: url('/static/fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600; /* SemiBold обычно 600 */
  font-style: normal;
}

@font-face {
  font-family: 'Unbounded-bold'; /* имя шрифта, которое ты будешь использовать */
  src: url('/static/fonts/Unbounded-Bold.ttf') format('truetype');
  font-weight: bold; /* или 700 */
  font-style: normal;
}

.tasks-title {

    text-align: center;
  font-family: "Unbounded-bold";
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  padding-bottom:14px;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.floating-particles::before {
    top: -100px;
    left: -100px;
}

.floating-particles::after {
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@font-face {
  font-family: 'Montserrat-Regular'; /* имя шрифта */
  src: url('/static/fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat-Medium'; /* имя шрифта */
  src: url('/static/fonts/Montserrat-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

.background-gradient,
.floating-particles {
  pointer-events: none; /* не перехватывают клики */
}
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 170px;
    box-sizing: border-box;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
    /* padding-bottom: 1rem; */
}

.tab-content.active {
    display: flex;
    overflow-y:auto;
}

/* Characters Grid */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.character-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    min-height: 200px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

.character-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.character-card h3 {
    padding: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.character-card p {
    padding: 0;
    font-size: 14px;
    line-height: 1.3;
}

.character-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}



.image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* overlay для имени и бейджей */
.overlay-content {
    position: absolute;
    width: 100%;
    bottom: 10px;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* клики проходят на карточку */
}

/* имя персонажа */
.name-overlay {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

/* badges контейнер */

/* badges */
.badges {
    display: flex;
    gap: 4px;
}

.badge {
    background: rgba(255, 204, 0, 0.85);
    color: #000;
    font-size: 8px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
}


.header {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 10px 18px;

  color: white;
  font-family: 'Montserrat-Bold', sans-serif;

}

.header-title {
  font-weight: 700; /* Unbounded Bold */
  font-size: 18px;
  margin: 0;
}


.balance-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: transparent;
}

.balance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
  border: 1px solid rgba(255, 204, 0, 0.4);
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: 500;
  color: white;
  user-select: none;
  font-family: "Montserrat-Bold", Helvetica;
  font-size: 14px;
}

/* вот это главное — растягиваем баланс */
.balance-item:not(.wallet-item) {
  flex: 1; /* занимает всё свободное место */
  justify-content: center; /* содержимое по центру */
}

/* кошелёк справа фиксированный */
.balance-item.wallet-item {
  flex-shrink: 0; /* не сжимается */
  padding: 6px 10px;
}

.balance-item.wallet-item button {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.stats-tabs {
  display: flex;
  justify-content: space-between; /* равномерно растягивает */
  gap: 15px;
  margin-bottom: 25px;
  width: 100vw;          /* полная ширина экрана */
  max-width: 78%;       /* не вылезать за контейнер */
  padding: 0 12px;       /* отступы слева и справа */
  box-sizing: border-box;
  margin-left:60px;
  margin-right:28px;
}


.balance-icon {
    width: 20px;
    height: 20px;
}

.balance-amount {
    font-weight: bold;
}


.lucky-pass-btn.lucky-active {
  background: #28a745; /* зелёный */
  border: 2px solid #1e7e34;
  transition: 0.3s ease;
}



.lucky-pass-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px #ffca28, 0 0 30px #ffa000;
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.language-select {
  position: relative;
  display: inline-block;
  user-select: none;
  cursor: pointer;
  color: white;
}
.language-select .options {
  display: none;
}

.language-select .options.show {
  display: block;
  position: absolute;
  top: 100%;
  /* right: 0; */
  background: #333;
  color: white;
  padding: 10px;
  border-radius: 5px;
  z-index: 1000;
  min-width: 100px;
  min-height: 100px;
}

.balance-icon {
  width: 24px;
  height: 24px;
}

.language-select .options li {
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
}

.language-select .options li:hover {
  background: #444;
}


.lucky-pass-btn img {
  width: 24px;
  height: 24px;
  display: block;
  user-select: none;
  pointer-events: none;
}



/* Chat Styles */
.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    /* background: var(--bg-secondary); */
    border-bottom: 1px solid var(--border);
    gap: 15px;
    flex-shrink: 0;
    height: 50px;
}

.chat-header img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-info h3 {
    color: #fff;
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 14px;
}

.status {
    font-size: 14px;
    color: var(--success);
}

.back-btn,
.gift-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease;
}

.back-btn:hover,
.gift-btn:hover {
    color: var(--accent);
}

/* Контейнер для видео и сообщений */
.chat-container {
    position: relative;
    flex: 1;
    display: flex;            /* важно */
    flex-direction: column;   /* чтобы flex:1 у chat-messages работал */
    overflow: hidden;
    /* margin-bottom:15px; */
}

/* Видео на фон */
.chat-background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Сообщения поверх видео */
.chat-messages {
    flex: 1 1 auto;           /* позволяет растягиваться */
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(0,0,0,0.2); /* полупрозрачный фон для читаемости */
    margin-bottom:0.8rem;
    
}


.message {
    margin-bottom: 15px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.system {
    justify-content: center;
}

.message .content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
}

.message:not(.user) .content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.message.user .content {
    background: #4f46e5;
    color: white;
}

.message.system .content {
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.chat-input {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 70px; /* сидит над bottom-nav */
  padding: 10px 20px;
  z-index: 1000;
  display: none;
  justify-content: center;
  transition: all 0.3s ease;
}

.chat-input.visible {
  display: flex;
  bottom: 20px; /* сдвигаем вниз, если нет bottom-nav */
}


/* Внутренний блок input */
.chat-input-inner {
    display: flex;
    gap: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 5px 10px;
    max-width: 600px;
    width: 100%;
}

/* Input */
.chat-input input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 15px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

/* Button */
.chat-input button {
    background: #ffc107;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background: var(--accent-hover);
}

/* Navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    flex-shrink: 0;
    height: 70px;
}

.bottom-nav.hidden-nav {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 5px;
}

.nav-item span {
    font-size: 12px;
}

.nav-item.active {
    color: #ffc107;
}

/* Settings */
.settings-content {
    padding: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .slider {
    background-color: var(--accent);
}

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

.danger-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Chat List */
.chat-list {
    padding: 0;
}

.chat-list-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    background: rgb(0,0,0,0.4);
    transition: background-color 0.3s ease;
}

.chat-list-item:hover {
    background: var(--bg-secondary);
}

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

.chat-list-item .chat-info {
    flex: 1;
}

.chat-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-time {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.last-message {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.unread-badge {
    background: var(--accent);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
}

/* Gift Modal */
.gift-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 30px;
    max-width: 300px;
    width: 90%;
    text-align: center;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.gift-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.gift-item i {
    font-size: 30px;
    color: var(--accent);
    margin-bottom: 10px;
}

.close-modal {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.modal-bottom-sheet {
    background: var(--bg-primary);
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
    border-top: 1px solid var(--border);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.modal-bottom-sheet img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 20px;
    border: 3px solid var(--accent);
}

.modal-bottom-sheet h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-bottom-sheet p {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.chat-start-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.chat-start-btn:hover {
    background: var(--accent-hover);
}

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

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

/* Responsive */
@media (max-width: 480px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .character-card h3 {
        font-size: 16px;
    }
    
    .character-card p {
        font-size: 12px;
    }

    .app-container {

      padding-bottom: 140px;
    }
}

/* Chat list empty state */
.chat-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.select-character-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.select-character-btn:hover {
    background: var(--accent-hover);
}

h1 {
    padding: 10px;
    font-size: 23px;
    color: var(--text-primary);
}

/* кнопка действий */
.action-btn {
    margin-right: 5px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    padding: 6px 6px;
    cursor: pointer;
    position: relative;
    z-index: 0;
    transition: transform 0.2s;
    /* убираем overflow чтобы свечение было видно */
}

/* Анимация свечения вокруг кнопки */
.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    animation: glow 2s infinite;
}

/* Пульсация свечения */
@keyframes glow {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
}

/* При наведении кнопка слегка увеличивается */
.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}



.action-modal {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  color: #fff;
  border-radius: 15px 15px 0 0;
  padding: 20px;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
  transition: bottom 0.3s ease;
  z-index: 1000;
}

.action-modal.show {
  bottom: 0;
}

.action-content h3 {
  margin-top: 0;
  text-align: center;
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: bold;
  color: #ffcc00;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);/* премиальный градиент */
  padding: 16px 20px;
  border-radius: 16px; /* более закругленные углы */
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25); /* мягкая тень */
  color: #fff;
}

.action-item:hover {
  background: linear-gradient(145deg, #6a1b9a, #9c27b0); /* чуть ярче на hover */
  transform: translateY(-3px); /* эффект «поднятия» */
  box-shadow: 0 12px 24px rgba(0,0,0,0.35); /* усиление тени */
}

.action-item span {
  font-size: 18px; /* чуть больше шрифт */
  font-weight: 600;
}

.action-item .price {
  font-weight: 700;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 8px;
  backdrop-filter: blur(6px); /* размытие фона под ценой */
}


.price {
  color: #ffcc00;
  font-weight: bold;
}

.close-btn {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: #ffcc00;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #c69f02;
}

.tasks-wrapper {
    padding:15px;
}



/* .task-modal {
  position: fixed;
  top: 0;
  left: 0;
  right:0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  backdrop-filter: blur(8px);
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#taskmodal {

  overscroll-behavior: contain;
}

.task-modal.show {
  visibility: visible;
  opacity: 1;
}
.task-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 76.66vh;
  background: #121620;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  overflow-y: auto;


  margin-top: 3vh;


  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(.22,.9,.3,1);
  touch-action: pan-y; 
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; 
  gap:13px;
}

.task-modal.show .task-modal-content {
  transform: translateY(0);
} */


.task-modal {
  position: fixed;
  top: 0;
  left: 0;
  right:0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  backdrop-filter: blur(8px);
  align-items: flex-end; /* чтобы контент был внизу */
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* фон модалки */
#taskmodal {
  /* чтобы не «протаскивало» страницу за модалкой */
  overscroll-behavior: contain;
}

.task-modal.show {
  visibility: visible;
  opacity: 1;
}
.task-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 76.66vh;
  background: #121620;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  overflow-y: auto;

  /* чтобы модалка не "прилипала" к верху экрана — отступ */
  margin-top: 3vh;

  /* анимация подъёма / возврата */
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(.22,.9,.3,1);
  touch-action: pan-y; /* разрешаем вертикальные пан-движения внутри модалки */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; 
  gap:13px;
}

.task-modal.show .task-modal-content {
  transform: translateY(0); /* выезжает */
}

/* Заголовок/описание */
.task-title {
  text-align: center;
  color: #fff;
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 20px;
  margin: 12px 10px 6px;
}
.task-desc {
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin: 0 18px 6px;
}

.task-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}
.task-icon-wrap img#taskBigIcon {
  width: 140px;
  height: 140px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.reward-icon {
    color: #feca57;
}

/* Награда */
.reward-block {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}
.reward-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #38393E;
  padding: 10px 18px;
  border-radius: 30px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.reward-inner img {
  width: 28px;
  height: 28px;
}
.reward-value {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.text-wrapper-8 {

  font-family: "Montserrat-Bold", Helvetica;
  color: #ffffff;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  position: relative;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

* Кнопки подписки */
.subscribe-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  margin-top: 6px;
}
.subscribe-btn {
  position: relative;
  z-index: auto;
  display: inline-block;
  margin: 0 auto; /* Отступ сверху + автополя слева и справа */
  border-radius: 12px;
  border: 1px solid rgba(255, 204, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, rgba(99, 102, 241, 0.1) 50%,rgba(236, 72, 153, 0.1) 100%);
  padding: 17px;
  min-width: 300px;
  text-align: center; /* для текста внутри */
  cursor: pointer;
}
.subscribe-btn.secondary {
  background: #3A3A3A; /* альтернативная кнопка */
  color: #fff;
}
/* Кнопки подписки */
.subscribe-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  margin-top: 6px;
}

/* Футер - кнопка Проверить — всегда видна под .scroll-area */
.footer-actions {
  flex: 0 0 auto;
  padding: 10px 20px 18px;
  background: transparent;
}
.verify-btn {
  position: relative;
  z-index: auto;
  display: inline-block;
  margin: 0 auto; /* Отступ сверху + автополя слева и справа */
  border-radius: 12px;
  border: 1px solid;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, rgba(99, 102, 241, 0.1) 50%,rgba(236, 72, 153, 0.1) 100%);
  padding: 17px;
  min-width: 300px;
  text-align: center; /* для текста внутри */
  cursor: pointer;
}


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


.balance-modal {
  position: fixed;
  top: 0;
  left: 0;
  right:0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  backdrop-filter: blur(8px);
  align-items: flex-end; /* чтобы контент был внизу */
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* фон модалки */
#balancemodal {
  /* чтобы не «протаскивало» страницу за модалкой */
  overscroll-behavior: contain;
}

.balance-modal.show {
  visibility: visible;
  opacity: 1;
}
.balance-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 76.66vh;
  background: #121620;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  overflow-y: auto;

  /* чтобы модалка не "прилипала" к верху экрана — отступ */
  margin-top: 3vh;

  /* анимация подъёма / возврата */
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(.22,.9,.3,1);
  touch-action: pan-y; /* разрешаем вертикальные пан-движения внутри модалки */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; 
  gap:13px;
}

.balance-modal.show .balance-modal-content {
  transform: translateY(0); /* выезжает */
}

.balance-input {
    width: 100%;
    max-width: 200px; /* ограничиваем ширину */
    padding: 8px;
    margin: 0 auto 10px auto; /* авто по бокам центрирует */
    border-radius: 4px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
    text-align: center; /* центр текста внутри input */
    display: block; /* нужно, чтобы margin auto сработал */
}

.balance-options {
    display: flex;
    justify-content: center; /* центрируем кнопки по горизонтали */
    flex-wrap: wrap;         /* если кнопок много, они переносятся */
    gap: 5px;                /* отступ между кнопками */
}

.balance-options button {
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    border: none;
    background: linear-gradient(135deg, var(--gold), #ffdd44, var(--gold-light));
    color: #0a0a0a;
}



.h2modal {
    text-align: center;       /* центрирование текста по горизонтали */
    display: block;           /* на всякий случай */
    width: 100%;              /* чтобы занимал всю ширину родителя */
    margin: 0 auto;  
    font-family:"Montserrat-Medium";
    font-size:17px;         /* центрирование блока, если нужно */
}


.p2modal {
text-align: center;       /* центрирование текста по горизонтали */
    display: block;           /* на всякий случай */
    width: 100%;              /* чтобы занимал всю ширину родителя */
    margin: 0 auto;  
    font-family:"Montserrat-Regular";
    font-size:14px; 

}


/* Стили для радио кнопок способов оплаты */
.payment-methods {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 1rem;
}

.payment-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.payment-radio-item {
  position: relative;
  flex: 1;
  min-width: 120px;
  max-width: 150px;
}

.payment-radio-button {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #333;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1f2e, #252b3a);
  color: #9ca3af;
  font-family: "Montserrat-Medium";
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-radio-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.payment-radio-button:hover:before {
  left: 100%;
}

.payment-radio-button:hover {
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2);
}

/* Активное состояние */
.payment-radio-button.active {
  border-color: var(--gold, #ffd700);
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  transform: scale(1.02);
}

.payment-radio-button.active:before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* Иконки для способов оплаты */
.payment-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.payment-radio-button[data-method="crypto"] .payment-icon:before {
  content: "₿";
  font-weight: bold;
}

.payment-radio-button[data-method="stars"] .payment-icon:before {
  content: "⭐";
}

/* Анимация при клике */
.payment-radio-button.clicked {
  animation: clickPulse 0.3s ease;
}

@keyframes clickPulse {
  0% { transform: scale(1.02); }
  50% { transform: scale(0.98); }
  100% { transform: scale(1.02); }
}

/* Неактивные кнопки когда одна выбрана */
.payment-radio-button:not(.active) {
  opacity: 0.7;
}

.payment-radio-button.active ~ .payment-radio-button:not(.active),
.payment-radio-item:has(.payment-radio-button.active) ~ .payment-radio-item .payment-radio-button:not(.active) {
  opacity: 0.5;
}

/* Адаптивность */
@media (max-width: 480px) {
  .payment-radio-group {
    flex-direction: column;
    gap: 6px;
  }
  
  .payment-radio-item {
    max-width: none;
  }
  
  .payment-radio-button {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Дополнительные эффекты */
.payment-radio-button.active {
  position: relative;
}

.payment-radio-button.active:after {
  content: '✓';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: bold;
  animation: checkmarkAppear 0.3s ease;
}

@keyframes checkmarkAppear {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}
/* маленькая полоса-хэндл */
.modal-handle-pass {
  width: 40px;
  height: 5px;
  background: #ccc;
  border-radius: 3px;
  margin: 8px auto 15px auto;
  cursor: grab;
  touch-action: none; /* ручка будет перехватывать жесты */
}

.payment-img {
  width: 100%;
  max-width: 90vw;      /* не шире экрана */
  max-height: 40vh;     /* ограничение по высоте */
  object-fit: contain;  /* сохраняет пропорции */
  border-radius: 12px;
  display: block;
  margin: 0 auto 12px auto; /* центрируем */
}

.payment-crypto-block {
  margin-top: 20px;
  text-align: center;
}

.payment-subtitle {
  font-size: 17px;
  margin-bottom: 10px;
}

.payment-qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0 15px 0;
}

.payment-qr {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.payment-address-block {
  font-size: 15px;
  word-break: break-all;
}

.payment-address {
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  user-select: text;
}
.payment-qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.payment-qr {
  width: 200px;
  height: 200px;
}

.payment-address-block {
  background: #2a2a2a;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  word-break: break-all;
}

.payment-subtitle {
  text-align: center;
  margin-bottom: 10px;
}

.payment-price-block {
  margin: 10px 0;
  font-weight: bold;
}

.confirm-payment-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: rgb(15, 14, 14);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}


.payment-price-block {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;            /* расстояние между текстами */
  width: 100%;
  text-align: center;
  margin: 10px 0 15px;
}

.price-label,
.price-value {
  font-size: 16px;
}

.payment-success-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  text-align: center;

  transform: translateY(100%);
  transition: transform .25s ease;
}

.payment-success-box.show-success {
  transform: translateY(0);
}

.payment-success-btn {
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 16px;
  background: #4caf50;
  color: #fff;
  border: none;
}



/* Превью / видео wrapper */
.preview-wrapper,
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;    /* ограничение ширины элемента */
  min-width: 240px;    /* чтобы не сжимался до мини-иконки */
  aspect-ratio: 16/9;  /* гарантирует корректное соотношение */
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  margin: 8px 0;
  transition: transform 300ms ease, width 300ms ease, height 300ms ease;
}

.buy-button {
  position: relative;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: rgb(15, 14, 14);
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  margin: 20px auto 0; /* верхний отступ 20px, горизонтально автоцентрирование */
  display: block; /* делает margin auto эффективным */
  transition: all 0.2s;
}

/* сам video для превью (muted autoplay) */
/* .preview-video,
.main-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  background: #000;
} */

/* видео в превью размыто */
/* .preview-video.blurred {
  filter: blur(8px) saturate(.9);
  transform: scale(1.02); 
} */

/* overlay с кнопкой в центре */
/* .preview-overlay,
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
} */

/* Кнопка play/pause — pointer-events включаем через wrapper */
/* .play-btn {
  pointer-events: auto;
  z-index: 4;
  font-size: 28px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .2s ease, transform .12s ease;
}


.play-btn.hidden {
  opacity: 0;
  transform: scale(.95);
  pointer-events: none;
}


.preview-wrapper.expanded,
.video-wrapper.expanded {
  position: fixed;
  left: 50%;
  top: 6vh;
  transform: translateX(-50%);
  width: 92vw;
  height: auto;
  z-index: 9999;
  max-height: 88vh;
  aspect-ratio: initial; 
}


.video-wrapper.expanded .main-video,
.preview-wrapper.expanded .main-video {
  position: relative;
  width: 100vw;
  height: auto;
  object-fit: contain;
}


.big-icon {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: rgba(255,255,255,0.9);
  pointer-events: none;
  transition: opacity .18s ease;
}


.big-icon.hidden { opacity: 0; } */

/* превью wrapper (в потоке) */
.preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-width: 240px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  margin: 8px 0;
  transition: all 260ms ease;
}

/* video-preview (muted preview) */
.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* блюр для превью */
.preview-video.blurred {
  filter: blur(8px) saturate(.95);
  transform: scale(1.02);
}

/* overlay и маленькая кнопка play */
.preview-overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; z-index:3; pointer-events:none; }
.play-btn { pointer-events:auto; font-size:24px; width:56px; height:56px; border-radius:999px; border:none; background:rgba(0,0,0,0.55); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; }

/* большая иконка (pause/play) */
.big-icon { position:absolute; z-index:4; top:50%; left:50%; transform:translate(-50%,-50%); font-size:40px; color:rgba(255,255,255,0.95); pointer-events:none; transition:opacity .18s ease; }
.big-icon.hidden { opacity:0; }

/* при inline-expanded, контейнер растягивается на ширину вьюпорта,
   но остаётся в потоке через margin-left трюк */
.preview-wrapper.inline-expanded {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw);
  aspect-ratio: auto !important;
  z-index: 999;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  /* чтобы контейнер мог перекрывать родителей с overflow: hidden */
  position: relative;
}

/* ВАЖНО: при развёрнутом состоянии видео не должно быть cover, иначе кадр обрезается.
   Вместо этого подгоняем по высоте контейнера (height:100%) и width:auto */
.preview-wrapper.inline-expanded .preview-video {
  position: relative;
  width: auto !important;
  height: 100% !important;     /* видео заполняет высоту развёрнутого контейнера */
  object-fit: contain !important; /* показываем весь кадр без обрезки */
  left: 0;
  top: 0;
}


/* кнопка закрыть в правом верхнем углу при развёрнутом блоке */
.preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.message .content { display:flex; justify-content:center; align-items:center; }
/* прячем маленькую кнопку, когда она не нужна */
.play-btn.hidden { opacity: 0; pointer-events: none; transform: scale(.98); transition: .12s; }



/* Profile Page Styles */
.profile-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.profile-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.profile-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-size: 14px;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
}

.profile-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--gold), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-status {
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
}

.balance-section {
    margin-bottom: 30px;
}

.balance-card {
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(255, 204, 0, 0.4);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px rgba(255, 204, 0, 0.2);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        rgba(255, 204, 0, 0.1),
        rgba(99, 102, 241, 0.1),
        rgba(236, 72, 153, 0.1),
        rgba(255, 204, 0, 0.1)
    );
    animation: rotate 8s linear infinite;
    z-index: -1;
}

.balance-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.9),
        rgba(30, 41, 59, 0.95));
    border-radius: 22px;
    z-index: -1;
}

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

.balance-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold), #ffdd44, var(--gold-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--bg);
    box-shadow: 
        0 0 25px rgba(255, 204, 0, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    position: relative;
}

.balance-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, var(--gold), var(--primary), var(--secondary));
    border-radius: 50%;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}


.balance-icon {
    width: 20px;
    height: 20px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

.balance-info {
    flex: 1;
}

.balance-label {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--primary), var(--secondary));
    -webkit-background-clip: text;

}

.balance-currency {
    font-size: 24px;
    margin-left: 5px;
}

.add-balance-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #ffdd44);
    border: 1px solid var(--border);
    color: var(--bg);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.add-balance-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.6);
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.08),
        rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
    
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 204, 0, 0.1),
        transparent);
    transition: left 0.6s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--gold);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 204, 0, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold), #ffdd44);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 22px;
    color: var(--bg);
    box-shadow: 
        0 0 20px rgba(255, 204, 0, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    position: relative;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--gold), var(--primary), var(--secondary));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 4s linear infinite;
}

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

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.stat-label {
    font-size: 13px;
    color: #fff;
    letter-spacing: 0.5px;
}

.stat-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--secondary));
    border-radius: 0 0 20px 20px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stat-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.chart-section {
    margin-bottom: 30px;
}

.chart-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
}

.chart-container {
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.05),
        rgba(99, 102, 241, 0.03));
    border: 1px solid rgba(255, 204, 0, 0.25);
    border-radius: 24px;
    padding: 25px;
    height: 220px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.3);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--secondary));
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.actions-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-btnnew {
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.08),
        rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 20px;
    padding: 25px;
    text-align: left;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.action-btnnew::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 204, 0, 0.1),
        transparent);
    transition: left 0.6s ease;
}

.action-btnnew:hover::before {
    left: 100%;
}

.action-btnnew:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 204, 0, 0.2);
}

.action-btnnew i {
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.5));
}

.action-btnnew span {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.action-btnnew small {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.clear-chats-btn {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.1),
        rgba(255, 204, 0, 0.05));
    border-color: rgba(239, 68, 68, 0.4);
}

.clear-chats-btn:hover {
    border-color: var(--danger);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(239, 68, 68, 0.2);
}

.clear-chats-btn i {
    color: var(--danger);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}

/* Responsive adjustments */
@media (max-width: 390px) {
    .last-message {
        max-width: 150px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .balance-amount {
        font-size: 15px;
    }
}

.settings-wrapper {
  padding: 25px;
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0; /* Удалён отступ снизу */
  left: 0;    /* Установлено на 0 для полной ширины */
  right: 0;   /* Установлено на 0 для полной ширины */
  
  height: 70px;
  background-color: rgba(13, 13, 13, 1);
  /* backdrop-filter: blur(20px); */
  border-radius: 36px 36px 0 0; /* округлённые только верхние края */
  /* box-shadow: 0 0 15px rgba(16, 85, 251, 0.5); синий свет по краям */
  z-index: 300;
  padding: 0 20px; /* Отступы внутри, если они нужны */
  /* border-color:656565; */
  border: 0.5px solid rgba(122, 123, 124, 0.4); 
}

.nav-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 11px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: bold;
  color: #7a7a7a;
  background: transparent;
  border: none;
  overflow: visible;
}

.nav-btn.active {
  color: white;
  font-weight: 600;
}



/* Win Notification - маленькое сверху, полностью круглое, смещено вниз */
.win-notification {
    position: fixed;
    top: 60px; /* опускаем на 40 пикселей вниз */
    left: 50%;
    transform: translateX(-50%);
    background-color: #2E2E2E;
    padding: 10px 20px;
    border-radius: 25.5px; /* половина высоты (51 / 2) для полной округлости */
    text-align: left;
    z-index: 10000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    width: 350px;
    height: 51px;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; /* medium */
    font-size: 14px;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;

}

.win-notification-heros {
    position: fixed;
    top: 60px; /* опускаем на 40 пикселей вниз */
    left: 50%;
    transform: translateX(-50%);
    background-color: #2E2E2E;
    padding: 10px 20px;
    border-radius: 25.5px; /* половина высоты (51 / 2) для полной округлости */
    text-align: left;
    z-index: 5000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    width: 350px;
    height: 51px;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; /* medium */
    font-size: 16px;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.win-notification-heros.show {
    opacity: 1;
    pointer-events: auto;
}


/* Иконка успеха слева */
.win-notification__icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    background-image: url('success-icon.png'); /* вставь сюда путь к твоему значку */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.copy-notification__icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    background-image: url('copy-icon.png'); /* вставь сюда путь к твоему значку */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.error-notification__icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    background-image: url('error.png'); /* вставь сюда путь к твоему значку */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Класс для показа уведомления */
.win-notification.show {
    opacity: 1;
    pointer-events: auto;
}


/* Общий контейнер */
.boxes-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  color: #fff;
  text-align: center;
}

/* Заголовки */
.boxes-header {
  margin-bottom: 20px;
}

.boxes-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.boxes-subtitle {
  font-size: 14px;
  color: #ccc;
}

/* Сетка */
.boxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

/* Карточка бокса */
.box-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px 10px 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 15px rgba(255,255,255,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.box-card:hover {
  transform: translateY(-4px) scale(1.02);
}

/* Изображение бокса */
.box-image {
  width: 70%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}


.box-card:hover .box-image {
  transform: scale(1.1);
}


/* Название и описание */
.box-card h3 {
  margin: 6px 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.box-card p {
  font-size: 13px;
  color: #bbb;
}

/* Кнопка */
.box-btn {
  margin-top: 10px;
  background: linear-gradient(90deg, #FFD700, #FFAA00);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.box-btn:hover {
  filter: brightness(1.2);
}

/* Индивидуальные свечения */
.box-gold {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.box-gold:hover {
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
}

.box-purple {
  box-shadow: 0 0 20px rgba(180, 0, 255, 0.6);
}

.box-purple:hover {
  box-shadow: 0 0 40px rgba(200, 0, 255, 0.9);
}

.box-blue {
  box-shadow: 0 0 20px rgba(0, 150, 255, 0.6);
}

.box-blue:hover {
  box-shadow: 0 0 40px rgba(0, 180, 255, 0.9);
}


.box-ref {
  box-shadow: 0 0 20px rgba(133, 135, 137, 0.6);
}

.box-ref:hover {
  box-shadow: 0 0 40px rgba(61, 61, 62, 0.6);
}

.delete-chat-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.delete-chat-btn:hover .delete-chat-svg {
  fill: red;
}

#chat-modal-confirm {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  display: none; /* по умолчанию скрыта */
}

#chat-modal-confirm.chat-modal-visible {
  display: flex; /* показываем только при добавлении класса */
}

.chat-modal-content {
  background: #121620;
  padding: 20px;
  border-radius: 12px;
  max-width: 300px;
  width: 100%;
  text-align: center;
}

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

.chat-modal-buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#chat-modal-ok { background-color: #e74c3c; color: #fff; }
#chat-modal-cancel { background-color: #ccc; }


:root{
  --overlay-bg: rgba(6,8,15,0.7);
  --panel-bg: linear-gradient(180deg, rgba(18,20,28,0.96), rgba(12,14,20,0.97));
  --accent-1: #6a8cff;
  --accent-2: #4050c2;
  --glass-border: rgba(255,255,255,0.04);
  --glass-inner: rgba(255,255,255,0.02);
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-strong: 0 30px 80px rgba(2,6,23,0.7);
  --text: #eef2ff;
  --muted: rgba(255,255,255,0.6);
  --max-panel-width: min(1200px, 96vw);
}

/* overlay hidden / visible */
.roulette-hidden { display: none !important; }

#box-roulette-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.6));
  padding: 24px;
  -webkit-font-smoothing:antialiased;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* backdrop (click outside) */
#box-roulette-overlay .roulette-backdrop{
  position:absolute;
  inset:0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px) saturate(120%);
  pointer-events: auto;
  opacity: .98;
}

/* panel — почти весь экран по высоте */
.roulette-panel{
  position: relative;
  pointer-events: auto;
  width: var(--max-panel-width);
  height: min(88vh, 950px);   /* почти весь экран */
  max-height: 92vh;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-strong);
  color: var(--text);
  display: grid;
  grid-template-columns: 1fr 360px; /* основная полоса + боковая панель */
  gap: 18px;
  overflow: hidden;
}

/* close button */
.roulette-close{
  position:absolute;
  right:14px;
  top:14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  width:36px;
  height:36px;
  border-radius:10px;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  backdrop-filter: blur(6px);
}

/* main stage (широкая полоса) */
.roulette-stage {
  grid-column: 1 / 2;
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:center;
  justify-content:center;
  padding: 18px;
  position:relative;
}

/* viewport: теперь большая и визуально центрированная */
.roulette-strip-viewport {
  width: 100%;
  height: calc(100% - 120px); /* занимает большую часть левой колонки */
  min-height: 260px;
  border-radius: 14px;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 4px 18px rgba(3,6,12,0.4);
  padding: 18px;
  box-sizing: border-box;
}

/* long strip */
.roulette-strip{
  display:flex;
  align-items:center;
  height:100%;
  transform: translateX(0);
  will-change: transform;
  gap: 12px;
}

/* item: теперь крупнее и с современной картой */
.roulette-item{
  width: 180px;
  min-width: 180px;
  height: 100%;
  flex: 0 0 180px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.007));
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 18px rgba(6,10,20,0.45);
}
.roulette-item:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(5,8,20,0.6); }

.roulette-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:10px;
  display:block;
}

/* pointer — строго по центру видимой области */
.roulette-stage .roulette-pointer{
  position:absolute;
  top: 12px;                   /* чуть над полосой */
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  color: #ffd665;
  text-shadow: 0 6px 20px rgba(0,0,0,0.6);
  z-index: 40;
  pointer-events:none;
  opacity: 0;
  transition: transform .45s ease, opacity .25s ease;
}
.pointer-drop { opacity:1; transform: translate(-50%, 6px); }

/* right panel — summary + кнопка */
.roulette-side {
  grid-column: 2 / 3;
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:stretch;
  justify-content:flex-start;
  padding: 12px;
  min-width: 260px;
}
.roulette-current {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 18px;
  text-align:center;
  color: var(--text);
  box-shadow: 0 8px 30px rgba(3,6,15,0.35);
}
.roulette-spin{
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  cursor:pointer;
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
  color: white;
  font-weight:700;
  font-size:16px;
  box-shadow: 0 10px 30px rgba(64,80,194,0.16);
  transition: transform .12s ease, box-shadow .12s ease;
}
.roulette-spin:active { transform: translateY(2px); box-shadow: 0 6px 18px rgba(64,80,194,0.12); }
.roulette-spin[disabled]{ opacity:.5; cursor:not-allowed; }

/* small helpers */
.ru-legend { font-size:13px; color:var(--muted); text-align:center; }

/* mobile: панель в колонку, почти весь экран */
@media (max-width: 900px){
  .roulette-panel {
    grid-template-columns: 1fr;
    height: 94vh;
    padding: 14px;
  }
  .roulette-stage { padding: 12px; }
  .roulette-strip-viewport { height: 46vh; min-height: 260px; padding: 12px; }
  .roulette-item { width: 120px; min-width:120px; }
  .roulette-side { order: 2; width:100%; }
  .roulette-stage  { font-size: 30px; top: 8px; }
}

/* very small phones */
@media (max-width: 420px){
  .roulette-strip-viewport { height: 40vh; }
  .roulette-item { width: 100px; min-width:100px; }
  .roulette-panel { padding: 10px; border-radius: 12px; }
  .roulette-close { width:34px; height:34px; right:10px; top:10px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  .roulette-item, .roulette-strip, .roulette-shimmer { transition: none !important; animation: none !important; }
}


/* RESULT / FOG */
.roulette-result.hidden { display:none; }
.roulette-result {
  position: absolute;
  inset: 0;
  z-index: 120;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events: none;
}

/* туман / фог */
.roulette-result .fog {
  position:absolute;
  inset:0;
  background: radial-gradient(ellipse at center, rgba(8,10,14,0.65), rgba(3,4,6,0.85));
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 420ms cubic-bezier(.2,.9,.2,1);
  pointer-events: auto;
}

/* тонкая анимация «подъёма тумана» */
.roulette-result.show .fog { opacity: 1; animation: fogPulse 900ms ease-out; }
@keyframes fogPulse {
  0% { transform: scale(0.98); opacity: 0; }
  60% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* карточка результата */
.result-card {
  position: relative;
  z-index: 140;
  width: min(520px, 92%);
  max-width: 92%;
  border-radius: 14px;
  padding: 18px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  text-align: center;
  color: #fff;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 420ms cubic-bezier(.2,.9,.2,1), opacity 420ms ease;
  pointer-events: auto;
}

.roulette-result.show .result-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* текст / приз */
.result-title { font-size: 18px; color: #ffd965; font-weight: 700; margin-bottom: 8px; }
.result-prize { font-size: 22px; font-weight: 800; margin-bottom: 14px; }

/* кнопки */
.result-actions { display:flex; gap:10px; justify-content:center; }
.result-get, .result-close {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
.result-get {
  background: linear-gradient(180deg,#ffd965,#f0b12b);
  color: #1b1220;
}
.result-close { background: rgba(255,255,255,0.06); color: #fff; }

/* mobile: make sure button always visible at bottom */
@media (max-width:900px) {
  .roulette-side { order: 2; width:100%; padding-top: 10px; }
  .roulette-spin { width: 100%; }
  .roulette-strip-viewport { height: 42vh; }
}

/* Убедимся, что .roulette-stage содержит кнопку внизу */
.roulette-stage {
  grid-column: 1 / 2;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  justify-content:flex-start; /* важный момент: начинаем сверху, кнопка — внизу секции */
  padding: 18px;
  position:relative;
}

/* Нижняя зона прямо под полосой */
.roulette-bottom-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

/* текст описания (над кнопкой) */
.roulette-description {
  max-width: 880px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
  padding: 0 12px;
}

/* кнопка внутри рулетки — ставим full width небольшого размера */
.roulette-controls {
  width: 100%;
  display:flex;
  justify-content:center;
  padding: 6px 12px 0 12px;
  box-sizing: border-box;
}
.roulette-controls .roulette-spin {
  width: min(420px, 92%);
  max-width: 100%;
  display: inline-block;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 16px;
}

/* Убираем кнопку из правой панели (чтобы никто случайно дублировал) */
.roulette-side .roulette-spin { display: none !important; }

/* На мобилке: stage занимает всю ширину, кнопка под полосой, фиксируем большой отступ снизу */
@media (max-width: 900px) {
  .roulette-panel {
    grid-template-columns: 1fr; /* одна колонка */
    grid-auto-rows: auto;
    height: 94vh;
    padding: 12px;
  }

  .roulette-stage {
    order: 1;
    align-items: center;
    justify-content:flex-start;
  }

  .roulette-strip-viewport {
    height: 46vh;
    min-height: 220px;
  }

  .roulette-controls .roulette-spin {
    width: 100%;
    max-width: none;
  }

  .roulette-side {
    order: 2;
    margin-top: 6px;
  }
}


/* ensure backdrop is under panel and panel is on top */
#box-roulette-overlay .roulette-backdrop { z-index: 1; }
.roulette-panel { z-index: 2; position: relative; }

/* make left stage scrollable independently and ensure the spin button stays visible */
.roulette-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
  box-sizing: border-box;

  /* allow vertical scrolling inside stage on small screens */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top:40px;
}

/* make right side scrollable but collapsed on small screens */
.roulette-side {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* keep the bottom controls sticky under the strip on mobile */
.roulette-bottom-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  /* make controls stick to bottom of stage area if stage has more height */
  position: sticky;
  bottom: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.02));
  padding-top: 8px;
  padding-bottom: 8px;
}

/* make spin button prominent and ensure it doesn't get hidden */
.roulette-controls .roulette-spin {
  width: clamp(220px, 84%, 420px);
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ensure result overlay can receive pointer events when visible */
.roulette-result { pointer-events: none; }
.roulette-result.show { pointer-events: auto; }

/* prevent roulette-current from getting focus if it has an id */
#roulette-current { outline: none; user-select: none; }

/* mobile layout: make stage taller and keep controls visible */
@media (max-width: 900px) {
  .roulette-panel {
    grid-template-columns: 1fr;
    height: 94vh;
    padding: 12px;
  }
  .roulette-strip-viewport { height: 46vh; min-height: 200px; }
  .roulette-side { display: block; max-height: 26vh; margin-top: 10px; }
  .roulette-bottom-info { position: sticky; bottom: 8px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.03)); }
}

/* if something else steals focus, disable outline */
*:focus { outline-offset: 2px; }



/* контейнер */
.spoiler-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* базовая картинка — по умолчанию блюр + затемнение */
.spoiler-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(16px) brightness(0.6);
  transform: scale(1.06);
  transition: filter 420ms cubic-bezier(.2,.9,.2,1), transform 420ms cubic-bezier(.2,.9,.2,1);
  will-change: filter, transform;
}

/* большая движущаяся полоса — главный shimmer */
.spoiler-shimmer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      110deg,
      rgba(255,255,255,0.02) 0%,
      rgba(255,255,255,0.07) 28%,
      rgba(255,255,255,0.20) 48%,
      rgba(255,255,255,0.07) 62%,
      rgba(255,255,255,0.02) 100%
    );
  transform: translateX(-120%) skewX(-18deg);
  mix-blend-mode: screen;
  opacity: 0.95;
  transition: opacity 300ms ease;
  will-change: transform, opacity;
  filter: blur(6px);
}

/* мелкие блестки (точки/спрайты), добавляют глубины */
.spoiler-glints {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 30%, rgba(255,255,255,0.06) 0 6px, transparent 8px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.04) 0 5px, transparent 7px),
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.05) 0 4px, transparent 6px);
  background-repeat: no-repeat;
  opacity: 0.9;
  transform: translateX(0);
  will-change: transform;
  transition: opacity 300ms ease;
}

/* анимация полосы — медленно пролистывается слева направо */
@keyframes shimmerMove {
  0%   { transform: translateX(-120%) skewX(-18deg); }
  50%  { transform: translateX(10%) skewX(-18deg); }
  100% { transform: translateX(120%) skewX(-18deg); }
}

/* дополнительный ритмичный микродвижок для блеска */
@keyframes glintFloat {
  0% { transform: translateY(0) scale(1); opacity: 0.9; }
  50% { transform: translateY(-6px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 0.9; }
}

/* включаем анимации пока не раскрыто */
.spoiler-wrapper:not(.revealed) .spoiler-shimmer {
  animation: shimmerMove 2.1s linear infinite;
}
.spoiler-wrapper:not(.revealed) .spoiler-glints {
  animation: glintFloat 2.5s ease-in-out infinite;
}

/* текст поверх */
.spoiler-text {
  position: absolute;
  z-index: 6;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
  pointer-events: none;
  mix-blend-mode: normal;
}

/* при раскрытии — убираем блюр и плавно гасим слои */
.spoiler-wrapper.revealed .spoiler-image {
  filter: blur(0) brightness(1);
  transform: scale(1);
}
.spoiler-wrapper.revealed .spoiler-shimmer,
.spoiler-wrapper.revealed .spoiler-glints {
  opacity: 0;
  animation: none;
  transition: opacity 420ms ease;
}

/* если нужно — класс permanent оставляет навсегда раскрытой */
.spoiler-wrapper.revealed.permanent {
  pointer-events: none;
}

/* адаптация: на слабых устройствах уменьшаем блёр/анимации */
@media (prefers-reduced-motion: reduce) {
  .spoiler-shimmer, .spoiler-glints { animation: none; opacity: 0.7; }
  .spoiler-image { transition: none; filter: blur(10px); }
}


.roulette-strip-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.roulette-strip-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.roulette-strip {
  display: flex;
  transition: transform 0.4s cubic-bezier(.12,.6,.28,1);
}




.roulette-pointer .arrow {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 25px solid #ff3f3f; /* цвет стрелки */
  animation: bounce 0.3s ease-in-out forwards;
}

/* анимация “прыжка” при выпадении подарка */
.pointer-drop .arrow {
  animation: drop 0.4s ease forwards;
}

@keyframes drop {
  0% { transform: translateY(-30px); }
  50% { transform: translateY(5px); }
  100% { transform: translateY(0); }
}
.roulette-pointernew {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-image: url('strelka.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 5px gold);
  animation: pulse 1.5s infinite ease-in-out;
  z-index:4;
}

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 5px gold); }
  50% { filter: drop-shadow(0 0 15px gold); }
}


.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  /* background: #f9f9f9; */
}

.action-item:hover {
   background: linear-gradient(135deg, 
        rgba(239, 193, 8, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
}

.action-item video {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 10px;
  flex-shrink: 0;
}

.action-item span {
  font-weight: bold;
}

.price {
  color: #4CAF50;
}


.video-thumb {
    width: 120px;       /* фиксированная ширина */
    height: 120px;      /* фиксированная высота */
    object-fit: cover;  /* обрезаем лишнее, чтобы не искажать кадр */
    border-radius: 8px; /* опционально, скругляем углы */
    display: block;
    margin-bottom: 5px;
}

.action-item span {
    display: block;      /* каждая подпись — отдельная строка */
    text-align: center;  /* гарантируем центрирование текста */
    font-size: 14px;
}

.action-item .price {
    font-weight: bold;
    color: gold;
}

/* Контейнер маркет */
.market-wrapper {
    flex-direction: column;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Активный маркет */
.market-wrapper.active {
    display: flex;
}

/* Заголовок маркет */
.market-wrapper .market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.market-wrapper .market-header h2 {
    font-family: 'Unbounded-bold';
    font-size: 22px;
    color: var(--text-primary);
}

.market-wrapper .market-header button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
    color: #fff;
    border: 1px solid rgba(255, 204, 0, 0.4);
}

.market-wrapper .market-header button:hover {
    background: var(--accent-hover);
}

/* Категории */
.market-wrapper .market-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.market-wrapper .market-categories button {
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.market-wrapper .market-categories button.active {
    color: #fff;
    border: 1px solid rgba(255, 204, 0, 0.4);
}

.market-wrapper .market-categories button:hover {
    /* background: var(--primary); */
    color: #fff;
}

.market-wrapper .cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* ровно 2 карточки в ряд */
    gap: 20px;
}


/* Карточка товара */
.market-wrapper .market-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.market-wrapper .market-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

/* Изображение карточки */
.market-wrapper .market-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

/* Контент карточки */
.market-wrapper .market-card-content {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.market-wrapper .market-card-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.market-wrapper .market-card-content p {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.market-wrapper .market-card-content button {
    padding: 8px 0;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.market-wrapper .market-card-content button:hover {
    background: var(--gold-dark);
    color: #fff;
}
.auction-badge {
  position: fixed;      
  right: 20px;          
  bottom: 90px;         
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 170, 0, 0.9));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  z-index: 10000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.auction-badge:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.auction-badge img.auction-badge-gif {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}

.auction-timer {
  position: absolute;
  top: 50px;
  right: 1px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: monospace;
  white-space: nowrap;
  backdrop-filter: blur(5px);
}




/* Фиксированная кнопка создания */
.create-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: #04080d;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: 0.2s;
    color: #fff;
    border: 1px solid rgba(255, 204, 0, 0.4);
}
.create-btn:hover { background-color: #0056b3; }
.create-btn svg { display: block; }


.market-modal {
  position: fixed;
  top: 0;
  left: 0;
  right:0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  backdrop-filter: blur(8px);
  align-items: flex-end; /* чтобы контент был внизу */
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* фон модалки */
/* #taskmodal {

  overscroll-behavior: contain;
} */

.market-modal.show {
  visibility: visible;
  opacity: 1;
}
.market-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 85.66vh;
  background: #121620;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  overflow-y: auto;

  /* чтобы модалка не "прилипала" к верху экрана — отступ */
  margin-top: 3vh;

  /* анимация подъёма / возврата */
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(.22,.9,.3,1);
  touch-action: pan-y; /* разрешаем вертикальные пан-движения внутри модалки */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; 
  gap:13px;
}

.market-modal.show .market-modal-content {
  transform: translateY(0); /* выезжает */
}

/* Заголовок/описание */
.market-title {
  text-align: center;
  color: #fff;
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 20px;
  margin: 12px 10px 6px;
}

/* -------------------- Верхние табы -------------------- */
.market-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.market-tab {
  padding: 8px 16px;
  border-radius: 12px;
  background: #1e2230;
  color: #aaa;
  font-family: "Unbounded-SemiBold", sans-serif;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.market-tab.active {
  background: #2a2f44;
  color: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.2);
}

/* hover эффект для вкладок */
.market-tab:hover:not(.active) {
  background: #252a3b;
  color: #fff;
}

/* -------------------- Поля формы -------------------- */
.market-modal input,
.market-modal select {
  background: #1e2230;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-modal input:focus,
.market-modal select:focus {
  border-color: #4f93ff;
  box-shadow: 0 0 6px rgba(79, 147, 255, 0.5);
}

/* подписи к полям */
.market-modal label {
  display: block;
  color: #ccc;
  font-size: 13px;
  margin-bottom: 4px;
  font-family: "Unbounded-Regular", sans-serif;
}

/* обёртка видео */
/* ---------------- Кастомное поле загрузки ---------------- */
#marketFileWrapper {
  margin-top: 10px;
}

.custom-file-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e2230;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: 100%;
  max-width: 100%;
}

.custom-file-upload:hover {
  background: #252a3b;
  border-color: #4f93ff;
}

.custom-file-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-label {
  color: #fff;
  font-size: 14px;
  margin-right: 8px;
  pointer-events: none;
}

.upload-icon {
  width: 16px;
  height: 16px;
  fill: #4f93ff;
  pointer-events: none;
}


/* -------------------- Кнопки -------------------- */
.tab-btn {
  padding: 10px 20px;
  font-family: "Unbounded-SemiBold", sans-serif;
  font-size: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#marketSaveBtn {
  background: linear-gradient(90deg, rgb(255, 215, 0), rgb(255, 170, 0));
  color: #fff;
  margin-right: 10px;
}

#marketSaveBtn:hover {
  background: #3a6ed1;
  transform: translateY(-2px);
}

.cancel-btn {
  background: #2a2f44;
  color: #aaa;
}

.cancel-btn:hover {
  background: #3a3f56;
  color: #fff;
  transform: translateY(-2px);
}

/* -------------------- Scroll area -------------------- */
.market-modal .scroll-area {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 10px;
}

/* -------------------- Дополнительно: центрированные заголовки и текст -------------------- */
.market-modal .market-title {
  text-align: center;
  color: #fff;
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 18px;
  margin-bottom: 10px;
}

.market-modal .market-description {
  color: #ccc;
  font-size: 14px;
  margin-bottom: 8px;
  text-align: left;
  word-break: break-word;
}


.spinner {
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

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


/* Бейджи типа */
.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}

.content-badge {
  background: linear-gradient(45deg, #6a11cb, #2575fc);
}

.item-badge {
  background: linear-gradient(45deg, #f7971e, #ffd200);
}

.other-badge {
  background: #999;
}

/* Карточки */
.market-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
  transition: transform 0.2s;
}

.market-card:hover {
  transform: translateY(-4px);
}

/* Пульсирующее свечение для предметов */
.item-pulse {
  box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7);
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7); }
  50% { box-shadow: 0 0 20px 5px rgba(255, 223, 0, 0.9); }
  100% { box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7); }
}

/* Контент внутри карточки */
.market-card-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.market-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
  transition: transform 0.2s;
  height: 320px; /* фиксированная высота */
}

.market-card:hover {
  transform: translateY(-4px);
}

.item-pulse {
  box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7);
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7); }
  50% { box-shadow: 0 0 20px 5px rgba(255, 223, 0, 0.9); }
  100% { box-shadow: 0 0 10px 2px rgba(255, 223, 0, 0.7); }
}

.market-card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* кнопка прижата вниз */
  padding: 10px;
  height: 100%;
}

.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px; /* отступ от описания */
}

.content-badge {
  background: linear-gradient(45deg, #6a11cb, #2575fc);
}

.item-badge {
  background: linear-gradient(45deg, #f7971e, #ffd200);
}

.other-badge {
  background: #999;
}

.buy-btn {
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-top: auto; /* кнопка прижата к низу */
}
.buy-btn:hover {
  background-color: #218838;
}

.payment-already-content {
  width: 95%;
  background: #1c1c1e;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: white;
  animation: slideUp .25s ease;
}

.already-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 auto 15px;
  display: block;
  box-shadow: 0 0 10px rgba(255,255,255,0.15);
}

/* кнопка — минималистичная */
#alreadyCloseBtn {
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  background: #2a2a2c;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}

#alreadyCloseBtn:hover {
  background: #3a3a3c;
}

.payment-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none; justify-content: center; align-items: end;
}
.payment-modal.show { display: flex; }

@keyframes slideUp {
  from { transform: translateY(120%); }
  to   { transform: translateY(0); }
}


.my-item-card {
  background: rgba(255,255,255,0.05);
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.my-item-img {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 8px;
}

.my-item-desc {
  font-size: 14px;
  opacity: 0.9;
}
.my-item-card.item-type {
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.6);
  border: 1px solid rgba(0, 180, 255, 0.4);
}
.video-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.video-viewer.show {
  display: flex;
}

.video-viewer-content video {
  width: 90%;
  max-width: 480px;
  border-radius: 16px;
}

.video-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.video-viewer.show {
  opacity: 1;
  pointer-events: auto;
}

#viewerVideo {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

.video-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: white;
  cursor: pointer;
  padding: 6px 12px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  user-select: none;
  transition: 0.2s;
}

.video-close:active {
  transform: scale(0.9);
}
.video-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.video-viewer.show {
  opacity: 1;
  pointer-events: auto;
}

#viewerVideo {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

/* Крестик */
.video-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: white;
  cursor: pointer;
  padding: 6px 12px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  user-select: none;
  transition: 0.2s;
  z-index: 20;
}
.video-close:active { transform: scale(0.9); }

/* Play в центре */
.video-play-btn,
.video-pause-btn {
  position: absolute;
  font-size: 60px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 22px 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  transition: 0.2s;
  user-select: none;
}

.video-play-btn {
  display: none; /* по умолчанию */
}

.video-pause-btn {
  display: none; /* появится во время проигрывания */
  font-size: 48px;
  padding: 18px 26px;
}

.video-play-btn:active,
.video-pause-btn:active {
  transform: scale(0.9);
}
#videoViewer.show { opacity: 1; }

#videoPlayBtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  background: rgba(0,0,0,0.45);
  padding: 22px;
  border-radius: 50%;
  color: white;
  border: none;
}

#videoPauseBtn {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 28px;
  background: rgba(0,0,0,0.45);
  padding: 12px;
  border-radius: 50%;
  color: white;
  border: none;
  opacity: 0;
  transition: opacity .2s ease;
}

#videoCloseBtn {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 28px;
  background: rgba(0,0,0,0.45);
  padding: 10px;
  border-radius: 50%;
  color: white;
  border: none;
}
#videoViewer.show { opacity: 1; }

#videoPlayBtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  background: rgba(0,0,0,0.45);
  padding: 22px;
  border-radius: 50%;
  color: white;
  border: none;
}

#videoCloseBtn {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 28px;
  background: rgba(0,0,0,0.45);
  padding: 10px;
  border-radius: 50%;
  color: white;
  border: none;
  cursor: pointer;
}


.owner-badge {
  background: linear-gradient(135deg, #4caf50, #81c784);
  font-weight: 700;
  text-transform: uppercase;
}

/* ==================== AUCTION MODAL STYLES ==================== */
.auction-modal {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.auction-modal.show {
  visibility: visible !important;
  opacity: 1 !important;
  left: 0 !important;
  pointer-events: auto !important;
}

/* Убираем блюр при скрытии */
.auction-modal:not(.show) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important; /* Поддержка Safari */
}

/* Специальные стили для корректной работы блюра */
.app-container {
  transition: filter 0.3s ease;
}

.app-container.blurred {
  filter: blur(8px);
  pointer-events: none;
}

.auction-modal-content {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: min(500px, 90vw);
  background: linear-gradient(135deg, 
    rgba(18, 22, 32, 0.95) 0%, 
    rgba(26, 30, 42, 0.95) 100%);
  border-radius: 0 20px 20px 0;
  padding: 0;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.4);
  border-left: 3px solid rgba(255, 215, 0, 0.8);
}

.auction-modal.show .auction-modal-content {
  transform: translateX(0) !important;
}

.auction-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.15) 0%, 
    rgba(255, 170, 0, 0.1) 50%,
    rgba(99, 102, 241, 0.1) 100%);
  position: relative;
}

.auction-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(255, 215, 0, 0.8) 0%, 
    rgba(255, 170, 0, 0.6) 50%,
    rgba(99, 102, 241, 0.4) 100%);
}

.auction-modal-header h3 {
  margin: 0;
  color: #fff;
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #fff 0%, rgba(255, 215, 0, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auction-close-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.auction-close-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.6);
  color: #fff;
  transform: scale(1.1);
}

.auction-modal-body {
  padding: 30px;
  display: flex;
  gap: 25px;
  align-items: flex-start;
  background: linear-gradient(180deg, 
    rgba(18, 22, 32, 0.8) 0%, 
    rgba(26, 30, 42, 0.9) 100%);
  flex: 1;
}

.auction-item-image {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(99, 102, 241, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
  position: relative;
}

.auction-item-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.1) 0%, 
    rgba(255, 170, 0, 0.05) 100%);
  z-index: 1;
}

.auction-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  position: relative;
  z-index: 2;
}

.auction-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auction-lot-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  font-family: "Unbounded-Bold", sans-serif;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #fff 0%, rgba(255, 215, 0, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auction-time-left,
.auction-current-bet,
.auction-owner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.auction-time-left:hover,
.auction-current-bet:hover,
.auction-owner:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateX(5px);
}

.auction-time-label,
.auction-bet-label,
.auction-owner-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
}

.auction-time-value,
.auction-bet-value,
.auction-owner-value {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auction-modal-footer {
  padding: 30px;
  border-top: 2px solid rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, 
    rgba(26, 30, 42, 0.9) 0%, 
    rgba(18, 22, 32, 0.95) 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  position: relative;
}

.auction-modal-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 215, 0, 0.8) 50%, 
    transparent 100%);
  border-radius: 2px;
}

.auction-user-status {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
  color: #4caf50;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  border: 1px solid rgba(76, 175, 80, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.auction-participate-btn {
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.9) 0%, 
    rgba(255, 170, 0, 0.9) 100%);
  color: #000;
  border: none;
  padding: 15px 35px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 320px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auction-participate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  transition: left 0.5s ease;
}

.auction-participate-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.auction-participate-btn:hover::before {
  left: 100%;
}

.auction-participate-btn:active {
  transform: translateY(-1px) scale(1.01);
}

/* Confirmation Modal */
.auction-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999; /* Увеличиваем z-index чтобы была поверх аукциона */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.auction-confirm-modal.show {
  visibility: visible;
  opacity: 1;
}

.auction-confirm-content {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.auction-confirm-content h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-family: "Unbounded-Bold", sans-serif;
  font-size: 20px;
}

.auction-confirm-content p {
  margin: 0 0 25px 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

.auction-confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.auction-confirm-yes,
.auction-confirm-no {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.auction-confirm-yes {
  background: linear-gradient(135deg, var(--success) 0%, #4caf50 100%);
  color: white;
}

.auction-confirm-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.auction-confirm-no {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.auction-confirm-no:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Стили для ввода суммы аукциона */
.auction-amount-input-container {
  margin: 20px 0;
  text-align: left;
}

.auction-amount-input-container label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.auction-amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

#auction-amount-input {
  flex: 1;
  padding: 12px 50px 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: all 0.3s ease;
}

#auction-amount-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

#auction-amount-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

.auction-currency {
  position: absolute;
  right: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
}

.auction-amount-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auction-amount-info small {
  color: var(--text-muted);
  font-size: 12px;
}

.auction-amount-error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  min-height: 20px;
  display: flex;
  align-items: center;
}

.auction-amount-error:before {
  content: "⚠️";
  margin-right: 6px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .auction-modal-content {
    width: 95vw;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .auction-modal-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  
  .auction-item-image {
    width: 120px;
    height: 120px;
  }
  
  .auction-lot-name {
    font-size: 20px;
  }
  
  .auction-time-left,
  .auction-current-bet,
  .auction-owner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
  
  .auction-modal-footer {
    padding: 20px;
  }
  
  .auction-participate-btn {
    max-width: 100%;
  }
  
  .auction-confirm-buttons {
    flex-direction: column;
  }
  
  .auction-timer {
    font-size: 9px;
    padding: 1px 4px;
  }

  /* Адаптивность для поля ввода суммы */
  .auction-amount-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  #auction-amount-input {
    padding: 12px 16px;
    padding-right: 16px;
  }

  .auction-currency {
    position: static;
    align-self: flex-end;
    margin-top: -30px;
    margin-right: 12px;
  }

  .auction-amount-info {
    flex-direction: column;
    gap: 4px;
  }
}
