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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.hidden {
    display: none;
}

/* Landing page (background image + button) */
.landing-page {
    position: fixed;
    inset: 0;
    background-image: url('background-srping.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1000;
    display: block;
    transition: opacity 0.6s ease;
}

.landing-page.fade-out {
    opacity: 0;
    pointer-events: none;
}

.enter-button {
    position: absolute;
    /* Vị trí mặc định: bên phải, khoảng giữa banner. Có thể chỉnh lại top/right theo ý. */
    right: 14%;
    top: 55%;
    transform: translateY(-50%);
    padding: 18px 32px;
    border-radius: 999px;
    border: none;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #ffce00 0%, #ff8c00 100%);
    color: #004225;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* .enter-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
} */

.enter-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-area {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.logo {
    max-width: 200px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 10px;
}

.logo-placeholder {
    width: 200px;
    height: 120px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #999;
    font-size: 1.2em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
}

.title {
    font-size: 3em;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24, #f0932b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    font-style: italic;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.range-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-selector label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.range-selector input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.range-selector input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.spin-button {
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.spin-button:active:not(:disabled) {
    transform: translateY(0);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.slot-machine-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 20px;
}

.slot-machine {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    border: 5px solid #ffd700;
    position: relative;
}

.slot-frame {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.slot {
    width: 140px;
    height: 180px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 50%, #ffffff 100%);
    border-radius: 15px;
    border: 4px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    z-index: 2;
}

.slot-reel {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot-reel.spinning {
    /* Animation is handled by JavaScript for better control */
}

.slot-reel.stopping {
    transition: transform 2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.slot-number {
    font-size: 4.5em;
    font-weight: bold;
    color: #1a1a1a;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.3);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: 100%;
    left: 0;
    z-index: 1;
    line-height: 60px;
}

.slot-result {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    margin-top: 20px;
}

.slot-result h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.final-result {
    font-size: 4em;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: resultPop 0.5s ease-out;
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: gold;
    border-radius: 50%;
    animation: sparkleAnimation 1s ease-out forwards;
}

@keyframes sparkleAnimation {
    0% {
        opacity: 1;
        transform: scale(0) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1) translateY(-50px);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-100px);
    }
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}


@keyframes resultPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.used-numbers {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.used-numbers h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.used-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.used-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.empty-message {
    color: #999;
    font-style: italic;
    text-align: center;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .control-panel {
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .title {
        font-size: 2em;
    }
    
    .logo {
        max-width: 150px;
        max-height: 90px;
    }
    
    .logo-placeholder {
        width: 150px;
        height: 90px;
    }

    .slot {
        width: 110px;
        height: 150px;
    }
    
    .slot-number {
        font-size: 3.5em;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .title {
        font-size: 1.5em;
    }
    
    .logo {
        max-width: 120px;
        max-height: 70px;
    }
    
    .logo-placeholder {
        width: 120px;
        height: 70px;
        font-size: 1em;
    }

    .slot-frame {
        flex-direction: column;
        gap: 10px;
    }
    
    .slot {
        width: 100px;
        height: 130px;
    }
    
    .slot-number {
        font-size: 3em;
    }
    
    .final-result {
        font-size: 3em;
    }
}

/* Scrollbar styling */
.used-numbers::-webkit-scrollbar {
    width: 8px;
}

.used-numbers::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.used-numbers::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.used-numbers::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.slot-number-scroll {
    font-size: 4.5em;
    font-weight: bold;
    color: #1a1a1a;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@keyframes digitPop {
    0% {
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}
