:root {
    --color-primary: #8b6914;
    --color-secondary: #1c1c1e;
    --color-dark: #121214;
    --color-darker: #0a0a0c;
    --color-text: #e5e5e7;
    --color-text-secondary: #98989d;
    --color-accent: #b8860b;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-gold: #d4a574;
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    background: #0f0f11;
    background-image: 
        radial-gradient(at 20% 30%, rgba(139, 105, 20, 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(184, 134, 11, 0.06) 0px, transparent 50%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive images — desktop, tablet, mobile */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.main-content img,
.content-section img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Header Styles */
.site-header {
    background: rgba(18, 18, 20, 0.98);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(139, 105, 20, 0.3);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.header-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 12px;
    flex-wrap: nowrap;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo-img {
    height: 42px;
    width: auto;
    max-width: min(220px, 100%);
    object-fit: contain;
    display: block;
}

.main-nav {
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
}

.btn-register-mobile {
    display: none !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.header-lang .lang-current {
    padding: 6px 10px;
    height: 36px;
}

.header-lang .flag-icon {
    width: 22px;
    height: 16px;
}

/* Navigation - one line on all languages, no scroll */

/* Hidden checkbox for mobile menu (no JS: label click toggles menu) */
.mobile-menu-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1003;
    pointer-events: auto;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    padding: 8px 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.nav-menu > li {
    flex-shrink: 1;
    min-width: 0;
}

.nav-item-register {
    margin-left: auto;
    flex-shrink: 0;
}

.language-dropdown {
    position: relative;
}

/* Flag Icons */
.flag-icon {
    display: inline-block;
    width: 24px;
    height: 18px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.flag-ru {
    background: linear-gradient(to bottom, #fff 33%, #0039a6 33%, #0039a6 66%, #d52b1e 66%);
}

.flag-en {
    background: #012169;
    background-image:
        /* Красный крест Святого Георгия (вертикальный) */
        linear-gradient(to right, transparent 44%, #c8102e 44%, #c8102e 56%, transparent 56%),
        /* Красный крест Святого Георгия (горизонтальный) */
        linear-gradient(to bottom, transparent 44%, #c8102e 44%, #c8102e 56%, transparent 56%),
        /* Белая обводка креста (вертикальная) */
        linear-gradient(to right, transparent 40%, #fff 40%, #fff 60%, transparent 60%),
        /* Белая обводка креста (горизонтальная) */
        linear-gradient(to bottom, transparent 40%, #fff 40%, #fff 60%, transparent 60%),
        /* Красные диагонали */
        linear-gradient(45deg, transparent 48.5%, #c8102e 48.5%, #c8102e 51.5%, transparent 51.5%),
        linear-gradient(-45deg, transparent 48.5%, #c8102e 48.5%, #c8102e 51.5%, transparent 51.5%),
        /* Белые диагонали (обводка) */
        linear-gradient(45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%);
}

.flag-de {
    background: linear-gradient(to bottom, #000 33%, #dd0000 33%, #dd0000 66%, #ffce00 66%);
}

.flag-pl {
    background: linear-gradient(to bottom, #fff 50%, #dc143c 50%);
}

.lang-current {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    height: 40px;
    border-radius: 6px;
    background: rgba(139, 105, 20, 0.2);
    border: 1px solid rgba(139, 105, 20, 0.3);
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-text);
}

.lang-code {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.lang-current:hover {
    background: rgba(139, 105, 20, 0.3);
    border-color: var(--color-primary);
}

.lang-current .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.lang-dropdown.active .arrow {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: rgba(28, 28, 30, 0.98);
    border: 1px solid rgba(139, 105, 20, 0.3);
    border-radius: 8px;
    padding: 5px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s;
    transform: translateY(-10px);
}

.language-dropdown.active .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 12px;
    min-width: 70px;
    height: 40px;
    border-radius: 6px;
    background: rgba(139, 105, 20, 0.15);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(139, 105, 20, 0.3);
}

.lang-option:hover {
    background: var(--color-primary);
    border-color: var(--color-gold);
    transform: scale(1.1);
}

.btn-register-nav {
    font-size: 14px;
    padding: 6px 10px;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.nav-link {
    display: block;
    padding: 6px 8px;
    font-size: 15px;
    white-space: nowrap;
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition);
    border-radius: 6px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
    background: rgba(212, 175, 55, 0.1);
}

.nav-link:hover::before,
.nav-link.active::before {
    transform: scaleX(1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    border-bottom: none !important;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover,
.btn:active,
.btn:focus,
.btn:visited {
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.5);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-primary) 100%);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    text-decoration: none !important;
    border-bottom: none !important;
}

.btn-register {
    animation: pulse 2s infinite;
    font-size: 18px;
    padding: 14px 35px;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(212, 175, 55, 0.7);
    }
}

/* Main Content */
.main-content {
    padding: 40px 0;
    width: 100%;
    overflow-x: hidden;
}

.content-section {
    background: rgba(28, 28, 30, 0.7);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid rgba(139, 105, 20, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    text-align: left;
}

.content-section h1 {
    color: var(--color-gold);
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.content-section h2 {
    color: var(--color-gold);
    font-size: 2rem;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.25);
}

.content-section h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin: 25px 0 15px;
}

.content-section p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.content-section ul,
.content-section ol {
    margin: 20px 0;
    padding-left: 30px;
}

.content-section li {
    margin-bottom: 10px;
    color: var(--color-text-secondary);
}

/* Content links styling */
.content-section a {
    color: var(--color-gold);
    text-decoration: underline;
    text-decoration-color: rgba(212, 175, 116, 0.4);
    text-underline-offset: 3px;
    transition: var(--transition);
}

.content-section a:hover {
    color: var(--color-accent);
    text-decoration-color: rgba(184, 134, 11, 0.6);
}

.content-section a:visited {
    color: var(--color-gold);
    opacity: 0.9;
}

.content-section table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 25px auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    display: table;
    table-layout: fixed;
}

.content-section table thead th,
.content-section table tbody td {
    text-align: center !important;
}

.content-section thead th,
.content-section tbody td {
    padding: 15px;
    text-align: center !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.content-section th {
    background: rgba(212, 175, 55, 0.2);
    color: var(--color-accent);
    font-weight: 600;
}

.content-section tbody tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.content-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    margin: 24px auto;
    display: block;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Баннеры в едином блоке 362×154 без серых полос (заполнение с обрезкой краёв) */
.content-image-tall {
    aspect-ratio: 362 / 154;
    object-fit: cover;
    object-position: center;
}

.cta-section {
    text-align: left;
    padding: 40px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: 15px;
    margin: 30px 0;
}

/* Footer */
.site-footer {
    background: rgba(0, 0, 0, 0.95);
    border-top: 2px solid var(--color-primary);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    color: var(--color-accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-menu a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-link.telegram:hover {
    background: #0088cc;
    color: white;
}

.social-link.vk:hover {
    background: #4a76a8;
    color: white;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.footer-bottom {
    text-align: left;
    padding-top: 30px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--color-text-secondary);
}

.disclaimer {
    font-size: 0.9rem;
    margin-top: 15px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-logo {
        min-width: 0;
        flex-shrink: 1;
    }
    
    .header-logo-img {
        height: 32px;
        max-width: min(160px, 100%);
    }
    
    .header-right {
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 6px;
        min-width: 0;
    }
    
    .language-dropdown {
        width: auto;
        flex-shrink: 0;
    }
    
    .lang-current {
        width: auto;
        min-height: 40px;
        padding: 6px 8px;
    }
    
    .lang-code {
        font-size: 12px;
    }
    
    .btn-register-mobile {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        border-bottom: none !important;
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
        text-decoration: none;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        z-index: 1003;
        min-width: 44px;
        padding: 6px;
    }
    
    .main-nav {
        width: 100%;
        order: 1;
        flex-basis: 100%;
        min-height: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        width: 100%;
        background: var(--color-bg);
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        margin: 0;
        padding: 12px 0;
        border-top: 1px solid rgba(139, 105, 20, 0.2);
    }
    
    .nav-menu.active,
    .mobile-menu-checkbox:checked ~ .header-row .main-nav .nav-menu {
        max-height: 1000px;
        overflow: visible;
    }
    
    .nav-menu > li {
        width: 100%;
    }
    
    .nav-item-register {
        display: none;
        margin-left: 0;
    }
    
    .language-dropdown {
        position: relative;
        z-index: 101;
    }
    
    .lang-dropdown-menu {
        left: 0;
        right: auto;
        min-width: 120px;
        z-index: 1100;
        position: absolute;
    }
    
    .lang-current {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .language-dropdown.active .lang-dropdown-menu {
        overflow: visible;
        pointer-events: auto;
    }
    
    .btn-register-nav {
        width: 100%;
        display: block;
        text-align: center;
        text-decoration: none !important;
        border-bottom: none !important;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .content-section {
        padding: 25px 20px;
    }
    
    .content-image {
        margin: 16px auto;
        border-radius: 8px;
    }
    
    .content-section h1 {
        font-size: 1.8rem;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .btn-register {
        padding: 10px 20px;
        font-size: 16px;
        color: #ffffff !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        border-bottom: none !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .header-row {
        gap: 6px;
    }
    
    .header-logo-img {
        height: 28px;
        max-width: min(120px, 100%);
    }
    
    .header-right {
        gap: 4px;
    }
    
    .lang-current {
        padding: 4px 6px;
        min-height: 36px;
    }
    
    .lang-code {
        font-size: 11px;
    }
    
    .btn-register-mobile {
        padding: 5px 8px;
        font-size: 11px;
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        border-bottom: none !important;
    }
    
    .mobile-menu-toggle {
        min-width: 40px;
        padding: 5px;
    }
    
    .content-section {
        padding: 20px 15px;
    }
    
    .language-switcher {
        gap: 5px;
    }
    
    .lang-link {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .language-switcher,
    .btn-register,
    .social-links {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .content-section {
        border: none;
        box-shadow: none;
    }
}
