/* ── Редактор .env ──────────────────────────────────────── */

.env-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.env-warning h3 {
    margin-top: 0;
    color: #856404;
}

.env-warning ul {
    margin: 8px 0;
    padding-left: 20px;
}

.env-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.env-entry {
    border-bottom: 1px solid #eee;
    padding: 8px 0;
}

.env-entry.env-comment {
    color: #888;
    font-style: italic;
}

.env-entry.env-sensitive {
    background: #fff8f0;
    border-left: 3px solid #ff9800;
    padding-left: 8px;
}

.env-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 12px;
    align-items: center;
}

.env-key-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.env-key-input {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.env-value-input {
    font-family: 'Courier New', monospace;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.env-value-input:focus {
    border-color: #007bff;
    outline: none;
}

.sensitive-badge {
    font-size: 14px;
}

.env-new .env-row {
    grid-template-columns: 300px 1fr;
}

.env-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #ddd;
}

.env-backups {
    margin-top: 32px;
}

.backups-table {
    width: 100%;
    border-collapse: collapse;
}

.backups-table th,
.backups-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.backups-table th {
    background: #f5f5f5;
}

.status-ok { color: #28a745; }
.status-error { color: #dc3545; }

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}
/* ── Правила: даты ────────────────────────────────────────── */

.rules-section-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

.rule-date {
    color: #999;
    font-size: 12px;
    margin-left: 6px;
}

/* ── Админка правил ───────────────────────────────────────── */

.rules-admin-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.admin-rules-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    background: #fafafa;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.section-header h2 {
    margin: 0;
    margin-right: auto;
}

.admin-rules-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.admin-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.admin-rule-text {
    flex: 1;
    min-width: 200px;
}

.rule-edit-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.inline-form input[type="text"] {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ── Дифф изменений правил в новостях ─────────────────────── */

.rules-diff {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

mark.diff-insert {
    background: #c8e6c9;
    color: #1b5e20;
    padding: 0 2px;
    border-radius: 2px;
}

mark.diff-delete {
    background: #ffcdd2;
    color: #b71c1c;
    text-decoration: line-through;
    padding: 0 2px;
    border-radius: 2px;
}

mark.diff-section {
    background: #fff9c4;
    color: #795548;
    padding: 0 4px;
    border-radius: 2px;
}
/* ── Лор: публичный просмотр ──────────────────────────────── */

.lore-section {
    margin-bottom: 32px;
}

.lore-section-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

.lore-entry {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9f9f9;
    border-left: 4px solid #8B5CF6;
    border-radius: 4px;
}

.lore-entry h3 {
    margin-top: 0;
    color: #6D28D9;
}

.lore-content {
    line-height: 1.6;
    margin-bottom: 8px;
}

.lore-date {
    color: #999;
    font-size: 12px;
    margin: 0;
}

/* ── Админка лора ─────────────────────────────────────────── */

.lore-admin-warning {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.admin-lore-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    background: #fafafa;
}

.admin-lore-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.admin-lore-entry {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    background: white;
}

.admin-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.entry-date {
    color: #888;
    font-size: 12px;
}

.entry-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.entry-edit-form input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: bold;
}

.entry-edit-form textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.entry-create-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed #ddd;
}

.entry-create-form input[type="text"],
.entry-create-form textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
/* ══════════════════════════════════════════════════════════
   ЗАГЛУШКА АВТОРИЗАЦИИ (auth_required.html)
   ══════════════════════════════════════════════════════════ */

.auth-gate-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-gate {
    max-width: 500px;
    width: 90%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.auth-gate-logo {
    font-size: 64px;
    margin-bottom: 16px;
}

.auth-gate h1 {
    margin: 0 0 12px 0;
    color: #1a1a2e;
    font-size: 28px;
}

.auth-gate-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 32px;
    font-size: 15px;
}

.auth-gate-button {
    display: inline-block;
    padding: 14px 32px;
    background: #171a21;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.auth-gate-button:hover {
    background: #2a475e;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.auth-gate-hint {
    margin-top: 24px;
    font-size: 12px;
    color: #999;
}

.auth-gate-features {
    text-align: left;
    margin: 24px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.auth-gate-features h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.auth-gate-features ul {
    margin: 0;
    padding-left: 20px;
}

.auth-gate-features li {
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
}
/* ── Таблица лидеров ──────────────────────────────────────── */

.leaderboard-note {
    color: #666;
    font-size: 14px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #FFD700;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.leaderboard-category {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.leaderboard-category h2 {
    margin-top: 0;
}

.category-description {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.leaderboard-table th {
    background: #f0f0f0;
    font-size: 13px;
}

.rank-cell {
    font-size: 18px;
    width: 40px;
}

.value-cell {
    font-weight: bold;
    text-align: right;
}

.leader-row {
    background: #fffbea;
}

.leader-badge {
    font-size: 16px;
    margin-left: 6px;
}

.leader-badge-item {
    font-weight: bold;
}
/* ── Расширенная статистика и оружие ──────────────────────── */

.extended-stats,
.weapon-stats {
    margin-top: 24px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.extended-stats h3,
.weapon-stats h3 {
    margin-top: 0;
    color: #444;
}

.extended-stats dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0;
}

.extended-stats dt {
    color: #777;
    font-size: 14px;
}

.extended-stats dd {
    margin: 0;
    font-weight: bold;
}

.weapons-table {
    width: 100%;
    border-collapse: collapse;
}

.weapons-table th,
.weapons-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.weapons-table th {
    background: #eee;
}

.favorite-weapon {
    color: #b8860b;
    font-size: 12px;
    margin-left: 6px;
    font-weight: bold;
}
/* ── Объединённая статистика игрока ──────────────────────── */

.player-stats {
    margin-top: 24px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.player-stats h3 {
    margin-top: 0;
    color: #444;
}

.player-stats dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0;
}

.player-stats dt {
    color: #777;
    font-size: 14px;
}

.player-stats dd {
    margin: 0;
    font-weight: bold;
}

.stat-sub {
    color: #888;
    font-weight: normal;
    font-size: 13px;
}

/* ── Раскрывающийся блок оружия ──────────────────────────── */

.weapon-stats-details {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.weapon-stats-details summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    padding: 8px 0;
    user-select: none;
    transition: color 0.2s;
}

.weapon-stats-details summary:hover {
    color: #0066cc;
}

.weapon-stats-details[open] summary {
    margin-bottom: 12px;
    color: #0066cc;
}

.weapon-stats-details summary::-webkit-details-marker {
    margin-right: 8px;
}

.weapons-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.weapons-table th,
.weapons-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.weapons-table th {
    background: #eee;
}

.weapons-table .value-cell {
    text-align: right;
    font-weight: bold;
}

.favorite-weapon {
    color: #b8860b;
    font-size: 12px;
    margin-left: 6px;
    font-weight: bold;
}
/* ── Логи в админке ───────────────────────────────────────── */

.log-sources,
.log-source-add {
    margin-top: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background: #f0f0f0;
}

.hint {
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

.logs-current-path code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.logs-list {
    list-style: none;
    padding: 0;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.logs-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-list li:last-child {
    border-bottom: none;
}

.logs-size {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

.logs-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
/* ── Логи игрока в профиле (админ) ────────────────────────── */

.player-logs {
    margin-top: 24px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.player-logs h3 {
    margin-top: 0;
    color: #444;
}

.player-log-block {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
}

.player-log-block summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: bold;
    user-select: none;
}

.player-log-block summary:hover {
    background: #f0f0f0;
}

.player-log-block .log-count {
    color: #888;
    font-weight: normal;
    font-size: 13px;
}

.player-log-block .logs-pre {
    margin: 0;
    border-radius: 0 0 6px 6px;
    max-height: 400px;
}
/* ── Каркас страницы (base.html) ─────────────────────────── */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.flash-container {
    max-width: 1100px;
    margin: 16px auto 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border, #e0e0e0);
    background: var(--card, #fff);
    color: var(--text, #222);
    white-space: pre-line;
}

.flash-success { border-left: 4px solid #28a745; }
.flash-error   { border-left: 4px solid #dc3545; }
.flash-info    { border-left: 4px solid #17a2b8; }

.site-footer {
    border-top: 1px solid var(--border, #e0e0e0);
    padding: 16px;
    text-align: center;
    color: var(--muted, #888);
    font-size: 13px;
}