body {
    background: linear-gradient(135deg, #0a0e1a 0%, #0c1222 100%);
    font-family: "Roboto", sans-serif;
    padding: 1.5rem;
    min-height: 100vh;
    --bs-body-font-family: "Roboto", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: "Roboto", sans-serif !important;
}

.icon {
    width: 24px;
    height: 24px;
}

.background {
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-position: center center;
    background-size: cover;
}

#page-portal {
    background-image: url("../img/background_castle.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    background-size: cover;
    overflow-y: scroll;
    scrollbar-width: none;
}

#page-public {
    background-image: url("../img/background_castle.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    background-size: cover;
    overflow-y: scroll;
    scrollbar-width: none;
}

.page-section {
    min-height: 1000px;
    padding-top: 100px;
    padding-bottom: 2rem;
}

/* Footer */
.site-footer {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(200, 163, 85, 0.15);
    padding: 1.5rem 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-logo {
    height: 1.6rem;
    opacity: 0.7;
}

.footer-server-name {
    font-family: "Roboto", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8e9bb5;
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: #6b7a99;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #d4b86a;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(200, 163, 85, 0.1);
    border: 1px solid rgba(200, 163, 85, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e9bb5;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social-icon:hover {
    background: rgba(200, 163, 85, 0.2);
    border-color: rgba(200, 163, 85, 0.4);
    color: #d4b86a;
}

.footer-copy {
    font-size: 0.75rem;
    color: #4a5568;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
}

.dashboard-container {
    margin: 0 auto;
}

.dashboard-card {
    background: rgba(18, 25, 45, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 24px;
    border: 1px solid rgba(200, 163, 85, 0.2);
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dashboard-card:hover {
    border-color: rgba(200, 163, 85, 0.4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Метрики (KPI) */
.metric-card {
    background: linear-gradient(145deg, #111827, #0f172a);
    border-radius: 20px;
    padding: 1.25rem;
    border-left: 4px solid #8b6914;
}

.metric-value {
    font-family: "Roboto", sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #f0f3fa;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8e9bb5;
    font-weight: 500;
}

.metric-trend-up {
    color: #10b981;
    font-size: 0.7rem;
    font-weight: 600;
}

.metric-trend-down {
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Заголовки секций */
.section-title {
    font-family: "Roboto", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: #e8d5a3;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #c8a355;
    font-size: 1.2rem;
}

/* Активности и уведомления */
.activity-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    transition: 0.15s;
    border: 1px solid transparent;
}

.activity-item:hover {
    background: rgba(200, 163, 85, 0.08);
    border-color: rgba(200, 163, 85, 0.2);
}

/* Быстрые действия */
.quick-action-btn {
    background: rgba(200, 163, 85, 0.1);
    border: 1px solid rgba(200, 163, 85, 0.3);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    color: #e2e8f0;
    text-decoration: none;
    display: block;
}

.quick-action-btn:hover {
    background: rgba(200, 163, 85, 0.2);
    border-color: #c8a355;
    transform: translateY(-2px);
    color: white;
}

.quick-action-btn i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #d4b86a;
}

/* Таблица лидеров */
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(72, 99, 144, 0.2);
}

.leaderboard-rank {
    width: 32px;
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    color: #fbbf24;
}

/* Прогресс бары */
.progress-custom {
    background-color: #1e2a3e;
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-custom {
    background: linear-gradient(90deg, #c8a355, #a855f7);
    border-radius: 20px;
    width: 0%;
    transition: width 0.4s;
    height: 6px;
}

/* Кнопки */
.btn-primary-game {
    background: linear-gradient(95deg, #8b6914, #c8a355, #8b6914);
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: 0.2s;
    color: white;
}

.btn-primary-game:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(200, 163, 85, 0.4);
    color: white;
}

.btn-outline-game {
    background: transparent;
    border: 1px solid #8b7332;
    border-radius: 12px;
    color: #e8d5a3;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: 0.2s;
}

.btn-outline-game:hover {
    background: rgba(200, 163, 85, 0.15);
    border-color: #c8a355;
    color: white;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #1f2a44, #131c2e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.character-name-link {
    transition:
        color 0.2s,
        text-shadow 0.2s;
}

.character-name-link:hover {
    color: #d4b86a !important;
    text-shadow: 0 0 12px rgba(200, 163, 85, 0.4);
}

.page-table-section {
    min-height: 1000px;
    padding-bottom: 2rem;
}
.table-dark-glass {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
}
.table-dark-glass thead th {
    background: rgba(200, 163, 85, 0.08);
    color: #e8d5a3;
    font-family: "Roboto", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(200, 163, 85, 0.25);
    font-weight: 600;
}
.table-dark-glass tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    transition: background 0.15s;
}
.table-dark-glass tbody tr:hover td {
    background: rgba(200, 163, 85, 0.05);
}
.table-dark-glass tbody tr:last-child td {
    border-bottom: none;
}
.dark-input-group .input-group-text {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(200, 163, 85, 0.2);
    color: #8e9bb5;
}
.dark-input-group .form-control,
.dark-input-group .form-select {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(200, 163, 85, 0.2);
    color: #e2e8f0;
}
.dark-input-group .form-control::placeholder {
    color: #6b7a99;
}
.dark-input-group .form-control:focus,
.dark-input-group .form-select:focus {
    background: rgba(20, 28, 50, 0.8);
    border-color: rgba(200, 163, 85, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(200, 163, 85, 0.15);
    color: #fff;
}
.dark-form-select {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(200, 163, 85, 0.2);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
}
.dark-form-select:focus {
    background: rgba(20, 28, 50, 0.8);
    border-color: rgba(200, 163, 85, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(200, 163, 85, 0.15);
    color: #fff;
    outline: none;
}
.dark-pagination .page-link {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(200, 163, 85, 0.15);
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    margin: 0 2px;
}
.dark-pagination .page-link:hover {
    background: rgba(200, 163, 85, 0.15);
    border-color: rgba(200, 163, 85, 0.4);
    color: #fff;
}
.dark-pagination .page-item.active .page-link {
    background: linear-gradient(95deg, #8b6914, #c8a355, #8b6914);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.dark-pagination .page-item.disabled .page-link {
    background: rgba(15, 20, 40, 0.3);
    border-color: transparent;
    color: #4a5568;
}
@media (max-width: 575.98px) {
    .dark-pagination .page-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        border-radius: 6px;
        margin: 0 1px;
    }
    .dark-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px 0;
    }
    .table-count-text {
        font-size: 0.75rem;
    }
}
.table-count-text {
    color: #8e9bb5;
    font-size: 0.85rem;
}
.table-count-text strong {
    color: #cbd5e1;
}
.npc-badge-m {
    background: rgba(200, 163, 85, 0.15);
    color: #d4b86a;
}
.npc-badge-f {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.table_header {
    background: linear-gradient(125deg, #fff, #c8a355, #8b6914);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: "Roboto";
}

/* Flash-сообщение: модальное затемнение */
.flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: flashFadeIn 0.3s ease;
}
@keyframes flashFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.flash-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}
.flash-box {
    background: rgba(18, 25, 45, 0.95);
    border: 1px solid rgba(200, 163, 85, 0.4);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(200, 163, 85, 0.15);
}
.flash-box i {
    font-size: 2.5rem;
    color: #c8a355;
    margin-bottom: 0.75rem;
}
.flash-box p {
    color: #e2e8f0;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}
.yes {
    color: #10b981;
    font-weight: 600;
    font-size: 0.85rem;
}
.no {
    color: #4a5568;
    font-size: 0.85rem;
}
.chance-high {
    color: #10b981;
    font-weight: 600;
}
.chance-mid {
    color: #f59e0b;
    font-weight: 600;
}
.chance-low {
    color: #6b7a99;
}
.monster-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    max-width: 380px;
    border-radius: 24px;
    background: linear-gradient(180deg, #1a1030 0%, #0f0f20 70%);
    border: 2px solid rgba(200, 163, 85, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(200, 163, 85, 0.08);
}
.monster-image-placeholder i {
    font-size: 5rem;
    color: #d4b86a;
    text-shadow: 0 0 30px rgba(200, 163, 85, 0.3);
}
.monster-link {
    color: #cbd5e1;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.monster-link:hover {
    color: #c8a355;
}
.item-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    max-width: 380px;
    border-radius: 24px;
    background: linear-gradient(180deg, #1a1030 0%, #0f0f20 70%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.08);
}
.item-image-placeholder i {
    font-size: 5rem;
    color: #d4b86a;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}
/* Character items */
.char_item {
    aspect-ratio: 1;
    background-repeat: no-repeat;
    background-size: cover;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    overflow: hidden;
}
.char_item:hover {
    border-color: rgba(59, 130, 246, 0.5);
}
.char_item_name {
    font-size: 0.55rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.1;
    padding: 2px;
}
.char_item_equipped_name {
    font-size: 0.5rem;
    color: #6b7a99;
    text-align: center;
    line-height: 1.1;
    padding: 2px;
}
.char_item_equipped_name:hover {
    color: #fbbf24;
}

/* Map styles */
.map-wrapper {
    position: relative;
    width: 100%;
    height: calc(90vh - 56px);
    overflow: hidden;
    background: #0a0e1a;
    cursor: grab;
}
.map-wrapper:active {
    cursor: grabbing;
}
.map-wrapper img {
    position: absolute;
    transform-origin: 0 0;
    user-select: none;
    pointer-events: none;
}
.map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}
.map-controls button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(200, 163, 85, 0.3);
    background: rgba(15, 20, 40, 0.85);
    color: #c8a355;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-controls button:hover {
    background: rgba(200, 163, 85, 0.15);
    border-color: rgba(200, 163, 85, 0.5);
}
.map-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    background: #c8a355;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 0 8px rgba(200, 163, 85, 0.5);
    transition: transform 0.15s;
}
.map-marker:hover {
    transform: scale(1.4);
    box-shadow: 0 0 14px rgba(200, 163, 85, 0.8);
}
.boss-marker {
    background: #ef4444;
    border-color: #fecaca;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.boss-marker:hover {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
}
.map-tabs {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 4px;
}
.map-tab {
    background: rgba(15, 20, 40, 0.85);
    border: 1px solid rgba(200, 163, 85, 0.2);
    color: #8e9bb5;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.map-tab:hover {
    border-color: rgba(200, 163, 85, 0.5);
    color: #cbd5e1;
}
.map-tab.active {
    background: linear-gradient(95deg, #8b6914, #c8a355, #8b6914);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.map-popup {
    position: absolute;
    background: rgba(15, 20, 40, 0.97);
    border: 1px solid rgba(200, 163, 85, 0.4);
    border-radius: 14px;
    z-index: 8;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    display: none;
    min-width: 220px;
    overflow: hidden;
}
.map-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(200, 163, 85, 0.15);
}
.map-popup-close {
    background: none;
    border: none;
    color: #8e9bb5;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.map-popup-close:hover {
    color: #fff;
}
.map-popup-header a {
    color: #e8d5a3;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.map-popup-header a:hover {
    color: #fff;
}
.map-popup-header a[href]:not([href="#"]) {
    cursor: pointer;
}
.map-popup-body {
    padding: 0.5rem;
}
.map-popup-body img {
    width: 100%;
    border-radius: 8px;
    display: block;
    max-width: 240px;
    max-height: 180px;
    object-fit: cover;
}
.map-coords {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 20, 40, 0.85);
    border: 1px solid rgba(200, 163, 85, 0.25);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    color: #8e9bb5;
    font-size: 0.7rem;
    z-index: 8;
    pointer-events: none;
    font-family: monospace;
}
