/* =========================================
   PROFILE V2 (PREMIUM LOOK)
   ========================================= */

.profile-section {
    padding-top: 30px !important;
}

.profile-v2-wrapper {
    max-width: 1400px;
    margin: 10px auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .profile-v2-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Левая колонка (Скин + Соцсети) */
.profile-left-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skin-render-container {
    width: 100%;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-card-v2 {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 480px;
}


/* Warn indicators */
.warn-indicators {
    display: flex;
    gap: 10px;
    margin-top: 0;
    justify-content: center;
    padding: 14px 0 4px;
}

.warn-square {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: default;
}

.warn-square.warn-active {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    /* box-shadow: 0 0 12px rgba(239,68,68,0.25); */
}

.warn-square.warn-inactive {
    opacity: 0.25;
}

.skin-render-v2 {
    max-width: 200px;
    max-height: 350px;
    filter: drop_shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
    object-fit: contain;
}

.skin-render-v2:hover {
    transform: translateY(-5px) scale(1.05);
}

.custom-skin-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-skin-v2 {
    image-rendering: pixelated;
    transition: transform 0.3s ease;
}

.head-preview-v2 {
    position: absolute;
    bottom: 25px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-highlight);
    background: var(--hover-bg);
    padding: 2px;
}

/* Соцсети в стиле Discord */
.social-grid-v2 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.social-card-v2 {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    padding: 0 20px;
    /* Убираем вертикальный padding, используем min-height */
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    overflow: visible;
    box-sizing: border-box;
}

.social-card-v2:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.social-card-v2 svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.social-card-v2.twitch:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.social-card-v2.youtube:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.social-card-v2.telegram:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.social-card-v2.discord:hover {
    border-color: #5865f2;
    color: #5865f2;
}

.social-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

/* Удаляем старый стиль Discord */
.discord-card-v2 {
    display: none;
}

/* Кнопка настроек */
.edit-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-highlight);
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
}

.edit-profile-btn:hover {
    color: white;
    background: rgba(22, 23, 29, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
}

/* Правая колонка */
.profile-right-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.profile-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ph-username-group h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.ph-last-seen {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.ph-last-seen.is-online {
    color: #3b82f6;
    /* Green color */
    font-weight: 600;
}

.role-badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
}

/* Кнопки лайков / дизлайков */
.votes-group-v2 {
    display: flex;
    gap: 10px;
}

.vote-btn-v2 {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-highlight);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.vote-btn-v2:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.vote-btn-v2.voted-like {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.vote-btn-v2 svg {
    transition: transform 0.2s;
}

.vote-btn-v2:hover svg {
    transform: scale(1.2);
}

.like-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.dislike-btn:hover {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.heatmap-legend-v2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}


/* Секция статистики */
.section-v2 {
    margin-top: 10px;
}

.section-v2-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.stats-row-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item-v2 {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.stat-item-v2 span {
    color: var(--text-main);
    font-weight: 700;
}

/* Тепловая карта (Custom 3-row Style) - Статичная */
.heatmap-v2 {
    display: grid;
    grid-template-rows: repeat(3, 28px);
    grid-auto-flow: column;
    grid-auto-columns: 28px;
    gap: 10px;
    background: transparent;
    padding: 15px;
    /* Запас для масштабирования при наведении */
    overflow: visible;
    /* Разрешаем выходить за границы для наведения */
    width: fit-content;
    margin: 5px -15px;
    /* Компенсируем padding для выравнивания */
    max-width: 100%;
}

.heatmap-v2::-webkit-scrollbar {
    display: none;
}

.heatmap-cell-v2 {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    cursor: help;
    transition: transform 0.2s ease, background 0.2s ease;
}

.heatmap-cell-v2:hover {
    transform: scale(1.3);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.4);
    /* box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); */
}

.heatmap-cell-v2.level-1 {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.35);
}

.heatmap-cell-v2.level-2 {
    background: rgba(59, 130, 246, 0.50);
    border-color: rgba(59, 130, 246, 0.60);
}

.heatmap-cell-v2.level-3 {
    background: rgba(59, 130, 246, 0.75);
    border-color: rgba(59, 130, 246, 0.85);
}

.heatmap-cell-v2.level-4 {
    background: rgba(59, 130, 246, 1.0);
    border-color: #3b82f6;
}

/* Tooltip Styles */
.heatmap-tooltip {
    position: absolute;
    background: rgba(22, 23, 29, 0.95);
    border: 1px solid var(--border-highlight);
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    transform: translate(-50%, -100%) translateY(-10px);
    text-align: center;
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); */
    backdrop-filter: blur(4px);
}

.heatmap-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.tooltip-hours {
    font-size: 13px;
    font-weight: 700;
}

/* Карточка города */
.town-card-v2 {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    text-decoration: none;
    transition: 0.2s;
}

