:root {
    --primary: #ff6b9d;
    --secondary: #c94b7d;
    --accent: #ffa8cc;
    --bg-dark: #0a0118;
    --bg-card: #1a0b2e;
    --bg-input: #2d1b4e;
    --text: #ffffff;
    --text-dim: #b8a4d4;
    --glow: rgba(255, 107, 157, 0.4);
    --border: rgba(255, 168, 204, 0.2);
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #16012e 50%, var(--bg-dark) 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Starfield */
@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-100vh); }
}

.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200vh;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="2" height="2"><circle cx="1" cy="1" r="1" fill="rgba(255,255,255,0.3)"/></svg>') repeat;
    animation: moveStars 200s linear infinite;
}

.stars2 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="3" height="3"><circle cx="1.5" cy="1.5" r="1" fill="rgba(255,168,204,0.4)"/></svg>') repeat;
    animation: moveStars 150s linear infinite;
}

.stars3 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><circle cx="2" cy="2" r="1" fill="rgba(255,107,157,0.5)"/></svg>') repeat;
    animation: moveStars 100s linear infinite;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-section {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary), var(--accent), var(--secondary), var(--primary));
    animation: rotate 4s linear infinite;
    filter: blur(10px);
}

.avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    object-fit: cover;
    box-shadow: 0 0 30px var(--glow);
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
}

.title {
    font-family: 'Kalam', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #4ade80;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

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

/* Chat Container */
.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chat-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(201, 75, 125, 0.05));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

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

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

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

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.user-message .avatar-small {
    background: var(--accent);
    border-color: var(--accent);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 75%;
}

.message-bubble {
    padding: 0.875rem 1.125rem;
    border-radius: 16px;
    line-height: 1.5;
}

.bot-message .message-bubble {
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.message-bubble p {
    margin-bottom: 0.5rem;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 0 0.5rem;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Quick Prompts */
.quick-prompts {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prompt-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-chip:hover {
    background: rgba(255, 107, 157, 0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Input Container */
.input-container {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.message-input {
    flex: 1;
    padding: 0.875rem 1.125rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow);
}

.message-input::placeholder {
    color: var(--text-dim);
}

.send-btn {
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-note {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .avatar-section {
        width: 100px;
        height: 100px;
    }
    
    .avatar-glow {
        width: 120px;
        height: 120px;
    }
    
    .messages {
        height: 350px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}
