@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    font-family: 'Tajawal', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: 
        radial-gradient(ellipse at 20% 50%, rgba(120, 40, 200, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(80, 20, 160, 0.1) 0%, transparent 40%);
}

.container {
    width: 100%;
    max-width: 700px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(150, 80, 255, 0.2);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(120, 40, 200, 0.15);
}

.header {
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(120, 40, 200, 0.3), rgba(60, 20, 120, 0.2));
    border-bottom: 1px solid rgba(150, 80, 255, 0.2);
    text-align: center;
}

.header h1 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    color: rgba(180, 130, 255, 0.8);
    font-size: 0.95rem;
    margin-top: 4px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(150, 80, 255, 0.3) transparent;
}

.chat-box::-webkit-scrollbar {
    width: 4px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: rgba(150, 80, 255, 0.3);
    border-radius: 4px;
}

.message {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message.bot {
    background: linear-gradient(135deg, rgba(120, 40, 200, 0.25), rgba(80, 20, 160, 0.2));
    border: 1px solid rgba(150, 80, 255, 0.25);
    color: #e8d5ff;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

.message.user {
    background: linear-gradient(135deg, rgba(40, 20, 80, 0.6), rgba(60, 30, 100, 0.5));
    border: 1px solid rgba(100, 60, 180, 0.3);
    color: #d0b8ff;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.message.typing {
    background: linear-gradient(135deg, rgba(120, 40, 200, 0.15), rgba(80, 20, 160, 0.1));
    border: 1px solid rgba(150, 80, 255, 0.15);
    color: rgba(180, 130, 255, 0.7);
    align-self: flex-start;
    font-style: italic;
}

.input-area {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(150, 80, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-row {
    display: flex;
    gap: 12px;
    flex-direction: row-reverse;
}

input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(150, 80, 255, 0.25);
    border-radius: 14px;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: right;
}

input[type="text"]:focus {
    border-color: rgba(150, 80, 255, 0.6);
    box-shadow: 0 0 20px rgba(120, 40, 200, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(150, 100, 220, 0.4);
}

#sendBtn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #7828c8, #5a1fa0);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#sendBtn:hover {
    background: linear-gradient(135deg, #8f35e0, #6b25ba);
    box-shadow: 0 4px 20px rgba(120, 40, 200, 0.4);
    transform: translateY(-1px);
}

#sendBtn:active {
    transform: translateY(0);
}

.new-game-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(150, 80, 255, 0.25);
    border-radius: 12px;
    color: rgba(180, 130, 255, 0.7);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.new-game-btn:hover {
    background: rgba(120, 40, 200, 0.15);
    border-color: rgba(150, 80, 255, 0.5);
    color: #d0b8ff;
}