/* =====================================================================
   RMaker Portal — Stylesheet
   Minimal · Light · Blue/light-blue palette · Dense layout
   ===================================================================== */

/* ── 1. Reset + Tokens ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* vBulletin 3 palette from the GDSA archive (gdsa.rpgmaker.ru, 2006)
       style «Тёмно-синий» (styleid 1) */
    --bg:        #E1E1E2;   /* page background (vb body) */
    --bg-2:      #FFFFFF;   /* cards / panels (vb .page) */
    --bg-2-rgb:  255, 255, 255;
    --bg-3:      #E1E4F2;   /* inputs / hover (vb .alt2 — visible on white) */
    --border:    #0B198C;   /* dark navy — vb .tborder border, the style's signature */
    --border-soft:#D1D1E1;  /* inner separators (vb .tborder background, the 1px cell gaps) */
    --text:      #000000;   /* main text (vb body) */
    --muted:     #666686;   /* secondary text (vb .time) */
    --accent:    #22229C;   /* link blue (vb a:link / a:visited) */
    --accent-hover:#FF4400; /* link hover orange (vb a:hover) */
    --accent-2:  #0d9d6c;   /* green (free/success) */
    --danger:    #FF0000;   /* red (vb .highlight) */
    --warning:   #CC9900;   /* amber for stars / notices (NOT the vb hover orange) */
    --tcat:      #869BBF;   /* vb .tcat header bar */
    --thead:     #5C7099;   /* vb .thead header bar */
    --tfoot:     #3E5C92;   /* vb .tfoot footer bar */
    --radius:    4px;
    --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Dark theme (toggle via html[data-theme="dark"]) ──────────────── */
html[data-theme="dark"] {
    --bg:        #12151c;
    --bg-2:      #1b2029;
    --bg-2-rgb:  27, 32, 41;
    --bg-3:      #232a35;
    --border:    #2e3644;
    --text:      #e6ebf2;
    --muted:     #97a3b4;
    --accent:    #5b8ff5;
}

html { font-size: 17.5px; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: .875rem;
    line-height: 1.45;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
/* vB behaviour: links turn orange on hover (vb a:hover = #FF4400) */
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }

::selection { background: rgba(34,34,156,.22); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #bcc9de; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #9fb0cb; }

/* ── 2. Layout utilities ──────────────────────────────────────────── */
.container { max-width: 1480px; margin: 0 auto; padding: 0 1rem; width: 100%; }

main.container { padding-top: 1rem; padding-bottom: 2rem; flex: 1; }

.section { margin-top: 1.25rem; }
.section--alt { background: var(--bg-2); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin: 1.5rem 0; padding: 1rem; }

.section__title {
    font-size: .95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section__title a { font-size: .8rem; font-weight: 500; text-transform: none; letter-spacing: 0; }

.page-header { padding: 1rem 0 .75rem; border-bottom: 1px solid var(--border-soft); margin-bottom: 1rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; }
.page-header p { color: var(--muted); font-size: .85rem; margin-top: .2rem; }

.muted, .text-muted { color: var(--muted); }
.text-center { text-align: center; }
.small { font-size: .78rem; }
.d-block { display: block; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ── 3. Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4e4eb0; border-color: #4e4eb0; color: #fff; }
.btn-success { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-success:hover { background: #10b57d; border-color: #10b57d; color: #fff; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: transparent; border-color: var(--warning); color: var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; }
.btn-outline:hover { background: var(--bg-3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }

.btn--sm, .btn-sm { padding: .18rem .5rem; font-size: .72rem; }
.btn--lg, .btn-lg { padding: .5rem 1.1rem; font-size: .9rem; }
.btn--full, .btn--block { width: 100%; }

/* ── 4. Header / Navigation ───────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(var(--bg-2-rgb), .92);
    border-bottom: 1px solid var(--border-soft);
    height: 48px;
    backdrop-filter: blur(8px);
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    gap: .75rem;
}
.logo { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem; }
.logo .logo-img { height: 26px; width: auto; display: block; flex-shrink: 0; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; color: var(--text); }

.nav-desktop { display: flex; align-items: center; gap: .15rem; }
.nav-desktop a {
    color: var(--muted);
    padding: .3rem .55rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .85rem;
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--text); background: var(--bg-3); text-decoration: none; }

.search-form { display: flex; align-items: center; flex: 0 1 300px; position: relative; }
.search-form input[type="text"] {
    width: 100%;
    padding: .3rem .6rem .3rem 1.9rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .82rem;
    outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-form .search-icon { position: absolute; left: .6rem; color: var(--muted); pointer-events: none; font-size: .8rem; }

.auth-section { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.avatar-sm, .avatar-sm img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-tiny { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.avatar-small { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.user-dropdown { position: relative; }
.user-dropdown-toggle {
    display: flex; align-items: center; gap: .4rem;
    background: transparent; border: 1px solid transparent; border-radius: var(--radius);
    padding: .2rem .4rem; cursor: pointer; color: var(--text); font-weight: 500; font-size: .82rem;
}
.user-dropdown-toggle:hover { border-color: var(--border); background: var(--bg-3); text-decoration: none; }

.dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 170px; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .3rem 0; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: all .15s ease;
    box-shadow: 0 6px 18px rgba(30,60,110,.12);
}
.user-dropdown:hover .dropdown-menu, .user-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a, .dropdown-menu button {
    display: block; width: 100%; padding: .4rem .75rem; color: var(--muted);
    text-align: left; border: none; background: none; font-size: .82rem; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { color: var(--text); background: var(--bg-3); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border-soft); }

.burger-btn { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; z-index: 150; }
.burger-btn span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 1px; }
.nav-mobile { display: none; position: fixed; top: 48px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--border-soft); padding: .75rem; flex-direction: column; gap: .25rem; z-index: 90; box-shadow: 0 6px 18px rgba(30,60,110,.12); }
.nav-mobile.open { display: flex; }
.nav-mobile a, .nav-mobile button { display: block; padding: .5rem .75rem; color: var(--muted); background: none; border: none; text-align: left; border-radius: var(--radius); font-weight: 500; }
.nav-mobile a:hover, .nav-mobile button:hover { color: var(--text); background: var(--bg-3); text-decoration: none; }

/* ── 5. Hero (home) — compact strip ───────────────────────────────── */
.hero { border-bottom: 1px solid var(--border-soft); background: linear-gradient(90deg, var(--bg-3), var(--bg)); display: flex; align-items: center; justify-content: center; padding: 1.25rem 1rem; }
.hero__title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }

/* ── 6. Game grid / cards ─────────────────────────────────────────── */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.game-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.game-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(34,34,156,.14); }
.card-link { display: contents; }

.card-img-wrap { overflow: hidden; position: relative; }
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-3); }

/* Status badge on game cards (demo / complete / unfinished / scene) */
.status-badge {
    position: absolute; top: .45rem; left: .45rem; z-index: 2;
    display: inline-block; padding: .12rem .5rem; border-radius: 999px;
    font-size: .64rem; font-weight: 700; letter-spacing: .02em; line-height: 1.4;
    color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.status-demo { background: #2563eb; }
.status-complete { background: #16a34a; }
.status-unfinished { background: #d97706; }
.status-scene { background: #7c3aed; }

.card-body { padding: .55rem .65rem .65rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-body h3 { font-size: .95rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--accent-hover); text-decoration: none; }

.card-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }

.genre-badge {
    display: inline-block; padding: .05rem .4rem; border-radius: 2px;
    font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
    background: var(--bg-3); color: var(--muted); border: 1px solid var(--border);
}
.genre-action    { background: rgba(220,38,38,.10); color: #b91c1c; border-color: rgba(220,38,38,.25); }
.genre-adventure { background: rgba(217,119,6,.10); color: #b45309; border-color: rgba(217,119,6,.25); }
.genre-rpg       { background: rgba(34,34,156,.10); color: #22229C; border-color: rgba(34,34,156,.25); }
.genre-strategy  { background: rgba(109,40,217,.10); color: #6d28d9; border-color: rgba(109,40,217,.25); }
.genre-simulator { background: rgba(13,157,108,.10); color: #047857; border-color: rgba(13,157,108,.25); }
.genre-puzzle    { background: rgba(14,116,144,.10); color: #0e7490; border-color: rgba(14,116,144,.25); }
.genre-horror    { background: rgba(190,18,60,.10); color: #be123c; border-color: rgba(190,18,60,.25); }
.genre-platformer{ background: rgba(34,34,156,.10); color: #22229C; border-color: rgba(34,34,156,.25); }
.genre-indie     { background: rgba(146,64,14,.10); color: #92400e; border-color: rgba(146,64,14,.25); }
.genre-other     { background: var(--bg-3); color: var(--muted); }

.engine-icon { font-size: .7rem; color: var(--muted); }

.card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: .35rem; border-top: 1px solid var(--border-soft); margin-top: auto;
}
.price-tag { font-weight: 700; font-size: .78rem; }
.price-free { color: var(--accent-2); }
.price-paid { color: var(--text); }
.rating-stars { font-size: .72rem; color: var(--warning); letter-spacing: 1px; }

/* ── 7. Catalog: sidebar filters ──────────────────────────────────── */
.catalog-layout {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.filters-side {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem;
    position: sticky;
    top: 4.5rem;
}
.filters-side form { display: flex; flex-direction: column; gap: .55rem; }
.filters-side__group label {
    display: block;
    margin-bottom: .18rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.filters-side .filter-select,
.filters-side .filter-text {
    width: 100%;
    padding: .22rem .45rem;
    font-size: .78rem;
}
.filters-side__actions { display: flex; gap: .4rem; margin-top: .15rem; }
.filters-side__actions .btn { flex: 1; justify-content: center; padding: .3rem .5rem; font-size: .8rem; }
.catalog-main { min-width: 0; }
.filter-select:focus, .filter-text:focus { border-color: var(--accent); }

.no-results { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.no-results__text { font-size: 1rem; }
.no-results__hint { font-size: .85rem; }

/* ── 8. Pagination ────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: .3rem; padding: 1.25rem 0; }
.pagination a, .pagination__link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; padding: 0 .45rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--muted); font-size: .8rem; font-weight: 500; background: var(--bg-2);
}
.pagination a:hover, .pagination__link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.pagination__link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── 9. Blog grid — dense ─────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.blog-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.blog-card:hover { border-color: var(--accent); }
.blog-card__link { color: var(--text); }
.blog-card__link:hover { text-decoration: none; }
.blog-card__thumb img { width: 100%; aspect-ratio: 16/7; object-fit: cover; background: var(--bg-3); }
.blog-card__title { font-size: .85rem; font-weight: 600; line-height: 1.3; padding: .5rem .6rem .2rem; }
.blog-card__excerpt { font-size: .78rem; color: var(--muted); padding: 0 .6rem; line-height: 1.4; }
.blog-card__footer { display: flex; align-items: center; justify-content: space-between; padding: .4rem .6rem .55rem; font-size: .72rem; color: var(--muted); }
.blog-card__tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.tag-chip {
    display: inline-block; padding: .05rem .45rem; background: var(--bg-3);
    border: 1px solid var(--border); border-radius: 2px; font-size: .68rem; color: var(--muted);
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.filter-notice { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; margin-bottom: .9rem; }
.filter-notice strong { color: var(--text); }
.filter-notice__clear { color: var(--accent); font-weight: 600; text-decoration: none; margin-left: auto; }
.filter-notice__clear:hover { text-decoration: underline; }

.blog-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.blog-summary-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.blog-summary-card:hover { border-color: var(--accent); }
.blog-summary-card a { color: var(--text); }
.blog-summary-card a:hover { text-decoration: none; }
.blog-summary-card__thumb img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.blog-summary-card__body { padding: .55rem .6rem .6rem; }
.blog-summary-card__title { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.blog-summary-card__excerpt { font-size: .78rem; color: var(--muted); line-height: 1.4; margin-top: .25rem; }
.blog-summary-card__meta { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--muted); margin-top: .4rem; }

/* How-to (home) */
.how-to-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; }
.feature-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .85rem; }
.feature-box__icon { font-size: 1.2rem; display: block; margin-bottom: .3rem; }
.feature-box h3 { font-size: .88rem; font-weight: 600; margin-bottom: .2rem; }
.feature-box p { font-size: .78rem; color: var(--muted); }

/* ── 10. Game detail page ─────────────────────────────────────────── */
.game-detail { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; position: relative; overflow: hidden; }
.game-detail--has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--bg-2) 0%, rgba(var(--bg-2-rgb), .6) 45%, rgba(var(--bg-2-rgb), 0) 100%),
        var(--detail-bg);
    background-repeat: no-repeat, no-repeat;
    background-position: left center, right center;
    background-size: 100% 100%, cover;
}
.game-detail--has-bg > .game-detail__inner { position: relative; z-index: 1; }
.game-detail__inner { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; }
.game-detail__cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--bg-3); }
.game-detail__meta-block h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: .4rem; }

.author-pill { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; margin-bottom: .5rem; }
.author-pill:hover { color: var(--accent-hover); text-decoration: none; }
.author-meta { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .5rem; }
.author-meta__line { font-size: .8rem; color: var(--muted); }
.author-meta__line strong { color: var(--text); }
.author-meta__line .author-pill { margin-bottom: 0; }

.genre-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.detail-info { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.detail-info strong { color: var(--text); }
.detail-rating { font-size: .85rem; margin-bottom: .3rem; }
.detail-price { font-size: 1.1rem; font-weight: 700; margin-bottom: .6rem; }

.action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }

.game-description { line-height: 1.6; font-size: .9rem; }
.game-description h2 { font-size: 1.1rem; margin: .75rem 0 .4rem; }
.game-description p { margin-bottom: .5rem; }

.screenshots-scroll { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; }
.screenshot-item { flex: 0 0 260px; }
.screenshot-item img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

.tags-row { display: flex; gap: .4rem; flex-wrap: wrap; }

.accordion { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); margin-bottom: .4rem; }
.accordion summary { cursor: pointer; padding: .5rem .7rem; font-size: .85rem; font-weight: 600; }
.accordion summary:hover { color: var(--accent-hover); }
.accordion[open] summary { border-bottom: 1px solid var(--border-soft); }
.accordion .form-section { padding: .7rem; }
.changelog-list { list-style: disc; padding: .4rem .7rem .6rem 1.6rem; font-size: .82rem; }
.changelog-list li { margin-bottom: .15rem; }
.version-history { margin-top: .4rem; }

/* Reviews */
.review-list { display: flex; flex-direction: column; gap: .5rem; }
.review-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; }
.review-item__header { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.review-item__text { font-size: .85rem; line-height: 1.5; }
.review-stars { color: var(--warning); font-size: .8rem; }

/* Comments */
.comment-thread { margin-top: .5rem; }
.comment-item { padding: .4rem 0; border-bottom: 1px solid var(--border-soft); font-size: .85rem; }
.comment-nested { border-left: 2px solid var(--border-soft); padding-left: .6rem; margin-top: .3rem; }
.comment-header { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; }
.comment-header strong { color: var(--text); }
.comment-header time { color: var(--muted); }
.comment-text { margin: .2rem 0 .3rem; }
.reply-trigger { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .72rem; padding: 0; }
.reply-form { margin-top: .4rem; padding: .5rem; background: var(--bg-3); border-radius: var(--radius); }
.reply-input { width: 100%; }
.reply-actions { display: flex; gap: .4rem; margin-top: .35rem; }

.comment-write-form, .review-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .7rem; margin: .6rem 0; }

/* ── 11. Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: .6rem; }
.form-group label { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="number"], .form-group input[type="search"], .form-group input[type="file"],
.form-group select, .form-group textarea,
.form-input, .form-textarea, .form-select, .filter-text, .filter-select {
    display: block; width: 100%;
    padding: .35rem .55rem;
    background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: .82rem; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
/* Подсветка незаполненного обязательного поля (кастомная валидация форм) */
.form-input.field-invalid, .form-textarea.field-invalid, .form-select.field-invalid,
.filter-text.field-invalid, .filter-select.field-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(255,0,0,.14);
}
.form-group input[type="checkbox"], .form-group input[type="radio"] { accent-color: var(--accent); width: 14px; height: 14px; }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%235b6b82' d='M5 7L1 3h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; padding-right: 1.8rem; }
.form-checkbox { display: flex; align-items: center; gap: .4rem; }
.form-checkbox label { margin: 0; font-weight: 400; }
.form-divider { border-top: 1px solid var(--border-soft); margin-top: 1rem; padding-top: 1rem; }
.form-row { display: flex; gap: .6rem; }
.hint, .field-hint { font-size: .72rem; color: var(--muted); }
.field-error { color: var(--danger); font-size: .75rem; }
.field-error input, .field-error textarea { border-color: var(--danger); }

/* Auth pages */
.auth-page { display: flex; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.auth-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: .9rem; }
.auth-link { display: block; text-align: center; margin-top: .8rem; font-size: .82rem; color: var(--muted); }
.auth-link:hover { color: var(--accent-hover); }
.auth-divider { text-align: center; color: var(--muted); font-size: .72rem; margin: .8rem 0 .5rem; }
.auth-divider hr { border: none; border-top: 1px solid var(--border); margin: 0 0 .6rem; }
.social-login-placeholder { display: flex; gap: .5rem; }
.social-btn { flex: 1; }

/* ── 12. Alerts / flash ───────────────────────────────────────────── */
.alert { padding: .5rem .75rem; border: 1px solid; border-radius: var(--radius); margin-bottom: .75rem; font-size: .82rem; }
.alert-success { background: rgba(13,157,108,.08); border-color: rgba(13,157,108,.35); color: #047857; }
.alert-danger  { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.35); color: #b91c1c; }
.alert-warning { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.35); color: #b45309; }
.alert-info    { background: rgba(34,34,156,.08); border-color: rgba(34,34,156,.35); color: #22229C; }
.alert-sm, .alert-small { padding: .35rem .6rem; font-size: .78rem; }

/* ── 13. Tables ───────────────────────────────────────────────────── */
.t-simple { width: 100%; border-collapse: collapse; font-size: .82rem; }
.t-simple th { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.t-simple td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t-simple tr:hover td { background: var(--bg-3); }

/* Badges */
.badge { display: inline-block; padding: .1rem .45rem; border-radius: 2px; font-size: .68rem; font-weight: 600; }
.badge-sm { padding: .05rem .35rem; font-size: .62rem; }
.badge-warning { background: rgba(217,119,6,.15); color: #b45309; border: 1px solid rgba(217,119,6,.35); }

/* ── 14. Checkout ─────────────────────────────────────────────────── */
.checkout-page { max-width: 640px; margin: 0 auto; }
.checkout-page h1 { font-size: 1.25rem; margin-bottom: 1rem; }
.checkout-card { display: flex; gap: .9rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; margin-bottom: 1rem; }
.checkout-card__left { flex-shrink: 0; }
.checkout-card__thumb { width: 120px; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); }
.checkout-card__body h2 { font-size: 1rem; margin-bottom: .25rem; }
.checkout-card__price { font-size: 1.05rem; font-weight: 700; }

.payment-selector-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.payment-methods { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.payment-option {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--bg-2);
}
.payment-option:has(input:checked) { border-color: var(--accent); background: var(--bg-3); }
.payment-method-label { font-size: .85rem; }
.payment-method-desc { color: var(--muted); font-size: .72rem; }
.total-amount { display: flex; justify-content: space-between; padding: .5rem 0; border-top: 1px solid var(--border); font-weight: 700; }
.total-price { color: var(--accent-2); }
.security-note, .refund-policy { font-size: .72rem; color: var(--muted); margin: .4rem 0; }
.disabled-action:disabled { opacity: .45; }

/* ── 15. Download page ────────────────────────────────────────────── */
.download-page { max-width: 760px; margin: 0 auto; }
.download-page h1 { font-size: 1.3rem; margin-bottom: .75rem; }
.download-card { display: flex; gap: 1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.download-card img { width: 150px; border-radius: var(--radius); }
.license-section { margin: 1rem 0; text-align: center; }
.license-key { display: inline-block; font-size: .9rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .75rem; word-break: break-all; }
.release-history, .support-box { margin: 1rem 0; }
.support-box, .notice-block { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; font-size: .82rem; }
.notice-warning { border-left: 3px solid var(--warning); }

/* ── 16. Dashboard ────────────────────────────────────────────────── */
.dashboard-content { display: flex; flex-direction: column; gap: 1rem; }
.dashboard-content h1 { font-size: 1.2rem; font-weight: 700; }

.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.d-stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; text-align: center; }
.d-stat span:first-child { display: block; font-size: 1.3rem; font-weight: 800; }
.d-stat span:last-child { font-size: .72rem; color: var(--muted); }
.d-stat--games .d-stat-number { color: var(--accent-2); }
.d-stat--purchases .d-stat-number { color: var(--accent); }

.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.recent-activity, .dashboard-blog, .dashboard-my-games, .dashboard-purchases, .dashboard-settings, .dashboard-overview { display: block; }

.game-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.game-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.game-tile:hover { border-color: var(--accent); }
.game-tile img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.game-tile h4 { font-size: .85rem; margin: 0; padding: .45rem .6rem 0; }
.game-tile .game-tile-body { padding: .4rem .6rem .6rem; }
.game-tile .muted { font-size: .72rem; }
.game-tile-actions { display: flex; gap: .4rem; margin-top: .4rem; }

.purchase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.purchase-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.purchase-card:hover { border-color: var(--accent); }
.purchase-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.purchase-card h4 { font-size: .85rem; margin: 0; padding: .45rem .6rem 0; }
.purchase-card .purchase-card-body { padding: .4rem .6rem .6rem; }
.purchase-card .muted { font-size: .72rem; }

.create-form, .dashboard-edit-form, .compose-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.drop-zone { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; cursor: pointer; }
.drop-zone:hover { border-color: var(--accent); }
.drop-zone p { font-size: .85rem; }
.drop-zone small { color: var(--muted); }

.user-posts-list { margin-top: 1rem; }
.compose-form { margin-bottom: 1rem; }

/* ── 17. Footer ───────────────────────────────────────────────────── */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: .9rem 0; margin-top: auto; }
.site-footer p { font-size: .78rem; color: var(--muted); }
.footer-links { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.footer-links a { color: var(--muted); font-size: .78rem; }
.footer-links a:hover { color: var(--accent-hover); }

/* ── 18. Misc ─────────────────────────────────────────────────────── */
.empty-state, .no-results--centered { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .88rem; }
.avatar { border-radius: 50%; object-fit: cover; }
.strength-meter { margin-top: .3rem; }
.strength-criteria { list-style: none; font-size: .72rem; color: var(--muted); }
.criteria-item { margin-bottom: .1rem; }
.strength-meter .met { color: var(--accent-2); }

.pagination--short { display: inline-flex; }
.blog-related-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; font-size: .85rem; color: var(--text); display: block; }
.blog-related-card:hover { border-color: var(--accent); text-decoration: none; }
.blog-scroll-row { display: flex; gap: .5rem; overflow-x: auto; }

/* Post (blog detail) */
.blog-detail { max-width: 860px; margin: 0 auto; }
.blog-detail__hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.blog-detail__header h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin: .75rem 0 .5rem; }
.blog-detail__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin-bottom: .5rem; }
.blog-detail__author { color: var(--text); font-weight: 600; }
.blog-detail__divider { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }
.content-block { font-size: .92rem; line-height: 1.7; }
.content-block p { margin-bottom: .6rem; }
.content-block h2 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
.content-block h3 { font-size: 1rem; margin: .9rem 0 .3rem; }
.content-block ul, .content-block ol { padding-left: 1.4rem; margin-bottom: .6rem; }
.content-block ul { list-style: disc; }
.content-block ol { list-style: decimal; }
.content-block blockquote { border-left: 3px solid var(--accent); padding: .5rem .8rem; background: var(--bg-3); margin: .6rem 0; color: var(--muted); font-style: italic; }
.content-block code { background: var(--bg-3); padding: .1rem .3rem; border-radius: 2px; font-size: .85em; }
.content-block pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem; overflow-x: auto; margin: .6rem 0; }
.content-block pre code { background: none; padding: 0; }
.content-block img { max-width: 100%; height: auto; display: block; margin: .6rem auto; border-radius: var(--radius); }
/* Форум: картинки в постах не должны «разъезжать» layout — жёсткий лимит
   по ширине (контейнер) и высоте (720px, см. config forum.image_max_display_height). */
.fw-img {
    max-width: 100%;
    max-height: 720px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: .5rem auto;
    border-radius: var(--radius);
}
.comment-attach { display: inline-block; margin: .15rem .25rem .15rem 0; vertical-align: top; }
.comment-attach--file { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .25rem .5rem; font-size: .85rem; text-decoration: none; color: var(--text); }
.comment-attach-img { max-width: 180px; max-height: 180px; object-fit: cover; border-radius: var(--radius); }
.comment-attachments { margin-top: .5rem; }
.blog-detail__views { color: var(--muted); font-size: .8rem; }
.blog-detail__author-bio { display: flex; gap: .8rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; margin: 1rem 0; }
.blog-detail__author-bio .bio-text strong { display: block; }
.blog-detail__author-bio .bio-text p { font-size: .8rem; color: var(--muted); }
.blog-detail__tags { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }

/* ── Lightbox (fullscreen image viewer) ───────────────────────────── */
[data-lightbox] img { cursor: zoom-in; }
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
}
#lightbox.is-open { display: flex; }
.lightbox__figure {
    margin: 0;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__img {
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0, 0, 0, .6);
    cursor: default;
}
.lightbox__close,
.lightbox__nav {
    position: fixed;
    z-index: 10001;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
.lightbox__counter {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .85);
    font-size: .85rem;
    background: rgba(0, 0, 0, .5);
    padding: .25rem .75rem;
    border-radius: 999px;
}


/* ── Header extras: notifications bell / language switch ──────────── */
.notif-bell {
    position: relative;
    font-size: 1.05rem;
    text-decoration: none;
    padding: .15rem .3rem;
}
/* Не даём глобальному a:hover (text-decoration: underline) рисовать
   подчёркивание-«полоску» под иконками при наведении. */
.notif-bell:hover { text-decoration: none; }
.notif-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: .62rem;
    line-height: 1;
    padding: .14rem .32rem;
    font-weight: 700;
}
.lang-switch { font-size: .78rem; color: var(--muted); }
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--accent-hover); }
#theme-toggle { font-size: 1rem; padding: .1rem .5rem; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nav-desktop { display: none; }
    .burger-btn { display: flex; }
    .search-form { flex: 1 1 auto; }
    .game-detail__inner { grid-template-columns: 160px 1fr; }
    .catalog-layout { grid-template-columns: 1fr; }
    .filters-side { position: static; }
}

