/* =========================================================
   Chat room
   ========================================================= */

.chat-page-head {
    position: relative;
    overflow: hidden;
    padding: 50px 0 54px;
    background: var(--forest);
    color: var(--paper);
}

.chat-page-head::after {
    content: "";
    position: absolute;
    top: -160px;
    right: 5%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 106, .13), transparent 65%);
}

.chat-page-head-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;
}

.chat-page-head h1 {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: clamp(4rem, 7vw, 6.6rem);
    font-weight: 400;
    letter-spacing: .01em;
    line-height: .82;
    text-transform: uppercase;
}

.chat-head-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 5px;
}

.chat-head-meta p {
    color: rgba(243, 239, 227, .76);
    font-size: 11px;
    letter-spacing: .05em;
}

.chat-section {
    padding: 30px 0 90px;
    background: #e9e4d7;
}

.chat-layout {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr) 282px;
    gap: 18px;
    align-items: start;
}

.chat-sidebar,
.chat-rail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-panel {
    border: 1px solid var(--line);
    background: var(--paper);
}

.chat-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.chat-panel-title .mono {
    color: var(--gold-deep);
    font-size: 11px;
}

.channel {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    color: var(--ink-soft);
    font-size: 11px;
    transition: background .2s ease;
}

.channel:hover {
    background: var(--paper-2);
}

.channel.is-active {
    background: var(--forest);
    color: var(--paper);
}

.channel.is-muted {
    color: var(--muted);
    cursor: default;
}

.channel-hash {
    color: var(--gold-deep);
    font-size: 14px;
    font-weight: 700;
}

.channel.is-active .channel-hash {
    color: var(--gold);
}

.channel > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.channel strong {
    font-size: 11px;
    font-weight: 700;
}

.channel small {
    color: var(--muted);
    font-size: 11px;
}

.channel.is-active small {
    color: rgba(243, 239, 227, .74);
}

.channel-count {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--forest);
    font-size: 11px;
    font-weight: 800;
}

.bank-rules {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 18px;
    counter-reset: rule;
}

.bank-rules li {
    position: relative;
    padding-left: 20px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
    counter-increment: rule;
}

.bank-rules li::before {
    content: "0" counter(rule);
    position: absolute;
    top: 0;
    left: 0;
    color: var(--gold-deep);
    font-size: 11px;
    font-weight: 800;
}

.online-count {
    color: var(--gold-deep);
    font-size: 11px;
    font-weight: 800;
}

.online-list {
    display: flex;
    flex-direction: column;
    padding: 7px;
}

.online-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px;
    border-radius: 2px;
}

.online-row:hover {
    background: var(--paper-2);
}

.online-row > span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.online-row strong {
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-row small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .04em;
}

.online-dot {
    position: absolute;
    right: -1px;
    bottom: 0;
    width: 8px;
    height: 8px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: #5d9b68;
}

/* Main window */

.chat-main {
    min-width: 0;
}

.chat-window {
    position: relative;
    display: flex;
    flex-direction: column;
    height: clamp(610px, calc(100vh - 230px), 840px);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
}

.chat-window-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.chat-window-head > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-window-head .channel-hash {
    font-size: 22px;
}

.chat-window-head h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1;
}

.chat-window-head p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.chat-window-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 22px 26px;
    background:
        linear-gradient(rgba(251, 248, 239, .94), rgba(251, 248, 239, .94)),
        url("../img/catch-placeholder.svg") center / cover;
    scrollbar-width: thin;
    scrollbar-color: #c8c0ad transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #c8c0ad;
    border-radius: 99px;
}

.chat-day-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 22px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.chat-day-divider::before,
.chat-day-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.chat-message {
    display: flex;
    gap: 11px;
    margin-bottom: 19px;
    animation: message-in .3s ease both;
}

@keyframes message-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message > .avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
}

.chat-message-body {
    min-width: 0;
    max-width: 78%;
    padding: 9px 12px 10px;
    border: 1px solid transparent;
    border-radius: 2px 8px 8px 8px;
    background: var(--paper-2);
}

