*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #18212B;
    --bg-secondary: #1E2A36;
    --bg-card: #22303F;
    --bg-hover: #2A3A4A;
    --text-primary: #E8EDF2;
    --text-secondary: #9BABB8;
    --text-muted: #6B7B8A;
    --accent: #C9A84C;
    --accent-hover: #E0C468;
    --accent-dark: #A07828;
    --border: #2E3F50;
    --success: #55C46A;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 8px;
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-primary) url('template/images/main_bg.png') repeat center center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    cursor: url('template/images/default.cur'), auto;
}

a {
    cursor: url('template/images/text.cur'), text;
}

button,
.btn,
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="range"],
select,
[role="button"] {
    cursor: url('template/images/pointer.cur'), pointer;
}

input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea {
    cursor: url('template/images/text.cur'), text;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ============ HEADER ============ */
.header {
    background: rgba(30, 42, 54, 0.5);
    border-bottom: 2px solid var(--accent-dark);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.header-logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 162.5px !important;
}

.header-logo-text span { color: var(--accent); }

/* ============ NAV ============ */
.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; }

.nav a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
}

.nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav a.active { color: var(--accent); background: rgba(201,168,76,0.1); }

/* ============ MAIN LAYOUT ============ */
.main-wrapper {
    width: 1076px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
    display: grid;
    grid-template-columns: 300px 700px;
    gap: 28px;
}

/* ============ SIDEBAR ============ */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.card {
    background: rgba(34, 48, 63, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header img { height: 18px; width: auto; }

.card-body { padding: 18px; }

/* В панели пользователя поднимаем разделитель, не меняя высоту карточки. */
.sidebar > .card:first-child > .card-header { padding-bottom: 8.5px; }
.sidebar > .card:first-child > .card-body { padding-top: 23.5px; }

/* У окна «Разделы» тот же отступ разделителя. */
.sidebar > .card:nth-child(2) > .card-header { padding-bottom: 8.5px; }

.login-form { display: flex; flex-direction: column; gap: 12px; }

.login-form input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.login-form input:focus { outline: none; border-color: var(--accent); }
.login-form input::placeholder { color: var(--text-muted); }

.community-message { margin: 12px 0 0; color: var(--text-secondary); font-size: 0.9rem; }
.community-message.is-error { color: #ffb4b4; }
.community-message.is-success { color: #a7e9ae; }
.account-greeting { margin: 12px 0; color: var(--text-secondary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: #1a1a1a; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,168,76,0.3); }
.btn-block { width: 100%; }
.btn-inactive { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-inactive:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-top: 4px;
}

.login-links a { color: var(--text-secondary); }
.login-links a:hover { color: var(--accent); }

.nav-sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-sidebar-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.nav-sidebar-list a:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-sidebar-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    width: 100%;
    min-width: 0;
    border-radius: var(--radius);
    background: rgba(107, 123, 138, 0.12);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.nav-sidebar-disabled .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.nav-sidebar-list a .dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
}

/* ============ CONTENT ============ */
.content { 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
	min-width: 0;
    height: 100%; 
    position: relative; /* Опорная точка координат */
}

.hero {
    background: linear-gradient(135deg, rgba(34,48,63,0.95) 0%, rgba(30,42,54,0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.hero-title span { color: var(--accent); }
.hero-desc { color: var(--text-secondary); font-size: 0.95rem; max-width: 600px; }

.breadcrumb {
    display: flex; 
    align-items: center; 
    gap: 8px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-secondary);
    padding: 0;
    margin-left: 4px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }

.hero.monsters-hero,
.hero.quests-hero {
    padding: 0;
}

.hero.monsters-hero .hero-content,
.hero.quests-hero .hero-content {
    padding: 30px 32px;
}

/* News */
.news-card {
    background: rgba(34,48,63,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex; align-items: center; justify-content: space-between;
}

.news-item {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--bg-hover); }

.news-item-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }

.news-badge {
    display: inline-block;
    padding: 2px 0 2px 9px;
    border: 0;
    border-left: 2px solid #c99b55;
    border-radius: 0;
    background: transparent;
    color: #d8bd82;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.news-badge-new { background: transparent; color: #d8bd82; border: 0; border-left: 2px solid #c99b55; }

.news-date, .news-views { font-size: 0.8rem; color: var(--text-muted); }

.news-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.news-title a { color: var(--text-primary); }
.news-title a:hover { color: var(--accent); }
.news-excerpt { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }

/* Pagination */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 16px 20px; border-top: 1px solid var(--border);
    margin-top: auto;
}

.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    border-radius: var(--radius); font-size: 0.85rem; font-weight: 500;
    transition: all var(--transition);
}

.pagination a { color: var(--text-secondary); border: 1px solid var(--border); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

.pagination .current { background: var(--accent); color: #1a1a1a; font-weight: 700; border: 1px solid var(--accent); }

.pagination img { height: 20px; width: auto; }

/* Icons */
.icon {
    width: 16px;
    height: 16px;
	flex-shrink: 0;
    display: inline-block;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    margin-top: auto;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-links { display: flex; align-items: center; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-secondary); font-size: 0.85rem;
}
.footer-links a:hover { color: var(--accent); }
.footer-links img { height: 28px; width: auto; }

.footer-copyright { color: var(--text-muted); font-size: 0.82rem; }

/* Базовое состояние описания */
.hero-desc {
    /* Регулирует плавность смены свойства opacity за 0.5 секунды */
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

/* Состояние при смене текста (управляется из JavaScript) */
.hero-desc.fade-out {
    opacity: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .main-wrapper { width: auto; grid-template-columns: 1fr; padding: 20px 16px; }
    .sidebar { order: 2; }
    .content { order: 1; }
    .nav { display: none; }
    .header-inner { flex-direction: column; height: auto; padding: 8px 0; gap: 6px; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 45, 145, 0.15) 0%, transparent 60%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    will-change: left, top;
}

/* Разрешаем элементам выходить за пределы блока hero */
.hero {
    position: relative;
    overflow: visible; 
}

.social-badges {
    position: absolute;
    top: 0;
    right: -230px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-badges .wumpus-badge { position: static; }

.wumpus-badge {
    position: absolute;
    top: 0px; /* Высота подъема над верхней границей колонки */
    right: -230px; /* Отступ от правого края */
    z-index: 10;
}

.wumpus-badge img {
    height: 40px;
    width: auto;
    display: block;
    transition: transform var(--transition);
}

.wumpus-badge:hover img {
    transform: scale(1.15);
}

.social-badge {
    display: block;
    width: 40px;
    height: 40px;
    transition: transform var(--transition);
}

.social-badge:hover { transform: scale(1.15); }

/* На широких экранах увеличиваем текст интерфейса без масштабирования фиксированного фона. */
@media (min-width: 1200px) {
    html {
        font-size: 110%;
    }
}

