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

:root {
    --wheel-size: 420px;
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
}

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

body {
    width: 100vw;
    height: 100vh;
    background-image: url('./photos/фон.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Ali-Bold', Arial, sans-serif;
    overflow: hidden;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* СТРАНИЦЫ */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.page.hidden {
    display: none;
}

/* РУЛЕТКА - позиционирование относительно центра */
.roulette-container {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 55vh; /* ← ИЗМЕНЕНО: 400px → 40vh */
    display: flex;
    justify-content: center;
    align-items: center;
}

.roulette-wheel {
    width: 100%;
    height: 100%;
    background-image: url('./photos/рулетка.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    z-index: 1;
}

.roulette-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: url('./photos/обводка рулетки.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    pointer-events: none;
}

/* КНОПКА КРУТИТЬ С БАЛАНСОМ */
.spin-button-wrapper {
    position: fixed;
    bottom: -16vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.spin-button {
    width: 350px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: none;
    display: block;
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.spin-button:active:not(:disabled) {
    transform: scale(0.95);
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    pointer-events: none;
}

/* РЕЗУЛЬТАТ - позиционирование относительно ВЕРХА экрана */
.result-display {
    position: fixed;
    top: 7vh; /* ← ИЗМЕНЕНО: 50px → 7vh */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-display.show {
    opacity: 1;
}


@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* МОДАЛЬНОЕ ОКНО ПРИЗА */
.prize-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.prize-modal.show {
    display: flex;
}

.prize-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* ЗАГОЛОВОК ПРИЗА - позиционирование относительно ВЕРХА экрана */
.prize-title {
    position: fixed;
    top: 3vh; /* ← ИЗМЕНЕНО: 25px → 3vh */
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: auto;
    z-index: 10;
}

/* ИЗОБРАЖЕНИЕ ПРИЗА - позиционирование относительно ЦЕНТРА экрана */
.prize-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 40vh; /* ← ИЗМЕНЕНО: 400px → 40vh */
    object-fit: contain;
}

/* НАДПИСЬ О БУСТЕ - позиционирование относительно НИЗА экрана */
.boost-note {
    position: fixed;
    bottom: 15vh; /* ← ИЗМЕНЕНО: 100px → 15vh */
    left: 50%;
    transform: translateX(-50%);
    color: #FFD700;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    display: none;
    background: rgba(255, 215, 0, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #FFD700;
}

.boost-note.show {
    display: block;
}

/* КНОПКА ЗАКРЫТЬ - позиционирование относительно НИЗА экрана */
.close-button {
    position: fixed;
    bottom: 1vh; /* ← ИЗМЕНЕНО: 10px → 1vh */
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-button:hover {
    transform: translateX(-50%) scale(1.05);
    filter: brightness(1.1);
}

.close-button:active {
    transform: translateX(-50%) scale(0.95);
}

@keyframes prizeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* НАВИГАЦИОННАЯ ПАНЕЛЬ */
.navigation-bar {
    position: fixed;
    bottom: 2vh; /* ← ИЗМЕНЕНО: 20px → 2vh */
    left: 50%;
    transform: translateX(-50%);
    background: rgb(44, 44, 44);
    border-radius: 10px;
    padding: 5px;
    display: flex;
    gap: 15px;
    z-index: 20;
}

.nav-button {
    width: 160px;
    border-radius: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.nav-button img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.nav-button:hover img {
    filter: brightness(0) invert(1) opacity(0.8);
}

.nav-button.active img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(96%) saturate(1237%) hue-rotate(175deg) brightness(98%) contrast(101%);
}


/* КОНТЕЙНЕР ДЛЯ ПЕРЕКЛЮЧАТЕЛЯ РЕЖИМОВ */
.mode-toggle-container {
    position: fixed;
    bottom: -8vh;
    left: 140px;
    z-index: 15;
}

.mode-toggle {
    width: 120px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-toggle:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.mode-toggle:active {
    transform: scale(0.95);
}

/* ОТОБРАЖЕНИЕ БАЛАНСА СПРАВА */
.balance-display-container {
    position: fixed;
    bottom: -8vh;
    right: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 15;
}

.balance-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 5px;
}

.balance-display-text {
    color: #FFFFFF;
    font-size: 16px;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}


/* СТРАНИЦА ДРУЗЕЙ */
.friends-container {
    padding: 20px;
    padding-bottom: 120px; /* Отступ для навигации */
}

.invite-header {
    color: #FFFFFF;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 100px; /* Спускаем текст вниз на 150px */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Уведомление о копировании */
.copy-notification {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
}

.copy-notification.success {
    background: rgba(0, 191, 255, 0.9);
}

.copy-notification.error {
    background: rgba(255, 0, 0, 0.9);
}

.copy-notification.show {
    opacity: 1;
}


.invite-buttons {
    position: relative; /* Для позиционирования уведомления */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    margin-top: 10px; /* Поднимаем кнопки вверх на 100px (было 150px, стало 50px) */
}

.invite-button, .copy-button {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.invite-button:hover, .copy-button:hover {
    transform: scale(1.05);
}

.invite-button img {
    width: 170px; /* Увеличиваем в два раза (было 120px, стало 240px) */
    height: auto;
}

.copy-button img {
    width: 49px; /* Уменьшаем размер кнопки копировать */
    height: auto;
}



.tasks-header {
    color: #FFFFFF;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center; /* Центрируем надпись "Задания" */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.tasks-container::-webkit-scrollbar {
    width: 6px;
}

.tasks-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.task-item {
    position: relative;
    background-image: url('photos/фон кнопок заданий.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    min-height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.task-item:visited,
.task-item:hover,
.task-item:active,
.task-item:focus {
    text-decoration: none;
    color: inherit;
    outline: none;
}

.task-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: contain;
}

.task-item:hover {
    transform: scale(1.02);
}

.task-text {
    color: #FFFFFF;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-decoration: none;
}

.task-text .highlight {
    color: #00bfff;
    text-decoration: none;
}

.task-reward {
    color: #FFFFFF;
    font-family: 'Ali-Bold', Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.loading-animation {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

