/* ==========================================
   orbis.in.ua - Hytale Theme Stylesheet
   ========================================== */

/* ===== Google Fonts з font-display: swap ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Merriweather:wght@300;400;700&display=swap');

/* ===== Кольорова схема Hytale (коричнево-золота) ===== */
:root {
    --hytale-brown: #4a3728;
    --hytale-brown-dark: #2d221a;
    --hytale-brown-light: #6b5444;
    --hytale-gold: #d4af37;
    --hytale-gold-light: #f0d679;
    --hytale-orange: #d97943;
    --hytale-cream: #f5f0e8;
    --hytale-beige: #e8dcc4;
    
    --primary-color: var(--hytale-brown);
    --secondary-color: var(--hytale-gold);
    --accent-color: var(--hytale-orange);
    --background-color: #1a1410;
    --surface-color: #2a2218;
    --text-color: #e8dcc4;
    --text-muted: #a89f8c;

    /* Scrollbar theme variables (site colors: light brown thumb, dark brown track) */
    --scrollbar-width: 12px;
    --scrollbar-track: var(--hytale-brown-dark); /* #2d221a - dark brown track */
    --scrollbar-thumb: var(--hytale-brown-light); /* #6b5444 - light brown thumb */
    --scrollbar-thumb-border: var(--background-color); /* #1a1410 - very dark border */
} 

/* ===== Global Scrollbar (Hytale Theme) ===== */
* {
    /* Firefox: thumb then track */
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* WebKit-based browsers */
*::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

*::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(26,20,16,0.08), var(--scrollbar-track));
    border-radius: calc(var(--scrollbar-width) * 1.5);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid var(--scrollbar-thumb-border);
    border-radius: calc(var(--scrollbar-width) * 1.5);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.7);
    transition: all 180ms ease;
    min-height: 28px; /* ensure usable thumb on small windows */
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--hytale-brown); /* #4a3728 - slightly darker brown on hover */
    border-color: var(--scrollbar-thumb-border);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.8);
    transform: translateZ(0) scale(1.02);
}

/* Focus state for keyboard users */
*::-webkit-scrollbar-thumb:focus, *::-webkit-scrollbar-thumb:active {
    outline: 2px solid var(--hytale-brown);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.7), 0 0 0 3px rgba(74, 55, 40, 0.1);
}

/* Make scrollbars slightly thinner on small screens */
@media (max-width: 768px) {
    *::-webkit-scrollbar { width: calc(var(--scrollbar-width) - 4px); height: calc(var(--scrollbar-width) - 4px); }
    :root { --scrollbar-width: 10px; }
}

/* Make smaller scrollbars inside compact components */
.compact *::-webkit-scrollbar { width: 10px; height: 10px; }
.compact * { scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
    *::-webkit-scrollbar-thumb { transition: none; }
}

/* ===== Global Styles ===== */
body.hytale-theme {
    background: linear-gradient(135deg, #1a1410 0%, #2d221a 100%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: 'Merriweather', 'Georgia', serif;
    min-height: 100vh;
}

.main-content {
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 2;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--hytale-gold-light);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.text-hytale {
    color: var(--hytale-gold) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Legacy helper used across templates */
.muted {
    color: var(--text-muted) !important;
}

a {
    color: var(--hytale-gold);
    text-decoration: none;
}

a:hover {
    color: var(--hytale-gold-light);
}

/* Ensure "light" helpers remain readable on dark theme */
body.hytale-theme .bg-light {
    background-color: var(--surface-color) !important;
    color: var(--text-color) !important;
}

body.hytale-theme code.bg-light,
body.hytale-theme pre.bg-light {
    border: 1px solid var(--hytale-brown-light);
}

/* Home hero + countdown (uses existing theme variables) */
.hero {
    margin-top: 12px;
}

/* Ensure the download button aligns vertically with compact server status block */
.hero .btn-download {
    /* allow height to stretch to match neighboring elements */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

@media (max-width: 576px) {
    .hero .btn-download {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
}

.hero__panel {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 20, 16, 0.7) 0%, rgba(26, 20, 16, 0.9) 100%), 
                url('../img/hytale-image-1200x300px.webp') center center / cover no-repeat;
    border: 1px solid var(--hytale-brown-light);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    overflow: hidden;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
}

.countdown {
    margin-top: 16px;
    font-size: 1.25rem;
    font-weight: 900;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--hytale-brown-light);
    background: rgba(26, 20, 16, 0.55);
}

.countdown__title {
    color: var(--hytale-gold-light);
    margin-bottom: 6px;
}

.countdown__value {
    letter-spacing: 0.3px;
}

.countdown__center {
    display: block;
}

/* Countdown finished animation */
@keyframes countdownPulse {
    0%, 100% {
        opacity: 1;
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(217, 121, 67, 0.3));
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    }
    50% {
        opacity: 0.7;
        background: linear-gradient(135deg, rgba(240, 214, 121, 0.3), rgba(212, 175, 55, 0.3));
        box-shadow: 0 0 20px rgba(217, 121, 67, 0.5);
    }
}

