/* ================================================================
   Deep Fight Club — public/pages.css
   Общий стиль отдельных страниц: лог боя, новости, форум, рейтинг.

   Пакет правок №22:
     Светлый фон теперь на весь экран.

   Пакет правок №24:
     Стили для страницы /forum — две колонки.

   ПАКЕТ ПРАВОК №38:
     1) Пагинация. Общие стили для блока страниц:
        .page-pagination, .page-pagination-btn,
        .page-pagination-info, .page-pagination-ellipsis.
        Используется в news.js, forum.js, rating.js.
     2) Стили страницы /rating:
        .rating-table, .rating-row, .rating-header-row,
        .rating-cell-*, .rating-place-*.
        Плюс стили для бейджа топ-1/2/3.

   ПАКЕТ ПРАВОК №39 (этот файл):
     Страница /rating теперь показывает только три колонки:
     # (место), Игрок, Рейтинг. Классы .rating-cell-num и
     .rating-cell-bosses больше не используются — удалены.
     Оставлены .rating-place, .rating-cell-player,
     .rating-cell-rating. Медиазапросы подчищены.
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #f7f0d9;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 150, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(200, 170, 120, 0.25) 0%, transparent 40%);
    font-family: 'Georgia', 'Times New Roman', serif;
    padding: 30px 40px 50px 40px;
    margin: 0;
    color: #2a1a0a;
}

.page-container {
    /* без фона, без рамки, без тени, без max-width */
}

.page-header {
    text-align: center;
    border-bottom: 3px solid #b89a7a;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 26px;
    color: #3a2a1a;
    text-shadow: 1px 1px 0 #b89a7a;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.page-meta {
    font-size: 13px;
    color: #6b4c2e;
    font-style: italic;
}

.page-section {
    margin-top: 22px;
    margin-bottom: 12px;
}

.page-section-title {
    font-size: 19px;
    color: #3a2a1a;
    padding-bottom: 4px;
    border-bottom: 1px solid #b89a7a;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.page-text {
    font-size: 15px;
    margin-bottom: 12px;
    text-align: justify;
    white-space: pre-wrap;
    word-break: break-word;
}

a {
    color: #6b4c2e;
    text-decoration: underline;
    font-weight: bold;
}

a:hover {
    color: #3a2a1a;
}

/* ================================================================
   КНОПКИ
   ================================================================ */

.page-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 15px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    background: #dac29c;
    color: #2a1a0a;
    border: 2px solid #b89a7a;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
    box-shadow: 0 3px 0 #8c6c4a, 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    text-align: center;
}

.page-btn:hover {
    transform: translateY(-1px);
    background: #e6d2b0;
    box-shadow: 0 4px 0 #8c6c4a, 0 6px 12px rgba(0, 0, 0, 0.25);
}

.page-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #8c6c4a;
}

.page-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 0 #8c6c4a, 0 4px 8px rgba(0, 0, 0, 0.2);
}

.page-btn-primary {
    background: #6b4c2e;
    color: #f7f0d9;
    border-color: #4d3620;
    box-shadow: 0 3px 0 #3a2a1a, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.page-btn-primary:hover {
    background: #7d5a38;
    box-shadow: 0 4px 0 #3a2a1a, 0 6px 12px rgba(0, 0, 0, 0.35);
}

.page-btn-primary:active {
    box-shadow: 0 1px 0 #3a2a1a;
}

.page-btn-primary:disabled {
    box-shadow: 0 3px 0 #3a2a1a, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.page-btn-danger {
    background: #b85858;
    color: #fff5f5;
    border-color: #8b2f2f;
    box-shadow: 0 3px 0 #5a1a1a, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.page-btn-danger:hover {
    background: #cc6a6a;
    box-shadow: 0 4px 0 #5a1a1a, 0 6px 12px rgba(0, 0, 0, 0.35);
}

.page-btn-danger:active {
    box-shadow: 0 1px 0 #5a1a1a;
}

.page-btn-small {
    padding: 4px 14px;
    font-size: 13px;
}

.page-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* ================================================================
   КАРТОЧКИ (новости, топики, посты)
   ================================================================ */

.page-card {
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(80, 50, 20, 0.10);
    transition: background 0.15s, box-shadow 0.15s;
}

.page-card-clickable {
    cursor: pointer;
}

.page-card-clickable:hover {
    background: #fffcf0;
    box-shadow: 0 3px 8px rgba(80, 50, 20, 0.20);
}

.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid #dac29c;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.page-card-title {
    font-size: 17px;
    font-weight: bold;
    color: #3a2a1a;
    word-break: break-word;
    flex: 1;
}

.page-card-date {
    font-size: 12px;
    color: #8c6c4a;
    white-space: nowrap;
}

.page-card-subtitle {
    font-size: 13px;
    color: #6b4c2e;
    margin-bottom: 8px;
    word-break: break-word;
}

.page-card-text {
    font-size: 15px;
    color: #2a1a0a;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.page-pinned {
    display: inline-block;
    background: #dac29c;
    color: #3a2a1a;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    border: 1px solid #b89a7a;
}

