/* Chatroom page + IRC badges */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.stormnet-page {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    color: #1e293b;
    background-color: #e2f0ff;
}

.stormnet-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
}

.stormnet-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: minmax(5rem, 11rem) 1fr minmax(5rem, 11rem);
    align-items: center;
    column-gap: 1rem;
}

.stormnet-header-logo-cell {
    justify-self: start;
}

.stormnet-header-logo {
    display: block;
    height: 4.25rem;
    width: auto;
    max-width: 11rem;
    object-fit: contain;
    border-radius: 0.375rem;
}

.stormnet-header-spacer {
    width: 100%;
    max-width: 11rem;
    justify-self: end;
    min-height: 1px;
}

.stormnet-brand-centered {
    text-align: center;
    min-width: 0;
}

.stormnet-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.stormnet-brand-centered #page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.stormnet-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
}

.stormnet-body-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
}

.stormnet-chat-column {
    flex: 1;
    min-width: 0;
}

.channel-explorer-dock {
    width: 15rem;
    min-width: 12rem;
    max-height: min(80vh, 720px);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.channel-explorer-dock.hidden {
    display: none !important;
}

.explorer-header {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0c4a6e;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.explorer-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(min(80vh, 720px) - 9rem);
}

.explorer-list li {
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.explorer-list li:hover {
    background: #e0f2fe;
}

.explorer-list li .ch-name {
    font-weight: 600;
    color: #0f172a;
}

.explorer-list li .ch-meta {
    font-size: 0.7rem;
    color: #64748b;
}

.emoji-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.35rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.2rem;
    max-width: 18rem;
}

.emoji-popover.hidden {
    display: none !important;
}

.emoji-popover button {
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.25rem;
}

.emoji-popover button:hover {
    background: #f1f5f9;
}

.gif-popover.hidden {
    display: none !important;
}

.gif-results-grid img {
    width: 100%;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.25rem;
    cursor: pointer;
}

@media (max-width: 720px) {
    .stormnet-body-row {
        flex-direction: column;
    }
    .channel-explorer-dock {
        width: 100%;
        max-height: 14rem;
    }
    .explorer-list {
        max-height: 8rem;
    }
}

.webchat-shell {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

#chat-stage {
    min-height: min(80vh, 720px);
}

/* Nick prompt: covers only the chat area until connected */
.nick-gate-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
}

#nick-gate.nick-gate-overlay.hidden {
    display: none !important;
    pointer-events: none;
}

body.hide-channel-sidebar .sidebar-channels {
    display: none !important;
}

body.hide-network-header #channel-list .network-header-row {
    display: none !important;
}

.badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.badge-op { background: #ca8a04; }
.badge-voice { background: #16a34a; }
.badge-halfop { background: #2563eb; }
.badge-admin { background: #db2777; }
.badge-owner { background: #9333ea; }
.badge-none { background: #94a3b8; }

/* IRC activity lines (join/part/mode, etc.) */
.chat-line-activity .chat-activity-text {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
}

/* Inline media embeds under chat rows */
.chat-embed-wrap {
    margin-top: 0.35rem;
}

.chat-embed-youtube-wrap {
    max-width: 560px;
}

.chat-embed-youtube {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 315px;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #0f172a;
}

.chat-embed-image {
    display: block;
    max-height: 12rem;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    object-fit: contain;
    background: #f8fafc;
}

.chat-embed-broken {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    border-radius: 0.375rem;
}

.chat-embed-broken-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* standalone-webchat-pro */
.chat-ctx-menu {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

.chat-new-marker hr {
    border: 0;
    border-top: 1px solid #7dd3fc;
}

.chat-unfurl-card a {
    text-decoration: none;
    color: inherit;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
