﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #fff;
    padding-bottom: 80px;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    width: 80%;
    max-width: 300px;
}

.loading-logo {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite ease-in-out;
}

.loading-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #fff;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6b5dd3, #8b7dd8);
    transition: width 0.3s ease;
}

.loading-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 80px;
    background: #1a1a1a;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    filter: blur(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), filter 0.4s ease, visibility 0.4s;
    z-index: 1;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    filter: blur(0);
    z-index: 10;
}

.page.slide-left, 
.page.slide-right {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(5px);
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 24px 16px;
    }

    .carousel-item {
        min-height: 160px;
        padding: 20px 10px !important;
    }

    .item-icon {
        height: 80px !important;
        font-size: 64px !important;
        margin-bottom: 16px;
    }

    .item-price {
        font-size: 18px !important;
    }

    .carousel-container {
        box-shadow: inset 0 2px 8px rgba(0,0,0,0.4),
        0 8px 25px rgba(0, 0, 0, 0.6);
    }

    .balance-row {
        gap: 20px !important;
    }

    .balance-card {
        padding: 20px !important;
        font-size: 24px !important;
    }

    .carousel-container {
        padding: 24px !important;
    }

    .prizes-wrapper {
        padding: 20px 0 !important;
    }

    .prizes-carousel {
        padding: 0 20px !important;
    }

    .prize-item {
        flex: 0 0 140px !important;
        padding: 16px !important;
    }

    .prize-icon {
        height: 65px !important;
        font-size: 56px !important;
    }

    .prize-value {
        font-size: 16px !important;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 900px;
    }
}