@keyframes countdownGradient {
    0% {
        color: var(--hytale-gold-light);
        text-shadow: 0 0 10px rgba(240, 214, 121, 0.5);
    }
    33% {
        color: var(--hytale-orange);
        text-shadow: 0 0 10px rgba(217, 121, 67, 0.5);
    }
    66% {
        color: var(--hytale-gold);
        text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    }
    100% {
        color: var(--hytale-gold-light);
        text-shadow: 0 0 10px rgba(240, 214, 121, 0.5);
    }
}

.countdown-finished {
    animation: countdownPulse 1.5s ease-in-out infinite, countdownGradient 3s ease-in-out infinite !important;
}

.countdown-finished.countdown__value {
    animation: countdownGradient 3s ease-in-out infinite !important;
}

/* ===== Navbar ===== */
.hytale-navbar {
    background: linear-gradient(90deg, var(--hytale-brown-dark) 0%, var(--hytale-brown) 100%);
    border-bottom: 2px solid var(--hytale-gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding: 12px 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.brand-name {
    color: var(--hytale-gold);
}

.brand-dot {
    color: var(--hytale-orange);
}

.brand-domain {
    background: linear-gradient(90deg, var(--hytale-orange), var(--hytale-gold), var(--hytale-orange));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.nav-link {
    color: var(--hytale-beige) !important;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--hytale-gold) !important;
    transform: translateY(-2px);
}

/* ===== Cards ===== */
.card {
    background: var(--surface-color);
    border: 1px solid var(--hytale-brown-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.2);
}

.card-header {
    background: var(--hytale-brown);
    border-bottom: 2px solid var(--hytale-gold);
    color: var(--hytale-gold-light);
    font-weight: 600;
}

/* Specific header variant used across templates: keep gradient, centered white text, match site theme */
.card-header.bg-gradient.text-white.text-center {
    background: linear-gradient(135deg, var(--hytale-brown) 0%, var(--hytale-brown-dark) 100%);
    color: var(--hytale-gold-light) !important;
    text-align: center;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--hytale-gold);
}

.card-body {
    color: var(--text-color);
}

.card-footer {
    background: var(--hytale-brown-dark);
    border-top: 1px solid var(--hytale-brown-light);
}

/* ===== Wiki: Infobox (site-consistent card variant) ===== */
.wiki-infobox {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--hytale-brown-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wiki-infobox:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.12);
}
.wiki-infobox .card-header {
    background: var(--hytale-brown);
    color: var(--hytale-gold-light);
    border-bottom: 2px solid var(--hytale-gold);
    font-weight: 700;
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    position: relative;
}
.wiki-infobox .card-header::before {
    /* subtle gold accent bar below header (reduced) */
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: -5px;
    height: 3px;
    background: linear-gradient(90deg, rgba(212,175,55,0.95), rgba(217,121,67,0.85));
    border-radius: 3px;
    opacity: 0.95;
}
.wiki-infobox .card-sub {
    font-size: 0.83rem;
    color: var(--hytale-gold-light);
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.2px;
    margin: 0;
}
.wiki-infobox .wiki-infobox-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid rgba(0,0,0,0.12);
} 
.wiki-infobox .card-body {
    padding: 0.9rem;
}
.wiki-infobox .card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--hytale-gold);
    font-weight: 700;
}
.wiki-infobox-table th {
    color: var(--hytale-gold);
    font-weight: 700;
    width: 40%;
    vertical-align: top;
    font-size: 0.9rem;
    padding-top: 0.35rem;
}
.wiki-infobox-table td {
    color: var(--text-color);
    font-size: 0.95rem;
}
/* Disable row hover highlight for infobox tables — fully override Bootstrap hover */
.wiki-infobox .table-hover tbody tr:hover,
.wiki-infobox .table tbody tr:hover {
    background: transparent !important;
}
/* Ensure the TD/TH elements don't get a different hover background from Bootstrap rules */
.wiki-infobox .table-hover tbody tr:hover > *,
.wiki-infobox .table tbody tr:hover > * {
    background-color: transparent !important;
}
/* Make table and its cells transparent and remove transitions */
.wiki-infobox .table,
.wiki-infobox .table tbody,
.wiki-infobox .table tbody tr,
.wiki-infobox .table tbody tr td,
.wiki-infobox .table tbody tr th {
    background-color: transparent !important;
    transition: none !important;
    box-shadow: none !important;
}
.wiki-infobox .table tbody tr {
    cursor: default;
}
@media (min-width: 992px) {
    .wiki-infobox .wiki-infobox-image { height: 180px; }
    .wiki-infobox .card-body { padding: 1rem; }
}

