:root {
    --bg-color: #050505;
    --panel-bg: #0f0f0f;
    --text-color: #f0f0f0;
    --primary-color: #d81b60;
    --primary-hover: #ad1457;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 600;
}
.logo span { color: var(--primary-color); font-weight: 300; }

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tokens {
    color: #ffd700;
    font-weight: 600;
}

.btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.btn:hover { background: rgba(255,255,255,0.05); }

.btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}
.btn.primary:hover { background: var(--primary-hover); }

.live-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.video-section {
    flex: 3;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.offline-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ff0000;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

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

.stream-info {
    margin-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.gifts-section {
    margin-top: 20px;
}

.gifts-section h3 { margin-bottom: 15px; }

.gifts-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.gift-btn {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gift-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.custom-tip {
    display: flex;
    gap: 10px;
}

.custom-tip input {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    outline: none;
}

.custom-tip input:focus { border-color: var(--primary-color); }

/* Chat Section */
.chat-section {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: var(--panel-bg);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    font-size: 14px;
    word-break: break-word;
    animation: fadeIn 0.3s ease;
}

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

.msg.system { color: var(--primary-color); font-weight: 600; text-align: center; margin-bottom: 10px; }
.msg .user { font-weight: 600; color: #aaa; margin-right: 5px; }
.msg.gift .user { color: #ffd700; }
.msg.tip .user { color: #00e676; }

.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 20px;
    color: white;
    outline: none;
}

.chat-input-area input:focus { border-color: var(--primary-color); }

.emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    filter: grayscale(1);
    transition: filter 0.3s;
}

.emoji-btn:hover { filter: grayscale(0); }

.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 15px;
    background: #1a1a1a;
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 200px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.emoji-picker.hidden { display: none; }

.emoji {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}
.emoji:hover { transform: scale(1.2); }

@media (max-width: 900px) {
    .live-container { flex-direction: column; }
    .video-section { flex: none; height: 60vh; }
    .chat-section { flex: 1; max-width: 100%; border-left: none; border-top: 1px solid var(--glass-border); }
}
