@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

/* Premium Dark Theme with Gold Accents */
:root {
    --black: #000000;
    --rich-black: #0a0a0a;
    --dark-charcoal: #141414;
    --charcoal: #1a1a1a;
    --gold: #d4af37;
    --rich-gold: #f4d03f;
    --amber: #ffbf00;
    --platinum: #e5e4e2;
    --silver: #c0c0c0;
    --dark-gold: #b8960b;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #6b6b6b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--black);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    letter-spacing: -0.01em;
}

/* Subtle animated gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(244, 208, 63, 0.02) 0%, transparent 50%);
    z-index: -1;
    animation: shimmer 15s ease-in-out infinite alternate;
}

@keyframes shimmer {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Premium Navigation */
.main-nav {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding: 18px 40px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    height: 40px;
    width: auto;
    margin-right: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: -0.01em;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, var(--gold), var(--rich-gold));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(244, 208, 63, 0.1));
    color: var(--gold);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15);
}

/* Main Container */
.container {
    display: flex;
    max-width: 1600px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 30px;
}

/* Stream Area */
.stream-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.6), rgba(26, 26, 26, 0.4));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    min-height: 80vh;
    overflow: hidden;
}

/* 3D Model Container */
.alon-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Speech Bubble */
.speech-bubble {
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 20px;
    padding: 18px 24px;
    width: min(380px, 35vw);
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 70px;
    display: flex;
    align-items: center;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 175, 55, 0.1) inset;
    z-index: 15;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(20, 20, 20, 0.98);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.speech-content {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: var(--gold);
    margin-left: 3px;
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Stream Info */
.stream-info {
    position: fixed;
    bottom: 30px;
    left: 30px;
    text-align: left;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    max-width: 280px;
    z-index: 5;
}

.stream-info h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--gold), var(--rich-gold));
    color: var(--black);
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4); }
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 24px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    max-height: 80vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(244, 208, 63, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
    margin-bottom: 20px;
}

.chat-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

#onlineUsers {
    padding: 6px 16px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold), var(--dark-gold));
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.message {
    padding: 14px 18px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 16px;
    border-left: 2px solid rgba(212, 175, 55, 0.3);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.username {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 8px;
    font-size: 13px;
}

.alon-message {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(244, 208, 63, 0.08));
    border-left: 2px solid var(--gold);
    align-self: flex-start;
    max-width: 85%;
}

.alon-username {
    color: var(--gold);
    font-weight: 700;
}

.system-message {
    text-align: center;
    padding: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.pump-user .username {
    color: var(--amber);
}

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(20, 20, 20, 0.4);
    border-radius: 18px;
    margin-top: 16px;
}

#messageInput {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    background: rgba(26, 26, 26, 0.8);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

#messageInput:focus {
    border-color: var(--gold);
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#sendButton {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--gold), var(--rich-gold));
    color: var(--black);
    border: none;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

#sendButton:active {
    transform: translateY(0);
}

/* Giveaway Indicator */
.giveaway-indicator {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 180px;
    z-index: 5;
}

.giveaway-gif {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.giveaway-timer {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    margin: 12px 0;
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
    50% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.8); }
}

.giveaway-timer.active {
    display: block;
}

.countdown {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 12px;
    display: none;
}

.countdown.active {
    display: block;
}

.giveaway-waiting {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.hidden {
    display: none;
}

/* Giveaway History */
.giveaway-history {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 240px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow: hidden;
}

.history-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 16px;
    margin: 0;
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(244, 208, 63, 0.05));
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.history-item {
    padding: 10px 12px;
    margin: 6px 0;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.winner-name {
    color: var(--text-primary);
    font-weight: 600;
}

.tx-link {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tx-link:hover {
    background: rgba(212, 175, 55, 0.25);
}

.no-winners {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    padding: 20px 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .main-nav {
        padding: 12px 16px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-logo {
        height: 32px;
        margin-right: 10px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    .container {
        flex-direction: column;
        padding: 0;
    }

    .stream-area {
        min-height: 60vh;
        height: 60vh;
        padding: 16px;
    }

    .alon-container {
        width: 100%;
        height: 100%;
        min-height: 400px;
    }

    .chat-area {
        min-height: 40vh;
    }

    .speech-bubble {
        width: min(320px, 80vw);
        padding: 16px 20px;
        font-size: 14px;
    }

    .giveaway-indicator {
        top: 16px;
        left: 16px;
        width: 150px;
        transform: scale(0.9);
    }

    .giveaway-history {
        top: 16px;
        right: 16px;
        width: 200px;
        transform: scale(0.9);
    }

    .stream-info {
        bottom: 16px;
        left: 16px;
        transform: scale(0.9);
    }

    /* 3D Canvas mobile optimization */
    #alon3d canvas {
        width: 100% !important;
        height: 100% !important;
    }
}