/* ================================================================
   ФОРМЫ
   ================================================================ */

.page-form {
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.page-form-title {
    font-size: 16px;
    font-weight: bold;
    color: #3a2a1a;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.page-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.page-form-field label {
    font-size: 14px;
    color: #3a2a1a;
    font-weight: bold;
}

.page-form input[type="text"],
.page-form input[type="number"],
.page-form textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Georgia', serif;
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    color: #2a1a0a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-form input[type="text"]:focus,
.page-form input[type="number"]:focus,
.page-form textarea:focus {
    border-color: #6b4c2e;
    box-shadow: 0 0 0 3px rgba(107, 76, 46, 0.15);
}

.page-form input::placeholder,
.page-form textarea::placeholder {
    color: #a08060;
    font-style: italic;
    opacity: 0.8;
}

.page-form textarea {
    resize: vertical;
    min-height: 100px;
}

.page-form-msg {
    font-size: 13px;
    min-height: 18px;
    margin-top: 6px;
    margin-bottom: 6px;
    color: #8b0000;
}

.page-form-msg.ok {
    color: #2d6a2d;
}

.page-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ================================================================
   СОСТОЯНИЯ
   ================================================================ */

.page-empty {
    text-align: center;
    font-style: italic;
    color: #8c6c4a;
    padding: 30px 10px;
    font-size: 15px;
}

.page-error {
    text-align: center;
    color: #8b0000;
    background: rgba(139, 0, 0, 0.08);
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 15px;
    margin: 16px 0;
}

.page-loading {
    text-align: center;
    color: #8c6c4a;
    font-style: italic;
    padding: 30px 10px;
    font-size: 15px;
}

.page-breadcrumbs {
    font-size: 13px;
    color: #8c6c4a;
    margin-bottom: 14px;
    word-break: break-word;
}

.page-breadcrumbs a {
    color: #6b4c2e;
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dac29c;
}

.page-toolbar-info {
    font-size: 13px;
    color: #6b4c2e;
}

/* ================================================================
   ЛОГ БОЯ
   ================================================================ */

.page-refresh-btn {
    margin-bottom: 16px;
}

.page-log-info {
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #3a2a1a;
}

.page-log-info .page-log-info-label {
    color: #6b4c2e;
    font-weight: bold;
}

.page-log-info .page-log-info-value {
    color: #2a1a0a;
    font-weight: bold;
}

.page-log-body {
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 14px 18px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #2a1a0a;
    max-height: 70vh;
    overflow-y: auto;
    word-break: break-word;
    white-space: pre-wrap;
}

.page-log-line {
    display: block;
    width: 100%;
}

.page-log-divider {
    width: 100%;
    height: 1px;
    background: #b89a7a;
    margin: 6px 0;
    opacity: 0.6;
}

/* ================================================================
   НИК СО ЗНАЧКАМИ И УРОВНЕМ
   ================================================================ */

.nick-render {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
    white-space: nowrap;
}

.nick-render .nick-badges {
    display: inline-flex;
    gap: 2px;
    align-items: center;
    vertical-align: middle;
    margin-right: 3px;
}

.nick-render .nick-badges img {
    display: block;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.nick-render .nick-name {
    font-weight: bold;
}

.nick-render .nick-level {
    margin-left: 3px;
}

/* ================================================================
   ЦВЕТ СООБЩЕНИЙ
   ================================================================ */

.msg-scarlet {
    color: #ff0000;
}

/* ================================================================
   РАСКЛАДКА ФОРУМА В ДВЕ КОЛОНКИ
   ================================================================ */

.forum-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 8px;
}

.forum-sections-col {
    flex: 0 0 240px;
    min-width: 200px;
    max-width: 280px;
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 12px 12px 14px 12px;
    box-shadow: 0 2px 4px rgba(80, 50, 20, 0.10);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.forum-topics-col {
    flex: 1 1 auto;
    min-width: 0;
}

.forum-col-title {
    font-size: 14px;
    font-weight: bold;
    color: #3a2a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid #b89a7a;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.forum-section-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    margin-bottom: 4px;
    font-family: 'Georgia', serif;
    font-size: 14px;
    color: #3a2a1a;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    word-break: break-word;
    line-height: 1.3;
}

.forum-section-item:hover {
    background: #f2e8d0;
    border-color: #dac29c;
}

.forum-section-item.active {
    background: #6b4c2e;
    color: #f7f0d9;
    border-color: #4d3620;
    font-weight: bold;
    box-shadow: 0 2px 0 #3a2a1a;
}

.forum-section-item.active:hover {
    background: #7d5a38;
    color: #f7f0d9;
}

.forum-section-item .forum-section-count {
    float: right;
    font-size: 12px;
    font-weight: normal;
    opacity: 0.7;
    margin-left: 8px;
}

.forum-topic-preview {
    font-size: 13px;
    color: #4a3a2a;
    line-height: 1.5;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    white-space: pre-wrap;
}

/* ================================================================
   ПАГИНАЦИЯ
   Общий блок для /news, /forum/section/:slug, /forum/topic/:id,
   /rating. Ссылки открываются в том же окне.
   ================================================================ */

.page-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 10px 0;
    padding: 12px 8px 4px 8px;
    border-top: 1px solid #dac29c;
}

.page-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 34px;
    padding: 0 10px;
    font-family: 'Georgia', serif;
    font-size: 14px;
    font-weight: bold;
    background: #dac29c;
    color: #2a1a0a;
    border: 2px solid #b89a7a;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 0 #8c6c4a;
}