.chat-message.is-mine .chat-message-body {
    border-color: #e4d7b8;
    background: #f5ecd8;
}

.chat-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.chat-message-meta strong {
    font-size: 11px;
    font-weight: 800;
}

.chat-message-meta time {
    color: var(--muted);
    font-size: 11px;
}

.chat-message-body > p {
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 90px 20px;
    color: var(--muted);
    text-align: center;
}

.chat-empty span {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
}

.chat-empty p {
    font-size: 11px;
}

.chat-new-messages {
    position: absolute;
    right: 0;
    bottom: 126px;
    left: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.chat-new-messages button {
    padding: 7px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--forest);
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 6px 20px rgba(12, 21, 14, .3);
    pointer-events: auto;
}

/* Composer */

.chat-composer {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    padding: 14px 16px 10px;
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.chat-composer-avatar {
    padding-top: 2px;
}

.chat-composer-main {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper-2);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.chat-composer-main:focus-within {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 3px rgba(201, 168, 106, .13);
}

.chat-composer textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    max-height: 130px;
    padding: 11px 12px 3px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
}

.chat-composer textarea::placeholder {
    color: #9c9e93;
}

.chat-composer-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 7px 6px 12px;
}

.chat-composer-hint {
    color: var(--muted);
    font-size: 11px;
}

.chat-char-count {
    margin-left: auto;
    color: #a6a79c;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 50%;
    background: var(--gold);
    color: var(--forest);
    transition: background .2s ease, transform .2s ease;
}

.chat-send:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

.chat-send:disabled {
    cursor: wait;
    opacity: .55;
}

.chat-composer-note {
    min-height: 18px;
    padding: 0 20px 7px 62px;
    background: var(--paper);
    color: var(--rust);
    font-size: 11px;
    font-weight: 600;
}

.chat-locked {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 20px;
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.chat-locked strong {
    font-size: 11px;
}

.chat-locked p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.chat-locked-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

/* Rail */

.rail-card {
    border: 1px solid var(--line);
    background: var(--paper);
}

.rail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.rail-card-head a {
    color: var(--gold-deep);
    font-size: 11px;
    letter-spacing: .06em;
}

.rail-catch {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    transition: background .2s ease;
}

.rail-catch:last-child {
    border-bottom: 0;
}

.rail-catch:hover {
    background: var(--paper-2);
}

.rail-catch-image {
    position: relative;
    flex: 0 0 72px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--forest);
}

.rail-catch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rail-catch-image span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 4px;
    background: var(--gold);
    color: var(--forest);
    font-family: var(--font-display);
    font-size: .8rem;
    line-height: 1;
}

.rail-catch > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.rail-catch strong {
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-catch small {
    overflow: hidden;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-catch-meta {
    margin-top: 4px;
    color: var(--gold-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.rail-card--bait {
    position: relative;
    overflow: hidden;
    padding: 20px;
    background: var(--gold);
    color: var(--forest);
}

.rail-card--bait::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -50px;
    width: 140px;
    height: 140px;
    border: 1px solid rgba(12, 21, 14, .15);
    border-radius: 50%;
}

.rail-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
    opacity: .7;
    text-transform: uppercase;
}

.rail-card--bait h3 {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 400;
    letter-spacing: .01em;
    line-height: .8;
    text-transform: uppercase;
}

.rail-card--bait p {
    position: relative;
    z-index: 1;
    margin-top: 13px;
    font-size: 11px;
    line-height: 1.6;
}

.rail-tag {
    display: inline-block;
    position: relative;
    z-index: 1;
    margin-top: 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    opacity: .65;
    text-transform: uppercase;
}

.rail-card--quote {
    padding: 20px;
    background: var(--forest);
    color: var(--gold);
}

.rail-card--quote svg {
    opacity: .5;
}

.rail-card--quote p {
    margin-top: 10px;
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.55rem;
    letter-spacing: .02em;
    line-height: 1.02;
    text-transform: uppercase;
}

.rail-card--quote span {
    display: block;
    margin-top: 12px;
    color: rgba(243, 239, 227, .66);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