/* ===== Server banners and small UI tweaks ===== */
.server-banner { width: 100%; height: 100%; object-fit: cover; display: block; }
.server-banner-placeholder { width: 100%; height: 70px; display:flex; align-items:center; justify-content:center; color:var(--text-muted); }
.server-detail-banner { width:100%; height:220px; object-fit:cover; }
.server-card .server-banner { height: 70px; border-radius: 6px; }

/* Card background using server banner image with dark overlay for readability */
.server-card-bg {
    position: relative;
    background-color: var(--surface-color);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    color: var(--text-color);
}
.server-card-bg::before { content: none; }

/* Removed pseudo-element overlay to avoid double darkening — explicit .server-card-overlay element is used instead */


/* Explicit overlay element (used in templates) to ensure overlay works reliably on all pages */
.server-card-bg .server-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1;
    pointer-events: none;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.35);
}
.server-card-bg .card-body {
    position: relative;
    z-index: 2;
    background: transparent;
}

/* Ensure banners scale to the full width of the card and do not repeat if the image is smaller */
.server-card-bg[style*="background-image"] {
    background-repeat: no-repeat !important;
    /* Use width-based scaling to preserve aspect ratio without tiling */
    background-size: 100% auto;
    background-position: top center;
}

/* Remove the thin decorative top line on cards that display a banner image */
.server-card-bg.server-card::before {
    display: none;
}

/* Slightly larger banner placeholder for cards when no image is present */
.server-banner-placeholder { background-color: rgba(255,255,255,0.02); }

/* Language flag for Ukrainian (two rounded rectangles) */
.lang-flag { display: inline-block; width: 36px; height: 18px; border-radius: 2px; vertical-align: middle; overflow: hidden; background-size: 100% 100%; background-repeat: no-repeat; -webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translateZ(0); }
.lang-flag.lang-uk { background-image: linear-gradient(180deg, #0057b7 0 50%, #ffd700 50% 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); border: none; }

/* Make clickable addresses look interactive */
.clickable { cursor: pointer; }
.clickable:hover { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.04); }

/* Players modal list styling */
#players-modal-body .list-group-item { background: transparent; color: var(--text-color); border: 1px solid rgba(255,255,255,0.04); }
#players-modal-body .text-muted { color: var(--text-muted) !important; }

/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--hytale-gold) 0%, var(--hytale-orange) 100%);
    border: none;
    color: var(--hytale-brown-dark);
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--hytale-gold-light) 0%, var(--hytale-gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--hytale-brown);
    border: 1px solid var(--hytale-brown-light);
    color: var(--hytale-beige);
}

.btn-secondary:hover {
    background: var(--hytale-brown-light);
    border-color: var(--hytale-gold);
}

.btn-outline-primary {
    border-color: var(--hytale-gold);
    color: var(--hytale-gold);
}

.btn-outline-primary:hover {
    background: var(--hytale-gold);
    color: var(--hytale-brown-dark);
}

/* ===== Forms ===== */
.form-control, .form-select {
    background: var(--surface-color);
    border: 1px solid var(--hytale-brown-light);
    color: var(--text-color);
}