.town-card-v2:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.3);
}

.town-banner-v2 {
    width: 80px;
    height: 120px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-highlight);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.town-img-v2 {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.town-placeholder-v2 {
    font-size: 2.2rem;
    opacity: 0.5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.town-content-v2 {
    flex: 1;
}

.town-name-v2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.town-desc-v2 {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.town-meta-v2 {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.town-meta-v2 li {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =========================================
   PROFILE WALL (VK-STYLE)
   ========================================= */

.wall-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-highlight);
    padding-top: 40px;
}

.wall-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wall-post-form {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    transition: border-color 0.3s ease;
}

.wall-post-form:focus-within {
    border-color: rgba(59, 130, 246, 0.4);
}

.wall-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    resize: none;
    min-height: 80px;
    outline: none;
    font-family: inherit;
    margin-bottom: 5px;
    /* Уменьшил отступ */
}

.wall-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-highlight);
    margin-top: 5px;
}


.wall-submit-btn {
    background: var(--border-highlight);
    color: var(--text-main);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wall-submit-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
    transform: translateY(-1px);
}


.post-item {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    position: relative;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--hover-bg);
    flex-shrink: 0;
}

.post-content-container {
    flex: 1;
    min-width: 0;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.post-author-name {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 15px;
}

.post-footer {
    display: flex;
    gap: 15px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 12px;
    border-radius: 100px;
}

.post-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.post-action.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.post-action.disliked {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.post-delete-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0;
    transition: 0.2s;
    color: var(--text-muted);
    text-decoration: none;
    background: rgba(22, 23, 29, 0.8);
    backdrop-filter: blur(4px);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
    z-index: 5;
}

.post-item:hover .post-delete-btn {
    opacity: 1;
}



/* Адаптация под мобильные устройства */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .container {
        padding: 0 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .profile-v2-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 15px 16px !important;
        /* Added 16px side padding for margins */
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .profile-left-col,
    .profile-right-col {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .skin-card-v2 {
        min-height: auto !important;
        padding: 25px 20px !important;
        margin: 0 !important;
        border-radius: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .profile-header-v2 {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
        padding: 0 !important;
    }

    .ph-username-group {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .ph-badges-row {
        justify-content: center !important;
        width: 100% !important;
    }

    .votes-group-v2 {
        justify-content: center !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    .social-grid-v2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        margin-top: 15px !important;
    }

    .social-card-v2 {
        width: 100% !important;
        margin: 0 !important;
        min-height: 52px !important;
        padding: 0 16px !important;
        justify-content: center !important;
    }

    /* Target the parent div of h1 and settings btn */
    .ph-title-row {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .ph-username-group h1 {
        font-size: 1.6rem !important;
        margin: 0 !important;
        word-break: break-all !important;
        text-align: center !important;
    }

    .role-badge-v2 {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: fit-content !important;
        max-width: fit-content !important;
        margin: 10px auto !important;
        padding: 5px 14px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 20px !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        white-space: nowrap !important;
        flex: none !important;
    }

    .edit-profile-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        margin: 0 !important;
    }

    .edit-profile-btn svg {
        width: 22px !important;
        height: 22px !important;
    }

    .stats-row-v2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .heatmap-v2 {
        width: 100% !important;
        padding: 10px 0 !important;
        overflow-x: auto !important;
        display: grid !important;
        grid-template-rows: repeat(3, 22px) !important;
        grid-auto-columns: 22px !important;
        grid-auto-flow: column !important;
        gap: 10px !important;
        background: transparent !important;
        border-radius: 0 !important;
        margin: 5px 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .heatmap-v2::-webkit-scrollbar {
        height: 4px !important;
        display: block !important;
    }

    .town-card-v2 {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 16px !important;
        width: 100% !important;
        gap: 15px !important;
        box-sizing: border-box !important;
        text-align: left !important;
    }

    .town-banner-v2 {
        width: 80px !important;
        height: 110px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .town-content-v2 {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .town-name-v2 {
        font-size: 1.1rem !important;
    }

    .town-meta-v2 {
        justify-content: flex-start !important;
        gap: 8px !important;
        font-size: 0.8rem !important;
    }

    .social-card-v2 {
        width: 100% !important;
        min-height: 56px !important;
        justify-content: center !important;
    }

    .post-item {
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-direction: row !important;
        gap: 12px !important;
    }

    .post-author-avatar {
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
    }

    .post-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}

.post-delete-btn:hover {
    color: #ef4444;
}

/* =========================================
   COMMENTS SECTION
   ========================================= */

.comments-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--hover-bg);
    object-fit: contain;
}

.comment-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comment-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    margin-right: 8px;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.comment-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    padding: 8px 15px;
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: 0.2s;
}

.comment-input:focus {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(0, 0, 0, 0.3);
}

.comment-submit-btn {
    background: transparent;
    border: 1px solid var(--border-highlight);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.comment-submit-btn:hover {
    color: white;
    opacity: 0.85;
    border-color: #3b82f6;
}

.comment-delete-link {
    font-size: 0.75rem;
    color: #ef4444;
    text-decoration: none;
    margin-left: 10px;
    opacity: 0;
    transition: 0.2s;
}

.comment-item:hover .comment-delete-link {
    opacity: 0.6;
}

.comment-delete-link:hover {
    opacity: 1;
}

/* --- Settings Modal Layout (Paneled Style) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--card-bg, #0A0A0A) !important;
    border: 1px solid var(--border-highlight) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: calc(100vh - 40px);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#profileSettingsModal .modal-container.settings-panel-modal {
    width: 900px !important;
    max-width: 95% !important;
    height: 500px !important;
    max-height: 85vh !important;
    display: flex !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.settings-modal-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.settings-sidebar {
    width: 210px;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-highlight);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 25px 16px;
    box-sizing: border-box;
}

.light-theme .settings-sidebar {
    background: rgba(0, 0, 0, 0.02);
}

.settings-sidebar-header {
    margin-bottom: 24px;
    padding-left: 10px;
}

.settings-sidebar-title {
    font-family: 'Unbounded', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    color: var(--text-muted) !important;
    letter-spacing: 0.05em !important;
    opacity: 0.6;
}

.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-menu-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Onest', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.settings-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.light-theme .settings-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.settings-menu-item.active {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #3b82f6 !important;
}

/* Content panes */
.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.settings-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px 30px;
    border-bottom: 1px solid var(--border-highlight);
    flex-shrink: 0;
}

.settings-tab-panes {
    flex: 1;
    padding: 25px 30px 25px 50px;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-pane {
    display: none;
    flex-direction: column;
    width: 100%;
}

.settings-pane.active {
    display: flex;
}

/* Tab 1: Character layout */
.settings-character-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .settings-modal-layout {
        grid-template-columns: 1fr;
    }
    .settings-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-highlight);
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    .settings-character-grid {
        grid-template-columns: 1fr;
    }
}

/* Inner containers */
.inner-card-v2 {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 16px;
}

.light-theme .inner-card-v2 {
    background: rgba(0, 0, 0, 0.01);
}

.preview-title-v2 {
    font-family: 'Unbounded', sans-serif !important;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Form groups and inputs */
.form-group-v2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-label-v2 {
    display: block;
    font-family: 'Unbounded', sans-serif !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.12em !important;
    margin-bottom: 8px;
}

.input-wrapper-v2 {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-v2 {
    position: absolute;
    left: 14px;
    color: rgba(242, 235, 221, 0.7) !important;
    pointer-events: none;
}

.form-input-v2 {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.light-theme .form-input-v2 {
    background: rgba(255,255,255,0.7);
}

.form-input-v2:focus {
    border-color: #3b82f6;
    outline: none;
    background: rgba(0,0,0,0.4);
}

.light-theme .form-input-v2:focus {
    background: #fff;
}

.form-input-v2::placeholder {
    color: rgba(242, 235, 221, 0.35) !important;
}

.clear-input-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.form-input-v2:placeholder-shown ~ .clear-input-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

.clear-input-btn:hover {
    opacity: 1;
}

/* Skin Upload Zone */
.skin-upload-zone {
    border: 2px dashed var(--border-highlight);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.skin-upload-zone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.skin-upload-zone.file-selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.02);
}

/* Skin History */
.skin-history-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.history-item {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    border: 2px solid var(--border-highlight);
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.history-item:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.history-item.active {
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.history-head-v2 {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    image-rendering: pixelated;
}

/* Toggle switch stylings */
.privacy-list-v2 {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.switch-group-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.switch-info-v2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-label-v2 {
    font-family: 'Unbounded', sans-serif !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.05em !important;
}

.switch-desc-v2 {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.switch-v2 {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch-v2 input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-v2 {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid var(--border-highlight);
}

.switch-v2 input:checked + .slider-v2 {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.slider-v2:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.switch-v2 input:checked + .slider-v2:before {
    transform: translateX(22px);
}

/* Footer save button */
.tab-footer-v2 {
    margin-top: 24px;
    border-top: 1px solid var(--border-highlight);
    padding-top: 20px;
}

.save-btn-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 30px;
    background: #3b82f6;
    color: #F2EBDD;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}

.save-btn-v2:hover {
    opacity: 0.85;
}

.save-btn-v2:active {
    transform: scale(0.98);
}

/* Wall Compose and Centering Mobile Improvements */
.wall-action-btn,
.wall-submit-btn {
    white-space: nowrap !important;
}

@media (max-width: 480px) {
    .wall-form-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }
    
    .wall-form-footer > div {
        justify-content: space-around !important;
        width: 100% !important;
    }
    
    .wall-submit-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
    }
}