/* Имена переменных, шрифт и сетка — как на boogiedk.me (frontend/src/styles/global.css), палитра своя. */
:root {
    --color-bg: #22262a;
    --color-surface: #292e33;
    --color-text: #e8eaed;
    --color-muted: #929aa3;
    --color-faint: #68707a;
    --color-line: #353b41;
    --color-underline: #5a626b;
    --color-accent: #ff8a3d;
    --color-on-accent: #1c0d02;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-sans);

    --page-width: 760px;
    --page-gutter: 24px;
}

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

body,
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style: none;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font: 16px/1.65 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-underline);
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
    color: var(--color-accent);
    text-decoration-color: currentColor;
}

.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: clamp(40px, 9vw, 104px) var(--page-gutter) 48px;
}

.page__footer {
    margin-top: 56px;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

/* Шапка */

.server__name {
    font: 700 clamp(2.5rem, 8vw, 3.75rem) / 1.05 var(--font-heading);
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.server__role {
    margin-top: 12px;
    font-size: 1.125rem;
    color: var(--color-accent);
}

.server__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}

.button:hover {
    color: var(--color-on-accent);
    filter: brightness(1.08);
}

.button--secondary {
    border-color: var(--color-line);
    background: none;
    color: var(--color-text);
    font-weight: 400;
}

.button--secondary:hover {
    background: var(--color-surface);
    color: var(--color-text);
    filter: none;
}

.button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Разделы */

.section {
    margin-top: 72px;
}

.section__title {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Параметры сервера */

.stats {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr 1.1fr;
    gap: 12px;
    margin-top: 32px;
}

.stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    padding: 12px 16px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--color-surface);
}

.stat dt {
    color: var(--color-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.stat dd {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stat__slots {
    color: var(--color-faint);
}

.server__updated {
    margin-top: 12px;
    text-align: right;
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.server__updated--error {
    color: var(--color-accent);
}

/* Каналы */

.channels > * {
    padding: 20px 0;
}

.channels > * + * {
    border-top: 1px solid var(--color-line);
}

.group__title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}

.group__title--spacer {
    color: var(--color-muted);
}

.group__count {
    color: var(--color-accent);
    font-size: 0.875rem;
}

.group > .channel,
.group > .users {
    margin-top: 8px;
}

.channel__head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group .channel__head {
    color: var(--color-muted);
}

.channels > .channel > .channel__head {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}

.channel.channel--empty > .channel__head {
    color: var(--color-faint);
    font-weight: 400;
}

.channel__children {
    margin: 4px 0 0 3px;
    padding-left: 16px;
    border-left: 1px solid var(--color-line);
}

.channel__children > .channel + .channel {
    margin-top: 6px;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}

.user__dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
}

.user--deaf .user__dot {
    background: var(--color-faint);
}

/* Отошёл: пустой кружок вместо третьего цвета */
.user--away .user__dot {
    border: 2px solid var(--color-muted);
    background: none;
}

.user__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user__flags {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

.user__time {
    flex: none;
    margin-left: auto;
    color: var(--color-muted);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.icon {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 600px) {
    .section {
        margin-top: 56px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