/* Help text readability on dark theme */
body.hytale-theme .form-text {
    color: var(--hytale-beige) !important;
}

/* Keep browser autofill colors consistent with theme */
body.hytale-theme input.form-control:-webkit-autofill,
body.hytale-theme input.form-control:-webkit-autofill:hover,
body.hytale-theme input.form-control:-webkit-autofill:focus,
body.hytale-theme textarea.form-control:-webkit-autofill,
body.hytale-theme textarea.form-control:-webkit-autofill:hover,
body.hytale-theme textarea.form-control:-webkit-autofill:focus,
body.hytale-theme select.form-select:-webkit-autofill,
body.hytale-theme select.form-select:-webkit-autofill:hover,
body.hytale-theme select.form-select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-color) !important;
    caret-color: var(--text-color);
    box-shadow: 0 0 0px 1000px var(--surface-color) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.form-control:focus, .form-select:focus {
    background: var(--surface-color);
    border-color: var(--hytale-gold);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--hytale-beige);
    font-weight: 500;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #98fb98;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
    color: #87ceeb;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffd700;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #ff6b6b;
}

/* ===== Badges ===== */
.badge {
    padding: 0.4em 0.7em;
    border-radius: 12px;
    font-weight: 500;
}

.badge-gold {
    background: var(--hytale-gold);
    color: var(--hytale-brown-dark);
}

/* Bootstrap contextual colors: avoid default blue on dark theme */
body.hytale-theme .badge.bg-primary {
    background: var(--hytale-brown) !important;
    border: 1px solid var(--hytale-gold);
    color: var(--hytale-gold-light) !important;
}

/* ===== Tables ===== */
.table {
    color: var(--text-color);
}

body.hytale-theme .table,
body.hytale-theme .table thead,
body.hytale-theme .table tbody,
body.hytale-theme .table tfoot,
body.hytale-theme .table tr,
body.hytale-theme .table th,
body.hytale-theme .table td {
    background-color: transparent;
}

.table thead th {
    background: var(--hytale-brown);
    border-color: var(--hytale-brown-light);
    color: var(--hytale-gold-light);
}

.table tbody tr {
    background: var(--surface-color);
    border-color: var(--hytale-brown-light);
}

.table tbody tr:hover {
    background: var(--hytale-brown);
}

/* ===== Pagination ===== */
.pagination .page-link {
    background: var(--surface-color);
    border-color: var(--hytale-brown-light);
    color: var(--hytale-gold);
}

.pagination .page-link:hover {
    background: var(--hytale-brown);
    border-color: var(--hytale-gold);
}

.pagination .page-item.active .page-link {
    background: var(--hytale-gold);
    border-color: var(--hytale-gold);
    color: var(--hytale-brown-dark);
}

/* ===== Modal ===== */
.modal-content {
    background: var(--surface-color);
    border: 2px solid var(--hytale-brown-light);
}

.modal-header {
    background: var(--hytale-brown);
    border-bottom: 2px solid var(--hytale-gold);
}

.modal-title {
    color: var(--hytale-gold-light);
}

.btn-close {
    filter: invert(1);
}

/* ===== Footer ===== */
.hytale-footer {
    background: linear-gradient(90deg, var(--hytale-brown-dark) 0%, var(--hytale-brown) 100%);
    border-top: 2px solid var(--hytale-gold);
    color: var(--text-muted);
    padding-top: 2rem;
}

.hytale-footer h5, .hytale-footer h6 {
    color: var(--hytale-gold);
}

.hytale-footer a {
    color: var(--hytale-beige);
}

.hytale-footer a:hover {
    color: var(--hytale-gold);
}

/* ===== Special Components ===== */
.post-body, .comment-body {
    background: var(--surface-color);
    border-left: 3px solid var(--hytale-gold);
    padding: 1rem;
    border-radius: 4px;
}

.user-avatar {
    border: 2px solid var(--hytale-gold);
    border-radius: 50%;
}

.server-card {
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--hytale-gold) 0%, var(--hytale-orange) 100%);
}

.online-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Markdown Editor ===== */
.markdown-editor {
    font-family: 'Courier New', monospace;
    min-height: 200px;
}

