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

* { 
    box-sizing: border-box; 
}

body {
    margin: 0;
    height: 100vh;
    background: radial-gradient(circle at center, #25050a 0%, #0a0203 100%);
    color: #e5d5d5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Custom Scrollbar für den modernen Look (außerhalb des Chats) */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0203;
}
::-webkit-scrollbar-thumb {
    background: #4a0f16;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff2a44;
}

/* ==================== MESSENGER HEADER ==================== */
header {
    background: rgba(5, 1, 2, 0.85);
    backdrop-filter: blur(12px);
    padding: 14px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 42, 68, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.header-container {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff2a44;
    box-shadow: 0 0 15px rgba(255, 42, 68, 0.4);
    transition: all 0.3s ease;
}

.header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.3em;
    color: #ff4d64;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 77, 100, 0.2);
}

.online-status {
    font-size: 0.8rem;
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-top: 4px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff88;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #00ff88;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 16px #00ff88; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}
.screen.active { display: flex; }

/* ==================== GAME RESPONSIVE LAYOUT ==================== */
.game-layout {
    display: flex;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.chat-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Status Bar */
.status {
    background: rgba(15, 5, 7, 0.9);
    padding: 14px 20px;
    display: flex;
    justify-content: space-around;
    gap: 20px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #b5a5a5;
    border-bottom: 1px solid rgba(255, 42, 68, 0.15);
    flex-shrink: 0;
}

.status-item {
    flex: 1;
    max-width: 300px;
}

.bar-container {
    background: #150a0c;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 2px;
    margin-top: 6px;
}

.bar {
    height: 8px;
    background: linear-gradient(90deg, #800a1d, #ff2a44);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 42, 68, 0.5);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video Spalte */
.video-column {
    display: none;
    width: 400px;
    background: #050102;
    border-left: 1px solid rgba(255, 42, 68, 0.2);
    padding: 24px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 65vh;
    border: 1px solid rgba(255, 42, 68, 0.3);
    box-shadow: 0 0 30px rgba(255, 42, 68, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stream-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #ff2a44;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    letter-spacing: 1.5px;
    box-shadow: 0 0 15px rgba(255, 42, 68, 0.6);
    z-index: 10;
}

/* ==================== SETUP SCREEN ==================== */
#setup {
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

#setup h2 {
    font-family: 'Cinzel', serif;
    color: #ff4d64;
    margin-bottom: 35px;
    font-size: 2em;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 42, 68, 0.2);
}

#setup input {
    width: 90%;
    max-width: 420px;
    padding: 16px 20px;
    margin: 14px 0;
    background: rgba(20, 6, 9, 0.7);
    border: 1px solid rgba(255, 42, 68, 0.2);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

#setup input:focus {
    border-color: #ff2a44;
    box-shadow: 0 0 15px rgba(255, 42, 68, 0.3);
    background: rgba(35, 10, 15, 0.9);
}

#setup button {
    width: 90%;
    max-width: 420px;
    padding: 18px;
    margin-top: 30px;
    background: linear-gradient(135deg, #800a1d, #b30f27);
    color: white;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(128, 10, 29, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

#setup button:hover {
    background: linear-gradient(135deg, #a60d26, #d91432);
    box-shadow: 0 6px 20px rgba(255, 42, 68, 0.4);
    transform: translateY(-2px);
}

/* ==================== GAME CHAT PANELS ==================== */
#chat-wrapper {
    flex: 1;
    overflow: hidden;
    background: rgba(5, 2, 3, 0.4);
    display: flex;
    flex-direction: column;
}

#chat {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    
    /* Schaltet den Scrollbalken für alle Browser stumm */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

#chat::-webkit-scrollbar {
    display: none;
}

.message {
    padding: 14px 20px;
    border-radius: 16px;
    max-width: 75%;
    line-height: 1.6;
    font-size: 0.98rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.domina {
    align-self: flex-start;
    background: linear-gradient(135deg, #1c0509, #2d0b11);
    color: #f5e6e8;
    border-left: 4px solid #ff2a44;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 20px rgba(255, 42, 68, 0.05);
}

.slave {
    align-self: flex-end;
    background: linear-gradient(135deg, #09170f, #11261b);
    color: #e6f5ed;
    border-right: 4px solid #00ff88;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.05);
}

/* ==================== MESSENGER TYPING INDICATOR ==================== */
.typing {
    align-self: flex-start;
    background: linear-gradient(135deg, #1c0509, #2d0b11);
    padding: 10px 16px; 
    border-radius: 14px;
    border-top-left-radius: 4px;
    font-style: italic;
    color: rgba(255, 77, 100, 0.85);
    font-size: 0.8rem; /* Schön dezent & klein */
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(255, 42, 68, 0.05);
    border-left: 3px solid rgba(255, 42, 68, 0.4);
    order: 99999 !important; /* Immer ganz unten fixiert */
    
    /* Unkaputtbares CSS-Blinken über die Transparenz */
    animation: opacityPulse 1.6s infinite ease-in-out;
}

@keyframes opacityPulse {
    0% { opacity: 0.35; }
    50% { opacity: 1; }
    100% { opacity: 0.35; }
}

#input-area {
    padding: 16px 20px;
    background: #050102;
    border-top: 1px solid rgba(255, 42, 68, 0.2);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

#command {
    flex: 1;
    padding: 16px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background: rgba(20, 6, 9, 0.8);
    border: 1px solid rgba(255, 42, 68, 0.25);
    border-radius: 12px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

#command:focus {
    border-color: #ff2a44;
    box-shadow: 0 0 15px rgba(255, 42, 68, 0.25);
    background: rgba(30, 8, 12, 0.9);
}

#input-area button {
    background: linear-gradient(135deg, #800a1d, #b30f27);
    color: white;
    border: none;
    padding: 0 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(128, 10, 29, 0.3);
    transition: all 0.3s ease;
}

#input-area button:hover {
    background: linear-gradient(135deg, #a60d26, #d91432);
    box-shadow: 0 4px 15px rgba(255, 42, 68, 0.4);
    transform: translateY(-1px);
}

/* ==================== DESKTOP ENHANCEMENTS ==================== */
@media (min-width: 768px) {
    .avatar {
        width: 55px;
        height: 55px;
    }
    
    .header-name {
        font-size: 1.6em;
    }
    
    .video-column {
        display: flex;
    }
}

/* ==================== OFFLINE / GAME OVER ZUSTAND ==================== */
.offline-placeholder {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 999 !important;
}

.video-wrapper.offline video {
    opacity: 0 !important;
    visibility: hidden !important;
}

.video-wrapper.offline {
    background-image: url('luna-offline.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-color: rgba(255,255,255,0.1) !important;
}

.video-wrapper.offline .stream-badge {
    background: rgba(30, 30, 30, 0.85) !important;
    box-shadow: none !important;
    color: #888888 !important;
}

/* RIGIDE ANTI-BOX-REPARATUR FÜR DEN OFFLINE-HEADER-STATUS */
.online-status.offline,
.offline .online-status {
    color: #666666 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-top: 4px !important;
    width: auto !important;
}

.online-status.offline .pulse-dot,
.offline .pulse-dot,
.offline .online-status .pulse-dot {
    background-color: #444444 !important;
    box-shadow: none !important;
    animation: none !important;
}

/* Erlaubt das Markieren AUSSCHLIESSLICH im Eingabefeld */
#command, input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}