.page-header {
    background: linear-gradient(135deg, #232323 0%, #1f1f2e 100%);
    padding: 20px 16px;
    margin: -16px -16px 20px -16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
    .page-header {
        margin: -24px -16px 20px -16px;
    }
}

.page-title {
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 700;
    text-align: center;
}

.ad-banner {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f2e 100%);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ad-content {
    flex: 1;
}

.ad-title {
    font-size: clamp(12px, 3vw, 15px);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-text {
    font-size: clamp(10px, 2.5vw, 12px);
    opacity: 0.7;
    line-height: 1.3;
}

.ad-badge {
    background: #6b5dd3;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 600;
    white-space: nowrap;
}

.balance-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.balance-card {
    flex: 1;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-card.active {
    box-shadow: 0 0 0 2px #6b5dd3;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
}

.balance-card:active {
    transform: scale(0.98);
}

.carousel-container {
    background: #0f0f0f;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4),
    0 6px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.carousel-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom,
    transparent,
    rgba(107, 93, 211, 0.8),
    rgba(107, 93, 211, 0.8),
    rgba(107, 93, 211, 0.8),
    transparent
    );
    transform: translateX(-50%);
    z-index: 9;
    pointer-events: none;
}

.carousel-track {
    display: flex;
    transition: transform 3s cubic-bezier(0.1, 0, 0.1, 1);
    gap: 10px;
    position: relative;
    will-change: transform;
    transform: translateZ(0);
}

.carousel-track.spinning {
    transition: transform 0.1s linear;
}

.carousel-indicator {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #6b5dd3;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(107, 93, 211, 0.3));
}

.carousel-item {
    flex: 0 0 calc(20% - 8px);
    background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: clamp(12px, 3vw, 20px) clamp(8px, 2vw, 12px);
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.3);
    min-height: clamp(100px, 30vw, 180px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.carousel-item.active {
    box-shadow: 0 0 0 3px #6b5dd3,
    0 6px 20px rgba(107, 93, 211, 0.3);
    transform: translateY(-2px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-icon {
    font-size: clamp(32px, 8vw, 72px);
    margin-bottom: clamp(8px, 2vw, 12px);
    height: clamp(40px, 10vw, 90px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: clamp(12px, 3vw, 16px);
    font-weight: 600;
    color: #ffd700;
    margin-top: clamp(4px, 1vw, 8px);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: clamp(14px, 4vw, 16px);
}

.toggle-switch {
    width: clamp(50px, 15vw, 60px);
    height: clamp(28px, 8vw, 32px);
    background: #6b5dd3;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-switch.off {
    background: #3a3a3a;
}

.toggle-knob {
    width: clamp(22px, 7vw, 26px);
    height: clamp(22px, 7vw, 26px);
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 3px;
    transition: right 0.3s;
}

.toggle-switch.off .toggle-knob {
    right: calc(100% - clamp(22px, 7vw, 26px) - 3px);
}

.main-button {
    width: 100%;
    background: linear-gradient(135deg, #8b7dd8 0%, #6b5dd3 100%);
    border: none;
    border-radius: 12px;
    padding: clamp(14px, 4vw, 16px);
    color: white;
    font-size: clamp(15px, 4vw, 17px);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(107, 93, 211, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
    min-height: 54px;
}

.main-button:active {
    transform: scale(0.98);
}

.main-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.free-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: clamp(9px, 2.5vw, 11px);
    font-weight: 600;
}

.section-title {
    margin: 28px 0 16px;
    font-size: clamp(15px, 4vw, 18px);
    font-weight: 600;
}

.prizes-wrapper {
    background: #0f0f0f;
    border-radius: 16px;
    padding: 16px 0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
    overflow: hidden;
    position: relative;
}

.prizes-wrapper::before,
.prizes-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.prizes-wrapper::before {
    left: 0;
    background: linear-gradient(to right, #0f0f0f, transparent);
}

.prizes-wrapper::after {
    right: 0;
    background: linear-gradient(to left, #0f0f0f, transparent);
}

.prizes-carousel {
    display: flex;
    gap: clamp(8px, 3vw, 12px);
    padding: 0 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.prizes-carousel::-webkit-scrollbar {
    display: none;
}

.prize-item {
    flex: 0 0 clamp(100px, 30vw, 130px);
    background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: clamp(10px, 3vw, 14px);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.prize-chance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: clamp(9px, 2.5vw, 11px);
    opacity: 0.6;
    margin-bottom: 8px;
}

.prize-icon {
    font-size: clamp(40px, 12vw, 52px);
    margin-bottom: 8px;
    height: clamp(45px, 14vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prize-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.prize-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: clamp(12px, 3.5vw, 15px);
    font-weight: 600;
    color: #ffd700;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.leaderboard-item:active {
    transform: scale(0.98);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.gold {
    color: #ffd700;
}

.leaderboard-rank.silver {
    color: #c0c0c0;
}

.leaderboard-rank.bronze {
    color: #cd7f32;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b5dd3 0%, #8b7dd8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.leaderboard-stats {
    font-size: 13px;
    opacity: 0.7;
}

.leaderboard-score {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b5dd3 0%, #8b7dd8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(107, 93, 211, 0.4);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-id {
    font-size: 14px;
    opacity: 0.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #6b5dd3;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.7;
}

.profile-section {
    margin-bottom: 20px;
}

.profile-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.8;
}

.profile-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.profile-item:active {
    transform: scale(0.98);
}

.profile-item-label {
    font-size: 15px;
}

.profile-item-value {
    font-size: 15px;
    opacity: 0.6;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: clamp(10px, 2.5vw, 12px);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s;
}

.nav-item.active {
    opacity: 1;
    color: #6b5dd3;
}

.nav-icon {
    font-size: clamp(20px, 6vw, 24px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 16px;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-radius: 20px;
    padding: clamp(30px, 8vw, 40px) clamp(20px, 5vw, 30px);
    max-width: 95%;
    width: 100%;
    max-width: 500px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: clamp(80px, 25vw, 120px);
    margin-bottom: 20px;
    animation: bounceIn 0.6s;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.modal-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-title {
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.modal-subtitle {
    font-size: clamp(14px, 4vw, 16px);
    opacity: 0.7;
    margin-bottom: 24px;
}

.modal-prize-name {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffd700;
}

.modal-prize-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: clamp(24px, 8vw, 32px);
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-button {
    width: 100%;
    padding: clamp(14px, 4vw, 16px);
    border: none;
    border-radius: 12px;
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.modal-button:active {
    transform: scale(0.98);
}

.modal-button-primary {
    background: linear-gradient(135deg, #8b7dd8 0%, #6b5dd3 100%);
    color: white;
}

.modal-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

@media (orientation: landscape) and (max-height: 600px) {
    .carousel-item {
        min-height: 90px !important;
        padding: 8px 4px !important;
    }

    .item-icon {
        height: 35px !important;
        font-size: 28px !important;
        margin-bottom: 4px !important;
    }

    .item-price {
        font-size: 11px !important;
        margin-top: 2px !important;
    }
}

@media (orientation: landscape) and (min-width: 768px) and (max-height: 600px) {
    .carousel-item {
        min-height: 120px !important;
        padding: 12px 8px !important;
    }

    .item-icon {
        height: 55px !important;
        font-size: 40px !important;
    }

    .item-price {
        font-size: 14px !important;
    }
}

@media (max-width: 767px) {
    .carousel-item {
        flex: 0 0 calc(25% - 8px);
        min-height: 120px;
        padding: 12px 6px;
    }

    .item-icon {
        font-size: 36px;
        height: 60px;
        margin-bottom: 8px;
    }

    .item-price {
        font-size: 13px;
    }

    .carousel-container {
        padding: 12px;
    }

    .carousel-track {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .carousel-item {
        flex: 0 0 calc(33.333% - 8px);
        min-height: 110px;
        padding: 10px 4px;
    }

    .item-icon {
        font-size: 32px;
        height: 50px;
        margin-bottom: 6px;
    }

    .item-price {
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .carousel-item {
        min-height: 140px;
        padding: 16px 10px;
    }

    .item-icon {
        height: 60px;
        font-size: 48px;
        margin-bottom: 12px;
    }

    .item-price {
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .carousel-item {
        min-height: 160px;
        padding: 20px 12px;
    }

    .item-icon {
        height: 70px;
        font-size: 56px;
        margin-bottom: 16px;
    }

    .item-price {
        font-size: 16px;
    }
}

@media (min-width: 1200px) {
    .carousel-item {
        min-height: 180px;
        padding: 24px 14px;
    }

    .item-icon {
        height: 80px;
        font-size: 64px;
        margin-bottom: 20px;
    }

    .item-price {
        font-size: 18px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .balance-card,
    .main-button,
    .modal-button,
    .nav-item {
        min-height: 44px;
    }

    .toggle-switch {
        min-width: 50px;
        min-height: 28px;
    }
}