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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.container {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #8B4513;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 40px;
    background: #654321;
    border-radius: 10px;
    border: 2px solid #8B4513;
}

h1 {
    text-align: center;
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.chat-container {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #8B4513;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid #8B4513;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

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

.message.user {
    background: rgba(70, 130, 180, 0.8);
    margin-left: 20px;
    border-left: 4px solid #4682B4;
}

.message.pirate {
    background: rgba(139, 69, 19, 0.8);
    margin-right: 20px;
    border-left: 4px solid #8B4513;
}

.sender {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message.user .sender {
    color: #87CEEB;
}

.message.pirate .sender {
    color: #FFD700;
}

.content {
    line-height: 1.4;
    font-size: 1em;
}

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

#user-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #8B4513;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1em;
}

#user-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#user-input::placeholder {
    color: #ccc;
}

#send-button {
    padding: 12px 20px;
    background: linear-gradient(45deg, #8B4513, #A0522D);
    color: #FFD700;
    border: 2px solid #8B4513;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#send-button:hover:not(:disabled) {
    background: linear-gradient(45deg, #A0522D, #8B4513);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

#send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-message {
    text-align: center;
    color: #FFD700;
    font-style: italic;
    font-size: 0.9em;
    min-height: 20px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 4px;
}

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

@media (max-width: 768px) {
    .input-container {
        flex-direction: column;
    }

    #send-button {
        width: 100%;
    }
}