/* ===== Dropdown ===== */
.dropdown-menu {
    background: var(--surface-color);
    border: 1px solid var(--hytale-brown-light);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover {
    background: var(--hytale-brown);
    color: var(--hytale-gold);
}

/* Accordion (used in Support FAQ, etc.) */
.accordion-item {
    background: var(--surface-color);
    border-color: var(--hytale-brown-light);
}

.accordion-button {
    background: var(--surface-color);
    color: var(--text-color);
}

.accordion-button:not(.collapsed) {
    background: var(--hytale-brown);
    color: var(--hytale-gold-light);
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-body {
    color: var(--text-color);
}

/* Tabs */
.nav-tabs .nav-link {
    color: var(--hytale-beige);
}

.nav-tabs .nav-link.active {
    background: var(--surface-color);
    border-color: var(--hytale-brown-light) var(--hytale-brown-light) var(--surface-color);
    color: var(--hytale-gold-light);
}

/* ===== Utilities ===== */
.bg-hytale {
    background: var(--hytale-brown) !important;
}

.border-hytale {
    border-color: var(--hytale-gold) !important;
}

/* Bootstrap list-group: make it match dark theme */
.list-group-item {
    background: var(--surface-color);
    border-color: var(--hytale-brown-light);
    color: var(--text-color);
}

body.hytale-theme .list-group-item.active {
    background: var(--hytale-brown) !important;
    border-color: var(--hytale-gold) !important;
    color: var(--hytale-gold-light) !important;
}

body.hytale-theme .list-group-item.active:hover {
    background: var(--hytale-brown-light) !important;
    color: var(--hytale-gold-light) !important;
}

.list-group-item-action:hover {
    background: var(--hytale-brown);
    color: var(--hytale-gold-light);
}

/* Legacy utility classes used in older templates */
.card__title {
    color: var(--hytale-gold-light);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn--ghost {
    background: transparent;
    border: 1px solid var(--hytale-brown-light);
    color: var(--hytale-beige);
}

.btn--ghost:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--hytale-gold);
    color: var(--hytale-gold-light);
}

/* Profile page */
.profile-banner {
    --profile-banner-url: none;
    position: relative;
    height: 180px;
    overflow: hidden;
    border-bottom: 1px solid var(--hytale-brown-light);
    background-image: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(217, 121, 67, 0.10) 45%, rgba(45, 34, 26, 0.0) 100%), var(--profile-banner-url);
    background-size: cover;
    background-position: center;
}

/* Home: news carousel */
.news-carousel__slide {
    min-height: 220px;
}

.news-carousel__image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

.news-carousel__image--placeholder {
    background: rgba(74, 55, 40, 0.35);
    border: 1px solid var(--hytale-brown-light);
    text-decoration: none;
}

.news-carousel .carousel-control-prev,
.news-carousel .carousel-control-next {
    width: 3.25rem;
}

.news-carousel .carousel-control-prev-icon,
.news-carousel .carousel-control-next-icon {
    border-radius: 999px;
    background-color: rgba(45, 34, 26, 0.65);
    background-size: 55% 55%;
}

/* Place indicators below the carousel content to avoid overlaying slides */
.news-carousel .carousel-indicators {
    position: static; /* prevent absolute overlay */
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-left: 0; /* reset bootstrap padding */
}

.news-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(45, 34, 26, 0.25);
    border: none;
    padding: 0;
}

.news-carousel .carousel-indicators button.active {
    background-color: rgba(45, 34, 26, 0.75);
}

.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 2px solid var(--hytale-gold);
    overflow: hidden;
    background: var(--hytale-brown-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar__placeholder {
    color: var(--hytale-beige);
    font-size: 2rem;
}


/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hytale-navbar .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* ===== Google Fonts (Фентезійні шрифти з підтримкою кирилиці) ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Merriweather:wght@400;700&display=swap');

/* ===== Breadcrumbs ===== */
.hytale-breadcrumb {
    position: relative;
    z-index: 2;
}

.hytale-breadcrumb .breadcrumb {
    background: linear-gradient(90deg, rgba(74, 55, 40, 0.3) 0%, rgba(212, 175, 55, 0.1) 100%);
    border: 1px solid var(--hytale-brown-light);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 0;
}

.hytale-breadcrumb .breadcrumb-item {
    font-size: 0.9rem;
}

.hytale-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--hytale-gold);
    font-weight: bold;
}

