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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #00d4ff;
    --bg-dark: #0a0e1a;
    --bg-darker: #050810;
    --text-primary: #ffffff;
    --text-secondary: #8892a6;
    --accent-gold: #ffd700;
    --accent-red: #ff4655;
    --border-color: #1a2332;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background:
        linear-gradient(135deg,
            #0a0e1a 0%,
            #1a1f35 25%,
            #0f1520 50%,
            #1c1530 75%,
            #0a0e1a 100%
        );
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.container {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at top left, rgba(255, 107, 53, 0.35) 0%, rgba(255, 107, 53, 0.1) 30%, transparent 60%),
        radial-gradient(ellipse at top right, rgba(0, 212, 255, 0.35) 0%, rgba(0, 212, 255, 0.1) 30%, transparent 60%),
        radial-gradient(ellipse at bottom center, rgba(157, 78, 221, 0.25) 0%, rgba(157, 78, 221, 0.08) 40%, transparent 70%);
}

.container::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 40%;
    height: 80%;
    background: url('res/1.png') no-repeat bottom left;
    background-size: contain;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.4));
}

.container::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 80%;
    background: url('res/2.png') no-repeat bottom right;
    background-size: contain;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(255, 107, 53, 0.4));
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.12) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg,
            rgba(0, 212, 255, 0.08) 0%,
            rgba(0, 212, 255, 0.15) 25%,
            rgba(255, 107, 53, 0.08) 50%,
            rgba(255, 107, 53, 0.15) 75%,
            rgba(157, 78, 221, 0.12) 100%
        );
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    z-index: 0;
}

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

/* Header */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.logo-accent {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
    letter-spacing: 2px;
}

.lang-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary-color);
}

.lang-btn.active {
    background: var(--secondary-color);
    color: var(--bg-dark);
    border-color: var(--secondary-color);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.title {
    font-size: 64px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    margin: 40px 0;
}

.wheel-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.wheel-border {
    position: relative;
    width: 600px;  /* PC: 500px + 20% = 600px */
    height: 600px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(0, 212, 255, 0.1));
    border-radius: 50%;
    padding: 20px;
    box-shadow:
        0 0 60px rgba(0, 212, 255, 0.3),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-red));
    border: 4px solid var(--bg-dark);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow:
        0 0 30px rgba(255, 107, 53, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.spin-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
        0 0 50px rgba(255, 107, 53, 0.8),
        0 10px 30px rgba(0, 0, 0, 0.6);
}

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

.spin-icon {
    font-size: 32px;
    animation: iconPulse 1.5s ease-in-out infinite;
}

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

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    z-index: 10;
}

/* ==================== */
/* Case Opening Mode    */
/* ==================== */

.hidden {
    display: none !important;
}

