:root {
    --bg: #0a0a0a;
    --bg2: #111111;
    --bg3: #161616;
    --border: #2a2a2a;
    --red: #cc2200;
    --red-glow: rgba(204,34,0,0.3);
    --gold: #c8a855;
    --gold-dim: rgba(200,168,85,0.15);
    --text: #d4d0c8;
    --text-dim: #7a7670;
    --text-muted: #484440;
    --green: #4a8c3f;
    --cyan: #2a8080;
}

/* ── WRAPPER ── */
.chat-wrapper {
    position: relative;
    border-radius: 2px;
}

/* ── OUTER GLOW FRAME ── */
.chat-outer {
    position: relative;
    padding: 2px;
    border-radius: 3px;
    background: linear-gradient(135deg, #cc2200 0%, #3a0a00 30%, #1a1000 50%, #3a2a00 70%, #c8a855 100%);
    box-shadow:
            0 0 0 1px rgba(204,34,0,0.2),
            0 0 20px rgba(204,34,0,0.15),
            0 0 60px rgba(204,34,0,0.08),
            inset 0 0 20px rgba(0,0,0,0.5);
    animation: frameGlow 4s ease-in-out infinite;
}

@keyframes frameGlow {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(204,34,0,0.2), 0 0 20px rgba(204,34,0,0.15), 0 0 60px rgba(204,34,0,0.08);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(204,34,0,0.4), 0 0 30px rgba(204,34,0,0.25), 0 0 80px rgba(204,34,0,0.12);
    }
}

/* ── INNER CONTAINER ── */
.chat-container {
    background: var(--bg2);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

/* Top scanline shimmer */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), var(--gold), var(--red), transparent);
    background-size: 200% 100%;
    animation: scanTop 3s linear infinite;
    z-index: 20;
}
@keyframes scanTop {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* Corner accents — all 4 with glow */
.corner-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 15;
}
.corner-wrap::before,
.corner-wrap::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-color: var(--red);
    border-style: solid;
    filter: drop-shadow(0 0 4px var(--red));
}
.corner-wrap::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.corner-wrap::after  { top: 0; right: 0; border-width: 2px 2px 0 0; }
.corner-bot::before,
.corner-bot::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-color: var(--gold);
    border-style: solid;
    filter: drop-shadow(0 0 4px var(--gold));
}
.corner-bot::before { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.corner-bot::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* ── TABS ── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #0d0d0d 0%, #0a0a0a 100%);
    padding: 0 14px;
    gap: 3px;
    position: relative;
}
.tabs::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--border) 80%, transparent 100%);
}

.tab {
    padding: 10px 20px;  /* bigger hit area */
    font-family: 'Share Tech Mono', monospace;
    font-size: 11.5px;   /* +15% от 10px */
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
    position: relative;
    top: 1px;
    user-select: none;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: -1px; left: 50%; right: 50%;
    height: 2px;
    background: var(--gold);
    transition: left 0.3s ease, right 0.3s ease;
    border-radius: 2px 2px 0 0;
}

.tab.active {
    color: var(--gold);
    border-bottom-color: transparent;
    text-shadow: 0 0 12px rgba(200,168,85,0.5);
}
.tab.active::before {
    left: 8px; right: 8px;
    box-shadow: 0 0 8px var(--gold), 0 0 16px rgba(200,168,85,0.3);
}

.tab:hover:not(.active) {
    color: var(--text-dim);
    background: rgba(255,255,255,0.02);
}

/* Active tab BG glow */
.tab.active {
    background: linear-gradient(180deg, rgba(200,168,85,0.06) 0%, transparent 100%);
}