.hytale-breadcrumb .breadcrumb-item a {
    color: var(--hytale-gold);
    text-decoration: none;
    transition: color 0.3s;
}

.hytale-breadcrumb .breadcrumb-item a:hover {
    color: var(--hytale-gold-light);
}

.hytale-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
}

/* ===== Enhanced Search Field ===== */
.navbar .d-flex {
    position: relative;
}

.navbar .form-control {
    width: 180px;
    padding-left: 36px;
    background: rgba(42, 34, 24, 0.6);
    border: 1px solid var(--hytale-brown-light);
    color: var(--text-color);
    transition: width 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.navbar .form-control:focus {
    width: 280px;
    background: rgba(42, 34, 24, 0.9);
    border-color: var(--hytale-gold);
    color: var(--text-color);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.navbar .d-flex::before {
    content: "\F52A";
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hytale-gold);
    pointer-events: none;
    z-index: 10;
}

/* ===== Card Paper Texture ===== */
.card {
    position: relative;
    background: linear-gradient(135deg, rgba(74, 55, 40, 0.4) 0%, rgba(42, 34, 24, 0.6) 100%);
    border: 1px solid var(--hytale-brown-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(74, 55, 40, 0.3) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

.card > * {
    position: relative;
    z-index: 2;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2);
}

/* ===== Orbis WYSIWYG Editor ===== */
.orbis-editor {
    border: 1px solid var(--hytale-brown-light);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-color);
    margin-bottom: 1rem;
}

.orbis-editor__notice {
    display: none;
    padding: 10px 12px;
    border-bottom: 1px solid var(--hytale-brown-light);
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    background: rgba(26, 20, 16, 0.75);
    color: var(--text-color);
}

.orbis-editor__notice.show {
    display: block;
}

.orbis-editor__notice[data-type="error"] {
    border-bottom-color: rgba(217, 121, 67, 0.6);
}

.orbis-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(74, 55, 40, 0.3), rgba(42, 34, 24, 0.5));
    border-bottom: 1px solid var(--hytale-brown-light);
}

.orbis-editor__btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--hytale-brown-light);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hytale-gold);
    transition: all 0.2s;
}

.orbis-editor__btn:hover {
    background: var(--hytale-gold);
    color: var(--hytale-brown-dark);
    transform: translateY(-1px);
}

.orbis-editor__popover {
    position: fixed;
    z-index: 10050;
    min-width: 260px;
    max-width: min(420px, calc(100vw - 16px));
    background: linear-gradient(135deg, rgba(74, 55, 40, 0.96) 0%, rgba(45, 34, 26, 0.96) 100%);
    border: 1px solid var(--hytale-brown-light);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.55), 0 0 0 2px rgba(212, 175, 55, 0.15);
    backdrop-filter: blur(8px);
}

.orbis-editor__popover-title {
    font-family: 'Cinzel', serif;
    color: var(--hytale-gold-light);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.orbis-editor__popover-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.orbis-editor__popover-hint {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.orbis-editor__input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--hytale-brown-light);
    background: rgba(26, 20, 16, 0.6);
    color: var(--text-color);
    outline: none;
}

