* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 400px;
    width: 100%;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: auto;
    max-height: 90vh;
    position: relative;
    z-index: 2;
    border: 2px solid #00d4ff;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 32px;
    color: #00d4ff;
    margin-bottom: 5px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    color: #00d4ff;
    font-size: 14px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00d4ff;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: #16213e;
    border: 2px solid #00d4ff;
    color: #00d4ff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.tab-btn:hover {
    background: #0f3460;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #1a1a2e;
    border-color: #00d4ff;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.back-btn-container {
    margin-bottom: 20px;
}

.back-btn {
    padding: 10px 15px;
    background: #16213e;
    border: 2px solid #00d4ff;
    color: #00d4ff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #0f3460;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 60px;
}

.menu-btn {
    padding: 30px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

.menu-btn:active {
    transform: translateY(-2px);
}

.menu-icon {
    font-size: 60px;
}

.menu-text {
    color: #1a1a2e;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #FF6B9D;
}

.roulette-container {
    position: relative;
    margin: 30px auto;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 15px;
    background: linear-gradient(90deg, rgba(0,212,255,0.1), rgba(0,212,255,0.05));
    border: 3px solid #00d4ff;
}

.roulette-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.roulette-track {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    will-change: transform;
    width: fit-content;
    position: relative;
    left: 0;
    animation: slow-spin 20s linear infinite;
}

@keyframes slow-spin {
    0% { 
        transform: translateX(0);
    }
    100% { 
        transform: translateX(-500px);
    }
}

.roulette-track.spinning {
    animation: spin-right-to-left 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes spin-right-to-left {
    0% { 
        transform: translateX(600px);
    }
    100% { 
        transform: translateX(var(--final-pos, 0));
    }
}

.gift-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
}

.gift-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 2px 8px rgba(0, 212, 255, 0.3));
    flex-shrink: 0;
}

.separator {
    font-size: 30px;
    color: #00d4ff;
    opacity: 0.6;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 5px;
    font-weight: bold;
}

.available-gifts {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #00d4ff15, #0099cc15);
    border: 2px solid #00d4ff;
    border-radius: 12px;
}

.available-gifts h3 {
    color: #00d4ff;
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.gifts-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gift-showcase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gift-showcase-img {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-showcase-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 212, 255, 0.3));
}

.gift-showcase-name {
    font-size: 11px;
    color: #00d4ff;
    text-align: center;
    font-weight: bold;
    line-height: 1.2;
    word-break: break-word;
}

.pointer-horizontal {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-top: 90px solid #00d4ff;
    z-index: 10;
    filter: drop-shadow(0 3px 8px rgba(0, 212, 255, 0.6));
}

.result-display {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #00d4ff15, #0099cc15);
    border-radius: 10px;
    border-left: 4px solid #00d4ff;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resultText {
    font-size: 18px;
    font-weight: bold;
    color: #00d4ff;
}

.result-display.win #resultText {
    color: #4CAF50;
}

.result-display.lose #resultText {
    color: #f44336;
}

.bet-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.bet-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #FF6B9D;
    background: white;
    color: #FF6B9D;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.bet-btn:hover {
    background: #FF6B9D;
    color: white;
    transform: scale(1.1);
}

.bet-btn:active {
    transform: scale(0.9);
}

#betInput {
    width: 100px;
    padding: 10px;
    font-size: 20px;
    border: 2px solid #FF6B9D;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    background: white;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.get-gifts-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
}

.get-gifts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

.get-gifts-btn:active {
    transform: translateY(0);
}

.spin-btn {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 212, 255, 0.4);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reset-btn {
    flex: 1;
    padding: 15px;
    background: white;
    color: #FF6B9D;
    border: 2px solid #FF6B9D;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.reset-btn:hover {
    background: #FFE5F0;
    transform: scale(1.02);
}

.reset-btn:active {
    transform: scale(0.95);
}

.inventory-container {
    padding: 20px;
}

.inventory-container h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gift-card {
    background: linear-gradient(135deg, #00d4ff15, #0099cc15);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: slideIn 0.3s ease-out;
    text-align: center;
}

.gift-card .gift-svg {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.gift-card .gift-name {
    font-size: 12px;
    color: #00d4ff;
    font-weight: bold;
    line-height: 1.2;
}

.gift-card .count {
    font-size: 16px;
    font-weight: bold;
    color: #00d4ff;
}

.empty-inventory {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 16px;
}

.leaderboard {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.leaderboard h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.wins-list {
    max-height: 150px;
    overflow-y: auto;
}

.win-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #4CAF50;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.win-item .multiplier {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

.win-item .amount {
    color: #4CAF50;
    font-weight: bold;
}

.empty {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 10px;
}

/* Scrollbar styling for main container */
.container::-webkit-scrollbar {
    width: 10px;
}

.container::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 10px;
}

.container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #0099cc);
    border-radius: 10px;
    border: 2px solid #1a1a2e;
}

.container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #00d4ff);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Scrollbar styling */
.wins-list::-webkit-scrollbar {
    width: 6px;
}

.wins-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wins-list::-webkit-scrollbar-thumb {
    background: #FF6B9D;
    border-radius: 10px;
}

.wins-list::-webkit-scrollbar-thumb:hover {
    background: #FF8E72;
}