/* Tab indicator dot */
.tab-dot {
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
.tab-dot.red   { background: var(--red);  box-shadow: 0 0 5px var(--red); }
.tab-dot.gold  { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.tab-dot.green { background: #4a8c3f;     box-shadow: 0 0 5px #4a8c3f; }
.tab-dot.blue  { background: #4a7acc;     box-shadow: 0 0 5px #4a7acc; }

/* ── MESSAGES ── */
.messages {
    height: 525px;
    overflow-y: auto;
    padding: 14px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scroll-behavior: smooth;
    position: relative;
}

/* Fade top */
.messages::before {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    height: 40px;
    margin-bottom: -40px;
    background: linear-gradient(180deg, var(--bg2) 0%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.messages::-webkit-scrollbar-thumb:hover { background: var(--red); box-shadow: 0 0 4px var(--red); }

/* ── MESSAGE ROW ── */
.msg {
    display: flex;
    align-items: baseline;
    gap: 0;
    padding: 3px 16px;
    transition: background 0.15s;
    position: relative;
    animation: msgIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(-8px);
}
@keyframes msgIn {
    to { opacity: 1; transform: translateX(0); }
}
.msg:hover { background: rgba(255,255,255,0.025); }
.msg:hover::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}

.msg-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    min-width: 50px;
    flex-shrink: 0;
}

.msg-channel {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    margin: 0 7px;
    flex-shrink: 0;
    border-radius: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.ch-all   { color: #888;    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.ch-shout { color: #e8b030; background: rgba(232,176,48,0.08);  border: 1px solid rgba(232,176,48,0.2);
    text-shadow: 0 0 8px rgba(232,176,48,0.4); }
.ch-trade { color: #50c878; background: rgba(80,200,120,0.07);  border: 1px solid rgba(80,200,120,0.2); }
.ch-clan  { color: #78aadd; background: rgba(120,170,220,0.07); border: 1px solid rgba(120,170,220,0.2); }
.ch-tell  { color: #dd78cc; background: rgba(220,120,200,0.07); border: 1px solid rgba(220,120,200,0.2); }
.ch-hero  { color: #cc2200; background: rgba(204,34,0,0.1);     border: 1px solid rgba(204,34,0,0.3);
    text-shadow: 0 0 6px rgba(204,34,0,0.5); box-shadow: 0 0 8px rgba(204,34,0,0.2); }

.msg-nick {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;       /* +15% от ~12px */
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 6px;
    letter-spacing: 0.5px;
}
.msg-nick::after {
    content: ':';
    color: var(--text-muted);
    margin-left: 1px;
    font-weight: 400;
}
.msg-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

/* Nick colors */
.nick-0 { color: #c87450; } .nick-1 { color: #7890c8; }
.nick-2 { color: #78c890; } .nick-3 { color: #c8a855; }
.nick-4 { color: #c87878; } .nick-5 { color: #9078c8; }
.nick-6 { color: #78b4c8; } .nick-7 { color: #c8c078; }

/* Time divider */
.time-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    opacity: 0.35;
}
.time-divider span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 2px;
}
.time-divider::before,
.time-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* System */
.msg-system {
    padding: 4px 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 1px;
    opacity: 0.65;
}

/* ── STATUS BAR ── */
.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.35);
    position: relative;
}
.statusbar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,168,85,0.2), transparent);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.status-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.status-item .val { color: var(--text-dim); }
.status-item .val.red  { color: var(--red);  text-shadow: 0 0 6px var(--red); }
.status-item .val.gold { color: var(--gold); text-shadow: 0 0 6px rgba(200,168,85,0.4); }

.refresh-bar {
    height: 2px; width: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
    overflow: hidden;
}
.refresh-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 1px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 6px var(--red);
}

/* ── LIVE BADGE ── */
.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11.5px;   /* +15% */
    color: var(--red);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.live-dot {
    width: 6px; height: 6px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red), 0 0 16px rgba(204,34,0,0.4);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { opacity:1; box-shadow: 0 0 8px var(--red), 0 0 16px rgba(204,34,0,0.4); }
    50%      { opacity:0.4; box-shadow: 0 0 2px var(--red); }
}

/* ── HEADER ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 14px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 32px;
    letter-spacing: 4px;
    color: var(--red);
    text-shadow: 0 0 20px var(--red-glow), 0 0 40px rgba(204,34,0,0.15);
    line-height: 1;
}
.logo span { color: var(--gold); text-shadow: 0 0 15px rgba(200,168,85,0.4); }
.header-right { display: flex; align-items: center; gap: 20px; }
.online-count {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
}
.online-count strong { color: var(--gold); }

/* Tab badge (count) */
.tab-count {
    display: inline-block;
    background: rgba(204,34,0,0.25);
    border: 1px solid rgba(204,34,0,0.4);
    color: var(--red);
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 6px;
    font-family: 'Share Tech Mono', monospace;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(204,34,0,0.2);
}