@media (max-width: 560px) {
    html { font-size: 16.5px; }
    .header__inner { flex-wrap: wrap; height: auto; padding: .5rem 0; gap: .5rem; }
    .header { position: relative; height: auto; }
    .nav-mobile { top: auto; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
    .blog-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .game-detail__inner { grid-template-columns: 1fr; }
}

/* Static pages (About / Contacts) */
.static-page { max-width: 760px; margin: 1.5rem auto; padding: 0 1rem; }
.static-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: .8rem; }
.static-page p { font-size: .95rem; line-height: 1.7; color: var(--muted); margin-bottom: .9rem; }
.static-page .lead { color: var(--text); }
.static-page .lead strong { color: var(--accent); }
.static-page abbr { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }
.contact-list { list-style: none; padding: 0; margin: 1rem 0; }
.contact-list li { display: flex; align-items: baseline; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.contact-list__label { min-width: 90px; font-weight: 600; color: var(--text); }
.contact-list a { color: var(--accent); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   Forum — dense, matches the portal's card/list language
   ===================================================================== */
.forum-header { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.forum-header__actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.forum-search { display: flex; gap: .3rem; }
.forum-search input[type="search"] {
    background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .28rem .55rem; font-size: .8rem; min-width: 190px; color: var(--text); outline: none;
}
.forum-search input[type="search"]:focus { border-color: var(--accent); }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .74rem; color: var(--muted); margin: .4rem 0 .1rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-hover); text-decoration: none; }
.breadcrumbs span { color: var(--muted); }

/* ── Section list (forum index) ───────────────────────────────────── */
.forum-sections { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.forum-section-card {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .55rem .7rem; transition: border-color .15s ease;
}
.forum-section-card:hover { border-color: var(--accent); }
.forum-section-card__main { flex: 1 1 300px; min-width: 0; }
.forum-section-card__title { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.forum-section-card__title a { color: var(--text); }
.forum-section-card__title a:hover { color: var(--accent-hover); text-decoration: none; }
.forum-section-card__desc { color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.forum-section-card__count { display: inline-block; margin-top: .2rem; font-size: .68rem; color: var(--muted); }
.forum-section-card__last { flex: 0 1 260px; min-width: 0; font-size: .74rem; display: flex; flex-direction: column; gap: .05rem; }
.forum-section-card__last-label { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; }
.forum-section-card__last a { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-section-card__last a:hover { color: var(--accent-hover); text-decoration: none; }
.forum-section-card__last-meta { color: var(--muted); font-size: .68rem; }
.forum-category { margin-top: 1.1rem; }
.forum-category__head {
    display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
    padding: .5rem .7rem; background: var(--tcat); color: #fff;
    border: 1px solid var(--border); border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.forum-category__title { font-size: 1rem; font-weight: 700; margin: 0; color: #fff; }
.forum-category__desc { color: rgba(255,255,255,.88); font-size: .74rem; }
.forum-sections--inset {
    margin-top: 0;
    padding: .5rem .5rem .4rem;
    border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Topic list (section) ─────────────────────────────────────────── */
.forum-topic-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: .6rem; background: var(--bg-2); }
.forum-topic-row {
    display: flex; align-items: center; gap: .75rem; padding: .9rem .75rem;
    border-bottom: 1px solid var(--border-soft);
}
.forum-topic-row:last-child { border-bottom: none; }
.forum-topic-row:hover { background: var(--bg-3); }
.forum-topic-row--hidden { opacity: .6; }
.forum-topic-row__main { flex: 1 1 auto; min-width: 0; }
.forum-topic-row__title { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.forum-topic-row__title a { color: var(--text); }
.forum-topic-row__title a:hover { color: var(--accent-hover); text-decoration: none; }
.forum-topic-row__meta { display: flex; align-items: center; gap: .3rem; font-size: .68rem; color: var(--muted); margin-top: .1rem; }
.forum-topic-row__stats { display: flex; gap: .6rem; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.forum-topic-row__last { font-size: .68rem; color: var(--muted); white-space: nowrap; }

/* ── Badges (match .badge / .genre-badge) ─────────────────────────── */
.forum-badge {
    display: inline-block; padding: .02rem .32rem; border-radius: 2px;
    font-size: .62rem; font-weight: 600; line-height: 1.5;
    background: var(--bg-3); border: 1px solid var(--border); color: var(--muted);
}
.forum-badge--pin { color: #b45309; border-color: rgba(217,119,6,.35); background: rgba(217,119,6,.10); }
.forum-badge--lock { color: #22229C; border-color: rgba(34,34,156,.30); background: rgba(34,34,156,.08); }
.forum-badge--hidden { color: #b91c1c; border-color: rgba(220,38,38,.30); background: rgba(220,38,38,.08); }

/* ── Topic head ───────────────────────────────────────────────────── */
.forum-topic-head { padding: .75rem 0 .6rem; border-bottom: 1px solid var(--border-soft); margin-bottom: .75rem; }
.forum-topic-head h1 { font-size: 1.3rem; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.forum-topic-head__meta { color: var(--muted); font-size: .74rem; margin-top: .2rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.forum-mod-actions { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.inline-form { display: inline; }

/* ── Posts (match .review-item / .comment-item density) ───────────── */
.forum-posts { display: flex; flex-direction: column; gap: .5rem; }
.forum-post {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .55rem .7rem;
}
.forum-post--op { border-left: 3px solid var(--accent); }
.forum-post--hidden { opacity: .6; }
.forum-post__head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .35rem; }
.forum-post__nick { font-weight: 600; font-size: .8rem; color: var(--text); }
.forum-post__nick:hover { color: var(--accent-hover); text-decoration: none; }
/* Кликабельные авторы (отзывы/комментарии/блог) */
.review-author, .comment-author, .blog-detail__author-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; vertical-align: middle; }
.review-author:hover, .comment-author:hover, .blog-detail__author-link:hover { color: var(--accent-hover); text-decoration: none; }
.blog-summary-card__author, .blog-card__author { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); text-decoration: none; }
.blog-summary-card__author:hover, .blog-card__author:hover { color: var(--accent-hover); }
/* Профиль: список комментариев пользователя */
.profile-comments { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.profile-comment { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.profile-comment__text { margin: 0 0 .2rem; }
.profile-comment a { color: var(--accent); text-decoration: none; }
.profile-comment a:hover { text-decoration: underline; }
.forum-post__role { font-size: .64rem; color: var(--muted); }
.forum-post__meta { font-size: .68rem; color: var(--muted); display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; }
.forum-post__content { font-size: .86rem; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.forum-post__content pre.fw-code { background: var(--bg-3); }
.forum-post__actions { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--border-soft); }

/* ── Forms (match .comment-write-form / .review-form) ─────────────── */
.forum-reply { margin-top: 1.25rem; }
.forum-reply-form, .forum-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .75rem; }
.forum-reply-form__actions, .forum-form__actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .45rem; }
.forum-upload-label { position: relative; overflow: hidden; cursor: pointer; }
.forum-upload-input { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.forum-hint { font-size: .7rem; margin-top: .35rem; }
.forum-form .form-group { margin-bottom: .55rem; }

@media (max-width: 640px) {
    .forum-topic-row__last { display: none; }
    .forum-section-card__last { flex-basis: 100%; }
    .forum-post__meta { margin-left: 0; }
    .forum-header__actions { width: 100%; }
    .forum-search { width: 100%; }
    .forum-search input[type="search"] { flex: 1; min-width: 0; }
}

/* ═══════════════ vBulletin-style forum features ═══════════════ */

/* ── Editor toolbar ─────────────────────────────── */
.forum-editor { display: flex; flex-direction: column; gap: .35rem; }
.forum-editor__toolbar { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; padding: .25rem .35rem; }
.forum-editor__btn { min-width: 1.75rem; height: 1.75rem; padding: 0 .35rem; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 4px; font-size: .78rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.forum-editor__btn:hover { border-color: var(--accent); color: var(--accent); }
.forum-editor__btn.fmt-bold { font-weight: 700; }
.forum-editor__btn.fmt-italic { font-style: italic; }
.forum-editor__btn.fmt-underline { text-decoration: underline; }
.forum-editor__btn.fmt-strike { text-decoration: line-through; }
.forum-editor__smile { height: 1.75rem; font-size: .72rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); max-width: 8.5rem; }
.forum-editor textarea { border-radius: 0 0 var(--radius) var(--radius); }

/* ── Postbit ────────────────────────────────────── */
.forum-post { display: grid; grid-template-columns: 150px 1fr; gap: .8rem; }
.forum-post__postbit { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: .4rem .2rem; border-right: 1px solid var(--border); }
.forum-post__postbit .avatar-small { width: 128px; height: 128px; }
.forum-post__postbit .forum-post__nick { font-size: .85rem; }
.forum-post__postbit-role { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.forum-post__postbit-status { display: inline-flex; align-items: center; gap: .25rem; font-size: .66rem; }
.forum-post__postbit-status.online { color: #2e7d32; }
.forum-post__postbit-status.offline { color: var(--muted); }
.forum-post__postbit-status .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.forum-post__postbit-status.online .dot { background: #4caf50; }
.forum-post__postbit-status.offline .dot { background: var(--muted); }
.forum-post__postbit-stats { font-size: .7rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: .3rem; margin-top: .2rem; width: 100%; }
.forum-post__postbit-stats div { margin-bottom: .15rem; }
.forum-post__postbit-stats b { color: var(--text); font-weight: 600; }
.forum-post__body { min-width: 0; }
.forum-post__signature { margin-top: .7rem; padding-top: .45rem; border-top: 1px dashed var(--border); font-size: .78rem; color: var(--muted); }

/* ── Square avatars on the forum (vBulletin-like, no rounding) ── */
.forum-post__postbit .avatar-small,
.forum-topic-row__meta .avatar-tiny,
.forum-members-table .avatar-tiny,
.pm-item .avatar-tiny,
.pm-view__head .avatar-small {
    border-radius: 0;
}

/* ── Like button ────────────────────────────────── */
.forum-like { display: inline-flex; align-items: center; gap: .3rem; }
.forum-like button, .forum-like form button { border: 1px solid var(--border); background: var(--bg-2); color: var(--text); border-radius: 999px; font-size: .72rem; padding: .2rem .6rem; cursor: pointer; }
.forum-like button:hover, .forum-like form button:hover { border-color: var(--accent); color: var(--accent); }
.forum-like .is-liked { color: var(--accent); border-color: var(--accent); }

/* ── Quote button ───────────────────────────────── */
.quote-btn { border: 1px solid var(--border); background: var(--bg-2); color: var(--text); border-radius: 999px; font-size: .72rem; padding: .2rem .6rem; cursor: pointer; }
.quote-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Topic badges / controls ────────────────────── */
.forum-badge--new { background: var(--accent); color: #fff; }
.forum-topic-head__tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }

/* ── Poll ───────────────────────────────────────── */
.forum-poll { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.forum-poll h3 { font-size: .95rem; margin: 0 0 .6rem; }
.forum-poll form { display: flex; flex-direction: column; gap: .35rem; }
.forum-poll__option { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.forum-poll__result { margin-top: .15rem; }
.forum-poll__result .bar { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; margin: .2rem 0; }
.forum-poll__result .bar > i { display: block; height: 100%; background: var(--accent); }
.forum-poll__meta { font-size: .7rem; color: var(--muted); margin-top: .5rem; }

/* ── New-topic poll fields ──────────────────────── */
.forum-poll-fields { background: var(--bg-2); border: 1px dashed var(--border); border-radius: var(--radius); padding: .6rem .75rem; margin-top: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.forum-poll-fields input { width: 100%; }

/* ── Who's online / members ─────────────────────── */
.forum-online { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; margin-top: 1.25rem; }
.forum-online__head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.forum-online__count { font-size: .75rem; color: var(--muted); }
.forum-online__names { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; }
.forum-online__names a { color: var(--text); text-decoration: none; }
.forum-online__names a:hover { color: var(--accent-hover); }
.online-dot { color: #4caf50; }

.forum-members-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.forum-members-table th, .forum-members-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.forum-members-table th { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.forum-members-table .member-avatar { display: inline-flex; align-items: center; gap: .5rem; }
.forum-members-table .avatar-tiny { width: 28px; height: 28px; }

/* ── Subscriptions ──────────────────────────────── */
.forum-sub-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.forum-sub-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .8rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ── PM ─────────────────────────────────────────── */
.pm-layout { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: start; }
.pm-menu { display: flex; flex-direction: column; gap: .3rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; }
.pm-menu a { padding: .4rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .85rem; }
.pm-menu a:hover, .pm-menu a.active { background: var(--bg-3); color: var(--accent); }
.pm-menu a .pm-badge { margin-left: .35rem; background: var(--accent); color: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .68rem; }
.pm-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.pm-item { display: flex; gap: .7rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; }
.pm-item.unread { border-left: 3px solid var(--accent); }
.pm-item__main { flex: 1; min-width: 0; }
.pm-item__subject { font-size: .88rem; font-weight: 600; color: var(--text); text-decoration: none; }
.pm-item__subject:hover { color: var(--accent-hover); }
.pm-item__meta { font-size: .72rem; color: var(--muted); }
.pm-view { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.pm-view__head { border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: .8rem; }
.pm-view__body { font-size: .9rem; line-height: 1.6; }

/* ── Print view ─────────────────────────────────── */
.print-only-note { display: block; margin: .5rem 0; font-size: .75rem; color: var(--muted); }
@media print {
    .header, .footer, .breadcrumbs, .forum-print-tools, .forum-post__actions, .forum-post__postbit-status, .forum-reply { display: none !important; }
    .forum-post { display: block; }
    .forum-post__postbit { border-right: none; }
}

/* ── Forum "new" dots on index ──────────────────── */
.forum-new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: .4rem; vertical-align: middle; }

/* ── Mobile postbit ─────────────────────────────── */
@media (max-width: 640px) {
    .forum-post { grid-template-columns: 1fr; }
    .forum-post__postbit { flex-direction: row; justify-content: flex-start; gap: .6rem; text-align: left; border-right: none; border-bottom: 1px solid var(--border); }
    .forum-post__postbit .avatar-small { width: 96px; height: 96px; }
    .forum-post__postbit-stats { border-top: none; padding-top: 0; margin-top: 0; }
    .pm-layout { grid-template-columns: 1fr; }
}
