/* Views transition */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
    /* Space for bottom nav */
}

.active-view {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home View */
.menu-grid {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    background: var(--gradient-main);
    border: none;
    justify-content: space-between;
}

.info-card .info-content h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.info-card .info-content p {
    font-size: 12px;
    opacity: 0.8;
}

.game-card .card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card .card-details h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.game-card .card-details p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Case View */
.cases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    padding-bottom: 100px;
}

.case-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: 0.2s;
}

.case-item:hover {
    border-color: var(--accent-blue);
    background: var(--card-bg-hover);
}

.case-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    object-fit: contain;
}

.case-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.case-price {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: -6px;
    margin-bottom: 6px;
}

.tag.limit {
    background: #6366f1;
}

/* Roulette View */
#roulette-view {
    background: #111;
    z-index: 150;
}

.view-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.roulette-stage {
    margin-top: 40px;
    position: relative;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.arrow-indicator {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-gold);
    font-size: 24px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.arrow-indicator::after {
    content: "▲";
    position: absolute;
    bottom: -130px;
    left: 0;
}

.roulette-track-container {
    width: 100%;
    height: 100%;
}

.roulette-track {
    display: flex;
    height: 100%;
    align-items: center;
    transform: translateX(0);
}

.roulette-track.idle {
    animation: infiniteScroll 10s linear infinite;
    width: max-content;
    /* Ensure it scrolls fully */
}

@keyframes infiniteScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* We will duplicate the items so -50% is the end of the first set */
}

.roulette-item {
    width: 100px;
    height: 90px;
    margin: 0 4px;
    background: #252530;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 3px solid transparent;
}

.roulette-item img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.case-info-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.case-preview-image {
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.case-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    justify-content: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

/* Profile View */
.profile-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-blue);
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.profile-balance {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-blue);
}

.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    margin-left: 8px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 80px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* Prizes Grid (Modal) */
.prizes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.prize-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid transparent;
}

.prize-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 6px;
}

.prize-name {
    font-size: 10px;
    text-align: center;
    color: #ccc;
}

.prize-price {
    font-size: 10px;
    color: var(--accent-gold);
    font-weight: bold;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(20, 20, 25, 0.9);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-around;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    z-index: 200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.nav-item {
    background: transparent;
    border: none;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item i {
    font-size: 22px;
    transition: 0.2s;
    margin-bottom: 0;
}

.nav-item.active {
    color: var(--accent-blue);
}

.nav-item.active i {
    transform: translateY(-4px);
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.5));
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #1c1c24;
}