:root {
    color-scheme: dark;
    --color-bg-dark: #21141d;
    --color-bg-navy: #2b1a25;
    --color-bg-card: #2c1b25;
    --color-bg-card-alt: #35202c;
    --color-bg-header: #593548;
    --color-bg-header-alt: #684054;
    --color-accent: #8e536d;
    --color-accent-blue: #cb91aa;
    --color-border: #785464;
    --color-border-light: #b68c9c;
    --color-text-light: #f0dfe7;
    --color-text-muted: #c8b0bd;
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 3px;
    --page-width: 1296px;
    --panel-shadow: 0 5px 22px #1c0d2240, inset 0 0 0 3px #120c1526;
}

html { scroll-padding-top: 100px; }
body {
    background-color: #291923;
    background-image: linear-gradient(to bottom, transparent 65%, #291923 100%), url('../assets/theme/background.webp');
    background-size: 100% 100%, max(100%, 1440px) auto;
    background-position: center top;
    background-repeat: no-repeat;
    line-height: 1.5;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #f2cddc; outline-offset: 4px; }
::selection { color: #fff; background: #945674; }
.site-background { background: none; min-height: 550px; }
.content-wrapper { max-width: var(--page-width); padding: 20px 0 54px; }
.main-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
.main-left, .main-right { gap: 18px; min-width: 0; }

.navbar { height: 76px; border-bottom: 1px solid #a98598; box-shadow: 0 2px 12px #160d1b26; }
.navbar-bg { background: #342330 url('../assets/theme/navigation.webp') center / cover; }
.navbar-inner { max-width: 1370px; height: 100%; padding: 0 24px; gap: 16px; }
.navbar-logo { margin-right: 6px; }
.navbar-logo img { width: 104px; height: 62px; min-width: 0; }
.navbar-nav { gap: 2px; }
.nav-link, .nav-login { font-size: .8125rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.nav-link { min-height: 44px; padding: 10px 11px; }
.nav-link:hover, .nav-link.is-current { background: url('../assets/theme/navigation-active.webp') center / 100% 100% no-repeat; color: #fff; }
.navbar-right { gap: 14px; }
.nav-login { display: inline-flex; align-items: center; min-height: 44px; }
.nav-register { min-height: 38px; background: #663b50 url('../assets/theme/button.webp') center / 100% 100%; padding: 0 16px; }
.nav-register .register-bg { display: none; }
.nav-register span { font-size: .75rem; }
.lang-selected { min-height: 38px; color: #f4e6ed; cursor: pointer; font-size: .8125rem; background: #2719239c; }
.lang-dropdown, .dropdown-menu-inner { background: #32212d; border-color: #ae8799; }
.lang-option, .dropdown-item { min-height: 40px; display: flex; align-items: center; }
.nav-dropdown.open .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu { display: block; }
.nav-toggle { display: none; }

.hero { height: clamp(350px, 28.5vw, 548px); background: transparent; overflow: visible; }
.hero-inner { width: min(var(--page-width), calc(100% - 48px)); height: 100%; margin: auto; display: flex; align-items: center; }
.hero-brand { width: 44%; margin-left: 3%; display: block; transform: translateY(6px); }
.hero-logo { width: 100%; height: auto; filter: drop-shadow(0 9px 14px #4a243233); }

.statistics-bar { max-width: var(--page-width); margin: 0 auto; border: 1px solid #aa8195; border-radius: 2px; box-shadow: var(--panel-shadow); }
.statistics-bg { background: linear-gradient(100deg, #442735f5, #2c1b25f5 50%, #593346ef); }
.statistics-inner { max-width: none; padding: 20px 14px; }
.statistics-item { gap: 12px; padding: 0 14px; }
.statistics-icon { width: 27px; height: 27px; filter: sepia(.65) hue-rotate(280deg) saturate(.55) brightness(1.25); }
.statistics-label { font-size: .8125rem; color: #d9c2ce; }
.statistics-value { font-size: 1.125rem; font-weight: 700; }
.statistics-divider { background: linear-gradient(transparent, #bc91a291, transparent); }

.widget, .slider-widget, .news-article, .register-card, .login-modal, .download-header, .download-card, .ranking-page-inner, .profile-inner {
    box-shadow: var(--panel-shadow);
}
.ranking-widget, .events-widget, .widget-body { background: #30202b; }
.widget-header, .ranking-widget .widget-header, .events-widget .widget-header,
.news-article-header, .register-card-header, .login-modal-header, .ranking-page-header, .download-header {
    background: #533144 url('../assets/theme/panel-header.webp') center / 100% 100%;
    border-bottom: 1px solid #916779;
    color: #fff0f7;
}
.widget-header, .ranking-widget .widget-header, .events-widget .widget-header {
    padding: 17px 20px;
    font-size: .875rem;
    text-transform: none;
    letter-spacing: .02em;
}
.ranking-tabs { background: #291b25; padding: 16px 14px 12px; }
.ranking-tabs .btn-tab, .slider-tab { font-size: .875rem; }
.ranking-tabs .btn-tab.active, .slider-tab.active {
    background: #74435a url('../assets/theme/button.webp') center / 100% 100%;
    border-color: #c399ad;
    box-shadow: inset 0 0 0 2px #28182366;
}
.ranking-tabs .btn-tab:not(.active), .slider-tab { border-color: #795565; background: #291b25; }
.ranking-empty { padding: 30px 10px; font-size: .875rem; }
.ranking-entry { border: 1px solid #715061; }
.ranking-entry-bg { background: linear-gradient(100deg, #93557530, transparent); }
.ranking-entry:nth-child(odd) { background: #3b2332; }
.ranking-entry:nth-child(even) { background: #2b1a25; }
.ranking-footer, .events-pagination { background: #271923; }
.ranking-load-more { font-size: .8125rem; min-height: 30px; }
.events-list { padding: 14px; gap: 8px; }
.event-item { border-color: #805c6e; cursor: default; }
.event-item-bg { background: linear-gradient(105deg, #704055 0%, #442936 50%, #30202b 100%); }
.event-item-inner { gap: 10px; padding: 12px 13px; }
.event-title { font-size: .875rem; }
.event-time { color: #e0cad4; font-size: .75rem; white-space: nowrap; }
.events-pagination { margin-top: 0; padding: 13px; }
.events-page-btn { height: 36px; width: 36px; }
.events-page-btn:disabled { opacity: .4; cursor: default; }

.slider-widget { padding: 7px; background: #37212ef5; border-color: #997084; }
.slider-track-wrapper { border: 1px solid #b08499; }
.slider-slide { width: 100%; flex: 0 0 100%; min-width: 0; }
.slider-image { height: 322px; object-position: center; }
.slider-caption { font-size: 1.125rem; padding: 24px 22px 18px; text-shadow: 0 1px 4px #150a12; }
.slider-slide::after { background: linear-gradient(transparent, #301824e6); }
.slider-slide:nth-child(2) .slider-image { object-position: 65% center; }
.slider-slide:nth-child(3) .slider-image { object-position: 35% center; }
.slider-arrow { width: 40px; height: 46px; border-radius: 2px; border-color: #b692a4; background: #351d2cbd; }
.slider-arrow:hover { background: #78485ed9; border-color: #e3bdd1; }
.slider-arrow img { width: 22px; }
.slider-tabs { padding: 10px 0 2px; background: transparent; border: 0; gap: 9px; }
.slider-tab { min-height: 44px; padding: 8px; color: #dec8d3; }

.news-widget { background: #34212def; padding: 15px; border: 1px solid #9b7185; }
.news-widget::before { content: ''; height: 20px; background: url('../assets/theme/news-divider.webp') center / 100% auto no-repeat; margin: 0 2px 15px; }
.news-article { border-color: #926c7e; }
.news-article-header { padding: 18px 22px; gap: 16px; }
.news-article-title { font-size: 1.125rem; }
.news-article-date { color: #ead3de; font-size: .75rem; }
.news-article-body { padding: 22px; gap: 22px; background: #291922; }
.news-article-excerpt { font-size: 1rem; line-height: 1.75; color: #e4ced9; }
.news-article-image { height: auto; max-height: 390px; aspect-ratio: 16 / 9; border: 1px solid #684353; }
.news-article-footer { background: #291922; padding: 0 22px 22px; }
.news-more-btn { min-width: 125px; min-height: 44px; justify-content: center; font-size: .875rem; }
.news-more-btn-bg { background: #79445d url('../assets/theme/button.webp') center / 100% 100%; }
.news-widget .news-article + .news-article { margin-top: 20px; }

.register-card, .login-modal { border-color: #ae8198; background: #2b1b26; }
.register-card { max-width: 560px; }
.register-card-header, .login-modal-header { min-height: 76px; }
.register-logo, .login-logo { height: 46px; }
.form-label { font-size: .8125rem; color: #e6cedb; text-transform: none; letter-spacing: .01em; flex-wrap: wrap; }
.form-label-hint { font-size: .75rem; }
.form-input { font-size: 1rem; background: #21141c; border-color: #8a6277; min-height: 45px; border-radius: 2px; }
.form-input::placeholder { color: #bca3b1; }
.form-input:focus { background: #32202c; border-color: #e5b8cd; }
.register-submit-btn, .login-submit-btn, .profile-settings-btn, .admin-btn--primary {
    background: #7a425d url('../assets/theme/button.webp') center / 100% 100%;
    border: 0;
    min-height: 48px;
    border-radius: 2px;
    letter-spacing: .025em;
}
.register-login-hint, .login-register-hint { font-size: .875rem; }
.login-overlay { background: #180e1bb5; }
.login-modal { max-height: calc(100dvh - 40px); overflow-y: auto; }
body.login-open { overflow: hidden; }
.download-inner { background: #2c1b26f5; border: 1px solid #9b7185; padding: 20px; }
.download-header { border-color: #896276; }
.download-desc { font-size: 1rem; color: #d9c2cf; }
.download-card { padding: 18px 14px; background: #36202d; }
.download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-table-head, .rp-pagination { background: #34212d; }
.rp-table-head { font-size: .75rem; }
.rp-row, .rp-table-head { grid-template-columns: 60px minmax(100px,1fr) 130px 85px 65px; gap: 8px; }
.profile-hero { background: #492d3d url('../assets/theme/panel-header.webp') center / cover; }
.profile-settings-grid { grid-template-columns: 1fr; }
.profile-tab { white-space: nowrap; }
.profile-tabs { overflow-x: auto; }
.profile-username { overflow-wrap: anywhere; }
.profile-panel, .profile-main { min-width: 0; }
.profile-info-label, .profile-stat-label, .prof-char-stat-label, .profile-card-title { font-size: .75rem; }
.profile-settings-card .form-input { font-size: 1rem; }

.social-bar { border: 1px solid #a27a8d; border-left: 0; }
.social-bar-bg { background: #392432e8; }
.social-icon-link { width: 40px; height: 40px; }
.social-icon-img { filter: sepia(.45) hue-rotate(290deg) saturate(.5) brightness(1.2); }
.footer { border-top-color: #a77f96; }
.footer-bg { background: #35232f url('../assets/theme/footer.webp') center / cover; }
.footer-inner { max-width: var(--page-width); min-height: 108px; padding: 24px 0; gap: 20px; }
.footer-logo { height: 52px; opacity: 1; }
.footer-tagline { display: none; }
.footer-nav { gap: 16px; }
.footer-link { font-size: .8125rem; color: #e0cad6; }
.footer-copy { font-size: .75rem; color: #d4b7c8; }

@media (max-width: 1390px) {
    .content-wrapper, .statistics-bar, .footer-inner { width: calc(100% - 112px); }
    .navbar-inner { gap: 8px; padding: 0 18px; }
    .nav-link { padding-inline: 8px; font-size: .75rem; }
    .navbar-right { gap: 10px; }
    .navbar-logo img { width: 90px; }
    .nav-register { padding-inline: 12px; }
    .main-layout { grid-template-columns: 300px minmax(0, 1fr); }
    .statistics-item { padding-inline: 10px; }
}
@media (max-width: 1100px) {
    .navbar { height: 68px; }
    .navbar-logo { margin-right: auto; }
    .navbar-logo img { width: 92px; height: 56px; }
    .nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; background: #392330; border: 1px solid #93677c; padding: 10px; cursor: pointer; order: 3; }
    .nav-toggle span { width: 100%; height: 2px; background: #e6cedb; }
    .navbar-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; padding: 14px 20px; background: #30202cfb; border-bottom: 1px solid #b1879d; box-shadow: 0 15px 24px #170c204d; }
    .navbar.menu-open .navbar-nav { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
    .nav-link { font-size: .8125rem; justify-content: center; min-height: 46px; }
    .navbar-right { gap: 16px; }
    .statistics-inner { padding: 16px 8px; }
    .statistics-item { gap: 8px; }
    .statistics-icon { width: 22px; height: 22px; }
    .statistics-label { white-space: normal; font-size: .75rem; }
    .main-layout { grid-template-columns: 270px minmax(0, 1fr); }
    .slider-image { height: 300px; }
    .slider-tabs { gap: 5px; }
    .slider-tab { font-size: .75rem; padding: 6px; }
    .slider-tab img { display: none; }
    .footer-inner { justify-content: center; }
    .profile-layout { grid-template-columns: 220px minmax(0,1fr); }
    .profile-chars-grid, .panel-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    body { background-size: 100% 100%, 1200px auto; background-position: center top, 56% top; }
    .hero { height: 320px; }
    .hero-inner { width: calc(100% - 30px); align-items: flex-end; padding-bottom: 35px; }
    .hero-brand { width: min(65%, 370px); margin-left: 0; }
    .content-wrapper, .statistics-bar, .footer-inner { width: calc(100% - 32px); }
    .main-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .main-right { grid-row: 1; }
    .main-left { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; }
    .statistics-inner { flex-wrap: wrap; justify-content: center; row-gap: 16px; padding: 18px 6px; }
    .statistics-item { flex: 0 0 33.333%; padding: 0 6px; }
    .statistics-divider { display: none; }
    .statistics-label { font-size: .75rem; }
    .statistics-value { font-size: 1rem; }
    .social-bar { position: relative; left: auto; top: auto; transform: none; flex-direction: row; justify-content: center; width: 100%; border: 0; border-radius: 0; padding: 3px 0; }
    .social-bar-bg { background: #2e1c27; border-radius: 0; }
    .social-icon-link { width: 44px; height: 32px; }
    .social-icon-link:hover { transform: none; }
    .news-article-header { flex-wrap: wrap; gap: 6px; padding: 16px; }
    .news-article-body { padding: 16px; }
    .news-article-footer { padding: 0 16px 18px; }
    .news-widget { padding: 10px; }
    .slider-image { height: auto; aspect-ratio: 16 / 9; }
    .slider-caption { font-size: 1rem; }
    .slider-tab { font-size: .8125rem; }
    .download-view, .ranking-view, .register-view, .profile-view { padding: 20px 16px 40px; }
    .download-inner { padding: 14px; }
    .download-header { padding: 16px; align-items: flex-start; gap: 10px; flex-direction: column; }
    .ranking-page-header { padding: 18px 14px 0; flex-wrap: wrap; gap: 0; }
    .ranking-page-table { overflow-x: auto; }
    .rp-row, .rp-table-head { min-width: 545px; }
    .profile-layout { grid-template-columns: minmax(0,1fr); }
    .profile-sidebar { border-right: 0; }
    .profile-hero { flex-wrap: wrap; padding: 22px; gap: 16px; }
    .profile-panel { padding: 16px; }
    .footer-inner { flex-direction: column; gap: 14px; }
    .footer-nav { justify-content: center; gap: 12px 18px; }
}
@media (max-width: 480px) {
    .navbar-inner { padding: 0 12px; gap: 10px; }
    .navbar-logo img { width: 76px; }
    .navbar-right { gap: 10px; }
    .nav-register { display: none; }
    .nav-login { font-size: .75rem; }
    .lang-selected { padding: 5px 6px; }
    .lang-flag { width: 19px; }
    .nav-toggle { width: 36px; height: 38px; padding: 8px; }
    .navbar.menu-open .navbar-nav { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 12px; }
    .nav-account-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
    .nav-account-icon { display: none; }
    .nav-logout { font-size: .75rem; }
    .hero { height: 278px; }
    .hero-brand { width: 75%; }
    .main-left { display: flex; align-items: stretch; }
    .statistics-item { flex-basis: 50%; }
    .statistics-item:last-child { flex-basis: 100%; }
    .statistics-item:last-child .statistics-text { flex-direction: row; align-items: center; gap: 12px; }
    .statistics-icon { width: 22px; height: 22px; }
    .content-wrapper { padding-top: 16px; }
    .slider-caption { padding: 22px 14px 12px; font-size: .9375rem; }
    .slider-arrow { width: 32px; height: 38px; }
    .slider-arrow--left { left: 8px; }
    .slider-arrow--right { right: 8px; }
    .slider-tab { padding-inline: 4px; font-size: .75rem; }
    .download-grid { grid-template-columns: minmax(0,1fr); }
    .register-form, .login-form { padding: 22px 18px; }
    .register-card-header, .login-modal-header { padding: 12px 16px; }
    .register-logo, .login-logo { height: 36px; }
    .form-label-hint { font-size: .75rem; }
    .login-overlay { padding: 14px; }
    .admin-field-row { grid-template-columns: 1fr; }
    .admin-user-row, .em-event-item { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