.page-pagination-btn:hover:not(.active):not(:disabled) {
    background: #e6d2b0;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #8c6c4a;
}

.page-pagination-btn:active:not(.active):not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #8c6c4a;
}

.page-pagination-btn.active {
    background: #6b4c2e;
    color: #f7f0d9;
    border-color: #4d3620;
    box-shadow: 0 2px 0 #3a2a1a;
    cursor: default;
}

.page-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: 0 2px 0 #8c6c4a;
}

.page-pagination-info {
    font-size: 13px;
    color: #6b4c2e;
    font-style: italic;
    padding: 0 8px;
    white-space: nowrap;
}

.page-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 34px;
    color: #8c6c4a;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
}

/* ================================================================
   ПАКЕТ ПРАВОК №39: СТРАНИЦА РЕЙТИНГА (/rating)
   Таблица из трёх колонок: #, Игрок, Рейтинг.
   ================================================================ */

.rating-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

.rating-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #6b4c2e;
    color: #f7f0d9;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 8px;
    font-size: 14px;
    color: #2a1a0a;
    transition: background 0.15s;
}

.rating-row:hover {
    background: #fffcf0;
}

.rating-row.top-1 {
    border-left: 6px solid #d4b000;
    background: #fffaea;
}

.rating-row.top-2 {
    border-left: 6px solid #999999;
    background: #f7f7f7;
}

.rating-row.top-3 {
    border-left: 6px solid #b07744;
    background: #faf1e8;
}

.rating-place {
    flex: 0 0 60px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    color: #6b4c2e;
}

.rating-row.top-1 .rating-place { color: #aa8800; }
.rating-row.top-2 .rating-place { color: #666666; }
.rating-row.top-3 .rating-place { color: #885522; }

.rating-cell-player {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.rating-cell-rating {
    flex: 0 0 120px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #6b4c2e;
    padding-right: 8px;
}

.rating-note {
    font-size: 12px;
    color: #6b4c2e;
    font-style: italic;
    margin-top: 10px;
    line-height: 1.5;
}

.rating-summary {
    background: #fcf7ec;
    border: 2px solid #b89a7a;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #3a2a1a;
    line-height: 1.6;
}

.rating-summary .rating-summary-title {
    font-weight: bold;
    color: #6b4c2e;
    margin-bottom: 4px;
    display: block;
}

/* ================================================================
   АДАПТИВ
   ================================================================ */

@media (max-width: 700px) {
    body {
        padding: 18px 18px 28px 18px;
    }
    .page-header h1 {
        font-size: 20px;
        letter-spacing: 1px;
    }
    .page-section-title {
        font-size: 17px;
    }
    .page-text,
    .page-card-text,
    .page-log-body {
        font-size: 14px;
    }
    .page-card {
        padding: 12px 14px;
    }
    .page-card-title {
        font-size: 16px;
    }
    .page-form {
        padding: 14px 16px;
    }
    .page-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    .page-log-body {
        font-size: 12px;
        padding: 12px 14px;
    }
    .forum-layout {
        flex-direction: column;
        gap: 12px;
    }
    .forum-sections-col {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
        position: static;
        max-height: none;
    }
    /* ПАКЕТ ПРАВОК №39: таблица рейтинга на планшетах. */
    .rating-header-row,
    .rating-row {
        font-size: 13px;
        padding: 6px 8px;
    }
    .rating-place {
        flex: 0 0 44px;
        font-size: 15px;
    }
    .rating-cell-rating {
        flex: 0 0 90px;
        font-size: 16px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 14px 12px 22px 12px;
    }
    .page-header h1 {
        font-size: 18px;
    }
    .page-meta {
        font-size: 12px;
    }
    .page-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
    .page-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .page-card-date {
        white-space: normal;
    }
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .forum-section-item {
        font-size: 13px;
        padding: 7px 10px;
    }
    .forum-col-title {
        font-size: 13px;
    }
    /* ПАКЕТ ПРАВОК №39: пагинация и рейтинг на телефонах. */
    .page-pagination {
        gap: 4px;
    }
    .page-pagination-btn {
        min-width: 32px;
        height: 30px;
        font-size: 13px;
        padding: 0 8px;
    }
    .page-pagination-info {
        font-size: 12px;
    }
    .rating-header-row,
    .rating-row {
        font-size: 12px;
        padding: 5px 6px;
        gap: 4px;
    }
    .rating-place {
        flex: 0 0 36px;
        font-size: 14px;
    }
    .rating-cell-rating {
        flex: 0 0 70px;
        font-size: 14px;
        padding-right: 4px;
    }
}