:root {
    --bg-color: #0b1114;
    --card-bg: #131b1f;
    --card-surface: #182328;
    --card-hover: #1e2c32;
    --text-main: #f1f5f9;
    --text-muted: #8b9ea7;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-soft: rgba(217, 119, 6, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --river: #081a24;
    --emerald-badge: #059669;
    --emerald-bg: rgba(6, 78, 59, 0.6);
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ===================================================
   ВЕКТОРНЫЕ ИКОНКИ (DATA URI)
   =================================================== */
.icon {
    display: inline-block;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}
.icon-xs { width: 1rem; height: 1rem; }
.icon-sm { width: 1.25rem; height: 1.25rem; }
.icon-md { width: 1.6rem; height: 1.6rem; }
.icon-lg { width: 2.2rem; height: 2.2rem; }
.icon-xl { width: 3.5rem; height: 3.5rem; }

.icon-beaver { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cellipse cx='14' cy='40' rx='13' ry='7' fill='%234a2810' transform='rotate(-15 14 40)'/%3E%3Cpath d='M6 37 Q14 40 22 43 M7 43 Q14 40 21 37' stroke='%232e1505' stroke-width='1.5' fill='none'/%3E%3Cellipse cx='36' cy='38' rx='20' ry='16' fill='%238b5a2b'/%3E%3Cellipse cx='38' cy='40' rx='14' ry='10' fill='%23a67242'/%3E%3Ccircle cx='44' cy='24' r='13' fill='%238b5a2b'/%3E%3Ccircle cx='41' cy='13' r='4.5' fill='%234a2810'/%3E%3Ccircle cx='41' cy='13' r='2.2' fill='%23a67242'/%3E%3Cellipse cx='50' cy='26' rx='6.5' ry='5' fill='%23d4a373'/%3E%3Cellipse cx='52' cy='23.5' rx='3' ry='2' fill='%231f140e'/%3E%3Crect x='49' y='30' width='2.6' height='4' rx='0.5' fill='%23ffffff' stroke='%23e0e0e0' stroke-width='0.3'/%3E%3Crect x='52.2' y='30' width='2.6' height='4' rx='0.5' fill='%23ffffff' stroke='%23e0e0e0' stroke-width='0.3'/%3E%3Ccircle cx='46' cy='20.5' r='2.2' fill='%231a1a1a'/%3E%3Ccircle cx='46.8' cy='19.7' r='0.8' fill='%23ffffff'/%3E%3Cellipse cx='46' cy='48' rx='5.5' ry='3.5' fill='%234a2810'/%3E%3Cellipse cx='28' cy='48' rx='5.5' ry='3.5' fill='%234a2810'/%3E%3C/svg%3E"); }
.icon-log { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M14 20 L50 20 L50 44 L14 44 Z' fill='%2378350f'/%3E%3Cellipse cx='50' cy='32' rx='6' ry='12' fill='%23b45309'/%3E%3Cellipse cx='50' cy='32' rx='4' ry='8' fill='%23d97706'/%3E%3Cellipse cx='50' cy='32' rx='1.5' ry='3' fill='%2378350f'/%3E%3Cellipse cx='14' cy='32' rx='6' ry='12' fill='%23451a03'/%3E%3Cline x1='22' y1='26' x2='40' y2='26' stroke='%23451a03' stroke-width='2' stroke-linecap='round'/%3E%3Cline x1='26' y1='36' x2='44' y2='36' stroke='%23451a03' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.icon-rock { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='12,46 18,22 36,14 52,24 54,46 38,52 20,50' fill='%234b5563'/%3E%3Cpolygon points='18,22 36,14 38,34 22,42' fill='%239ca3af'/%3E%3Cpolygon points='36,14 52,24 48,38 38,34' fill='%236b7280'/%3E%3Cpolygon points='22,42 38,34 38,52 20,50' fill='%23374151'/%3E%3Cpolygon points='38,34 48,38 54,46 38,52' fill='%231f2937'/%3E%3C/svg%3E"); }
.icon-helmet { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M12 40 C12 18 22 14 32 14 C42 14 52 18 52 40 C52 45 46 45 46 45 L18 45 C18 45 12 45 12 40 Z' fill='%233f4a2c'/%3E%3Cellipse cx='32' cy='42' rx='24' ry='4' fill='%232d351f'/%3E%3Cpath d='M22 22 Q32 18 42 22' stroke='%2355643b' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }
.icon-leaf { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E"); }
.icon-shield { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.icon-forum { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.icon-archive { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.icon-logout { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }
.icon-maintenance { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.icon-login { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E"); }
.icon-helm { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cline x1='12' y1='2' x2='12' y2='6'/%3E%3Cline x1='12' y1='18' x2='12' y2='22'/%3E%3Cline x1='4.93' y1='4.93' x2='7.76' y2='7.76'/%3E%3Cline x1='16.24' y1='16.24' x2='19.07' y2='19.07'/%3E%3Cline x1='2' y1='12' x2='6' y2='12'/%3E%3Cline x1='18' y1='12' x2='22' y2='12'/%3E%3C/svg%3E"); }
.icon-tools { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z'/%3E%3Cpath d='m14 7 3 3'/%3E%3C/svg%3E"); }
.icon-dive { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M20 12v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6'/%3E%3Cpath d='M9 12V9a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E"); }
.icon-sound-on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14'/%3E%3C/svg%3E"); }
.icon-sound-off { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cline x1='23' y1='9' x2='17' y2='15'/%3E%3Cline x1='17' y1='9' x2='23' y2='15'/%3E%3C/svg%3E"); }

/* ===================================================
   ШАПКА САЙТА И НАВИГАЦИЯ
   =================================================== */
header {
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 17, 20, 0.9);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 0.75rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--emerald-bg);
    color: #6ee7b7;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid rgba(5, 150, 105, 0.4);
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
    animation: pulse-dot 2.4s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.status-text-mobile {
    display: none;
}

/* ===================================================
   ПЛАШКА ПОЛЬЗОВАТЕЛЯ И ВЫПАДАЮЩЕЕ МЕНЮ
   =================================================== */
.user-container {
    position: relative;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-surface);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    max-width: 170px;
}

.user-pill:hover {
    border-color: var(--accent);
    background: var(--card-hover);
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #25333a;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-pill.authenticated .user-avatar {
    background: var(--accent);
    color: #ffffff;
}

.user-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-badge {
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.45rem;
    box-shadow: 0 18px 36px rgba(0,0,0,0.65);
    z-index: 100;
}

.user-dropdown.active {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.danger {
    color: #f87171;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
    padding-top: 0.55rem;
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===================================================
   ОСНОВНЫЕ СЕКЦИИ И ТИПОГРАФИКА
   =================================================== */
main {
    flex: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 2.75rem 1.25rem;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 2.75rem;
}

.hero-badge {
    display: inline-block;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--accent-soft);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(217, 119, 6, 0.28);
}

.hero h1 {
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

.btn {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* ===================================================
   ПРОМО-БЛОК ПОЛИГОНА (INDEX.HTML)
   =================================================== */
.simulator-showcase {
    background: linear-gradient(180deg, #131c20 0%, #0c1417 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    margin-bottom: 2.75rem;
    box-shadow: 0 16px 36px rgba(0,0,0,0.4);
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.85rem;
    flex-wrap: wrap;
}

.showcase-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.showcase-header h2 {
    font-size: 1.65rem;
    color: #fff;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.showcase-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 620px;
    line-height: 1.55;
}

.showcase-cta {
    align-self: center;
    white-space: nowrap;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.showcase-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(217, 119, 6, 0.4);
    transform: translateY(-3px);
}

.showcase-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.showcase-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: #fff;
}

.showcase-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1.15rem;
}

.card-link-label {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
}

/* ===================================================
   СТРАНИЦА ИГРОВОГО ПОЛИГОНА (GAMES.HTML)
   =================================================== */
.gallery-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.sim-tabs {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.sim-tab-btn {
    background: var(--card-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.15rem;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.sim-tab-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--card-hover);
}

.sim-tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.game-section {
    background: linear-gradient(180deg, var(--card-bg) 0%, #0f1619 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 16px 36px rgba(0,0,0,0.35);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 440px;
    margin: 0 auto 0.85rem auto;
    font-size: 0.9rem;
    font-weight: 600;
}

.game-header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sound-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    user-select: none;
}

.sound-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.sound-toggle-btn.muted {
    opacity: 0.6;
    color: #94a3b8;
}

.game-score {
    color: var(--accent);
}

.canvas-container {
    position: relative;
    max-width: 440px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    touch-action: none;
    background: var(--river);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 6;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 20, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
    z-index: 5;
    text-align: center;
}

.game-overlay h2 {
    font-size: 1.45rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-overlay p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1.35rem;
    max-width: 320px;
    line-height: 1.5;
}

.game-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
    text-align: center;
}

/* ===================================================
   КАРТОЧКИ ПРЕИМУЩЕСТВ И ФОРУМ-СПОТЛАЙТ
   =================================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.35rem;
    margin-bottom: 2rem;
}

.card {
    background: linear-gradient(180deg, var(--card-bg) 0%, #11171a 100%);
    border: 1px solid var(--border);
    padding: 1.65rem;
    border-radius: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.card-icon {
    margin-bottom: 0.75rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
}

.card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.45rem;
    color: #ffffff;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.forum-spotlight {
    background: linear-gradient(180deg, #131d22 0%, #0d1519 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem 2.2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.forum-spotlight-content {
    flex: 1;
}

.forum-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.forum-spotlight h3 {
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 0.45rem;
}

.forum-spotlight p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 620px;
}

.forum-action-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.join-section {
    text-align: center;
    background: linear-gradient(135deg, #131c20 0%, #0c1820 100%);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2.25rem 1.5rem;
}

/* ===================================================
   МОДАЛЬНЫЕ ОКНА И ФОРМЫ ВАЛИДАЦИИ
   =================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #141d21;
    border: 1px solid var(--border);
    border-radius: 18px;
    width: 100%;
    max-width: 400px;
    padding: 1.85rem;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.form-error-banner {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.1rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.1rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    background: #0b1114;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #ffffff;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent);
}

.field-error-text {
    display: none;
    color: #f87171;
    font-size: 0.74rem;
    margin-top: 0.35rem;
    font-weight: 500;
}

.form-group.has-error input {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-group.has-error .field-error-text {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-group input {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.checkbox-group.has-error span {
    color: #f87171;
}

.modal-switch-box {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

.link-btn:hover {
    color: #f59e0b;
}

/* ===================================================
   ЭКРАН ТЕХОБСЛУЖИВАНИЯ (FORUM.HTML)
   =================================================== */
.stub-main-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 150px);
    padding: 2rem 1.25rem;
}

.stub-screen {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stub-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.stub-icon-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
}

.stub-screen h2 {
    font-size: 1.75rem;
    margin-bottom: 0.85rem;
    color: #ffffff;
    font-weight: 700;
}

.stub-screen p {
    color: var(--text-muted);
    font-size: 0.96rem;
    margin-bottom: 1.85rem;
    line-height: 1.6;
}

.stub-screen .btn {
    margin: 0 auto;
}

/* ===================================================
   ПОДВАЛ
   =================================================== */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: auto;
}

/* ===================================================
   АДАПТИВНОСТЬ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА
   =================================================== */
@media (max-width: 768px) {
    .simulator-showcase {
        padding: 1.6rem 1.25rem;
    }

    .showcase-header {
        flex-direction: column;
        align-items: stretch;
    }

    .showcase-cta {
        width: 100%;
    }

    .forum-spotlight {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .forum-action-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    header {
        padding: 0.65rem 0.85rem;
        gap: 0.4rem;
    }

    .logo {
        font-size: 1.1rem;
        gap: 0.4rem;
    }

    .nav-right {
        gap: 0.45rem;
    }

    .status-text-full {
        display: none !important;
    }

    .status-text-mobile {
        display: inline !important;
    }

    .status-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.74rem;
    }

    .user-pill {
        padding: 0.25rem 0.55rem;
        max-width: 110px;
        font-size: 0.78rem;
    }

    .pill-badge {
        display: none;
    }

    main {
        padding: 2rem 1rem;
    }

    .hero {
        margin-bottom: 2rem;
    }

    .game-section {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 2rem;
    }

    .join-section {
        padding: 1.75rem 1.15rem;
    }
}

@media (max-width: 360px) {
    .user-pill {
        max-width: 95px;
    }
}