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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    height: 100vh;
    overflow: hidden;
}

.ninja-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40vw;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* Home Page */
.home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
}

.home-content {
    text-align: center;
    z-index: 1;
    max-width: 500px;
    padding: 2rem;
}

.home-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 2rem;
}

.primary-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 600;
}

.primary-btn:hover {
    transform: scale(1.05);
}

.features {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.feature {
    font-size: 0.9rem;
    color: #888;
}

/* Chat Page */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #2a2a2a;
    border-bottom: 2px solid #ff6b35;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    text-decoration: none;
    color: #ff6b35;
    font-weight: bold;
}

.channel-name {
    color: #aaa;
    font-size: 0.9rem;
    font-family: monospace;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-count {
    color: #888;
    font-size: 0.85rem;
}

.username-input {
    background-color: #333;
    border: 1px solid #444;
    color: #f0f0f0;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.username-input:focus {
    border-color: #ff6b35;
}

.share-btn {
    background-color: #333;
    border: 1px solid #444;
    color: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background-color: #444;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: slideIn 0.2s ease-out;
}

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

.message.own {
    align-self: flex-end;
}

.message.other {
    align-self: flex-start;
}

.message.system {
    align-self: center;
    max-width: 90%;
}

.message-header {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
}

.message.own .message-header {
    text-align: right;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.own .message-bubble {
    background-color: #ff6b35;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.other .message-bubble {
    background-color: #333;
    color: #f0f0f0;
    border-bottom-left-radius: 4px;
}

.message.system .message-bubble {
    background-color: transparent;
    color: #888;
    font-size: 0.85rem;
    text-align: center;
    font-style: italic;
}

.input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: #2a2a2a;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    min-height: 44px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    background-color: #333;
    border: 1px solid #444;
    color: #f0f0f0;
    padding: 0.75rem 1rem;
    padding-right: 4rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
}

.message-input:focus {
    border-color: #ff6b35;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: #666;
    pointer-events: none;
}

.char-counter.warning {
    color: #ff6b35;
    font-weight: 600;
}

.send-btn {
    background-color: #ff6b35;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #f7931e;
}

.send-btn:disabled {
    background-color: #444;
    cursor: not-allowed;
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .header-left, .header-right {
        justify-content: space-between;
    }

    .message {
        max-width: 85%;
    }

    .home-content h1 {
        font-size: 2rem;
    }

    .ninja-bg {
        font-size: 60vw;
    }
}
