@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --fire: #ff6b35;
    --fire-light: #ff8c5a;
    --fire-dark: #e55a2b;
    --fire-glow: rgba(255, 107, 53, 0.3);
    --text: #f0f0f0;
    --text-dim: #a0a0a0;
    --text-dark: #666;
    --border: #2a2a2a;
    --green: #4ade80;
    --red: #f87171;
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== ОГНЕННЫЙ ФОН ===== */
.fire-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 20% 100%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(255, 60, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(255, 140, 0, 0.04) 0%, transparent 40%);
}

.fire-bg::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--fire), var(--fire-light), var(--fire), transparent);
    animation: fireLine 3s ease-in-out infinite;
}

@keyframes fireLine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== ШАПКА ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
}

.fire-icon {
    font-size: 1.6rem;
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.logo-text {
    background: linear-gradient(135deg, var(--fire), var(--fire-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version {
    font-size: 0.75rem;
    background: var(--fire);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-btn:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-btn.active {
    color: var(--fire);
    border-color: var(--fire);
    background: rgba(255, 107, 53, 0.1);
}

.ban-btn {
    color: var(--red);
}

.ban-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--red);
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-panel img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--fire);
}

/* ===== ОСНОВНОЕ ===== */
.main {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== ИНФО СЕРВЕРА ===== */
.server-info {
    text-align: center;
    margin-bottom: 24px;
}

.ip-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.ip-box:hover {
    border-color: var(--fire);
    box-shadow: 0 0 20px var(--fire-glow);
}

.ip-label {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.ip-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fire-light);
    letter-spacing: 1px;
}

.copy-hint {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fire);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.ip-box:hover .copy-hint {
    opacity: 1;
}

/* ===== ЗАГОЛОВОК + КНОПКИ ===== */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-fire {
    background: linear-gradient(135deg, var(--fire), var(--fire-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-fire:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

.btn-dark {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-dark:hover {
    background: var(--border);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--bg-hover);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-small:hover {
    color: var(--text);
}

/* ===== СПИСОК ТЕМ ===== */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: all 0.2s;
    cursor: pointer;
}

.topic-card:hover {
    border-color: var(--fire);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.topic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.topic-title:hover {
    color: var(--fire-light);
}

.topic-category {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 107, 53, 0.15);
    color: var(--fire-light);
    white-space: nowrap;
}

.topic-meta {
    display: flex;
    gap: 16px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.topic-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topic-preview {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state h2 {
    color: var(--text);
    margin-bottom: 8px;
}

/* ===== СТРАНИЦА ТЕМЫ ===== */
.topic-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.topic-header h1 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.topic-header-meta {
    display: flex;
    gap: 16px;
    color: var(--text-dim);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

/* ===== СООБЩЕНИЯ ===== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--fire);
}

.message-author {
    font-weight: 600;
    color: var(--fire-light);
}

.message-time {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-left: auto;
}

.message-body {
    color: var(--text);
    line-height: 1.7;
    word-break: break-word;
}

.message-files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.file-attachment:hover {
    border-color: var(--fire);
    color: var(--text);
}

.file-attachment img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-sm);
    display: block;
}

.file-attachment video {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    display: block;
}

/* ===== ОТВЕТ ===== */
.reply-box, .form-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.reply-box h3 {
    margin-bottom: 14px;
    color: var(--fire-light);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--fire);
    box-shadow: 0 0 0 3px var(--fire-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== ЗАГРУЗКА ФАЙЛОВ ===== */
.file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px dashed var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.file-label:hover {
    border-color: var(--fire);
    color: var(--text);
}

.file-label input {
    display: none;
}

.file-names {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.file-names span {
    display: inline-block;
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 4px;
    margin: 2px;
}

/* ===== ФОРМА АПЕЛЛЯЦИИ ===== */
.appeal-box {
    max-width: 600px;
    margin: 0 auto;
}

.appeal-info {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== АВТОРИЗАЦИЯ ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 1;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fire), transparent);
    border-radius: 2px;
}

.logo-big {
    font-size: 2rem;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.auth-info {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.auth-footer strong {
    color: var(--fire-light);
    font-family: 'Courier New', monospace;
}

.link-site {
    display: inline-block;
    margin-top: 8px;
    color: var(--fire);
    text-decoration: none;
}

.link-site:hover {
    text-decoration: underline;
}

.auth-wall {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
}

.auth-wall a {
    color: var(--fire);
    text-decoration: none;
}

/* ===== ФУТЕР ===== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-dark);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

.footer p {
    margin: 4px 0;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--fire);
    color: var(--text);
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .main {
        padding: 16px;
    }
    
    .topic-card-header {
        flex-direction: column;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}