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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.game-header {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.game-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-header p {
    opacity: 0.8;
    font-style: italic;
}

.api-key-settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.api-key-settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

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

.message {
    max-width: 85%;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-in;
}

.dm-message {
    align-self: flex-start;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom-left-radius: 5px;
}

.player-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-bottom-right-radius: 5px;
}

.message-content {
    line-height: 1.5;
    word-wrap: break-word;
}

.input-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#playerInput {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#playerInput:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#sendButton {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.loading-dots {
    display: flex;
    gap: 3px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .chat-container {
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
        padding: 12px;
    }
    
    .input-container {
        padding: 15px;
    }
    
    #playerInput {
        padding: 12px;
        font-size: 16px;
    }
    
    #sendButton {
        padding: 12px 20px;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Streaming cursor animation */
.streaming-cursor {
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    margin-left: 2px;
}

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