.case-container {
    position: relative;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.case-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: caseGlowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes caseGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.case-box {
    position: relative;
    width: 700px;
    max-width: 95vw;
    background: linear-gradient(180deg, #1a2332 0%, #0a0e1a 100%);
    border: 3px solid var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.case-lid {
    height: 60px;
    background: linear-gradient(180deg, #2a3a4a 0%, #1a2332 100%);
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.case-lid-inner {
    width: 100px;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold));
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.case-box.opening .case-lid {
    transform: rotateX(-120deg) translateY(-30px);
    transform-origin: top center;
}

.case-body {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.case-items-track {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: none;
    will-change: transform;
}

.case-items-track.spinning {
    transition: transform 5s cubic-bezier(0.15, 0.85, 0.35, 1);
}

.case-item {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    margin: 0 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.case-item img {
    width: 64px;  /* Reduced 20% (was 80px) */
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.case-item-name {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.case-item.winner {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.case-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-gold), transparent);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    z-index: 10;
}

.case-pointer::before,
.case-pointer::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
}

.case-pointer::before {
    top: 0;
    border-top: 20px solid var(--accent-gold);
}

.case-pointer::after {
    bottom: 0;
    border-bottom: 20px solid var(--accent-gold);
}

.open-button {
    background: linear-gradient(135deg, var(--accent-gold), #ff9800);
    border: none;
    color: #000;
    padding: 18px 60px;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    border-radius: 8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

.open-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.6);
}

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

.open-icon {
    font-size: 28px;
}

/* Case Opening Responsive */
@media (max-width: 768px) {
    .case-box {
        width: 95vw;
    }

    .case-item {
        width: 100px;
        height: 100px;
        margin: 0 5px;
    }

    .case-item img {
        width: 48px;  /* Reduced 20% (was 60px) */
        height: 48px;
    }

    .case-item-name {
        font-size: 9px;
    }

    .case-body {
        height: 140px;
    }

    .open-button {
        padding: 15px 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .case-item {
        width: 80px;
        height: 80px;
        margin: 0 4px;
    }

    .case-item img {
        width: 40px;  /* Reduced 20% (was 50px) */
        height: 40px;
    }

    .case-item-name {
        font-size: 8px;
    }

    .case-body {
        height: 110px;
    }

    .case-lid {
        height: 40px;
    }

    .open-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* ==================== */
/* Modal                */
/* ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.95), rgba(10, 14, 26, 0.95));
    border: 2px solid var(--secondary-color);
    border-radius: 20px;
    padding: 60px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 60px rgba(0, 212, 255, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.5s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
    animation: modalGlow 2s ease-in-out infinite;
}

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

.prize-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: prizeFloat 2s ease-in-out infinite;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prize-icon img {
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.6));
    animation: prizeRotate 3s ease-in-out infinite;
}

@keyframes prizeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes prizeRotate {
    0%, 100% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(15deg) scale(1.05); }
}

.modal-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.modal-prize {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-weight: 600;
}

.claim-button {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-red));
    border: none;
    color: white;
    padding: 18px 60px;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    border-radius: 8px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
}

.claim-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.6);
}

.button-arrow {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.claim-button:hover .button-arrow {
    transform: translateX(5px);
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container::before {
        top: 70px;
        bottom: auto;
        left: 0;
        width: 42%;  /* 70% × 0.6 = 42% */
        height: 72%; /* 120% × 0.6 = 72% */
        background: url('res/1.png') no-repeat top left;
        background-size: contain;
        opacity: 0.25;
    }

    .container::after {
        top: auto;
        bottom: 0;
        right: 0;
        width: 42%;  /* 70% × 0.6 = 42% */
        height: 72%; /* 120% × 0.6 = 72% */
        background: url('res/2.png') no-repeat bottom right;
        background-size: contain;
        opacity: 0.25;
    }

    .header {
        padding: 15px 20px;
    }

    .logo-text {
        font-size: 20px;
    }

    .logo-accent {
        font-size: 14px;
    }

    .title {
        font-size: 42px;
    }

    .subtitle {
        font-size: 16px;
    }

    .wheel-border {
        width: 88vw;  /* Mobile: 88% screen width */
        height: 88vw;
        max-width: 500px;
        max-height: 500px;
        padding: 15px;
    }

    .spin-button {
        width: 100px;
        height: 100px;
        font-size: 16px;
    }

    .spin-icon {
        font-size: 28px;
    }

    .modal-content {
        padding: 40px 30px;
    }

    .modal-title {
        font-size: 28px;
    }

    .modal-prize {
        font-size: 20px;
    }

    .claim-button {
        padding: 15px 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container::before {
        top: 70px;
        bottom: auto;
        left: 0;
        width: 48%;  /* 80% × 0.6 = 48% */
        height: 84%; /* 140% × 0.6 = 84% */
        background: url('res/1.png') no-repeat top left;
        background-size: contain;
        opacity: 0.2;
    }

    .container::after {
        top: auto;
        bottom: 0;
        right: 0;
        width: 48%;  /* 80% × 0.6 = 48% */
        height: 84%; /* 140% × 0.6 = 84% */
        background: url('res/2.png') no-repeat bottom right;
        background-size: contain;
        opacity: 0.2;
    }

    .main-content {
        padding: 30px 15px;
    }

    .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .wheel-border {
        width: 88vw;  /* Mobile: 88% screen width */
        height: 88vw;
        max-width: 400px;
        max-height: 400px;
        padding: 10px;
    }

    .spin-button {
        width: 80px;
        height: 80px;
        font-size: 14px;
    }

    .spin-icon {
        font-size: 24px;
    }

    .wheel-pointer {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 30px;
    }

    .prize-icon {
        font-size: 70px;
        min-height: 120px;
    }

    .prize-icon img {
        max-width: 130px;
        max-height: 130px;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-prize {
        font-size: 18px;
    }

    .claim-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}