.orbis-editor__input:focus {
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.orbis-editor__textarea {
    width: 100%;
    margin: 8px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--hytale-brown-light);
    background: rgba(26, 20, 16, 0.6);
    color: var(--text-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    outline: none;
}

.orbis-editor__action {
    border: 1px solid var(--hytale-gold);
    background: linear-gradient(135deg, var(--hytale-gold) 0%, var(--hytale-gold-light) 100%);
    color: var(--hytale-brown-dark);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    cursor: pointer;
}

.orbis-editor__color {
    width: 42px;
    height: 38px;
    border: 1px solid var(--hytale-brown-light);
    border-radius: 8px;
    background: transparent;
    padding: 0;
}

.orbis-editor__swatches {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.orbis-editor__swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(245, 240, 232, 0.25);
    cursor: pointer;
}

.orbis-editor__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.orbis-editor__chip {
    border: 1px solid var(--hytale-brown-light);
    background: rgba(26, 20, 16, 0.5);
    color: var(--hytale-gold-light);
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}

.orbis-editor__chip:hover {
    border-color: var(--hytale-gold);
    color: var(--hytale-gold);
}

.orbis-editor__emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.orbis-editor__emoji {
    border: 1px solid rgba(245, 240, 232, 0.18);
    background: rgba(26, 20, 16, 0.5);
    border-radius: 8px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 18px;
}

.orbis-editor__emoji:hover {
    border-color: var(--hytale-gold);
    background: rgba(212, 175, 55, 0.12);
}

.orbis-editor__table-grid {
    display: grid;
    gap: 4px;
}

.orbis-editor__table-row {
    display: grid;
    grid-template-columns: repeat(8, 16px);
    gap: 4px;
}

.orbis-editor__table-cell {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(245, 240, 232, 0.18);
    background: rgba(26, 20, 16, 0.35);
}

.orbis-editor__table-cell.active {
    background: rgba(212, 175, 55, 0.35);
    border-color: rgba(212, 175, 55, 0.7);
}

.orbis-editor__separator {
    width: 1px;
    height: 34px;
    background: var(--hytale-brown-light);
    margin: 0 4px;
}

.orbis-editor__content {
    padding: 16px;
    min-height: 300px;
    max-height: 80vh;
    overflow: auto;
    resize: vertical;
    font-family: 'Merriweather', serif;
    line-height: 1.7;
    color: var(--text-color);
}

.orbis-editor__content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: italic;
}

.orbis-editor__content:focus {
    outline: none;
}

.orbis-editor__dragover {
    background: rgba(212, 175, 55, 0.1);
    border: 2px dashed var(--hytale-gold);
}

.orbis-editor__image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    cursor: move;
    border: 2px solid var(--hytale-brown-light);
}

/* Resizable image wrapper */
.orbis-editor__image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 10px 0;
}

.orbis-editor__video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin: 1.5rem 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.orbis-editor__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Audio player and file link styling to match Hytale theme */
.orbis-editor__audio-wrapper {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(74,55,40,0.18), rgba(42,34,24,0.12));
    border: 1px solid var(--hytale-brown-light);
}

.orbis-editor__audio {
    width: 100%;
    height: auto;
    background: transparent;
    outline: none;
    border-radius: 8px;
}

.orbis-editor__file-wrapper {
    display: inline-block;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hytale-gold) 0%, var(--hytale-gold-light) 100%);
    color: var(--hytale-brown-dark);
    border: 1px solid rgba(0,0,0,0.12);
}

.orbis-editor__file-link {
    color: var(--hytale-brown-dark);
    font-weight: 600;
    text-decoration: none;
}

.orbis-editor__file-link:hover {
    text-decoration: underline;
    color: var(--hytale-brown);
}

.orbis-editor__image-wrapper.is-selected {
    outline: 2px solid rgba(212, 175, 55, 0.8);
    outline-offset: 2px;
}

.orbis-editor__image-wrapper.is-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.orbis-editor__image-wrapper.is-full {
    display: block;
    width: 100% !important;
    margin-left: 0;
    margin-right: 0;
}

.orbis-editor__image-wrapper.is-float-left {
    float: left;
    margin: 10px 16px 10px 0;
    max-width: 60%;
}

.orbis-editor__image-wrapper.is-float-right {
    float: right;
    margin: 10px 0 10px 16px;
    max-width: 60%;
}

.orbis-editor__caption {
    margin: 6px 0 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.orbis-editor__image-toolbar {
    position: fixed;
    z-index: 10060;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(74, 55, 40, 0.96) 0%, rgba(45, 34, 26, 0.96) 100%);
    border: 1px solid var(--hytale-brown-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
}

.orbis-editor__image-tool {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--hytale-brown-light);
    background: rgba(212, 175, 55, 0.08);
    color: var(--hytale-gold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.orbis-editor__image-tool:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.5);
}

.orbis-editor__image-tool.danger {
    color: rgba(217, 121, 67, 0.95);
}

.orbis-editor__image-sep {
    width: 1px;
    height: 28px;
    background: rgba(107, 84, 68, 0.8);
    margin: 0 4px;
}

.orbis-editor__image-range input[type="range"] {
    width: 120px;
}

@media (max-width: 768px) {
    .orbis-editor__image-range input[type="range"] {
        width: 90px;
    }
}

