@charset "utf-8";

:root {
    --chat-admin-color: #ff8b8b;
    --chat-member-color: #ffd36b;
    --chat-guest-color: #ffd36b;
    --chat-notice-color: #ffd36b;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #1d2333;
    color: #e6edf7;
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
body {
    display: flex;
    flex-direction: column;
}
.chat-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #21283B;
    border-bottom: 1px solid #2f3749;
    position: relative;
}
.chat-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.chat-title {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.chat-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #9aa4bf;
    font-size: 12px;
    white-space: nowrap;
}
.chat-count-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    color: #9aa4bf;
}
.chat-count-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}
.chat-count-value {
    color: inherit;
}
.chat-count-real {
    color: inherit;
    font-size: 11px;
    opacity: 0.9;
}
.chat-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9aa4bf;
    font-size: 12px;
    white-space: nowrap;
}
.chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d6a235;
    box-shadow: 0 0 0 2px rgba(214, 162, 53, 0.18);
    flex: 0 0 auto;
}
.chat-status.is-ok .chat-status-dot {
    background: #3ac16a;
    box-shadow: 0 0 0 2px rgba(58, 193, 106, 0.18);
}
.chat-status.is-error .chat-status-dot {
    background: #d45555;
    box-shadow: 0 0 0 2px rgba(212, 85, 85, 0.18);
}
.chat-status.is-warn .chat-status-dot {
    background: #d6a235;
    box-shadow: 0 0 0 2px rgba(214, 162, 53, 0.18);
}
.chat-status-text {
    display: none;
}
.chat-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #e6edf7;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.chat-menu-btn:hover {
    background: #232c40;
}
.chat-menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 2px;
    width: 210px;
    background: #1f2638;
    border: 1px solid #39445c;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: none;
    z-index: 120;
}
.chat-menu.is-open {
    display: block;
}
.chat-menu-section + .chat-menu-section {
    border-top: 1px solid #2f3749;
}
.chat-menu-action,
.chat-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    padding: 12px 14px;
    background: transparent;
    color: #e6edf7;
    font-size: 13px;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}
.chat-menu-action:hover,
.chat-menu-link:hover {
    background: #293249;
}
.chat-menu-action[hidden],
.chat-menu-link[hidden] {
    display: none;
}
.chat-menu-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #2d3549;
    flex: 0 0 auto;
    transition: background 0.2s ease;
}
.chat-menu-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c6cfde;
    transition: transform 0.2s ease, background 0.2s ease;
}
.chat-menu-toggle.is-on {
    background: #2e73f2;
}
.chat-menu-toggle.is-on::after {
    transform: translateX(18px);
    background: #ffffff;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: #5b657e #202739;
}
.chat-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-messages::-webkit-scrollbar-track {
    background: #202739;
    border-radius: 999px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #5b657e;
    border-radius: 999px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #6b7691;
}
.chat-message {
    margin-bottom: 4px;
    padding: 0px 0px;
    border-radius: 10px;
}
.chat-message.system {
    background: #273249;
    color: #c7d4ea;
}
.chat-body {
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    text-align: left;
}
.chat-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    display: inline-block;
    vertical-align: -3px;
    margin-right: 4px;
}
.chat-nick {
    font-weight: 700;
    color: var(--chat-member-color);
}
.chat-role-admin .chat-nick {
    color: var(--chat-admin-color);
}
.chat-role-member .chat-nick {
    color: var(--chat-member-color);
}
.chat-role-guest .chat-nick {
    color: var(--chat-guest-color);
}
.chat-nick.is-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(255, 211, 107, 0.4);
    text-underline-offset: 2px;
}
.chat-inline-nick.is-clickable {
    cursor: pointer;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 211, 107, 0.4);
    text-underline-offset: 2px;
}
.chat-role-admin .chat-inline-nick {
    color: var(--chat-admin-color);
}
.chat-role-member .chat-inline-nick,
.chat-role-guest .chat-inline-nick,
.chat-message.system .chat-inline-nick {
    color: var(--chat-member-color);
}
.chat-nick::after {
    content: ":";
    margin-right: 3px;
}
.chat-text {
    font: inherit;
    white-space: pre-wrap;
    line-height:180%;
}
.chat-message-match-alarm {
    margin: 8px 0;
    padding: 6px 8px;
    border-radius: 10px;
    background: #273249;
    border: 1px solid rgba(79, 231, 68, 0.18);
}
.chat-body-match-alarm {
    text-align: center;
    color: #d9e4f7;
    font-weight: 700;
}
.chat-message-match-alarm .chat-text {
    color: #d9e4f7;
    line-height: 1.65;
}
.chat-empty {
    font-size:12px;
    color: #7f8aa4;
    text-align: center;
    padding: 18px 12px;
}
.chat-banner,
.chat-notice {
    margin: 8px 0 8px;
    border-radius: 10px;
    overflow: hidden;
}
.chat-banner-link {
    display: block;
    text-decoration: none;
}
.chat-banner-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.chat-notice {
    padding: 4px 4px;
    background: #273249;
    color: var(--chat-notice-color);
    text-align: center;
    line-height: 1.7;
    font-size: 13px;
    font-weight: 700;
}
.chat-notice-line + .chat-notice-line {
    margin-top: 2px;
}
.chat-notice a {
    color: #4fe744;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(79, 231, 68, 0.45);
    text-underline-offset: 2px;
}
.chat-notice a:visited {
    color: #4fe744;
}
.chat-notice a:hover {
    color: #78f06f;
}
.chat-runtime-notice a {
    color: #4fe744;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(79, 231, 68, 0.45);
    text-underline-offset: 2px;
}
.chat-runtime-notice a:hover {
    color: #78f06f;
}
.chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #21283B;
    border-top: 1px solid #2f3749;
}
.chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #39445c;
    border-radius: 8px;
    background: #21283b;
    color: #f4f7fb;
    padding: 11px 12px;
    font-size: 13px;
    outline: none;
}
.chat-input:disabled {
    opacity: 0.65;
}
.chat-send {
    border: 0;
    border-radius: 8px;
    /*
    background: #f6ac39;
    */
    background: #f6ac39;
    color: #151b28;
    font-weight: 700;
    cursor: pointer;
}
.chat-send:disabled {
    opacity: 0.5;
    cursor: default;
}
.chat-popup-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 16, 24, 0.6);
    z-index: 1000;
}
.chat-popup-backdrop.is-visible {
    display: flex;
}
.chat-popup {
    width: min(360px, calc(100vw - 24px));
    border-radius: 12px;
    background: #1a2130;
    border: 1px solid #2f3749;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.chat-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #2f3749;
}
.chat-popup-title {
    font-size: 14px;
    font-weight: 700;
}
.chat-popup-close {
    border: 0;
    background: transparent;
    color: #9aa4bf;
    font-size: 18px;
    cursor: pointer;
}
.chat-popup-body {
    padding: 14px;
}
.chat-popup-target {
    margin-bottom: 12px;
    color: #c8d2e6;
    font-size: 13px;
}
.chat-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.chat-popup-action {
    border: 0;
    border-radius: 8px;
    padding: 10px 8px;
    background: #293249;
    color: #f4f7fb;
    font-size: 12px;
    cursor: pointer;
}
.chat-popup-action:hover {
    background: #33405d;
}
@media (max-width: 860px) {
    .chat-topbar {
        padding: 10px 12px;
    }
    .chat-form {
        padding: 10px;
    }
    .chat-menu {
        right: 12px;
    }
}
