* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, #7c3aed, transparent 30%),
        radial-gradient(circle at bottom right, #06b6d4, transparent 30%),
        #09090f;
    color: white;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 35px;
    border-radius: 28px;
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}

.auth-card h1 {
    margin: 0;
    font-size: 34px;
}

.auth-card p {
    color: #cbd5e1;
    margin-bottom: 25px;
}

.auth-card input,
.message-form input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 15px 18px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 15px;
}

.auth-card input::placeholder,
.message-form input::placeholder {
    color: #94a3b8;
}

.auth-card button,
.message-form button {
    border: 0;
    padding: 15px 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.auth-card button {
    width: 100%;
}

.auth-card button:hover,
.message-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(6,182,212,0.25);
}

.auth-card a {
    display: block;
    margin-top: 20px;
    color: #67e8f9;
    text-decoration: none;
    text-align: center;
}

.auth-card span {
    display: block;
    margin-top: 12px;
    color: #fca5a5;
    text-align: center;
}

.app {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
}

.sidebar {
    padding: 28px;
    background: rgba(15,23,42,0.78);
    backdrop-filter: blur(22px);
    border-right: 1px solid rgba(255,255,255,0.10);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 28px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

.brand h2 {
    margin: 0;
}

.brand p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 14px;
}

.profile {
    margin-top: 25px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #22c55e, #06b6d4);
    font-weight: 900;
}

.profile small {
    display: block;
    color: #22c55e;
    margin-top: 4px;
}

.logout {
    margin-top: auto;
    text-decoration: none;
    color: white;
    padding: 15px;
    border-radius: 16px;
    background: rgba(239,68,68,0.18);
    text-align: center;
}

.chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    padding: 24px 32px;
    background: rgba(15,23,42,0.50);
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.chat-header h2 {
    margin: 0;
}

.chat-header p {
    margin: 6px 0 0;
    color: #94a3b8;
}

.messages {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.message {
    display: flex;
    margin-bottom: 14px;
}

.message.mine {
    justify-content: flex-end;
}

.message.other {
    justify-content: flex-start;
}

.bubble {
    max-width: 65%;
    padding: 14px 16px;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.20);
}

.mine .bubble {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-bottom-right-radius: 6px;
}

.other .bubble {
    background: rgba(255,255,255,0.12);
    border-bottom-left-radius: 6px;
}

.bubble strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    opacity: 0.85;
}

.bubble p {
    margin: 0;
    line-height: 1.45;
}

.time {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.score {
    display: block;
    margin-top: 7px;
    color: #fde68a;
    font-size: 11px;
}

.typing-box {
    min-height: 28px;
    padding: 0 32px;
}

.typing {
    color: #cbd5e1;
    font-size: 14px;
    margin-bottom: 8px;
}

.typing span {
    animation: blink 1.2s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

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

.message-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 22px 32px 28px;
    background: rgba(15,23,42,0.45);
    border-top: 1px solid rgba(255,255,255,0.10);
}

.message-form input {
    margin-bottom: 0;
}

.warning-box {
    margin-top: 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.25);
}

.warning-box small {
    display: block;
    margin-bottom: 8px;
    color: #fde68a;
    font-weight: 700;
}

.blurred-text {
    filter: blur(7px);
    user-select: none;
    transition: 0.25s;
}

.blurred-text.revealed {
    filter: blur(0);
    user-select: text;
}

.warning-box button {
    margin-top: 10px;
    border: 0;
    padding: 9px 13px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    color: white;
    cursor: pointer;
    font-weight: 700;
}

.warning-box button:hover {
    background: rgba(255,255,255,0.28);
}

@media (max-width: 800px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .bubble {
        max-width: 85%;
    }

    .messages {
        padding: 20px;
    }

    .message-form {
        padding: 18px;
    }
}