body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    padding: 20px;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), url('../res/bckgr2.png') no-repeat center center;
    background-size: cover;
    filter: blur(0px);
    z-index: -1;
    transform: scale(1.25) translate(var(--bg-x, 0), var(--bg-y, 0));
    transition: transform 0.1s ease-out; /* Плавность движения */
    pointer-events: none;
}

.nav-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.nav-link {
    color: #aaaaaa;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
    color: #fff;
}

.nav-link.active {
    color: #fff;
    background: #1a1a1a;
    border: 1px solid #444;
}

.page-placeholder {
    text-align: center;
    margin: 80px auto;
}

.page-title {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 10px;
}

.auth-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

/* On narrow screens, let the two corner bars flow normally instead of
   overlapping in the top corners. */
@media (max-width: 760px) {
    .nav-bar,
    .auth-bar {
        position: static;
        justify-content: center;
        margin: 0 auto;
    }

    .auth-bar {
        margin-top: 10px;
    }
}

.auth-user {
    color: #e0e0e0;
    font-size: 0.95rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.auth-user:hover {
    border-bottom: 1px solid #fff;
}

.auth-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border 0.15s;
}

.auth-btn:hover {
    border: 1px solid #fff;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 30px;
}

.main-logo {
    max-width: 300px;
    width: 90%;
    height: auto;
    opacity: 1.0;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 20px 40px 20px;
    color: #666;
}

.copyright {
    margin-top: 10px;
}

.subtitle {
    text-align: center;
    color: #aaaaaa;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    justify-items: center;
    align-items: start;
    margin: 30px auto;
    max-width: 1300px; /* Ограничение ширины */
    box-sizing: border-box;
}

.image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Более выраженная тень */
    cursor: pointer;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.025); /* Слегка более заметный фон */
    transition: background-color 0.2s;
}

.image-container:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Подсветка при наведении */
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Изменено с cover, чтобы прозрачные объекты не обрезались и был виден фон */
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.filter-buttons {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 10px;
}

.filter-buttons.top-level {
    margin-top: 20px;
}

.filter-buttons.bottom-level {
    margin-bottom: 20px;
}

.filter-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px 22px;
    font-size: 1rem;
    cursor: pointer;
    transition: border 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #fff;
}

.accordion-toggle {
    margin: 10px 0;
    text-align: center;
    cursor: pointer;
    color: #aaaaaa;
    text-decoration: underline;
}

.accordion-toggle:hover {
    color: #fff;
}

.accordion-content {
    display: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    display: block;
}

.developer-info {
    text-align: center;
    color: #444;
    font-size: 0.8rem;
    margin-top: 20px;
    margin-bottom: 0;
}

.discord-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 0;
    flex-wrap: wrap;
}

.discord-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform 0.2s;
}

.discord-link-item:hover {
    transform: scale(1.05);
}

.discord-link-item span {
    font-size: 0.9rem;
}

.discord-icon {
    width: 32px;
    height: 32px;
    transition: opacity 0.2s;
    opacity: 0.8;
}

.discord-link-item:hover .discord-icon {
    opacity: 1;
}

.profile-card {
    max-width: 480px;
    margin: 40px auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.025);
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.profile-title {
    margin-top: 0;
    color: #fff;
    font-size: 1.5rem;
}

.profile-hint {
    color: #aaaaaa;
    margin-bottom: 24px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #333;
    text-align: left;
}

.profile-label {
    color: #aaaaaa;
    font-size: 0.9rem;
}

.profile-value {
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-mono {
    font-family: monospace;
    font-size: 0.85rem;
}

.profile-card .auth-btn {
    margin-top: 24px;
}

/* --- Voting: collapsible groups per Ditchfest number --- */
#voting-root {
    max-width: 820px;
    margin: 0 auto;
}

.vote-group {
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.vote-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    color: #fff;
    border: none;
    padding: 12px 16px;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
}

.vote-group-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.vote-group-header::before {
    content: "▸";
    color: #888;
    margin-right: 8px;
    transition: transform 0.15s;
    display: inline-block;
}

.vote-group.open .vote-group-header::before {
    transform: rotate(90deg);
}

.vg-title {
    flex: 1;
}

.vg-count {
    color: #888;
    font-size: 0.8rem;
    font-weight: normal;
}

.vote-group-body {
    display: none;
    border-top: 1px solid #2a2a2a;
}

.vote-group.open .vote-group-body {
    display: block;
}

.map-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid #242424;
}

.map-row:last-child {
    border-bottom: none;
}

.map-thumb {
    width: 64px;
    height: 36px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 3px;
    background-color: #111;
}

.map-info {
    flex: 1;
    min-width: 0;
}

.map-name {
    color: #e0e0e0;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-author {
    color: #888;
    font-size: 0.8rem;
}

.vote-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 14px;
    font-size: 1rem;
    cursor: pointer;
    transition: border 0.15s, background 0.15s;
}

.vote-btn:hover {
    border: 1px solid #fff;
}

.vote-btn.voted {
    background: #2e7d32;
    border-color: #2e7d32;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.vote-btn-sm {
    flex-shrink: 0;
    min-width: 56px;
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Anchors styled as buttons (e.g. Admin panel link) */
a.auth-btn {
    display: inline-block;
    text-decoration: none;
}

/* Admin status badge — shown only to admins (e.g. on the profile card) */
.admin-badge {
    display: inline-block;
    margin-top: 24px;
    padding: 6px 16px;
    background: #2e7d32;
    color: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
}

.admin-badge::before {
    content: "★ ";
}

.admin-badge:hover {
    background: #388e3c;
}

/* --- Admin panel --- */
.admin-card {
    max-width: 560px;
    margin: 0 auto 24px auto;
    padding: 24px;
    background-color: rgba(255, 255, 255, 0.025);
    border: 1px solid #333;
    border-radius: 8px;
}

.admin-label {
    display: block;
    color: #aaaaaa;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.admin-add {
    display: flex;
    gap: 8px;
}

.admin-input {
    flex: 1;
    min-width: 0;
    background: #111;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 9px 12px;
    font-size: 0.9rem;
}

.admin-input:focus {
    outline: none;
    border-color: #fff;
}

.admin-msg {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #aaaaaa;
    min-height: 1em;
}

.admin-err {
    color: #e57373;
}

.admin-list {
    max-width: 560px;
    margin: 0 auto;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.02);
}

.admin-info {
    min-width: 0;
}

.admin-name {
    color: #e0e0e0;
}

.admin-id {
    color: #777;
    font-family: monospace;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-remove {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.85rem;
}

.admin-remove:hover {
    border-color: #e57373;
}

/* --- Mappers leaderboard --- */
.leaderboard {
    max-width: 640px;
    margin: 30px auto;
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.025);
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard th,
.leaderboard td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
}

.leaderboard th {
    color: #aaaaaa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard td {
    color: #e0e0e0;
}

.leaderboard tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.lb-rank {
    width: 48px;
    color: #888;
}

.lb-votes {
    text-align: right;
    width: 80px;
    font-weight: bold;
}

.leaderboard th.lb-votes {
    text-align: right;
}