/* Ensure floated images don't overlap subsequent blocks */
.orbis-editor__content::after {
    content: "";
    display: block;
    clear: both;
}

/* Safe constraints for article content images (prevents layout breakage) */
.news-content img,
.wiki-content img,
article .card-body img {
    max-width: 100%;
    height: auto;
}

/* News content styling */
.news-content {
    line-height: 1.8;
    font-size: 1rem;
}

.news-content h2,
.news-content h3,
.news-content h4 {
    color: var(--hytale-gold-light);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.news-content blockquote {
    border-left: 4px solid var(--hytale-gold);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Indentation support for news content */
.news-content div[style*="margin-left"],
.news-content .orbis-editor__indent {
    margin-left: 40px;
    padding-left: 8px;
    border-left: 3px solid rgba(212, 175, 55, 0.3);
    margin-top: 8px;
    margin-bottom: 8px;
}

.news-content div[style*="margin-left"] p,
.news-content .orbis-editor__indent p {
    margin: 8px 0;
}

/* Nested indents */
.news-content div[style*="margin-left"] div[style*="margin-left"],
.news-content div[style*="margin-left"] .orbis-editor__indent {
    margin-left: 40px;
}

.orbis-editor__image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 2px solid var(--hytale-brown-light);
}

/* If the wrapper has an explicit width (style or data attribute) treat it as a block
   so percentage widths work as expected inside flow of the article */
.orbis-editor__image-wrapper[data-width-percent],
.orbis-editor__image-wrapper[style*="width"] {
    display: block;
}

.orbis-editor__image-wrapper:hover {
    /* disabled hover outline to avoid visual distraction on public pages */
    outline: none;
}

.orbis-editor__resize-handle {
    /* hide resize handle by default on public pages; shown only inside the editor */
    display: none;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--hytale-gold);
    cursor: nwse-resize;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Only show the handle when the image wrapper is inside the actual editor UI */
.orbis-editor .orbis-editor__image-wrapper:hover .orbis-editor__resize-handle {
    display: block;
    opacity: 0.8;
}

.orbis-editor .orbis-editor__resize-handle:hover {
    opacity: 1 !important;
    background: var(--hytale-gold-light);
}

.orbis-editor__code {
    background: rgba(26, 20, 16, 0.8);
    border: 1px solid var(--hytale-brown-light);
    border-left: 4px solid var(--hytale-gold);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.orbis-editor__source {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.orbis-editor__content h2,
.orbis-editor__content h3,
.orbis-editor__content h4 {
    font-family: 'Cinzel', serif;
    color: var(--hytale-gold-light);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.orbis-editor__content blockquote {
    border-left: 4px solid var(--hytale-gold);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}

.orbis-editor__content ul,
.orbis-editor__content ol {
    padding-left: 24px;
    margin: 12px 0;
}

.orbis-editor__content a {
    color: var(--hytale-gold);
    text-decoration: underline;
}

.orbis-editor__content a:hover {
    color: var(--hytale-gold-light);
}

/* Indentation support */
.orbis-editor__indent,
.orbis-editor__content div[style*="margin-left"] {
    margin-left: 40px;
    padding-left: 8px;
    border-left: 3px solid rgba(212, 175, 55, 0.3);
}

.orbis-editor__indent p,
.orbis-editor__content div[style*="margin-left"] p {
    margin: 8px 0;
}

/* Nested indents */
.orbis-editor__indent .orbis-editor__indent,
.orbis-editor__indent div[style*="margin-left"],
.orbis-editor__content div[style*="margin-left"] .orbis-editor__indent,
.orbis-editor__content div[style*="margin-left"] div[style*="margin-left"] {
    margin-left: 40px;
}

/* Alignment support */
.orbis-editor__content p {
    text-align: inherit;
}

/* ===== News Detail Cover Styling ===== */
.news-detail-cover {
    max-height: 450px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hytale-brown-dark);
    border-bottom: 2px solid var(--hytale-gold);
}

.news-detail-cover img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.news-detail-cover:hover img {
    transform: scale(1.02);
}

/* Full-bleed helper: allows content to break out of the .container and span the full viewport width */
.full-bleed {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    max-width: none;
    padding-left: 16px; /* keep small inner padding */
    padding-right: 16px;
}

.full-bleed .card {
    border-radius: 0;
}

