:root {
    --bg-dark: #0a0e17;
    --panel-bg: rgba(16, 22, 35, 0.9);
    --accent-it: #00d2ff;
    --accent-car: #ff3c00;
    --text-main: #e0e6ed;
    --text-muted: #8899a6;
    --shadow-it: 0 0 20px rgba(0, 210, 255, 0.3);
    --shadow-car: 0 0 20px rgba(255, 60, 0, 0.3);
}

/* Общие настройки */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-dark);
    /* Двойной фон: сетка слева (голубая) и справа (оранжевая) */
    background-image: 
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZyBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiMwMGQyZmYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6bTQwIDQwaDQwdjQwSDQwVjQweiIvPjwvZz48L2c+PC9zdmc+'),
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MCIgaGVpZ2h0PSI4MCIgdmlld0JveD0iMCAwIDgwIDgwIj48ZyBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZjNjMDAiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6bTQwIDQwaDQwdjQwSDQwVjQweiIvPjwvZz48L2c+PC9zdmc+');
    background-position: left top, right top;
    background-repeat: repeat-y, repeat-y;
    background-size: 50% auto, 50% auto;
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Вертикальная разделительная линия по центру */
body::after {
    content: '';
    position: fixed;
    top: 0; 
    left: 50%;
    width: 2px; 
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-it), var(--accent-car));
    z-index: 0;
    pointer-events: none;
    transform: translateX(-50%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Хедер страницы */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

.header h1 {
    color: var(--accent-it);
    font-size: 2.0rem;
    margin-bottom: 10px;
    text-shadow: var(--shadow-it);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent-it);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.back-link:hover {
    text-shadow: var(--shadow-it);
    letter-spacing: 1px;
}

/* Список сообщений */
.messages-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.message-item {
    background: var(--panel-bg);
    border: 1px solid #222;

	border-left: 3px solid var(--accent-car);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
	overflow: hidden;
}

.message-item:hover {
    border-color: var(--accent-it);
    box-shadow: var(--shadow-it);
    transform: translateX(5px);
}

/* Шапка сообщения: Аватар и Имя */
.msg-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.msg-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0, 210, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    flex-shrink: 0;
}

.msg-name {
    color: var(--accent-it);
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Бейдж с датой в углу */
.msg-date-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.05);
    border-top-left-radius: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Сумма в углу */
.msg-amount-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #9ca3af;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border-top-right-radius: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Основной контейнер сообщения */
.msg-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 15px 15px 5px;
}

/* Левая колонка - аватар */
.msg-avatar-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 210, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Правая колонка - текстовый блок */
.msg-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Верхняя строка - заголовок */
.msg-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-it);
    margin-bottom: 8px;
    line-height: 1.2;
}

/* Нижний блок - описание */
.msg-description {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

.message-item .external-link {
    color: var(--neon-primary, #00d4ff);
    text-decoration: underline;
    word-break: break-all;
}

.message-text .external-link {
    color: var(--accent-it);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-it);
    transition: 0.2s;
}

.message-text .external-link:hover {
    color: #fff;
    text-shadow: var(--shadow-it);
}

/* Пагинация */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination {
    display: flex;
    background: var(--panel-bg);
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.page-link {
    padding: 10px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.page-link:last-child {
    border-right: none;
}

.page-link.active {
    background: var(--accent-car);
    color: #fff;
    font-weight: bold;
    pointer-events: none;
}

.page-link:not(.active):hover {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-it);
    box-shadow: var(--shadow-it);
}

.page-dots {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Пагинация и кнопки */
.load-more-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 40px auto;
    padding: 16px 30px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
}

.load-more-btn:active {
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background: #2c3e50;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.pagination-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
}

.empty-message {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    background: var(--panel-bg);
    border-radius: 20px;
    border: 1px dashed #333;
}

/* Футер */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Стили для ответов на сообщения */
.message-reply {
/* Твой градиент */
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1) 0%, rgba(0, 255, 136, 0.05) 100%);    
    /* Акцентная линия слева */
    border-left: 3px solid var(--accent-it);    
    /* Скругляем все углы для мягкости, кроме левого верхнего (опционально) */
    border-radius: 8px;   
    padding: 12px 15px;    
    /* Отступ: 15px от сообщения, 65px слева (чтобы быть под текстом, а не под авой) */
    margin: 5px 0 5px 65px; 
    position: relative;
    border: 1px solid rgba(0, 210, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Декоративная линия-связка (опционально) */
.message-reply::before {
    content: '└';
    position: absolute;
    left: -25px;
    top: 0;
    color: var(--accent-it);
    font-size: 1.5rem;
    opacity: 0.5;
}

.reply-label {
    font-size: 0.7rem;
    color: var(--accent-it);
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-label i {
    font-size: 0.7rem;
}

/* Текст самого ответа */
.reply-text {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 500px) {
    .message-text {
        margin-left: 0;
        margin-top: 15px;
    }
    
    .msg-header {
        gap: 15px;
    }
    
    .msg-avatar {
        width: 50px;
        height: 50px;
    }
    
    .header h1 {
        font-size: 1.375rem; 
    }
    
    body::after {
        display: none; /* Убираем разделитель на малых экранах */
    }
    
    .message-reply {
        margin-left: 15px;
        margin-top: 15px;
    }
}

/* Стили для Twemoji эмодзи */
img.emoji {
    display: inline-block;
    height: 1.2em;
    width: 1.2em;
    margin: 0 .1em;
    vertical-align: -0.2em;
    /* Твой классный неоновый эффект */
    filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.3));
    
    /* Дополнительные настройки для стабильности */
    border: none !important;
    outline: none !important;
    user-select: none;         /* Нельзя выделить как текст */
    -webkit-user-drag: none;   /* Нельзя "схватить" и перетащить картинку */
    cursor: inherit;           /* Наследует курсор от текста (I-beam) или ссылки (pointer) */
}

/* Если смайл внутри ссылки, он не должен подчеркиваться */
.external-link img.emoji {
    text-decoration: none !important;
}