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

body {
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    width: 100%;
    background: #FFCC00;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.header-right .logo {
    height: 32px;
}

.info-bar {
    width: 100%;
    background: #FFCC00;
    padding: 8px 16px 16px;
}

.info-bar-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.gift-icon, .calendar-icon {
    flex-shrink: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-prizes-image {
    border-radius: 16px;
    margin-bottom: 20px;
}

.modal-prizes-image img {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 12px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
}

.modal-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-attempts {
    font-size: 14px;
    color: #333;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: #FF6B35;
}

.modal-input::placeholder {
    color: #999;
}

.modal-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.modal-btn:active {
    transform: translateY(0);
}

.prize-icon-big {
    font-size: 64px;
    margin-bottom: 16px;
}

.prize-image-big {
    margin-bottom: 16px;
}

.prize-image-big img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.win-modal .modal-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
}

.game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px 16px;
}

.app {
    background: linear-gradient(180deg, #FF491B 0%, #FF831E 100%);
    border-radius: 25px;
    padding: 16px;
    color: #fff;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.balance {
    background: #fff;
    color: #333;
    padding: 6px 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.coin-icon {
    font-size: 18px;
}

.top-actions {
    display: flex;
    gap: 6px;
}

.pill {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.2s;
}

.pill:hover, .pill.active {
    background: rgba(255, 255, 255, 0.3);
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.title-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.carousel-window {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 30px 0 20px;
}

.center-arrow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 40px solid #fff;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    z-index: 10;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 12px;
    will-change: transform;
}

.prize-card {
    flex: 0 0 auto;
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.prize-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 6px;
}

.prize-card .prize-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.2;
}

.prize-card.is-active {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px #fff, 0 12px 30px rgba(0, 0, 0, 0.3);
}

.prize-card[data-type="lose"] {
    background: linear-gradient(135deg, #444 0%, #222 100%);
}

.prize-card[data-type="lose"] .prize-name {
    color: #fff;
}

.spin-btn {
    margin-top: 24px;
    padding: 14px 60px;
    background: linear-gradient(135deg, #2a2a2a 0%, #111 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.spin-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.spin-btn:active:not(.disabled) {
    transform: translateY(1px);
}

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

.attempt-info {
    margin-top: 12px;
    font-size: 14px;
    opacity: 0.9;
}

.chat-section {
    width: 100%;
    max-width: 500px;
    padding: 20px 16px;
}

.chat-container {
    background: #FFCC00;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #FFCC00;
}

.chat-logo {
    height: 28px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-messages {
    background: #fff;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar.video-avatar {
    position: relative;
}

.chat-avatar.video-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-content {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a73e8;
    margin-bottom: 4px;
}

.chat-text {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    background: #f0f0f0;
    padding: 10px 14px;
    border-radius: 0 16px 16px 16px;
    display: inline-block;
}

.chat-time {
    font-size: 11px;
    color: #1a73e8;
    margin-top: 4px;
}

.chat-media {
    max-width: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 4px;
}

.chat-media img,
.chat-media video {
    width: 100%;
    display: block;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #FFCC00;
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-input:focus {
    border-color: #e6b800;
}

.chat-media-btn,
.chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-media-btn:hover,
.chat-send-btn:hover {
    transform: scale(1.1);
}

.footer {
    padding: 30px 20px;
    text-align: center;
}

.footer a {
    color: #999;
    font-size: 12px;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .info-bar-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .top-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pill span:last-child {
        display: none;
    }

    .prize-card {
        width: 90px;
        height: 90px;
    }

    .prize-card img {
        width: 45px;
        height: 45px;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.user-avatar {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar .avatar-letter {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-message .chat-text {
    background: #e3f2fd;
    border-radius: 16px 0 16px 16px;
}

.carousel-track {
    transition: none;
}

.carousel-track.spinning .prize-card {
    filter: blur(1px);
}

.carousel-track.spinning .prize-card.is-active {
    filter: blur(0.5px);
    transform: scale(1.05);
}

.prize-card.is-active {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px #fff, 0 12px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
}

.prize-card.winner {
    animation: winnerPulse 0.6s ease-out;
}

@keyframes winnerPulse {
    0% {
        transform: scale(1.15);
    }
    30% {
        transform: scale(1.3);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.9), 0 0 40px rgba(255, 215, 0, 0.8);
    }
    100% {
        transform: scale(1.15);
        box-shadow: 0 0 0 4px #fff, 0 12px 30px rgba(0, 0, 0, 0.3);
    }
}

@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.prize-card.winner {
    animation: celebrate 0.5s ease-in-out 3;
}

.app {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

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

.center-arrow {
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

.carousel-track.spinning ~ .center-arrow,
.spinning + .center-arrow {
    animation: none;
}

.spin-btn.disabled {
    position: relative;
    overflow: hidden;
}

.spin-btn.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}
