/* Root variables - New Year theme */
:root {
    --tg-theme-bg-color: #0a0e27;
    --tg-theme-text-color: #ffffff;
    --tg-theme-button-color: #c41e3a;
    --primary-color: #ffffff;
    --secondary-color: #1a1f3a;
    --accent-gold: #d4af37;
    --accent-red: #c41e3a;
    --accent-green: #165b33;
    --accent-silver: #c0c0c0;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 50%, #0f1629 100%);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Snowflakes */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5em;
    animation: snowfall linear infinite;
}

.snowflake:nth-child(1) {
    left: 10%;
    animation-duration: 12s;
    animation-delay: 0s;
}

.snowflake:nth-child(2) {
    left: 20%;
    animation-duration: 15s;
    animation-delay: 2s;
}

.snowflake:nth-child(3) {
    left: 35%;
    animation-duration: 10s;
    animation-delay: 4s;
}

.snowflake:nth-child(4) {
    left: 50%;
    animation-duration: 13s;
    animation-delay: 1s;
}

.snowflake:nth-child(5) {
    left: 65%;
    animation-duration: 11s;
    animation-delay: 3s;
}

.snowflake:nth-child(6) {
    left: 75%;
    animation-duration: 14s;
    animation-delay: 5s;
}

.snowflake:nth-child(7) {
    left: 85%;
    animation-duration: 12s;
    animation-delay: 2.5s;
}

.snowflake:nth-child(8) {
    left: 95%;
    animation-duration: 13s;
    animation-delay: 4.5s;
}

@keyframes snowfall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Background elements */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    z-index: 0;
    filter: sepia(0.1) hue-rotate(200deg) saturate(0.7);
}

.bg-element {
    position: absolute;
    pointer-events: none;
}

.bg-element-1 {
    bottom: -5%;
    right: -5%;
    width: 25%;
    min-width: 300px;
    height: auto;
    opacity: 1;
    z-index: 1;
    filter: sepia(0.6) hue-rotate(200deg) saturate(0.8);
}

.bg-element-2 {
    bottom: 8%;
    right: 8%;
    width: 80px;
    height: auto;
    opacity: 1;
    z-index: 5;
}

.bg-element-3 {
    top: 30%;
    left: 0;
    width: 5%;
    min-width: 75px;
    height: auto;
    opacity: 1;
    z-index: 1;
    filter: sepia(0.6) hue-rotate(200deg) saturate(0.8);
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* User ID display */
.user-id-display {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(212, 175, 55, 0.2);
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

/* Prizes button */
.prizes-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(212, 175, 55, 0.2);
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.prizes-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--accent-silver);
    color: var(--accent-silver);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

/* Wheel container */
.wheel-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-silver) 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

/* Wheel */
.wheel-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #d4af37;
    z-index: 10;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.8));
}

#wheel {
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.4), 0 0 80px rgba(212, 175, 55, 0.2);
}

/* Spin button */
.spin-btn {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-silver) 50%, var(--accent-gold) 100%);
    color: #000000;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 18px 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Result */
.result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.result-content {
    background: rgba(20, 25, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.result-title {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
}

.result-prize {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.result-prize-id {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
}

.result-ok-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 48px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-ok-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: rgba(20, 25, 40, 0.95);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #cccccc;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Prize item */
.prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.prize-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.prize-item:last-child {
    margin-bottom: 0;
}

.prize-name {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.prize-quantity {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 480px) {
    .title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    #wheel {
        width: 320px;
        height: 320px;
    }

    .spin-btn {
        padding: 14px 36px;
        font-size: 14px;
    }

    .result-title {
        font-size: 22px;
    }

    .result-prize {
        font-size: 36px;
    }

    .result-content {
        padding: 30px 20px;
    }

    .user-id-display {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 12px;
    }

    .prizes-btn {
        top: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .bg-element-1 {
        width: 40%;
        min-width: 200px;
    }

    .bg-element-2 {
        width: 60px;
    }

    .bg-element-3 {
        width: 8%;
        min-width: 50px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wheel-container {
    animation: fadeIn 0.5s ease;
}
